diff --git a/main_menu.tscn b/main_menu.tscn index 20d2fa1..fcf8127 100644 --- a/main_menu.tscn +++ b/main_menu.tscn @@ -33,14 +33,14 @@ size_flags_vertical = 0 [node name="box2" parent="MarginContainer" instance=ExtResource( 1 )] material = null -margin_right = 101.0 +margin_right = 89.0 margin_bottom = 37.0 size_flags_horizontal = 3 size_flags_vertical = 3 texture = ExtResource( 4 ) [node name="MarginContainer2" type="MarginContainer" parent="MarginContainer"] -margin_right = 101.0 +margin_right = 89.0 margin_bottom = 37.0 custom_constants/margin_right = 4 custom_constants/margin_top = 4 @@ -50,7 +50,7 @@ custom_constants/margin_bottom = 4 [node name="Label" type="Label" parent="MarginContainer/MarginContainer2"] margin_left = 4.0 margin_top = 4.0 -margin_right = 97.0 +margin_right = 85.0 margin_bottom = 33.0 text = "Load Save File From here" diff --git a/widgets/BattleScene.tscn b/widgets/BattleScene.tscn index 93fe8d5..2c634a2 100644 --- a/widgets/BattleScene.tscn +++ b/widgets/BattleScene.tscn @@ -20,7 +20,7 @@ stretch_mode = 3 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -margin_top = -80.0 +margin_top = -81.0 size_flags_horizontal = 3 custom_constants/separation = 0 diff --git a/widgets/ColorMenu.gd b/widgets/ColorMenu.gd index 65934ac..b8d64a5 100644 --- a/widgets/ColorMenu.gd +++ b/widgets/ColorMenu.gd @@ -8,9 +8,9 @@ func update_menu_color() -> void: ThemeManager.set_menu_color_555(r, g, b) func _ready() -> void: - $slider_r.value = r - $slider_g.value = g - $slider_b.value = b + $'%slider_r'.value = r + $'%slider_g'.value = g + $'%slider_b'.value = b func _on_slider_r_value_changed(value: float) -> void: r = value diff --git a/widgets/ColorMenu.tscn b/widgets/ColorMenu.tscn index a1d85bf..0e48ce4 100644 --- a/widgets/ColorMenu.tscn +++ b/widgets/ColorMenu.tscn @@ -31,6 +31,7 @@ text = " align = 2 [node name="slider_r" type="HSlider" parent="."] +unique_name_in_owner = true margin_left = 18.0 margin_top = 21.0 margin_right = 58.0 @@ -38,6 +39,7 @@ margin_bottom = 29.0 max_value = 31.0 [node name="slider_g" type="HSlider" parent="."] +unique_name_in_owner = true margin_left = 18.0 margin_top = 36.0 margin_right = 58.0 @@ -45,6 +47,7 @@ margin_bottom = 44.0 max_value = 31.0 [node name="slider_b" type="HSlider" parent="."] +unique_name_in_owner = true margin_left = 18.0 margin_top = 51.0 margin_right = 58.0 diff --git a/widgets/PartyMenu.gd b/widgets/PartyMenu.gd index 08b558b..9e8ea11 100644 --- a/widgets/PartyMenu.gd +++ b/widgets/PartyMenu.gd @@ -8,8 +8,8 @@ func update_labels(data: Dictionary): p.visible = not characters[i].is_absent p.update_labels(data, i) - $rightside/panel_time/VBoxContainer/lbl_time.text = Common.game_time_frames_to_hhmm(data.game_time_frames) - $rightside/panel_gil/VBoxContainer/lbl_gilcount.text = '%d' % data.current_gil + $'%lbl_time'.text = Common.game_time_frames_to_hhmm(data.game_time_frames) + $'%lbl_gilcount'.text = '%d' % data.current_gil # Called when the node enters the scene tree for the first time. func _ready() -> void: diff --git a/widgets/PartyMenu.tscn b/widgets/PartyMenu.tscn index 66391ce..e71bf0b 100644 --- a/widgets/PartyMenu.tscn +++ b/widgets/PartyMenu.tscn @@ -144,6 +144,7 @@ margin_bottom = 14.0 text = "Time" [node name="lbl_time" type="Label" parent="rightside/panel_time/VBoxContainer"] +unique_name_in_owner = true margin_top = 14.0 margin_right = 56.0 margin_bottom = 28.0 @@ -164,6 +165,7 @@ margin_bottom = 32.0 custom_constants/separation = 0 [node name="lbl_gilcount" type="Label" parent="rightside/panel_gil/VBoxContainer"] +unique_name_in_owner = true margin_right = 64.0 margin_bottom = 14.0 text = "0" diff --git a/widgets/PartyMenuCharacter.gd b/widgets/PartyMenuCharacter.gd index 1a44eba..4715b5c 100644 --- a/widgets/PartyMenuCharacter.gd +++ b/widgets/PartyMenuCharacter.gd @@ -1,7 +1,7 @@ extends ReferenceRect -onready var rect_frontrow := Rect2($ref0/ref_frontrow.rect_position, $ref0/ref_frontrow.rect_size) -onready var rect_backrow := Rect2($ref0/ref_backrow.rect_position, $ref0/ref_backrow.rect_size) +onready var rect_frontrow := Rect2($'%ref_frontrow'.rect_position, $'%ref_frontrow'.rect_size) +onready var rect_backrow := Rect2($'%ref_backrow'.rect_position, $'%ref_backrow'.rect_size) onready var row_rects := [rect_frontrow, rect_backrow] onready var ls = [$ref_commands/l1, $ref_commands/l2, $ref_commands/l3, $ref_commands/l4] onready var ts = [$ref_commands/t1, $ref_commands/t2, $ref_commands/t3, $ref_commands/t4] @@ -12,24 +12,24 @@ func update_labels(data: Dictionary, i: int): var character = c.character_id var job = c.current_job_id var cj_idx = character*22 + job - $ref0/lbl_name.text = data.character_names_decoded[character] - $ref0/lbl_lv_cur.text = '%d' % c.level - $ref1/lbl_job.text = StringLoader.tables.job_names[job] - $ref1/lbl_abp_lv_cur.text = '%d-' % c.current_job_level - $ref1/lbl_abp_progress.text = '' if job == 21 else ('%d/' % c.current_job_abp) - $ref1/lbl_abp_next.text = '' if job == 21 else ('%d' % RomLoader.snes_data.job_levels[job][c.current_job_level].ABP) - $ref1/lbl_hp_cur.text = '%d/' % c.hp_current - $ref1/lbl_hp_max.text = '%d' % c.hp_max - $ref1/lbl_mp_cur.text = '%d/' % c.mp_current - $ref1/lbl_mp_max.text = '%d' % c.mp_max + $'%lbl_name'.text = data.character_names_decoded[character] + $'%lbl_lv_cur'.text = '%d' % c.level + $'%lbl_job'.text = StringLoader.tables.job_names[job] + $'%lbl_abp_lv_cur'.text = '%d-' % c.current_job_level + $'%lbl_abp_progress'.text = '' if job == 21 else ('%d/' % c.current_job_abp) + $'%lbl_abp_next'.text = '' if job == 21 else ('%d' % RomLoader.snes_data.job_levels[job][c.current_job_level].ABP) + $'%lbl_hp_cur'.text = '%d/' % c.hp_current + $'%lbl_hp_max'.text = '%d' % c.hp_max + $'%lbl_mp_cur'.text = '%d/' % c.mp_current + $'%lbl_mp_max'.text = '%d' % c.mp_max for i in 4: ls[i].text = StringLoader.get_ability_name(c.equipped_abilities[i]) ts[i].texture = ThemeManager.get_ability_icon(c.equipped_abilities[i]) t1s[i].texture = ts[i].texture # Draw character battle sprite in either ref_frontrow or ref_backrow - $ref0/PC.position = row_rects[c.is_back_row].position - $ref0/PC.material.set_shader_param('palette', SpriteLoader.character_battle_sprite_palette_textures[cj_idx]) - $ref0/PC.texture = SpriteLoader.strip_textures[cj_idx] + $'%PC'.position = row_rects[c.is_back_row].position + $'%PC'.material.set_shader_param('palette', SpriteLoader.character_battle_sprite_palette_textures[cj_idx]) + $'%PC'.texture = SpriteLoader.strip_textures[cj_idx] # Think about status icons # Called when the node enters the scene tree for the first time. diff --git a/widgets/PartyMenuCharacter.tscn b/widgets/PartyMenuCharacter.tscn index 73c9f0c..9574710 100644 --- a/widgets/PartyMenuCharacter.tscn +++ b/widgets/PartyMenuCharacter.tscn @@ -18,6 +18,7 @@ margin_bottom = 50.0 border_color = Color( 0, 0, 1, 1 ) [node name="lbl_job" type="Label" parent="ref1"] +unique_name_in_owner = true margin_right = 72.0 margin_bottom = 14.0 text = "Freelancer" @@ -30,6 +31,7 @@ margin_bottom = 26.0 text = "LV" [node name="lbl_abp_lv_cur" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 24.0 margin_top = 12.0 margin_right = 48.0 @@ -38,6 +40,7 @@ text = "2-" align = 2 [node name="lbl_abp_progress" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 36.0 margin_top = 12.0 margin_right = 80.0 @@ -46,6 +49,7 @@ text = "76/" align = 2 [node name="lbl_abp_next" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 60.0 margin_top = 12.0 margin_right = 104.0 @@ -62,6 +66,7 @@ rect_min_size = Vector2( 24, 0 ) text = "HP" [node name="lbl_hp_cur" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 32.0 margin_top = 25.0 margin_right = 72.0 @@ -71,6 +76,7 @@ text = "9999/" align = 2 [node name="lbl_hp_max" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 72.0 margin_top = 25.0 margin_right = 104.0 @@ -87,6 +93,7 @@ margin_bottom = 50.0 text = "MP" [node name="lbl_mp_cur" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 32.0 margin_top = 36.0 margin_right = 72.0 @@ -95,6 +102,7 @@ text = "999/" align = 2 [node name="lbl_mp_max" type="Label" parent="ref1"] +unique_name_in_owner = true margin_left = 72.0 margin_top = 36.0 margin_right = 104.0 @@ -107,6 +115,7 @@ margin_right = 56.0 margin_bottom = 50.0 [node name="lbl_name" type="Label" parent="ref0"] +unique_name_in_owner = true margin_right = 40.0 margin_bottom = 14.0 text = "Butz" @@ -119,6 +128,7 @@ margin_bottom = 26.0 text = "LV" [node name="lbl_lv_cur" type="Label" parent="ref0"] +unique_name_in_owner = true margin_left = 32.0 margin_top = 12.0 margin_right = 56.0 @@ -127,6 +137,7 @@ text = "26" align = 2 [node name="ref_frontrow" type="ReferenceRect" parent="ref0"] +unique_name_in_owner = true anchor_top = 1.0 anchor_bottom = 1.0 margin_left = 8.0 @@ -135,6 +146,7 @@ margin_right = 24.0 border_color = Color( 1, 0.501961, 0, 1 ) [node name="ref_backrow" type="ReferenceRect" parent="ref0"] +unique_name_in_owner = true anchor_top = 1.0 anchor_bottom = 1.0 margin_left = 40.0 @@ -143,6 +155,7 @@ margin_right = 56.0 border_color = Color( 0, 1, 0, 1 ) [node name="PC" parent="ref0" instance=ExtResource( 2 )] +unique_name_in_owner = true [node name="ref_commands" type="ReferenceRect" parent="."] margin_left = 168.0 diff --git a/widgets/RomSelect.gd b/widgets/RomSelect.gd index d52b5fb..fd68766 100644 --- a/widgets/RomSelect.gd +++ b/widgets/RomSelect.gd @@ -26,14 +26,14 @@ onready var vscroller: VScrollBar = itemlist.get_child(0) onready var folder_buttons_scroller: ScrollContainer = $VBoxContainer/ScrollContainer onready var folder_buttons: HBoxContainer = $VBoxContainer/ScrollContainer/folder_buttons onready var btn_ok: Button = $VBoxContainer/HBoxContainer/VBoxContainer/btn_ok -onready var lbl_filename_header: Label = $VBoxContainer/HBoxContainer/VBoxContainer/lbl_filename -onready var lbl_filename_content: Label = $VBoxContainer/HBoxContainer/VBoxContainer/mc/filename -onready var lbl_filetype_header: Label = $VBoxContainer/HBoxContainer/VBoxContainer/lbl_type -onready var lbl_filetype_content: Label = $VBoxContainer/HBoxContainer/VBoxContainer/mc2/filetype -onready var lbl_filesize_header: Label = $VBoxContainer/HBoxContainer/VBoxContainer/lbl_size -onready var lbl_filesize_content: Label = $VBoxContainer/HBoxContainer/VBoxContainer/mc3/filesize -onready var lbl_fileinfo_header: Label = $VBoxContainer/HBoxContainer/VBoxContainer/lbl_info -onready var lbl_fileinfo_content: Label = $VBoxContainer/HBoxContainer/VBoxContainer/mc4/fileinfo +onready var lbl_filename_header: Label = $'%lbl_filename_header' +onready var lbl_filename_content: Label = $'%lbl_filename_content' +onready var lbl_filetype_header: Label = $'%lbl_filetype_header' +onready var lbl_filetype_content: Label = $'%lbl_filetype_content' +onready var lbl_filesize_header: Label = $'%lbl_filesize_header' +onready var lbl_filesize_content: Label = $'%lbl_filesize_content' +onready var lbl_fileinfo_header: Label = $'%lbl_fileinfo_header' +onready var lbl_fileinfo_content: Label = $'%lbl_fileinfo_content' const inactive_modulate_color := Color(0.5, 0.5, 0.5) const active_modulate_color := Color.white var last_dir := '' diff --git a/widgets/RomSelect.tscn b/widgets/RomSelect.tscn index 138cd6e..3c50c73 100644 --- a/widgets/RomSelect.tscn +++ b/widgets/RomSelect.tscn @@ -59,7 +59,8 @@ margin_bottom = 185.0 size_flags_horizontal = 3 custom_constants/separation = 1 -[node name="lbl_filename" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +[node name="lbl_filename_header" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true margin_right = 148.0 margin_bottom = 14.0 size_flags_vertical = 1 @@ -73,7 +74,8 @@ custom_constants/margin_top = 0 custom_constants/margin_left = 12 custom_constants/margin_bottom = 0 -[node name="filename" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc"] +[node name="lbl_filename_content" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc"] +unique_name_in_owner = true margin_left = 12.0 margin_right = 148.0 margin_bottom = 14.0 @@ -81,7 +83,8 @@ size_flags_vertical = 3 text = "Test" autowrap = true -[node name="lbl_type" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +[node name="lbl_filetype_header" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true margin_top = 30.0 margin_right = 148.0 margin_bottom = 44.0 @@ -96,7 +99,8 @@ custom_constants/margin_top = 0 custom_constants/margin_left = 12 custom_constants/margin_bottom = 0 -[node name="filetype" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc2"] +[node name="lbl_filetype_content" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc2"] +unique_name_in_owner = true margin_left = 12.0 margin_right = 148.0 margin_bottom = 14.0 @@ -104,7 +108,8 @@ size_flags_vertical = 1 text = "Test" autowrap = true -[node name="lbl_size" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +[node name="lbl_filesize_header" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true margin_top = 60.0 margin_right = 148.0 margin_bottom = 74.0 @@ -119,7 +124,8 @@ custom_constants/margin_top = 0 custom_constants/margin_left = 12 custom_constants/margin_bottom = 0 -[node name="filesize" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc3"] +[node name="lbl_filesize_content" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc3"] +unique_name_in_owner = true margin_left = 12.0 margin_right = 148.0 margin_bottom = 14.0 @@ -127,7 +133,8 @@ size_flags_vertical = 1 text = "Test" autowrap = true -[node name="lbl_info" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +[node name="lbl_fileinfo_header" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true margin_top = 90.0 margin_right = 148.0 margin_bottom = 104.0 @@ -143,7 +150,8 @@ custom_constants/margin_top = 0 custom_constants/margin_left = 12 custom_constants/margin_bottom = 0 -[node name="fileinfo" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc4"] +[node name="lbl_fileinfo_content" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer/mc4"] +unique_name_in_owner = true margin_left = 12.0 margin_right = 148.0 margin_bottom = 57.0 @@ -152,7 +160,7 @@ text = "Test" autowrap = true [node name="btn_ok" type="Button" parent="VBoxContainer/HBoxContainer/VBoxContainer"] -margin_left = 61.0 +margin_left = 62.0 margin_top = 163.0 margin_right = 86.0 margin_bottom = 185.0 diff --git a/widgets/SaveSlot.gd b/widgets/SaveSlot.gd index 7b8e3b6..4087483 100644 --- a/widgets/SaveSlot.gd +++ b/widgets/SaveSlot.gd @@ -31,10 +31,10 @@ func set_data(data: Dictionary): var sprite_id := (char_id * 22) + job_id PCs[i].material.set_shader_param('palette', SpriteLoader.character_battle_sprite_palette_textures[sprite_id]) PCs[i].texture = SpriteLoader.strip_textures[sprite_id] - $HBoxContainer/right_labels/HBoxContainer/lbl_level_num.text = '%d' % data.characters[0].level - $HBoxContainer/left_labels/lbl_gametime.text = Common.game_time_frames_to_hhmm(data.game_time_frames) - $HBoxContainer/left_labels/lbl_name.text = data.character_names[data.characters[0].character_id] - $HBoxContainer/right_labels/lbl_hp.text = '%d/%4d' % [data.characters[0].hp_current, data.characters[0].hp_max] + $'%lbl_level_num'.text = '%d' % data.characters[0].level + $'%lbl_gametime'.text = Common.game_time_frames_to_hhmm(data.game_time_frames) + $'%lbl_name'.text = data.character_names[data.characters[0].character_id] + $'%lbl_hp'.text = '%d/%4d' % [data.characters[0].hp_current, data.characters[0].hp_max] # Called when the node enters the scene tree for the first time. func _ready() -> void: @@ -43,7 +43,7 @@ func _ready() -> void: for i in 4: var pc = PC.instance() pc.set_position(Vector2(i*24, 8)) - $HBoxContainer/PCs.add_child(pc) + $'%PCs'.add_child(pc) PCs.append(pc) set_data(dummy_data) diff --git a/widgets/SaveSlot.tscn b/widgets/SaveSlot.tscn index 2ec0306..1c21a4e 100644 --- a/widgets/SaveSlot.tscn +++ b/widgets/SaveSlot.tscn @@ -24,12 +24,14 @@ margin_bottom = 36.0 rect_min_size = Vector2( 40, 0 ) [node name="lbl_name" type="Label" parent="HBoxContainer/left_labels"] +unique_name_in_owner = true margin_right = 40.0 margin_bottom = 14.0 size_flags_vertical = 1 text = "Butz" [node name="lbl_gametime" type="Label" parent="HBoxContainer/left_labels"] +unique_name_in_owner = true margin_top = 22.0 margin_right = 40.0 margin_bottom = 36.0 @@ -38,6 +40,7 @@ text = "13:42" align = 2 [node name="PCs" type="Control" parent="HBoxContainer"] +unique_name_in_owner = true margin_left = 48.0 margin_right = 136.0 margin_bottom = 36.0 @@ -65,13 +68,15 @@ margin_right = 72.0 margin_bottom = 14.0 [node name="lbl_level" type="Label" parent="HBoxContainer/right_labels/HBoxContainer"] -margin_right = 15.0 +unique_name_in_owner = true +margin_right = 14.0 margin_bottom = 14.0 size_flags_vertical = 1 text = "LV" [node name="lbl_level_num" type="Label" parent="HBoxContainer/right_labels/HBoxContainer"] -margin_left = 23.0 +unique_name_in_owner = true +margin_left = 22.0 margin_right = 72.0 margin_bottom = 14.0 size_flags_horizontal = 3 @@ -80,6 +85,7 @@ text = "33" align = 2 [node name="lbl_hp" type="Label" parent="HBoxContainer/right_labels"] +unique_name_in_owner = true margin_top = 22.0 margin_right = 72.0 margin_bottom = 36.0