Small test change.

This commit is contained in:
Relintai 2022-02-11 16:32:21 +01:00
parent 595937136b
commit 174fcaf972
6 changed files with 175 additions and 8 deletions

0
am.orig Normal file
View File

144
am.rej Normal file
View File

@ -0,0 +1,144 @@
--- project.godot
+++ project.godot
@@ -835,3 +835,8 @@ quality/directional_shadow/size.mobile=1024
quality/shading/force_vertex_shading=true
quality/2d/use_batching=true
quality/shadows/enabled=false
+
+[ui]
+
+actionbar/show_keybind_text=true
+actionbar/show_cooldown_text=true
--- ActionBarEntry.gd
+++ ActionBarEntry.gd
@@ -44,6 +44,9 @@ var categ_cd : float = 0
var has_gcd : bool = false
var gcd : float = 0.0
+var show_keybind_text : bool = true
+var show_cooldown_text : bool = true
+
func _ready() -> void:
button = get_node(button_path) as Button
icon_rect = get_node(icon_path) as TextureRect
@@ -56,6 +59,19 @@ func _ready() -> void:
ProfileManager.connect("keybinds_changed", self, "on_keybinds_changed")
+ show_keybind_text = Settings.get_value("ui", "actionbar_show_keybind_text")
+ show_cooldown_text = Settings.get_value("ui", "actionbar_show_coldown_text")
+
+ Settings.connect("setting_changed", self, "on_setting_changed")
+
+ if show_keybind_text:
+ keybind_text.show()
+ else:
+ keybind_text.hide()
+
+ if !show_cooldown_text:
+ cooldown_text.hide()
+
func _exit_tree():
if icon_rect.texture != null:
ThemeAtlas.unref_texture(icon_rect.texture)
@@ -90,7 +106,9 @@ func _process(delta : float) -> void:
func set_cooldown_time(time : float) -> void:
cooldown_indicator.value = time
- cooldown_text.text = str(int(time))
+
+ if show_cooldown_text:
+ cooldown_text.text = str(int(time))
func show_cooldown_timer(max_time : float) -> void:
if cooldown_indicator.visible and cooldown_indicator.max_value < max_time:
@@ -100,11 +118,15 @@ func show_cooldown_timer(max_time : float) -> void:
cooldown_indicator.max_value = max_time
cooldown_indicator.show()
- cooldown_text.show()
+
+ if show_cooldown_text:
+ cooldown_text.show()
func hide_cooldown_timer() -> void:
cooldown_indicator.hide()
- cooldown_text.hide()
+
+ if show_cooldown_text:
+ cooldown_text.hide()
func set_button_entry(action_bar_button_entry: ActionBarButtonEntry, p_player: Entity) -> void:
player = p_player
@@ -386,3 +408,24 @@ func _cgcd_started(e : Entity, value :float) -> void:
func _cgcd_finished(val) -> void:
gcd = 0
+
+func on_setting_changed(section, key, value):
+ if section == "ui":
+ if key == "actionbar_show_keybind_text":
+ show_keybind_text = value
+
+ if show_keybind_text:
+ keybind_text.show()
+ else:
+ keybind_text.hide()
+
+ elif key == "actionbar_show_coldown_text":
+ show_cooldown_text = value
+
+ if cd > 0.2 || categ_cd > 0.2:
+ #The update loop should take care of the rest
+ if show_cooldown_text:
+ cooldown_text.show()
+ else:
+ cooldown_text.hide()
+
--- SettingsManager.gd
+++ SettingsManager.gd
@@ -51,6 +51,8 @@ var _settings : Dictionary = {
"touchscreen_mode" : OS.has_touchscreen_ui_hint(),
"ui_scale" : ProjectSettings.get("display/window/size/ui_scale"),
"ui_scale_touch" : ProjectSettings.get("display/window/size/ui_scale_touch"),
+ "actionbar_show_keybind_text" : ProjectSettings.get("ui/actionbar/show_keybind_text"),
+ "actionbar_show_coldown_text" : ProjectSettings.get("ui/actionbar/show_cooldown_text"),
},
"debug" : {
"debug_info" : false
@@ -188,6 +190,12 @@ func set_ui_ui_scale_touch(value : float) -> void:
ProjectSettings.set("rendering/window/size/ui_scale_touch", value)
set_stretch()
+func set_ui_actionbar_show_keybind_text(value : bool) -> void:
+ ProjectSettings.set("ui/actionbar/show_keybind_text", value)
+
+func set_ui_actionbar_show_coldown_text(value : bool) -> void:
+ ProjectSettings.set("ui/actionbar/show_cooldown_text", value)
+
func set_stretch():
if !loaded:
return
--- Options.tscn
+++ Options.tscn
@@ -205,6 +205,20 @@ max_value = 2.4
step = 0.01
rounded = false
+[node name="OptionToggleRow2" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 4 )]
+margin_top = 98.0
+margin_bottom = 124.0
+property_category = "ui"
+property_name = "actionbar_show_keybind_text"
+property_label = "Show Keybind Text"
+
+[node name="OptionToggleRow3" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 4 )]
+margin_top = 132.0
+margin_bottom = 158.0
+property_category = "ui"
+property_name = "actionbar_show_coldown_text"
+property_label = "Show Cooldown Text"
+
[node name="Debug" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://tilesets/tiles.png" type="Texture" id=1]
[resource]
atlas = ExtResource( 1 )
region = Rect2( 38, 40, 16, 16 )

View File

@ -14,7 +14,7 @@ dest_files=[ "res://.import/tiles.png-5d675a2fb09e0df27dbb24e34fa9fb00.stex" ]
[params] [params]
compress/mode=0 compress/mode=3
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_mode=0 compress/hdr_mode=0
compress/bptc_ldr=0 compress/bptc_ldr=0
@ -24,7 +24,7 @@ flags/filter=false
flags/mipmaps=false flags/mipmaps=false
flags/anisotropic=false flags/anisotropic=false
flags/srgb=2 flags/srgb=2
process/fix_alpha_border=false process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/HDR_as_SRGB=false process/HDR_as_SRGB=false
process/invert_color=false process/invert_color=false

View File

@ -1,6 +1,7 @@
[gd_resource type="RTileSet" load_steps=6 format=2] [gd_resource type="RTileSet" load_steps=7 format=2]
[ext_resource path="res://tilesets/tiles.png" type="Texture" id=1] [ext_resource path="res://tilesets/tiles.png" type="Texture" id=1]
[ext_resource path="res://tilesets/new_atlastexture.tres" type="Texture" id=2]
[sub_resource type="NavigationPolygon" id=1] [sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) vertices = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
@ -22,7 +23,7 @@ noise = SubResource( 4 )
0/texture = ExtResource( 1 ) 0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 ) 0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 ) 0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 32, 32, 32, 32 ) 0/region = Rect2( 38, 39, 18, 17 )
0/tile_mode = 0 0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 ) 0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 ) 0/navigation_offset = Vector2( 0, 0 )
@ -37,7 +38,7 @@ noise = SubResource( 4 )
1/texture = ExtResource( 1 ) 1/texture = ExtResource( 1 )
1/tex_offset = Vector2( 0, 0 ) 1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 ) 1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 96, 0, 32, 32 ) 1/region = Rect2( 104, 6, 20, 19 )
1/tile_mode = 0 1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 ) 1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 ) 1/navigation_offset = Vector2( 0, 0 )
@ -52,7 +53,7 @@ noise = SubResource( 4 )
2/texture = ExtResource( 1 ) 2/texture = ExtResource( 1 )
2/tex_offset = Vector2( 0, 0 ) 2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 ) 2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 96, 32, 32, 32 ) 2/region = Rect2( 100, 37, 23, 21 )
2/tile_mode = 0 2/tile_mode = 0
2/occluder_offset = Vector2( 0, 0 ) 2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 ) 2/navigation_offset = Vector2( 0, 0 )
@ -63,3 +64,17 @@ noise = SubResource( 4 )
2/shape_one_way_margin = 0.0 2/shape_one_way_margin = 0.0
2/shapes = [ ] 2/shapes = [ ]
2/z_index = 0 2/z_index = 0
3/name = "new_atlastexture.tres 3"
3/texture = ExtResource( 2 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 0, 0, 16, 16 )
3/tile_mode = 0
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0