mirror of
https://github.com/notwa/mm
synced 2024-11-04 20:09:03 -08:00
Play As submenu
This commit is contained in:
parent
86173f3014
commit
b05b3621fb
3 changed files with 69 additions and 1 deletions
|
@ -55,6 +55,7 @@ return {
|
|||
navi_timer = AL(0x38, 2),
|
||||
has_normal_magic = AL(0x3A, 1),
|
||||
has_double_magic = AL(0x3C, 1),
|
||||
--AL(0x67, 1), something to do with saving?
|
||||
equip_tunic_boots = AL(0x70, 1),
|
||||
equip_sword_shield = AL(0x71, 1),
|
||||
inventory_items = AL(0x74, 24),
|
||||
|
@ -168,6 +169,7 @@ return {
|
|||
|
||||
room_number = AG(0x11CBC, 1),
|
||||
room_pointer = AG(0x11CC8, 4),
|
||||
age_modifier_global = AG(0x11DE8, 1),
|
||||
|
||||
link_actor = setmetatable({
|
||||
item_in_hand = AA(0x142, 1),
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require = require "depend"
|
||||
require "boilerplate"
|
||||
require "addrs.init"
|
||||
require "classes"
|
||||
|
@ -48,13 +49,69 @@ function self_destruct:on()
|
|||
addrs.hearts(0)
|
||||
end
|
||||
|
||||
local playas_child = Callbacks()
|
||||
function playas_child:run()
|
||||
addrs.age_modifier_global(1)
|
||||
end
|
||||
local playas_adult = Callbacks()
|
||||
function playas_adult:run()
|
||||
addrs.age_modifier_global(0)
|
||||
end
|
||||
|
||||
local playas_human = Callbacks()
|
||||
function playas_human:on()
|
||||
addrs.mask_worn(0)
|
||||
addrs.transformation(4)
|
||||
end
|
||||
local playas_deku = Callbacks()
|
||||
function playas_deku:on()
|
||||
addrs.mask_worn(0)
|
||||
addrs.transformation(3)
|
||||
end
|
||||
local playas_goron = Callbacks()
|
||||
function playas_goron:on()
|
||||
addrs.mask_worn(0)
|
||||
addrs.transformation(1)
|
||||
end
|
||||
local playas_zora = Callbacks()
|
||||
function playas_zora:on()
|
||||
addrs.mask_worn(0)
|
||||
addrs.transformation(2)
|
||||
end
|
||||
local playas_fd = Callbacks()
|
||||
function playas_fd:on()
|
||||
addrs.mask_worn(0)
|
||||
addrs.transformation(0)
|
||||
end
|
||||
|
||||
local playas_menu = oot and Menu{
|
||||
Screen{
|
||||
Text("Play as..."),
|
||||
--Radial("Default", playas_group),
|
||||
Oneshot("Child Link", playas_child),
|
||||
Oneshot("Adult Link", playas_adult),
|
||||
Back(),
|
||||
},
|
||||
} or Menu{
|
||||
Screen{
|
||||
Text("Play as..."),
|
||||
Oneshot("Human Link", playas_human),
|
||||
Oneshot("Deku Link", playas_deku),
|
||||
Oneshot("Goron Link", playas_goron),
|
||||
Oneshot("Zora Link", playas_zora),
|
||||
Oneshot("Fierce Deity", playas_fd),
|
||||
Back(),
|
||||
},
|
||||
}
|
||||
|
||||
local main_menu = Menu{
|
||||
Screen{
|
||||
Text("hey"),
|
||||
Text("Main Menu"),
|
||||
Toggle("L to Levitate", levitate),
|
||||
Toggle("A to Run Fast", supersonic),
|
||||
Hold("Levitate", levitate),
|
||||
Oneshot("100%", everything),
|
||||
LinkTo("Play as", playas_menu),
|
||||
Back(),
|
||||
},
|
||||
Screen{
|
||||
|
|
|
@ -6,6 +6,7 @@ MenuItem = Class()
|
|||
Text = Class(MenuItem)
|
||||
Back = Class(Text)
|
||||
Close = Back -- FIXME
|
||||
LinkTo = Class(Text)
|
||||
|
||||
Active = Class(Text)
|
||||
Toggle = Class(Active)
|
||||
|
@ -68,6 +69,14 @@ function Back:run()
|
|||
return nil -- FIXME
|
||||
end
|
||||
|
||||
function LinkTo:init(text, submenu)
|
||||
Text.init(self, text)
|
||||
self.submenu = submenu
|
||||
end
|
||||
function LinkTo:run()
|
||||
return self.submenu
|
||||
end
|
||||
|
||||
function Active:init(text, callbacks)
|
||||
self.text = text
|
||||
self.callbacks = callbacks or {}
|
||||
|
|
Loading…
Reference in a new issue