Basic items menu layout

Realign ability icons on atlas
Fix testing override for ability icons
This commit is contained in:
Luke Hubmayer-Werner 2023-08-05 22:11:02 +09:30
parent a1b9d7ae27
commit df8c1b0493
8 changed files with 88 additions and 8 deletions

View File

@ -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

View File

@ -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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

74
widgets/ItemsMenu.tscn Normal file
View File

@ -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