diff --git a/resources/game_data/cost_function/identity/identity.gd b/resources/game_data/cost_function/identity/identity.gd index 9c8ad02..da9a4da 100644 --- a/resources/game_data/cost_function/identity/identity.gd +++ b/resources/game_data/cost_function/identity/identity.gd @@ -1,5 +1,5 @@ -extends Resource class_name CostFunction +extends Resource func get_cost(base_cost: int, _level: int) -> int: diff --git a/resources/game_data/enemy_data/enemy_data.gd b/resources/game_data/enemy_data/enemy_data.gd index 848131b..4fc80cf 100644 --- a/resources/game_data/enemy_data/enemy_data.gd +++ b/resources/game_data/enemy_data/enemy_data.gd @@ -1,5 +1,5 @@ -extends Resource class_name EnemyData +extends Resource @export var order: int = 0 @export var id: String diff --git a/resources/game_data/event_data/event_data.gd b/resources/game_data/event_data/event_data.gd index 7eecbec..69bc555 100644 --- a/resources/game_data/event_data/event_data.gd +++ b/resources/game_data/event_data/event_data.gd @@ -1,5 +1,5 @@ -extends Resource class_name EventData +extends Resource @export var id: String @export var vars: Array = [] diff --git a/resources/game_data/npc_event/npc_event.gd b/resources/game_data/npc_event/npc_event.gd index bad9ec0..b7e9bb4 100644 --- a/resources/game_data/npc_event/npc_event.gd +++ b/resources/game_data/npc_event/npc_event.gd @@ -1,5 +1,5 @@ -extends Resource class_name NpcEvent +extends Resource @export var sort_value: int = 0 @export var npc_id: String diff --git a/resources/game_data/resource_generator/resource_generator.gd b/resources/game_data/resource_generator/resource_generator.gd index b22938c..f8a1ae4 100644 --- a/resources/game_data/resource_generator/resource_generator.gd +++ b/resources/game_data/resource_generator/resource_generator.gd @@ -1,5 +1,5 @@ -extends Resource class_name ResourceGenerator +extends Resource @export var color: Color = Color.BLACK @export var sort_value: int = 0 diff --git a/resources/game_data/tab_data/tab_data.gd b/resources/game_data/tab_data/tab_data.gd index 2b4fce4..ceda976 100644 --- a/resources/game_data/tab_data/tab_data.gd +++ b/resources/game_data/tab_data/tab_data.gd @@ -1,5 +1,5 @@ -extends Resource class_name TabData +extends Resource @export var id: String @export var sort_value: int = 0 diff --git a/resources/game_data/worker_role/worker_role.gd b/resources/game_data/worker_role/worker_role.gd index 3ac3e3d..995c1f3 100644 --- a/resources/game_data/worker_role/worker_role.gd +++ b/resources/game_data/worker_role/worker_role.gd @@ -1,5 +1,5 @@ -extends Resource class_name WorkerRole +extends Resource @export var order: int = 0 @export var sort_value: int = 0 diff --git a/scenes/autostart/save_file_picker/save_file_picker.gd b/scenes/autostart/save_file_picker/save_file_picker.gd index a220ef7..266ed9b 100644 --- a/scenes/autostart/save_file_picker/save_file_picker.gd +++ b/scenes/autostart/save_file_picker/save_file_picker.gd @@ -1,10 +1,10 @@ extends Node +@export var main_scene: PackedScene + @onready var ui: Control = %UI @onready var save_file_tracker: SaveFileTracker = %SaveFileTracker -@export var main_scene: PackedScene - ############### ## overrides ## ############### diff --git a/scenes/component/effect/label_effect_queue/label_effect/label_effect.gd b/scenes/component/effect/label_effect_queue/label_effect/label_effect.gd index 154eeb1..1539a77 100644 --- a/scenes/component/effect/label_effect_queue/label_effect/label_effect.gd +++ b/scenes/component/effect/label_effect_queue/label_effect/label_effect.gd @@ -1,15 +1,15 @@ -extends Node2D class_name LabelEffect +extends Node2D signal task_finished(text: String) +var finished: bool = true +var task: String + @onready var sub_viewport: SubViewport = $SubViewport @onready var label: Label = %Label @onready var gpu_particles_2d: GPUParticles2D = $GPUParticles2D -var finished: bool = true -var task: String - func _process(_delta: float) -> void: if !is_visible_in_tree(): diff --git a/scenes/component/effect/label_effect_queue/label_effect_queue.gd b/scenes/component/effect/label_effect_queue/label_effect_queue.gd index 3d358cb..e9fba88 100644 --- a/scenes/component/effect/label_effect_queue/label_effect_queue.gd +++ b/scenes/component/effect/label_effect_queue/label_effect_queue.gd @@ -1,8 +1,5 @@ -extends Node2D class_name LabelEffectQueue - -@onready var queue: Node2D = %Queue -@onready var timer: Timer = $Timer +extends Node2D @export var label_effect_scene: PackedScene @export var delay: float = 0.5 @@ -14,6 +11,9 @@ var _particle_id: String var _tasks: Array[String] = [] var _last_task: String = "" +@onready var queue: Node2D = %Queue +@onready var timer: Timer = $Timer + func _ready() -> void: set_delay(delay) diff --git a/scenes/component/effect/line_effect/line_effect.gd b/scenes/component/effect/line_effect/line_effect.gd index 8f81076..1499335 100644 --- a/scenes/component/effect/line_effect/line_effect.gd +++ b/scenes/component/effect/line_effect/line_effect.gd @@ -1,5 +1,5 @@ -extends Line2D class_name LineEffect +extends Line2D @export var max_alpha: float = 1.0 @export var duration: float = 1.0 diff --git a/scenes/component/texture/texture_pixel_explosion/texture_pixel_explosion.gd b/scenes/component/texture/texture_pixel_explosion/texture_pixel_explosion.gd index b9a3865..c005ad2 100644 --- a/scenes/component/texture/texture_pixel_explosion/texture_pixel_explosion.gd +++ b/scenes/component/texture/texture_pixel_explosion/texture_pixel_explosion.gd @@ -1,7 +1,5 @@ -extends TextureRect class_name TexturePixelExplosion - -@onready var simple_tween: SimpleTween = %SimpleTween +extends TextureRect ## tween params var death_animation_duration: float = 1.0 @@ -9,6 +7,8 @@ var death_animation_end_delay: float = 0.3 var death_animation_duration_fast: float = 0.8 var death_animation_end_delay_fast: float = 0.2 +@onready var simple_tween: SimpleTween = %SimpleTween + ############### ## overrides ## ############### diff --git a/scenes/component/texture/texture_rgb_offset/texture_rgb_offset.gd b/scenes/component/texture/texture_rgb_offset/texture_rgb_offset.gd index 071d506..bfc6381 100644 --- a/scenes/component/texture/texture_rgb_offset/texture_rgb_offset.gd +++ b/scenes/component/texture/texture_rgb_offset/texture_rgb_offset.gd @@ -1,7 +1,5 @@ -extends TextureRect class_name TextureRgbOffset - -@onready var simple_tween: SimpleTween = %SimpleTween +extends TextureRect ## tween params var shader_simple_tween_duration: float = 0.5 @@ -9,6 +7,8 @@ var rl_max: float = 6 var rx_max: float = rl_max var ry_max: float = rl_max +@onready var simple_tween: SimpleTween = %SimpleTween + ############### ## overrides ## ############### @@ -30,7 +30,7 @@ func get_simple_tween() -> SimpleTween: func play_animation(duration: float = shader_simple_tween_duration) -> void: if simple_tween.is_finished(): _randomize_shader_simple_tween_direction() - simple_tween.play_animation_(duration) + simple_tween.play_animation_during(duration) func _randomize_shader_simple_tween_direction() -> void: diff --git a/scenes/component/tween/simple_tween/simple_tween.gd b/scenes/component/tween/simple_tween/simple_tween.gd index 12eb55e..ba2e466 100644 --- a/scenes/component/tween/simple_tween/simple_tween.gd +++ b/scenes/component/tween/simple_tween/simple_tween.gd @@ -1,5 +1,5 @@ -extends Node class_name SimpleTween +extends Node signal animation_end signal animation_finished @@ -33,10 +33,10 @@ func is_finished() -> bool: func play_animation(reverse: bool = false) -> void: - play_animation_(0, reverse) + play_animation_during(0, reverse) -func play_animation_(override_duration: float, reverse: bool = false) -> void: +func play_animation_during(override_duration: float, reverse: bool = false) -> void: _reversed_flag = reverse finished = false if _tween != null: diff --git a/scenes/controller/event_controller/event_controller.gd b/scenes/controller/event_controller/event_controller.gd index 88bef8a..49787ab 100644 --- a/scenes/controller/event_controller/event_controller.gd +++ b/scenes/controller/event_controller/event_controller.gd @@ -1,5 +1,5 @@ -extends Node class_name EventController +extends Node ############### ## overrides ## diff --git a/scenes/controller/experience_controller/experience_controller.gd b/scenes/controller/experience_controller/experience_controller.gd index 1a628e5..c1c984c 100644 --- a/scenes/controller/experience_controller/experience_controller.gd +++ b/scenes/controller/experience_controller/experience_controller.gd @@ -1,5 +1,5 @@ -extends Node class_name ExperienceController +extends Node ############### ## overrides ## diff --git a/scenes/controller/npc_controller/npc_controller.gd b/scenes/controller/npc_controller/npc_controller.gd index bbcf5cb..4da3e45 100644 --- a/scenes/controller/npc_controller/npc_controller.gd +++ b/scenes/controller/npc_controller/npc_controller.gd @@ -1,5 +1,5 @@ -extends Node class_name NpcController +extends Node ############### ## overrides ## diff --git a/scenes/manager/enemy_manager/enemy_manager.gd b/scenes/manager/enemy_manager/enemy_manager.gd index 42d5b12..fcb2e8b 100644 --- a/scenes/manager/enemy_manager/enemy_manager.gd +++ b/scenes/manager/enemy_manager/enemy_manager.gd @@ -1,5 +1,5 @@ -extends Node class_name EnemyManager +extends Node ############### ## overrides ## diff --git a/scenes/manager/event_manager/event_manager.gd b/scenes/manager/event_manager/event_manager.gd index 12fe254..44229ca 100644 --- a/scenes/manager/event_manager/event_manager.gd +++ b/scenes/manager/event_manager/event_manager.gd @@ -1,5 +1,5 @@ -extends Node class_name EventManager +extends Node ############### ## overrides ## diff --git a/scenes/manager/npc_manager/npc_manager.gd b/scenes/manager/npc_manager/npc_manager.gd index bc0b631..b196573 100644 --- a/scenes/manager/npc_manager/npc_manager.gd +++ b/scenes/manager/npc_manager/npc_manager.gd @@ -1,5 +1,5 @@ -extends Node class_name NpcManager +extends Node ############### ## overrides ## diff --git a/scenes/manager/resource_manager/resource_manager.gd b/scenes/manager/resource_manager/resource_manager.gd index 49696d8..7680acf 100644 --- a/scenes/manager/resource_manager/resource_manager.gd +++ b/scenes/manager/resource_manager/resource_manager.gd @@ -1,5 +1,5 @@ -extends Node class_name ResourceManager +extends Node ############### ## overrides ## @@ -26,7 +26,7 @@ func _handle_on_resource_generated(id: String, amount: int, source_id: String) - SaveFile.resources[id] = SaveFile.resources.get(id, 0) + amount if amount < 0: - var spent_id: String = ResourceManager._spent_id(id) + var spent_id: String = ResourceManager.make_spent_id(id) SaveFile.resources[spent_id] = SaveFile.resources.get(spent_id, 0) - amount SignalBus.resource_updated.emit(id, SaveFile.resources.get(id, 0), amount, source_id) @@ -63,8 +63,10 @@ static func is_max_amount_reached(id: String) -> bool: static func get_total_generated(id: String) -> int: - return SaveFile.resources.get(id, 0) + SaveFile.resources.get(ResourceManager._spent_id(id), 0) + return ( + SaveFile.resources.get(id, 0) + SaveFile.resources.get(ResourceManager.make_spent_id(id), 0) + ) -static func _spent_id(id: String) -> String: +static func make_spent_id(id: String) -> String: return "spent_" + id diff --git a/scenes/manager/worker_manager/worker_manager.gd b/scenes/manager/worker_manager/worker_manager.gd index c5468b6..e269e42 100644 --- a/scenes/manager/worker_manager/worker_manager.gd +++ b/scenes/manager/worker_manager/worker_manager.gd @@ -1,5 +1,5 @@ -extends Node class_name WorkerManager +extends Node ############### ## overrides ## diff --git a/scenes/ui/enemy/enemy_progress_bar/enemy_progress_bar.gd b/scenes/ui/enemy/enemy_progress_bar/enemy_progress_bar.gd index 8680ac8..c1d0991 100644 --- a/scenes/ui/enemy/enemy_progress_bar/enemy_progress_bar.gd +++ b/scenes/ui/enemy/enemy_progress_bar/enemy_progress_bar.gd @@ -1,5 +1,5 @@ -extends MarginContainer class_name EnemyProgressBar +extends MarginContainer @onready var progress_bar_left: ProgressBar = %ProgressBarLeft @onready var progress_bar_right: ProgressBar = %ProgressBarRight diff --git a/scenes/ui/event_tracker/event_tracker.gd b/scenes/ui/event_tracker/event_tracker.gd index 0127f3b..c6f4dc4 100644 --- a/scenes/ui/event_tracker/event_tracker.gd +++ b/scenes/ui/event_tracker/event_tracker.gd @@ -1,14 +1,14 @@ extends MarginContainer -@onready var event_v_box_container: VBoxContainer = %EventVBoxContainer -@onready var scroll_container: ScrollContainer = %ScrollContainer - -@onready var title_label: Label = %TitleLabel @export var event_item_scene: PackedScene -@export var PAGE_SIZE: int = 20 +@export var page_size: int = 20 var _total_lines: int = 0 +@onready var event_v_box_container: VBoxContainer = %EventVBoxContainer +@onready var scroll_container: ScrollContainer = %ScrollContainer +@onready var title_label: Label = %TitleLabel + ############### ## overrides ## ############### @@ -38,7 +38,7 @@ func _load_from_save_file() -> void: var next_index: int = SaveFile.event_log.size() var load_range: int = next_index if Game.params["debug_no_scrollbar"]: - load_range = min(PAGE_SIZE, next_index) + load_range = min(page_size, next_index) for index: int in range(load_range): var event_log_index: int = index + 1 var event_log: Dictionary = SaveFile.event_log[str(event_log_index)] @@ -53,7 +53,7 @@ func _add_event(event_data: EventData, vals: Array, index: int, new: bool) -> vo event_item.set_content(event_data, vals, index, new) _total_lines += 1 if Game.params["debug_no_scrollbar"]: - while _total_lines > PAGE_SIZE: + while _total_lines > page_size: NodeUtils.remove_oldest(event_v_box_container) _total_lines -= 1 diff --git a/scenes/ui/event_tracker/event_tracker_item/event_tracker_item.gd b/scenes/ui/event_tracker/event_tracker_item/event_tracker_item.gd index 47ab6f8..da20736 100644 --- a/scenes/ui/event_tracker/event_tracker_item/event_tracker_item.gd +++ b/scenes/ui/event_tracker/event_tracker_item/event_tracker_item.gd @@ -1,14 +1,14 @@ -extends MarginContainer class_name EventTrackerItem - -@onready var line_label: Label = %LineLabel -@onready var event_label: Label = %EventLabel -@onready var typing_text_tween: Node = %TypingTextTween +extends MarginContainer var _event_data: EventData var _vals: Array var _index: int +@onready var line_label: Label = %LineLabel +@onready var event_label: Label = %EventLabel +@onready var typing_text_tween: Node = %TypingTextTween + func _ready() -> void: pass diff --git a/scenes/ui/experience_tracker/experience_tracker.gd b/scenes/ui/experience_tracker/experience_tracker.gd index 845afd5..065ae97 100644 --- a/scenes/ui/experience_tracker/experience_tracker.gd +++ b/scenes/ui/experience_tracker/experience_tracker.gd @@ -1,5 +1,5 @@ -extends MarginContainer class_name ExperienceTracker +extends MarginContainer @onready var experience_label: Label = %ExperienceLabel @onready var updated_simple_tween: SimpleTween = %UpdatedSimpleTween @@ -48,6 +48,6 @@ func _connect_signals() -> void: ############ -func __updated_simple_tween_method(animation_percent: float) -> void: +func _updated_simple_tween_method(animation_percent: float) -> void: self.modulate.r = animation_percent self.modulate.g = animation_percent diff --git a/scenes/ui/experience_tracker/experience_tracker.tscn b/scenes/ui/experience_tracker/experience_tracker.tscn index 13abf59..9897aa7 100644 --- a/scenes/ui/experience_tracker/experience_tracker.tscn +++ b/scenes/ui/experience_tracker/experience_tracker.tscn @@ -23,4 +23,4 @@ text = "Experience: 123" unique_name_in_owner = true target = NodePath("../..") duration = 0.5 -call_method = "__updated_simple_tween_method" +call_method = "_updated_simple_tween_method" diff --git a/scenes/ui/info_container/info_container.gd b/scenes/ui/info_container/info_container.gd index 500468f..f9fca3a 100644 --- a/scenes/ui/info_container/info_container.gd +++ b/scenes/ui/info_container/info_container.gd @@ -1,11 +1,11 @@ extends MarginContainer -@onready var title_label: Label = %TitleLabel -@onready var info_label: Label = %InfoLabel - var info_id: String var info_type: String +@onready var title_label: Label = %TitleLabel +@onready var info_label: Label = %InfoLabel + ############### ## overrides ## ############### diff --git a/scenes/ui/manager_settings_container/scale_button/scale_button.gd b/scenes/ui/manager_settings_container/scale_button/scale_button.gd index 95722b8..0e1c514 100644 --- a/scenes/ui/manager_settings_container/scale_button/scale_button.gd +++ b/scenes/ui/manager_settings_container/scale_button/scale_button.gd @@ -1,4 +1,4 @@ -extends MarginContainer class_name ScaleButton +extends MarginContainer @onready var button: Button = %Button diff --git a/scenes/ui/progress_button/progress_button.gd b/scenes/ui/progress_button/progress_button.gd index 5ac5ea1..db9bbc6 100644 --- a/scenes/ui/progress_button/progress_button.gd +++ b/scenes/ui/progress_button/progress_button.gd @@ -190,7 +190,7 @@ func _on_progress_button_paid(resource_generator: ResourceGenerator) -> void: return if get_id() == resource_generator.id: - progress_bar_simple_tween.play_animation_(_resource_generator.get_cooldown()) + progress_bar_simple_tween.play_animation_during(_resource_generator.get_cooldown()) if _resource_generator.sfx_button_success: Audio.play_sfx(_resource_generator.id, _resource_generator.sfx_button_success) diff --git a/scenes/ui/resource_tracker/resource_tracker.gd b/scenes/ui/resource_tracker/resource_tracker.gd index e83dcda..bf899d0 100644 --- a/scenes/ui/resource_tracker/resource_tracker.gd +++ b/scenes/ui/resource_tracker/resource_tracker.gd @@ -1,10 +1,10 @@ -extends MarginContainer class_name ResourceTracker +extends MarginContainer -@onready var resource_v_box_container: VBoxContainer = %ResourceVBoxContainer +@export var resource_item_scene: PackedScene +@onready var resource_v_box_container: VBoxContainer = %ResourceVBoxContainer @onready var title_label: Label = %TitleLabel -@export var resource_item_scene: PackedScene ############### ## overrides ## @@ -17,7 +17,6 @@ func _ready() -> void: _load_from_save_file() - ############# ## helpers ## ############# diff --git a/scenes/ui/save_file_tracker/save_file_item/save_file_item.gd b/scenes/ui/save_file_tracker/save_file_item/save_file_item.gd index b136fcc..d088ce2 100644 --- a/scenes/ui/save_file_tracker/save_file_item/save_file_item.gd +++ b/scenes/ui/save_file_tracker/save_file_item/save_file_item.gd @@ -1,31 +1,31 @@ -extends MarginContainer class_name SaveFileItem - -const SECTION_1_WIDTH_PX: int = 180 -const SECTION_2_WIDTH_PX: int = 140 -const SECTION_3_WIDTH_PX: int = 170 +extends MarginContainer signal load_button_click(save_file_name: String) signal delete_button_click(save_file_name: String) signal new_button_click(save_file_name: String) signal new_input_set(save_file_name: String, new_text: String, old_text: String) -@onready var load_button: Button = %LoadButton -@onready var delete_button: Button = %DeleteButton -@onready var new_button: Button = %NewButton -@onready var load_margin_container: MarginContainer = %LoadMarginContainer -@onready var delete_margin_container: MarginContainer = %DeleteMarginContainer -@onready var new_margin_container: MarginContainer = %NewMarginContainer -@onready var section_h_box_container: HBoxContainer = %SectionHBoxContainer +const SECTION_1_WIDTH_PX: int = 180 +const SECTION_2_WIDTH_PX: int = 140 +const SECTION_3_WIDTH_PX: int = 170 @export var save_file_item_section_scene: PackedScene +var name_section: SaveFileItemSection + var _save_file_name: String var _new: bool var _sort_value: int -var __delete_counter: int = 0 +var _delete_counter: int = 0 -var name_section: SaveFileItemSection +@onready var load_button: Button = %LoadButton +@onready var delete_button: Button = %DeleteButton +@onready var new_button: Button = %NewButton +@onready var load_margin_container: MarginContainer = %LoadMarginContainer +@onready var delete_margin_container: MarginContainer = %DeleteMarginContainer +@onready var new_margin_container: MarginContainer = %NewMarginContainer +@onready var section_h_box_container: HBoxContainer = %SectionHBoxContainer ############### ## overrides ## @@ -133,10 +133,10 @@ func _display_new(new: bool) -> void: func _display_delete_counter() -> void: var ui_delete: String = Locale.get_ui_label("delete") - if __delete_counter == 0: + if _delete_counter == 0: delete_button.text = ui_delete else: - delete_button.text = "(" + str(Game.params["delete_counter"] + 1 - __delete_counter) + ")" + delete_button.text = "(" + str(Game.params["delete_counter"] + 1 - _delete_counter) + ")" ############## @@ -145,11 +145,11 @@ func _display_delete_counter() -> void: func _handle_on_delete_button() -> void: - if __delete_counter >= Game.params["delete_counter"]: + if _delete_counter >= Game.params["delete_counter"]: delete_button_click.emit(_save_file_name) queue_free() else: - __delete_counter += 1 + _delete_counter += 1 _display_delete_counter() delete_button.release_focus() @@ -179,7 +179,7 @@ func _on_delete_button() -> void: func _on_delete_reset() -> void: - __delete_counter = 0 + _delete_counter = 0 _display_delete_counter() diff --git a/scenes/ui/save_file_tracker/save_file_item/save_file_item_section/save_file_item_section.gd b/scenes/ui/save_file_tracker/save_file_item/save_file_item_section/save_file_item_section.gd index 20a930c..f91a126 100644 --- a/scenes/ui/save_file_tracker/save_file_item/save_file_item_section/save_file_item_section.gd +++ b/scenes/ui/save_file_tracker/save_file_item/save_file_item_section/save_file_item_section.gd @@ -1,18 +1,18 @@ -extends MarginContainer class_name SaveFileItemSection +extends MarginContainer signal new_input_set(new_text: String, old_text: String) +var _input_enabled: bool = false +var _input_text: String = "" +var _previous_input_text: String = "" + @onready var title_label: Label = %TitleLabel @onready var value_label: Label = %ValueLabel @onready var input_margin_container: MarginContainer = %InputMarginContainer @onready var line_edit: LineEdit = %LineEdit @onready var scroll_container: ScrollContainer = %ScrollContainer -var _input_enabled: bool = false -var _input_text: String = "" -var _previous_input_text: String = "" - ############### ## overrides ## ############### diff --git a/scenes/ui/screen/soul_screen/soul_screen.gd b/scenes/ui/screen/soul_screen/soul_screen.gd index 350baa0..296fca2 100644 --- a/scenes/ui/screen/soul_screen/soul_screen.gd +++ b/scenes/ui/screen/soul_screen/soul_screen.gd @@ -2,12 +2,12 @@ extends MarginContainer const TAB_DATA_ID: String = "soul" -@onready var screen_h_box_container: HBoxContainer = %ScreenHBoxContainer - @export var substance_button_scene: PackedScene var vbox_containers: Array[VBoxContainer] = [] +@onready var screen_h_box_container: HBoxContainer = %ScreenHBoxContainer + ############### ## overrides ## ############### @@ -19,7 +19,6 @@ func _ready() -> void: _load_from_save_file() - ############# ## helpers ## ############# diff --git a/scenes/ui/screen/world_screen/world_screen.gd b/scenes/ui/screen/world_screen/world_screen.gd index 81ab617..69f6c04 100644 --- a/scenes/ui/screen/world_screen/world_screen.gd +++ b/scenes/ui/screen/world_screen/world_screen.gd @@ -2,12 +2,12 @@ extends MarginContainer const TAB_DATA_ID: String = "world" -@onready var h_box_container: HBoxContainer = %HBoxContainer - @export var progress_button_scene: PackedScene var grid_containers: Array[GridContainer] = [] +@onready var h_box_container: HBoxContainer = %HBoxContainer + ############### ## overrides ## ############### diff --git a/scenes/ui/settings_container/toggle_button/toggle_button.gd b/scenes/ui/settings_container/toggle_button/toggle_button.gd index 374e0b3..046ec89 100644 --- a/scenes/ui/settings_container/toggle_button/toggle_button.gd +++ b/scenes/ui/settings_container/toggle_button/toggle_button.gd @@ -1,11 +1,11 @@ extends MarginContainer -@onready var button: Button = %Button - @export var _id: String @export var _toggle_ids: Array[String] = [] @export var _toggle_id_index: int = -1 +@onready var button: Button = %Button + func _ready() -> void: button.button_up.connect(_on_button_up) diff --git a/scenes/ui/substance_button/substance_button.gd b/scenes/ui/substance_button/substance_button.gd index 47344b8..932781e 100644 --- a/scenes/ui/substance_button/substance_button.gd +++ b/scenes/ui/substance_button/substance_button.gd @@ -1,5 +1,8 @@ -extends MarginContainer class_name SubstanceButton +extends MarginContainer + +var _enemy_data: EnemyData +var _enemy_option: int @onready var texture_margin_container: MarginContainer = %TextureMarginContainer @onready var texture_rect: TextureRect = %TextureRect @@ -7,9 +10,6 @@ class_name SubstanceButton @onready var button: Button = %Button @onready var effect_label: Label = %EffectLabel -var _enemy_data: EnemyData -var _enemy_option: int - ############### ## overrides ## ############### @@ -38,10 +38,9 @@ func get_title() -> String: func get_color() -> Color: if _enemy_option == 2: return ColorSwatches.GREEN - elif _enemy_option == 1: + if _enemy_option == 1: return ColorSwatches.RED - else: - return Color.WHITE + return Color.WHITE func set_data(enemy_data: EnemyData) -> void: