diff --git a/scripts/managers/Common.gd b/scripts/managers/Common.gd index 7c44b69..020ad1d 100644 --- a/scripts/managers/Common.gd +++ b/scripts/managers/Common.gd @@ -174,6 +174,7 @@ func shrink_to_integer(): if OS.get_window_size() != new_window_size: # avoid retriggering this event forever OS.set_window_size(new_window_size) print('resized to scale %d %s' % [scale, new_window_size]) + get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP, base_resolution*scale, scale) func update_window_scale(): if OS.window_size < base_resolution*2: @@ -191,11 +192,12 @@ func update_window_scale(): # Don't fight the WM if it sets the window size back again print_debug("Config is to shrink down to integer scale, but %s was the last external resize event, so we won't fight the window manager" % size) else: - print_debug('Setting lastres to %s, will resize to %dx == %s in 1 second' % [self.last_resolution_pre_shrink, scale, target_size]) + var delay = 1.0 - min((size - self.last_resolution_pre_shrink).length_squared()/1000, 0.95) + print_debug('Setting lastres to %s, will resize to %dx == %s in %f seconds' % [self.last_resolution_pre_shrink, scale, target_size, delay]) self.last_resolution_pre_shrink = size shrink_timer.paused = false - shrink_timer.start(1) - get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP, base_resolution*scale, scale) + shrink_timer.start(delay) + get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP, base_resolution*scale, scale) static func game_time_frames_to_hhmm(game_time_frames: int) -> String: var game_seconds = game_time_frames / 60 diff --git a/test_scene.gd b/test_scene.gd index 5502de6..0345a2d 100644 --- a/test_scene.gd +++ b/test_scene.gd @@ -21,6 +21,6 @@ func _ready(): # buffer.data_array = save_file.get_buffer(0x600) # save_slot_dicts.append(SaveLoader.get_struct(buffer, 'Save_slot')) var data = save_slot_dicts[0] - data.characters[2].ability_4 = 0x9B + data.characters[2].equipped_abilities[3] = 0x9B $PartyMenu.update_labels(data) ThemeManager.set_menu_color_555(data.config.menu_color_r, data.config.menu_color_g, data.config.menu_color_b) diff --git a/theme/ThemeElements.png b/theme/ThemeElements.png index 9dcd87b..ae44b14 100644 Binary files a/theme/ThemeElements.png and b/theme/ThemeElements.png differ diff --git a/theme/icons/ability_character.tres b/theme/icons/ability_character.tres index d62eaf4..1044171 100644 --- a/theme/icons/ability_character.tres +++ b/theme/icons/ability_character.tres @@ -4,4 +4,5 @@ [resource] atlas = ExtResource( 1 ) -region = Rect2( 64, 14, 12, 12 ) +region = Rect2( 64, 11, 12, 9 ) +margin = Rect2( 0, 2, 0, 3 ) diff --git a/theme/icons/ability_command.tres b/theme/icons/ability_command.tres index 3d0653e..246465a 100644 --- a/theme/icons/ability_command.tres +++ b/theme/icons/ability_command.tres @@ -4,4 +4,5 @@ [resource] atlas = ExtResource( 1 ) -region = Rect2( 64, 1, 12, 12 ) +region = Rect2( 64, 1, 12, 9 ) +margin = Rect2( 0, 2, 0, 3 ) diff --git a/theme/icons/ability_menu.tres b/theme/icons/ability_menu.tres index d003280..ab8d677 100644 --- a/theme/icons/ability_menu.tres +++ b/theme/icons/ability_menu.tres @@ -4,4 +4,5 @@ [resource] atlas = ExtResource( 1 ) -region = Rect2( 64, 40, 12, 12 ) +region = Rect2( 64, 31, 12, 9 ) +margin = Rect2( 0, 2, 0, 3 ) diff --git a/theme/icons/ability_party.tres b/theme/icons/ability_party.tres index d83697b..4e480d6 100644 --- a/theme/icons/ability_party.tres +++ b/theme/icons/ability_party.tres @@ -4,4 +4,5 @@ [resource] atlas = ExtResource( 1 ) -region = Rect2( 64, 27, 12, 12 ) +region = Rect2( 64, 21, 12, 9 ) +margin = Rect2( 0, 2, 0, 3 ) diff --git a/widgets/ItemsMenu.tscn b/widgets/ItemsMenu.tscn new file mode 100644 index 0000000..2fad0b6 --- /dev/null +++ b/widgets/ItemsMenu.tscn @@ -0,0 +1,74 @@ +[gd_scene format=2] + +[node name="ItemsMenu" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_right = 1.0 +margin_bottom = 22.0 +custom_constants/separation = 0 + +[node name="title" type="PanelContainer" parent="HBoxContainer"] +margin_right = 45.0 +margin_bottom = 22.0 + +[node name="ITEMS" type="Label" parent="HBoxContainer/title"] +margin_left = 4.0 +margin_top = 4.0 +margin_right = 41.0 +margin_bottom = 18.0 +text = "Items" + +[node name="actions" type="PanelContainer" parent="HBoxContainer"] +margin_left = 45.0 +margin_right = 384.0 +margin_bottom = 22.0 +size_flags_horizontal = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/actions"] +margin_left = 4.0 +margin_top = 4.0 +margin_right = 335.0 +margin_bottom = 18.0 + +[node name="Label" type="Label" parent="HBoxContainer/actions/HBoxContainer"] +margin_right = 105.0 +margin_bottom = 14.0 +size_flags_horizontal = 3 +text = "Use" +align = 1 + +[node name="Label2" type="Label" parent="HBoxContainer/actions/HBoxContainer"] +margin_left = 113.0 +margin_right = 218.0 +margin_bottom = 14.0 +size_flags_horizontal = 3 +text = "Sort" +align = 1 + +[node name="Label3" type="Label" parent="HBoxContainer/actions/HBoxContainer"] +margin_left = 226.0 +margin_right = 331.0 +margin_bottom = 14.0 +size_flags_horizontal = 3 +text = "Rare" +align = 1 + +[node name="itemdesc" type="PanelContainer" parent="."] +anchor_right = 1.0 +margin_top = 22.0 +margin_bottom = 66.0 + +[node name="Label" type="Label" parent="itemdesc"] +margin_left = 4.0 +margin_top = 4.0 +margin_right = 380.0 +margin_bottom = 40.0 +size_flags_vertical = 1 +text = "Item description" + +[node name="items" type="PanelContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_top = 66.0