From 3c4d268a69abd64399e1beeb60de93fc035c5b89 Mon Sep 17 00:00:00 2001 From: IcterusGames <112021348+IcterusGames@users.noreply.github.com> Date: Mon, 6 Feb 2023 19:54:49 -0400 Subject: [PATCH] Version 1.0.4 --- addons/simplegrasstextured/about.gd | 10 ++ addons/simplegrasstextured/about.tscn | 52 +++++++ addons/simplegrasstextured/grass.gd | 14 +- .../images/win_pattern.png.import | 4 +- addons/simplegrasstextured/plugin.cfg | 2 +- addons/simplegrasstextured/plugin.gd | 130 +++++++++++------- .../textures/grassbushcc008.png.import | 4 +- addons/simplegrasstextured/toolbar.gd | 8 ++ addons/simplegrasstextured/toolbar.tscn | 55 ++++++-- 9 files changed, 209 insertions(+), 70 deletions(-) create mode 100644 addons/simplegrasstextured/about.gd create mode 100644 addons/simplegrasstextured/about.tscn diff --git a/addons/simplegrasstextured/about.gd b/addons/simplegrasstextured/about.gd new file mode 100644 index 0000000..99db9fc --- /dev/null +++ b/addons/simplegrasstextured/about.gd @@ -0,0 +1,10 @@ +@tool +extends AcceptDialog + + +func _ready(): + get_ok_button().custom_minimum_size.x = 100 + + +func _on_rich_text_label_meta_clicked(meta): + OS.shell_open(str(meta)) diff --git a/addons/simplegrasstextured/about.tscn b/addons/simplegrasstextured/about.tscn new file mode 100644 index 0000000..f9ad417 --- /dev/null +++ b/addons/simplegrasstextured/about.tscn @@ -0,0 +1,52 @@ +[gd_scene load_steps=5 format=3 uid="uid://cb8klhv6nwvtl"] + +[ext_resource type="Texture2D" uid="uid://bsmcpupaj02v8" path="res://addons/simplegrasstextured/icon.svg" id="1_at31v"] +[ext_resource type="Script" path="res://addons/simplegrasstextured/about.gd" id="1_r23hh"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hnw4u"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lwftf"] + +[node name="Control" type="AcceptDialog"] +title = "About" +size = Vector2i(520, 215) +min_size = Vector2i(520, 200) +max_size = Vector2i(1280, 720) +script = ExtResource("1_r23hh") + +[node name="MarginContainer" type="MarginContainer" parent="."] +offset_left = 8.0 +offset_top = 8.0 +offset_right = 512.0 +offset_bottom = 166.0 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(48, 48) +layout_mode = 2 +texture = ExtResource("1_at31v") +stretch_mode = 4 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/focus = SubResource("StyleBoxEmpty_hnw4u") +theme_override_styles/normal = SubResource("StyleBoxEmpty_lwftf") +bbcode_enabled = true +text = "Simple Grass Textured Plugin +v. 1.0.4 +by IcterusGames +[font_size=7] [/font_size] +[url]https://icterusgames.itch.io/[/url] +[font_size=7] [/font_size] +[url]https://github.com/IcterusGames/SimpleGrassTextured[/url] +" + +[connection signal="meta_clicked" from="MarginContainer/HBoxContainer/RichTextLabel" to="." method="_on_rich_text_label_meta_clicked"] diff --git a/addons/simplegrasstextured/grass.gd b/addons/simplegrasstextured/grass.gd index bc7c969..25e8e4f 100644 --- a/addons/simplegrasstextured/grass.gd +++ b/addons/simplegrasstextured/grass.gd @@ -184,7 +184,6 @@ func _update_multimesh(): var pos_max := pos_min * -1 var center := Vector3.ZERO var radius := 0.0 - var r_index := [] for trans in _buffer_add: if pos_min > trans.origin: pos_min = trans.origin @@ -194,14 +193,13 @@ func _update_multimesh(): radius = center.distance_to(pos_min) + 1.0 for i in range(multimesh.instance_count): var trans := multimesh.get_instance_transform(i) - if trans.origin.distance_to(center) <= radius: - r_index.append(i) - for i in r_index: - var trans := multimesh.get_instance_transform(i) + if trans.origin.distance_to(center) > radius: + continue for trans_add in _buffer_add: - if trans_add.origin.distance_to(trans.origin) <= sgt_dist_min: - _buffer_add.erase(trans_add) - break + if trans_add.origin.distance_to(trans.origin) > sgt_dist_min: + continue + _buffer_add.erase(trans_add) + break multi_new.instance_count = count_prev + _buffer_add.size() for i in range(multimesh.instance_count): multi_new.set_instance_transform(i, multimesh.get_instance_transform(i)) diff --git a/addons/simplegrasstextured/images/win_pattern.png.import b/addons/simplegrasstextured/images/win_pattern.png.import index 3f731ce..8bdeb75 100644 --- a/addons/simplegrasstextured/images/win_pattern.png.import +++ b/addons/simplegrasstextured/images/win_pattern.png.import @@ -5,7 +5,7 @@ type="CompressedTexture2D" uid="uid://i566v0wqsfa" path.s3tc="res://.godot/imported/win_pattern.png-c44fa1ee331bdb684ff53320dba8c2b3.s3tc.ctex" metadata={ -"imported_formats": ["s3tc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } @@ -17,9 +17,9 @@ dest_files=["res://.godot/imported/win_pattern.png-c44fa1ee331bdb684ff53320dba8c [params] compress/mode=2 +compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 -compress/bptc_ldr=0 compress/normal_map=0 compress/channel_pack=0 mipmaps/generate=true diff --git a/addons/simplegrasstextured/plugin.cfg b/addons/simplegrasstextured/plugin.cfg index 9e49d47..a0d7c07 100644 --- a/addons/simplegrasstextured/plugin.cfg +++ b/addons/simplegrasstextured/plugin.cfg @@ -3,5 +3,5 @@ name="SimpleGrassTextured" description="Create simple grass textured" author="IcterusGames" -version="1.0.3" +version="1.0.4" script="plugin.gd" diff --git a/addons/simplegrasstextured/plugin.gd b/addons/simplegrasstextured/plugin.gd index dce54ca..3cd7259 100644 --- a/addons/simplegrasstextured/plugin.gd +++ b/addons/simplegrasstextured/plugin.gd @@ -26,10 +26,15 @@ extends EditorPlugin const DEPTH_BRUSH := 10.0 +enum EVENT_MOUSE { + EVENT_NONE, + EVENT_MOVE, + EVENT_CLICK, +} + var _raycast_3d : RayCast3D = null var _decal_pointer : Decal = null var _grass_selected = null -var _timer_draw : Timer = null var _position_draw := Vector3.ZERO var _normal_draw := Vector3.ZERO var _object_draw : Object = null @@ -41,6 +46,11 @@ var _edit_rotation_rand := 1.0 var _edit_draw := true : set = _on_set_draw var _edit_erase := false : set = _on_set_erase var _gui_toolbar = null +var _time_draw := 0 +var _draw_paused := true +var _mouse_event := EVENT_MOUSE.EVENT_NONE +var _project_ray_origin := Vector3.INF +var _project_ray_normal := Vector3.INF func _enter_tree(): @@ -59,11 +69,8 @@ func _enter_tree(): _decal_pointer.set_texture(Decal.TEXTURE_ALBEDO, load("res://addons/simplegrasstextured/images/pointer.png")) _decal_pointer.visible = false _decal_pointer.extents = Vector3(_edit_radius, DEPTH_BRUSH, _edit_radius) - _timer_draw = Timer.new() - _timer_draw.timeout.connect(_on_timer_draw_timeout) add_child(_raycast_3d) add_child(_decal_pointer) - add_child(_timer_draw) _gui_toolbar.slider_radius.value_changed.connect(_on_slider_radius_value_changed) _gui_toolbar.slider_density.value_changed.connect(_on_slider_density_value_changed) _gui_toolbar.button_draw.toggled.connect(_on_button_draw_toggled) @@ -91,6 +98,7 @@ func _get_plugin_name() -> String: func _handles(object) -> bool: if object != null and object.has_meta("SimpleGrassTextured") and object.visible: _grass_selected = object + _update_gui() return true _grass_selected = null return false @@ -98,20 +106,13 @@ func _handles(object) -> bool: func _edit(object : Variant): _grass_selected = object + _update_gui() func _make_visible(visible : bool): if visible: if _grass_selected != null: - _gui_toolbar.slider_radius.value = _grass_selected.sgt_radius - _gui_toolbar.slider_density.value = _grass_selected.sgt_density - _gui_toolbar.edit_scale.value = _grass_selected.sgt_scale - _gui_toolbar.edit_rotation.value = _grass_selected.sgt_rotation - _gui_toolbar.edit_rotation_rand.value = _grass_selected.sgt_rotation_rand - _gui_toolbar.edit_distance.value = _grass_selected.sgt_dist_min - _gui_toolbar.chk_normals.button_pressed = _grass_selected.sgt_follow_normal - if _grass_selected.multimesh != null: - _gui_toolbar.label_stats.text = "Count: " + str(_grass_selected.multimesh.instance_count) + _update_gui() _gui_toolbar.visible = true else: _gui_toolbar.visible = false @@ -119,44 +120,37 @@ func _make_visible(visible : bool): _grass_selected = null -func _forward_3d_gui_input(viewport_camera: Camera3D, event: InputEvent) -> int: - if _grass_selected == null: - return EditorPlugin.AFTER_GUI_INPUT_PASS - if _grass_selected.multimesh != null: - _gui_toolbar.label_stats.text = "Count: " + str(_grass_selected.multimesh.instance_count) - if event is InputEventMouseButton: - if event.button_index == MOUSE_BUTTON_LEFT: - if not (_edit_draw or _edit_erase): - return EditorPlugin.AFTER_GUI_INPUT_PASS - if event.pressed: - _raycast_3d.global_transform.origin = viewport_camera.project_ray_origin(event.position) - _raycast_3d.global_transform.basis.y = viewport_camera.project_ray_normal(event.position) - _raycast_3d.target_position = Vector3(0, 100000, 0) - _raycast_3d.force_raycast_update() - if _raycast_3d.is_colliding(): - _position_draw = _raycast_3d.get_collision_point() - _normal_draw = _raycast_3d.get_collision_normal() - _object_draw = _raycast_3d.get_collider() - _on_timer_draw_timeout() - _timer_draw.start(0.15) - else: - _object_draw = null - else: - _object_draw = null - _timer_draw.stop() - return EditorPlugin.AFTER_GUI_INPUT_STOP - if event is InputEventMouseMotion: - _raycast_3d.global_transform.origin = viewport_camera.project_ray_origin(event.position) - _raycast_3d.global_transform.basis.y = viewport_camera.project_ray_normal(event.position) +func _physics_process(_delta): + if _mouse_event == EVENT_MOUSE.EVENT_CLICK: + _raycast_3d.global_transform.origin = _project_ray_origin + _raycast_3d.global_transform.basis.y = _project_ray_normal + _raycast_3d.target_position = Vector3(0, 100000, 0) + _raycast_3d.force_raycast_update() + if _raycast_3d.is_colliding(): + _position_draw = _raycast_3d.get_collision_point() + _normal_draw = _raycast_3d.get_collision_normal() + _object_draw = _raycast_3d.get_collider() + _eval_brush() + _time_draw = Time.get_ticks_msec() + _draw_paused = false + else: + _time_draw = 0 + _draw_paused = true + _object_draw = null + _mouse_event = EVENT_MOUSE.EVENT_NONE + elif _mouse_event == EVENT_MOUSE.EVENT_MOVE: + _raycast_3d.global_transform.origin = _project_ray_origin + _raycast_3d.global_transform.basis.y = _project_ray_normal _raycast_3d.target_position = Vector3(0, 100000, 0) _raycast_3d.force_raycast_update() if ( not _raycast_3d.is_colliding() or ( _object_draw != null and _raycast_3d.get_collider() != _object_draw )): _decal_pointer.visible = false - _timer_draw.paused = true - return EditorPlugin.AFTER_GUI_INPUT_PASS + _draw_paused = true + _mouse_event = EVENT_MOUSE.EVENT_NONE + return else: - _timer_draw.paused = false + _draw_paused = false _position_draw = _raycast_3d.get_collision_point() _normal_draw = _raycast_3d.get_collision_normal() var trans := Transform3D() @@ -173,9 +167,53 @@ func _forward_3d_gui_input(viewport_camera: Camera3D, event: InputEvent) -> int: _decal_pointer.global_transform = trans _decal_pointer.extents = Vector3(_edit_radius, DEPTH_BRUSH, _edit_radius) _decal_pointer.visible = _edit_draw or _edit_erase + _mouse_event = EVENT_MOUSE.EVENT_NONE + if _time_draw > 0: + if not _draw_paused: + if Time.get_ticks_msec() - _time_draw >= 150: + _time_draw = Time.get_ticks_msec() + _eval_brush() + + +func _forward_3d_gui_input(viewport_camera: Camera3D, event: InputEvent) -> int: + if _grass_selected == null: + return EditorPlugin.AFTER_GUI_INPUT_PASS + if _grass_selected.multimesh != null: + _gui_toolbar.label_stats.text = "Count: " + str(_grass_selected.multimesh.instance_count) + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT: + if not (_edit_draw or _edit_erase): + return EditorPlugin.AFTER_GUI_INPUT_PASS + if event.pressed: + _project_ray_origin = viewport_camera.project_ray_origin(event.position) + _project_ray_normal = viewport_camera.project_ray_normal(event.position) + _mouse_event = EVENT_MOUSE.EVENT_CLICK + else: + _time_draw = 0 + _object_draw = null + _mouse_event = EVENT_MOUSE.EVENT_NONE + return EditorPlugin.AFTER_GUI_INPUT_STOP + if event is InputEventMouseMotion: + if _mouse_event != EVENT_MOUSE.EVENT_CLICK: + _project_ray_origin = viewport_camera.project_ray_origin(event.position) + _project_ray_normal = viewport_camera.project_ray_normal(event.position) + _mouse_event = EVENT_MOUSE.EVENT_MOVE return EditorPlugin.AFTER_GUI_INPUT_PASS +func _update_gui(): + if _grass_selected != null: + _gui_toolbar.slider_radius.value = _grass_selected.sgt_radius + _gui_toolbar.slider_density.value = _grass_selected.sgt_density + _gui_toolbar.edit_scale.value = _grass_selected.sgt_scale + _gui_toolbar.edit_rotation.value = _grass_selected.sgt_rotation + _gui_toolbar.edit_rotation_rand.value = _grass_selected.sgt_rotation_rand + _gui_toolbar.edit_distance.value = _grass_selected.sgt_dist_min + _gui_toolbar.chk_normals.button_pressed = _grass_selected.sgt_follow_normal + if _grass_selected.multimesh != null: + _gui_toolbar.label_stats.text = "Count: " + str(_grass_selected.multimesh.instance_count) + + func _on_button_draw_toggled(pressed : bool): _edit_draw = pressed if _edit_draw: @@ -253,7 +291,7 @@ func _on_set_erase(value : bool): _gui_toolbar.button_erase.button_pressed = _edit_erase -func _on_timer_draw_timeout(): +func _eval_brush(): if _grass_selected == null: return if _edit_draw: diff --git a/addons/simplegrasstextured/textures/grassbushcc008.png.import b/addons/simplegrasstextured/textures/grassbushcc008.png.import index 5be178d..5d0d4f0 100644 --- a/addons/simplegrasstextured/textures/grassbushcc008.png.import +++ b/addons/simplegrasstextured/textures/grassbushcc008.png.import @@ -5,7 +5,7 @@ type="CompressedTexture2D" uid="uid://c4ggdp0kg5wjk" path.s3tc="res://.godot/imported/grassbushcc008.png-7110abc2a2a9dc117662bb95ed60be39.s3tc.ctex" metadata={ -"imported_formats": ["s3tc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } @@ -17,9 +17,9 @@ dest_files=["res://.godot/imported/grassbushcc008.png-7110abc2a2a9dc117662bb95ed [params] compress/mode=2 +compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 -compress/bptc_ldr=0 compress/normal_map=0 compress/channel_pack=0 mipmaps/generate=true diff --git a/addons/simplegrasstextured/toolbar.gd b/addons/simplegrasstextured/toolbar.gd index a98386d..f07cb02 100644 --- a/addons/simplegrasstextured/toolbar.gd +++ b/addons/simplegrasstextured/toolbar.gd @@ -39,9 +39,11 @@ extends HBoxContainer @onready var _label_density := $HSliderDensity/Label as Label @onready var _tween_radius : Tween = null @onready var _tween_density : Tween = null +var _win_about = load("res://addons/simplegrasstextured/about.tscn").instantiate() func _ready(): + get_window().call_deferred(StringName("add_child"), _win_about) _on_theme_changed() @@ -74,3 +76,9 @@ func _on_theme_changed(): $IconRadius.modulate = get_theme_color("font_color", "Label") $IconDensity.modulate = get_theme_color("font_color", "Label") $IconDistance.modulate = get_theme_color("font_color", "Label") + + +func _on_panel_container_gui_input(event): + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT and event.pressed: + _win_about.popup_centered() diff --git a/addons/simplegrasstextured/toolbar.tscn b/addons/simplegrasstextured/toolbar.tscn index 72945ce..9c431a2 100644 --- a/addons/simplegrasstextured/toolbar.tscn +++ b/addons/simplegrasstextured/toolbar.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://dsim5cbhc6kwm"] +[gd_scene load_steps=10 format=3 uid="uid://dsim5cbhc6kwm"] [ext_resource type="Script" path="res://addons/simplegrasstextured/toolbar.gd" id="1_aa1o6"] [ext_resource type="Texture2D" uid="uid://bsmcpupaj02v8" path="res://addons/simplegrasstextured/icon.svg" id="2_2ni6b"] @@ -6,7 +6,11 @@ [ext_resource type="Texture2D" uid="uid://tqiak77omdnr" path="res://addons/simplegrasstextured/images/icon_density.svg" id="4_4c5wp"] [ext_resource type="Texture2D" uid="uid://d28dlfkm62t6e" path="res://addons/simplegrasstextured/images/icon_distance.svg" id="5_uonyg"] -[sub_resource type="Image" id="Image_tbt8h"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6mh15"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hc7jq"] + +[sub_resource type="Image" id="Image_w1uti"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -15,27 +19,55 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_ms2vh"] -image = SubResource("Image_tbt8h") +[sub_resource type="ImageTexture" id="ImageTexture_7dmaa"] +image = SubResource("Image_w1uti") [node name="Control" type="HBoxContainer"] -anchors_preset = 15 +anchors_preset = 10 anchor_right = 1.0 -anchor_bottom = 1.0 +offset_bottom = 31.0 grow_horizontal = 2 -grow_vertical = 2 script = ExtResource("1_aa1o6") [node name="VSeparator" type="VSeparator" parent="."] visible = false layout_mode = 2 -[node name="TextureRect" type="TextureRect" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="."] custom_minimum_size = Vector2(24, 0) layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_6mh15") + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 +mouse_filter = 2 +alignment = 1 + +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(24, 0) +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_bottom = 3 + +[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/MarginContainer"] +custom_minimum_size = Vector2(24, 0) +layout_mode = 2 +mouse_filter = 2 texture = ExtResource("2_2ni6b") stretch_mode = 3 +[node name="Label" type="Label" parent="PanelContainer"] +clip_contents = true +layout_mode = 2 +size_flags_vertical = 1 +auto_translate = false +localize_numeral_system = false +theme_override_font_sizes/font_size = 7 +theme_override_styles/normal = SubResource("StyleBoxEmpty_hc7jq") +text = "1.0.4" +horizontal_alignment = 1 +vertical_alignment = 2 + [node name="ButtonDraw" type="Button" parent="."] layout_mode = 2 toggle_mode = true @@ -117,7 +149,7 @@ layout_mode = 2 [node name="IconScale" type="TextureRect" parent="."] texture_filter = 1 layout_mode = 2 -texture = SubResource("ImageTexture_ms2vh") +texture = SubResource("ImageTexture_7dmaa") stretch_mode = 3 [node name="SpinScale" type="SpinBox" parent="."] @@ -136,7 +168,7 @@ layout_mode = 2 [node name="IconRotation" type="TextureRect" parent="."] texture_filter = 1 layout_mode = 2 -texture = SubResource("ImageTexture_ms2vh") +texture = SubResource("ImageTexture_7dmaa") stretch_mode = 3 [node name="SpinRotation" type="SpinBox" parent="."] @@ -150,7 +182,7 @@ select_all_on_focus = true [node name="IconRotationRand" type="TextureRect" parent="."] texture_filter = 1 layout_mode = 2 -texture = SubResource("ImageTexture_ms2vh") +texture = SubResource("ImageTexture_7dmaa") stretch_mode = 3 [node name="SpinRotationRand" type="SpinBox" parent="."] @@ -196,5 +228,6 @@ horizontal_alignment = 2 vertical_alignment = 1 [connection signal="theme_changed" from="." to="." method="_on_theme_changed"] +[connection signal="gui_input" from="PanelContainer" to="." method="_on_panel_container_gui_input"] [connection signal="value_changed" from="HSliderRadius" to="." method="_on_h_slider_radius_value_changed"] [connection signal="value_changed" from="HSliderDensity" to="." method="_on_h_slider_density_value_changed"]