bug fixes
This commit is contained in:
+13
-9
@@ -123,9 +123,11 @@ func _toggle_char_sheet():
|
||||
char_sheet_ui.visible = not char_sheet_ui.visible
|
||||
|
||||
func _create_settings_panel():
|
||||
# Create settings button (top right corner, 1/3 original size)
|
||||
# Create settings button (top right corner, small size)
|
||||
settings_btn = TextureButton.new()
|
||||
settings_btn.custom_minimum_size = Vector2(16, 16)
|
||||
settings_btn.custom_minimum_size = Vector2(32, 32)
|
||||
settings_btn.ignore_texture_size = true
|
||||
settings_btn.stretch_mode = TextureButton.STRETCH_KEEP_ASPECT_CENTERED
|
||||
|
||||
# Load settings icon from CDN
|
||||
var texture_loaded = false
|
||||
@@ -133,7 +135,6 @@ func _create_settings_panel():
|
||||
var settings_texture = UpdateManager.load_texture("textures/ui/buttons/settings.png")
|
||||
if settings_texture:
|
||||
settings_btn.texture_normal = settings_texture
|
||||
settings_btn.scale = Vector2(.17,.17) # 1/3 of 0.5 = 0.167
|
||||
texture_loaded = true
|
||||
|
||||
# Fallback: add a visible background if texture doesn't load
|
||||
@@ -145,11 +146,10 @@ func _create_settings_panel():
|
||||
fallback_style.set_corner_radius_all(8)
|
||||
settings_btn.add_theme_stylebox_override("normal", fallback_style)
|
||||
|
||||
|
||||
# Add a label to show "⚙" gear icon
|
||||
var label = Label.new()
|
||||
label.text = "⚙"
|
||||
label.add_theme_font_size_override("font_size", 6) # Smaller for 1/3 size
|
||||
label.add_theme_font_size_override("font_size", 20)
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
label.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
@@ -158,12 +158,12 @@ func _create_settings_panel():
|
||||
settings_btn.pressed.connect(_toggle_settings_panel)
|
||||
add_child(settings_btn)
|
||||
|
||||
# Position top right corner (moved further left and down)
|
||||
# Position top right corner
|
||||
settings_btn.set_anchors_and_offsets_preset(Control.PRESET_TOP_RIGHT)
|
||||
settings_btn.offset_left = -50
|
||||
settings_btn.offset_left = -42 # 32 + 10 margin
|
||||
settings_btn.offset_top = 10
|
||||
settings_btn.offset_right = -56
|
||||
settings_btn.offset_bottom = 24
|
||||
settings_btn.offset_right = -10
|
||||
settings_btn.offset_bottom = 42
|
||||
|
||||
# Create settings panel (initially hidden)
|
||||
settings_panel = Panel.new()
|
||||
@@ -294,6 +294,8 @@ func _on_settings_file_downloaded(file_path: String):
|
||||
var settings_texture = UpdateManager.load_texture("textures/ui/buttons/settings.png")
|
||||
if settings_texture:
|
||||
settings_btn.texture_normal = settings_texture
|
||||
settings_btn.ignore_texture_size = true
|
||||
settings_btn.stretch_mode = TextureButton.STRETCH_KEEP_ASPECT_CENTERED
|
||||
# Remove fallback styling if it was applied
|
||||
if settings_btn.get_child_count() > 0:
|
||||
for child in settings_btn.get_children():
|
||||
@@ -305,6 +307,8 @@ func _on_update_completed(_count: int):
|
||||
var settings_texture = UpdateManager.load_texture("textures/ui/buttons/settings.png")
|
||||
if settings_texture:
|
||||
settings_btn.texture_normal = settings_texture
|
||||
settings_btn.ignore_texture_size = true
|
||||
settings_btn.stretch_mode = TextureButton.STRETCH_KEEP_ASPECT_CENTERED
|
||||
# Remove fallback styling if it was applied
|
||||
if settings_btn.get_child_count() > 0:
|
||||
for child in settings_btn.get_children():
|
||||
|
||||
Reference in New Issue
Block a user