Refactor code structure for improved readability and maintainability
This commit is contained in:
+1
-7
@@ -4,7 +4,7 @@ signal produce_items(item_id: String, amount: int)
|
||||
|
||||
const OWNIVERSE_ITEM = preload("uid://d3xjfxwe3w16v")
|
||||
|
||||
const SPEED_TEXTURE_NAME_TEMPLATE = "res://UI/TopMenu/Time&Speed/Time%s.png"
|
||||
const SPEED_TEXTURE_NAME_TEMPLATE = "res://ui/topmenu/time&speed/time%s.png"
|
||||
|
||||
const PAGE_COUNT = 5
|
||||
const PAGE_WIDTH = 1080
|
||||
@@ -161,9 +161,6 @@ func _init_owniverse_items() -> bool:
|
||||
item.init_button(item_props)
|
||||
item.item_activated.connect(item_activated)
|
||||
|
||||
#if owniverse.entities.has(item_id):
|
||||
#item.visible = owniverse.entities[item_id].is_unlocked
|
||||
|
||||
owniverse_items[item_id] = item
|
||||
|
||||
return false
|
||||
@@ -173,14 +170,11 @@ func item_activated(item: OwniverseItem) -> void:
|
||||
_control_page(item)
|
||||
_set_item_description(item)
|
||||
|
||||
print(item.item_id)
|
||||
if item.item_id == "S" or item.item_id == "H":
|
||||
owniverse.produce(item.item_id, 1)
|
||||
|
||||
func _unlock_item(item_id: String):
|
||||
owniverse_items[item_id].visible = true
|
||||
print("Unlocked ", item_id)
|
||||
pass
|
||||
|
||||
|
||||
func _check_counters(delta: float) -> Array:
|
||||
|
||||
Reference in New Issue
Block a user