remove npc and item handling

This commit is contained in:
2026-02-17 20:23:11 +01:00
parent 9a65891afa
commit ef4876b083
7 changed files with 52 additions and 170 deletions

View File

@@ -28,19 +28,26 @@ local Config = {
local CONFIG_SAVE_BANK = 7
local CONFIG_MAGIC_VALUE_ADDRESS = 2
local CONFIG_SPLASH_DURATION_ADDRESS = 3 -- New address for splash duration
local CONFIG_MAGIC_VALUE = 0xDE -- A magic number to check if config is saved
function Config.save()
-- Save physics settings
mset(CONFIG_MAGIC_VALUE, CONFIG_MAGIC_VALUE_ADDRESS, CONFIG_SAVE_BANK) -- Mark as saved
--mset(Config.timing.splash_duration, CONFIG_SPLASH_DURATION_ADDRESS, CONFIG_SAVE_BANK)
end
function Config.load()
Config.restore_defaults()
-- Check if config has been saved before using a magic value
if mget(CONFIG_MAGIC_VALUE_ADDRESS, CONFIG_SAVE_BANK) == CONFIG_MAGIC_VALUE then
-- Config has been saved, load values
Config.timing.splash_duration = mget(CONFIG_SPLASH_DURATION_ADDRESS, CONFIG_SAVE_BANK)
else
-- No saved config, restore defaults
Config.restore_defaults()
end
end
function Config.restore_defaults()
Config.timing.splash_duration = DEFAULT_CONFIG.timing.splash_duration
-- Any other configurable items should be reset here
end

View File

@@ -28,13 +28,9 @@ local function get_initial_data()
},
current_screen = 1,
splash_timer = Config.timing.splash_duration,
dialog = {
text = "",
menu_items = {},
selected_menu_item = 1,
active_entity = nil,
showing_description = false,
current_node_key = nil
popup = { -- New popup table
show = false,
content = {} -- Array of strings
},
player = {
sprite_id = Config.player.sprite_id
@@ -51,36 +47,17 @@ local function get_initial_data()
screens = clone_table({
{
name = "Screen 1",
items = {
{
name = "Key",
sprite_id = 4,
desc = "A rusty old key. It might open something."
}
}
},
{
-- Screen 2
name = "Screen 2",
items = {
{
name = "Potion",
sprite_id = 7,
desc = "A glowing red potion. It looks potent."
}
}
},
{
-- Screen 3
name = "Screen 3",
items = {}
}
})
}
end
Context = {}
local function reset_context_to_initial_state()
local initial_data = get_initial_data()
@@ -127,4 +104,4 @@ function Context.load_game()
Context.game_in_progress = true
MenuWindow.refresh_menu_items()
end
end

View File

@@ -10,9 +10,10 @@ local MinigameRhythmWindow = {}
local MinigameDDRWindow = {}
local Util = {}
local Actions = {}
local Context = {}
local UI = {}
local Print = {}
local Input = {}
local Player = {}
local Audio = {}local Audio = {}
local Audio = {}
local Actions = {}