Loot changes

This commit is contained in:
dingo
2026-01-20 16:23:00 -05:00
parent 5bc1c6e0f9
commit a39f4a0a98
20 changed files with 791 additions and 50 deletions
+31
View File
@@ -26,6 +26,7 @@ var minimap_tex: ImageTexture = null
# Mobile UI buttons
var inventory_button: Button = null
var crafting_button: Button = null
var stats_button: Button = null
const MINIMAP_SIZE := 120
const MINIMAP_SCALE := 3 # How many world pixels per minimap pixel
@@ -172,6 +173,28 @@ func _setup_mobile_buttons():
crafting_button.offset_right = -10
crafting_button.offset_bottom = -150
# Create stats button (bottom right, above crafting)
stats_button = Button.new()
stats_button.text = "Stats"
stats_button.custom_minimum_size = Vector2(60, 60)
var stats_style = StyleBoxFlat.new()
stats_style.bg_color = Color(0.3, 0.5, 0.3, 0.9)
stats_style.border_color = Color(0.5, 0.7, 0.5)
stats_style.set_border_width_all(2)
stats_style.set_corner_radius_all(8)
stats_button.add_theme_stylebox_override("normal", stats_style)
stats_button.pressed.connect(_on_mobile_stats_pressed)
add_child(stats_button)
# Position bottom right, above crafting button
stats_button.set_anchors_and_offsets_preset(Control.PRESET_BOTTOM_RIGHT)
stats_button.offset_left = -70
stats_button.offset_top = -280
stats_button.offset_right = -10
stats_button.offset_bottom = -220
func _on_mobile_inventory_pressed():
# Toggle inventory visibility
var dungeon_manager = get_tree().get_first_node_in_group("dungeon_manager")
@@ -184,6 +207,12 @@ func _on_mobile_crafting_pressed():
if dungeon_manager and dungeon_manager.has_method("_toggle_crafting"):
dungeon_manager._toggle_crafting()
func _on_mobile_stats_pressed():
# Toggle char sheet visibility
var dungeon_manager = get_tree().get_first_node_in_group("dungeon_manager")
if dungeon_manager and dungeon_manager.has_method("_toggle_char_sheet"):
dungeon_manager._toggle_char_sheet()
func _generate_minimap():
if not GameState or GameState.dungeon.tiles.is_empty():
return
@@ -438,6 +467,8 @@ func set_mobile_controls_visible(visible: bool):
inventory_button.visible = visible
if crafting_button:
crafting_button.visible = visible
if stats_button:
stats_button.visible = visible
# Show/hide touch joystick
var joystick = get_node_or_null("TouchJoystick")