more strings

This commit is contained in:
Luke Hubmayer-Werner 2023-08-07 01:18:07 +09:30
parent 877c5d90e4
commit e9cf2c112e
3 changed files with 30 additions and 5 deletions

View File

@ -6,7 +6,7 @@ dialogue 0x900 0x2013F0 0x082220 3 2 0x000000 0x0A0000 True
enemy_names 384 0x200050 0x105C00 10 8
items 0x100 0x111380 9
job_names 22 0x115600 8
job_and_ability_descs 133 0x117140 2 0x110000 0x110000
job_and_ability_descs 133 0x117140 2 0x110000 0x110000 True
magics 87 0x111C80 6
magics2 73 0x111E8A 9
menu_strings 139 0x00F987 2 0x270000 0x000000 True

1 name num_entries address snes_address bytes snes_bytes rpge_ptr_offset snes_ptr_offset dialog null_terminated
6 enemy_names 384 0x200050 0x105C00 10 8
7 items 0x100 0x111380 9
8 job_names 22 0x115600 8
9 job_and_ability_descs 133 0x117140 2 0x110000 0x110000 True
10 magics 87 0x111C80 6
11 magics2 73 0x111E8A 9
12 menu_strings 139 0x00F987 2 0x270000 0x000000 True

View File

@ -83,14 +83,30 @@ func load_snes_rom(rom: File, is_RPGe: bool = false) -> void:
else:
for raw in raw_strings:
strings.append(decode_string(raw, glyph_table_small))
tables_raw[block_name] = raw_strings
tables[block_name] = strings
self.tables_raw[block_name] = raw_strings
self.tables[block_name] = strings
func get_ability_name(id: int) -> String:
if id < 128:
return tables.battle_commands[id]
return self.tables.battle_commands[id]
else:
return tables.ability_names[id-128]
return self.tables.ability_names[id-128]
func get_ability_desc(id: int) -> String:
# TODO: revisit for GBA
if id < 78:
return self.tables.job_and_ability_descs[id+22]
elif (id >= 128) and (id <= 161):
return self.tables.job_and_ability_descs[(id-128)+100]
else:
assert(false, 'ability id %d out of description ranges' % id)
return 'ability id %d out of description ranges' % id
func get_job_name(id: int) -> String:
return self.tables.job_names[id]
func get_job_desc(id: int) -> String:
return self.tables.job_and_ability_descs[id]
func _ready() -> void:
pass

View File

@ -24,3 +24,12 @@ func _ready():
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)
var lbl = Label.new()
for i in 22:
lbl.text = lbl.text + '%s - %s\n' % [StringLoader.get_job_name(i), StringLoader.get_job_desc(i)]
for i in 78:
lbl.text = lbl.text + '\n%s - %s' % [StringLoader.get_ability_name(i), StringLoader.get_ability_desc(i)]
for i in range(128, 161):
lbl.text = lbl.text + '\n%s - %s' % [StringLoader.get_ability_name(i), StringLoader.get_ability_desc(i)]
add_child(lbl)