59 lines
2.3 KiB
GDScript
59 lines
2.3 KiB
GDScript
extends Control
|
|
const palette_mat := preload('res://palette_mat.tres')
|
|
const battle_bg_shader = preload('res://shaders/tilemap_shader.gdshader')
|
|
var save_slots = []
|
|
var save_slot_dicts = []
|
|
|
|
func _ready():
|
|
Engine.set_target_fps(60)
|
|
var save_file := File.new()
|
|
#var error := save_file.open('test.srm', File.READ)
|
|
var error := save_file.open('/home/luke/.config/Mesen2/Saves/FF5_SCC_WepTweaks_Inus_Dash.srm', File.READ)
|
|
if error == OK:
|
|
for i in 4:
|
|
save_slots.append(SaveLoader.get_save_slot(save_file, i))
|
|
save_slot_dicts.append(SaveLoader.load_save_slot(save_slots[i]))
|
|
print('Loaded test save file')
|
|
save_file.close()
|
|
# error = save_file.open('downloaded_saves/psx_world1.gme', File.READ)
|
|
# if error == OK:
|
|
# var buffer := StreamPeerBuffer.new()
|
|
# save_file.seek(0x2FA0)
|
|
# 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].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 monster_box := GridContainer.new()
|
|
monster_box.columns = 8
|
|
add_child(monster_box)
|
|
for mon in RomLoader.snes_data.monster_battle_sprites:
|
|
var t := TextureRect.new()
|
|
t.material = palette_mat.duplicate()
|
|
t.texture = mon.sprite
|
|
t.material.set_shader_param('palette', mon.palette)
|
|
monster_box.add_child(t)
|
|
|
|
var battle_bg_mat := ShaderMaterial.new()
|
|
battle_bg_mat.shader = battle_bg_shader
|
|
# var bg = SpriteLoader.battle_backgrounds[1]
|
|
for bg in SpriteLoader.battle_backgrounds.slice(0, 2):
|
|
var t := TextureRect.new()
|
|
t.material = battle_bg_mat.duplicate()
|
|
t.texture = bg.tilemap_tex
|
|
t.material.set_shader_param('palette', bg.palette_texs[0])
|
|
t.material.set_shader_param('tile_atlas', bg.tile_atlas_texs[0])
|
|
t.rect_scale = Vector2(8, 8)
|
|
t.name = 'BattleBG'
|
|
add_child(t)
|
|
# 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)
|