Skip to content

Commit

Permalink
Added functionality to editor
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwijuice56 committed Aug 17, 2023
1 parent 436061a commit 039090e
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 50 deletions.
19 changes: 19 additions & 0 deletions game/main/element_manager/custom_element/custom_element.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class_name CustomElement
extends Resource

@export var display_name: String
@export var id: int
# 0: flat, 1: fancy
@export var style: int
@export var color_a: Color
@export var color_b: Color
@export var color_c: Color
# 0: powder, 1: solid, 2: liquid, 3: gas
@export var state: int
@export var density: float = 0.2
@export var viscosity: float = 0.5
@export var conductivity: float = 0.0
@export var temperature: float = 0.5
@export var flammability: float = 0.0
@export var reactivity: float = 0.5
@export var durability: float = 0.5
12 changes: 0 additions & 12 deletions game/main/element_manager/element_material/types/fluid.gd
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
extends Element
class_name Fluid

@export_enum("WATER", "FIRE", "CRYSTAL") var noise_texture: int
@export var color_a: Color
@export var color_b: Color
@export var color_c: Color

@export var noise_scale: float = 2.0
@export var noise_speed: float = 15.0
@export var current_size: float = 16.0
@export var wave_cycle: float = 3.0
@export var contraction_size: float = 16.0
@export var wave_density: float = 2.0
@export var shimmer_speed: float = 24.0
@export var shimmer_density: float = 1.5
@export var shimmer_opacity: float = 0.5
@export var shimmer_cycle: float = 2.0
Binary file added game/main/ui/_icons/icon_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions game/main/ui/_icons/icon_circle.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://l1h1lwsmjxdv"
path="res://.godot/imported/icon_circle.png-a254992dfc200b87316861d4ced5fa20.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://main/ui/_icons/icon_circle.png"
dest_files=["res://.godot/imported/icon_circle.png-a254992dfc200b87316861d4ced5fa20.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added game/main/ui/_icons/icon_circle2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions game/main/ui/_icons/icon_circle2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cwrw6b4hfr57h"
path="res://.godot/imported/icon_circle2.png-66203458bd9959c80b999bc3d3521e6e.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://main/ui/_icons/icon_circle2.png"
dest_files=["res://.godot/imported/icon_circle2.png-66203458bd9959c80b999bc3d3521e6e.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
4 changes: 3 additions & 1 deletion game/main/ui/_theme/theme.tres
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[gd_resource type="Theme" load_steps=9 format=3 uid="uid://co20v1mxv2dfm"]
[gd_resource type="Theme" load_steps=10 format=3 uid="uid://co20v1mxv2dfm"]

[ext_resource type="Texture2D" uid="uid://l1h1lwsmjxdv" path="res://main/ui/_icons/icon_circle.png" id="1_mvg4m"]
[ext_resource type="FontFile" uid="uid://b8lxwo5dkwrs4" path="res://main/ui/_theme/font/Poppins-Regular.ttf" id="1_p73bs"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dsk6v"]
Expand Down Expand Up @@ -67,6 +68,7 @@ CheckBox/styles/hover = SubResource("StyleBoxFlat_11w6c")
CheckBox/styles/normal = SubResource("StyleBoxFlat_xa765")
CheckBox/styles/pressed = SubResource("StyleBoxFlat_us5ki")
MenuButton/styles/hover = SubResource("StyleBoxFlat_11w6c")
PopupMenu/icons/radio_unchecked = ExtResource("1_mvg4m")
PopupMenu/styles/hover = SubResource("StyleBoxFlat_11w6c")
PopupMenu/styles/panel = SubResource("StyleBoxFlat_jpob4")
VScrollBar/styles/grabber = SubResource("StyleBoxFlat_xyiyu")
Expand Down
80 changes: 46 additions & 34 deletions game/main/ui/submenu/element_editor/ElementEditor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 8

[node name="ApperanceLabel" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
[node name="AppearanceLabel" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
text = "Appearance"
horizontal_alignment = 1
Expand All @@ -265,7 +265,8 @@ layout_mode = 2
size_flags_horizontal = 3
text = "name"

[node name="LineEdit" type="LineEdit" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/NameGrouping"]
[node name="Name" type="LineEdit" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/NameGrouping"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_styles/normal = SubResource("StyleBoxFlat_oid3n")
Expand All @@ -281,7 +282,8 @@ layout_mode = 2
size_flags_horizontal = 3
text = "style"

[node name="OptionButton" type="OptionButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ColorStyleGrouping"]
[node name="Style" type="OptionButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ColorStyleGrouping"]
unique_name_in_owner = true
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -302,9 +304,9 @@ theme_override_constants/separation = 8
[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlatColorGrouping"]
layout_mode = 2
size_flags_horizontal = 3
text = "color"
text = "base color"

[node name="FlatColor" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlatColorGrouping" groups=["color_picker"]]
[node name="ColorA" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlatColorGrouping" groups=["color_picker"]]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -317,22 +319,6 @@ unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 8

[node name="BaseColor" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping"]
layout_mode = 2

[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/BaseColor"]
layout_mode = 2
size_flags_horizontal = 3
text = "base color 1"

[node name="BaseColor1" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/BaseColor" groups=["color_picker"]]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 0
color = Color(0.243137, 0.352941, 1, 1)
edit_alpha = false

[node name="BaseColor2" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping"]
layout_mode = 2

Expand All @@ -341,7 +327,7 @@ layout_mode = 2
size_flags_horizontal = 3
text = "base color 2"

[node name="BaseColor2" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/BaseColor2" groups=["color_picker"]]
[node name="ColorB" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/BaseColor2" groups=["color_picker"]]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -357,7 +343,7 @@ layout_mode = 2
size_flags_horizontal = 3
text = "outline color"

[node name="OutlineColor" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/OutlineColor" groups=["color_picker"]]
[node name="ColorC" type="ColorPickerButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FancyColorGrouping/OutlineColor" groups=["color_picker"]]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -378,7 +364,8 @@ layout_mode = 2
size_flags_horizontal = 3
text = "state"

[node name="OptionButton" type="OptionButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/StateGrouping"]
[node name="State" type="OptionButton" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/StateGrouping"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 0
Expand Down Expand Up @@ -415,6 +402,28 @@ step = 0.01
value = 0.5
tick_count = 4

[node name="ViscosityGrouping" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2

[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ViscosityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
text = "viscosity"

[node name="Viscosity" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ViscosityGrouping"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
theme_override_styles/slider = SubResource("StyleBoxFlat_70ulr")
theme_override_styles/grabber_area = SubResource("StyleBoxFlat_o5yxv")
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_5uj0p")
max_value = 1.0
step = 0.01
value = 0.5
tick_count = 4

[node name="ConductivityGrouping" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
Expand All @@ -424,7 +433,7 @@ layout_mode = 2
size_flags_horizontal = 3
text = "conductivity"

[node name="HSlider" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ConductivityGrouping"]
[node name="Conductivity" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ConductivityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
Expand All @@ -444,7 +453,7 @@ layout_mode = 2
size_flags_horizontal = 3
text = "temperature"

[node name="HSlider" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/TemperatureGrouping"]
[node name="Temperature" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/TemperatureGrouping"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
Expand All @@ -453,7 +462,8 @@ theme_override_styles/grabber_area = SubResource("StyleBoxFlat_o5yxv")
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_5uj0p")
max_value = 1.0
step = 0.01
tick_count = 4
value = 0.5
tick_count = 3

[node name="FlammabilityGrouping" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
Expand All @@ -464,7 +474,7 @@ layout_mode = 2
size_flags_horizontal = 3
text = "flammability"

[node name="HSlider" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping"]
[node name="Flammability" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
Expand All @@ -475,16 +485,16 @@ max_value = 1.0
step = 0.01
tick_count = 4

[node name="FlammabilityGrouping2" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
[node name="ReactivityGrouping" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2

[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping2"]
[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ReactivityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
text = "reactivity"

[node name="HSlider" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping2"]
[node name="Reactivity" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/ReactivityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
Expand All @@ -493,18 +503,19 @@ theme_override_styles/grabber_area = SubResource("StyleBoxFlat_o5yxv")
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_5uj0p")
max_value = 1.0
step = 0.01
value = 0.75
tick_count = 4

[node name="FlammabilityGrouping3" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
[node name="DurabilityGrouping" type="HBoxContainer" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2

[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping3"]
[node name="Label" type="Label" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/DurabilityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
text = "durability"

[node name="HSlider" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/FlammabilityGrouping3"]
[node name="Durability" type="HSlider" parent="SettingsContainer/PanelContainer/VBoxContainer/ScrollContainer/VBoxContainer/DurabilityGrouping"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
Expand All @@ -513,6 +524,7 @@ theme_override_styles/grabber_area = SubResource("StyleBoxFlat_o5yxv")
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_5uj0p")
max_value = 1.0
step = 0.01
value = 0.25
tick_count = 4

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
Expand Down
Loading

0 comments on commit 039090e

Please sign in to comment.