This commit is contained in:
8
inc/decision/decision.go_to_home.lua
Normal file
8
inc/decision/decision.go_to_home.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
DecisionManager.register({
|
||||
id = "go_to_home",
|
||||
label = "Go to Home",
|
||||
handle = function()
|
||||
Util.go_to_screen_by_id("home")
|
||||
end,
|
||||
condition = function() return true end
|
||||
})
|
||||
8
inc/decision/decision.go_to_office.lua
Normal file
8
inc/decision/decision.go_to_office.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
DecisionManager.register({
|
||||
id = "go_to_office",
|
||||
label = "Go to Office",
|
||||
handle = function()
|
||||
Util.go_to_screen_by_id("office")
|
||||
end,
|
||||
condition = function() return true end
|
||||
})
|
||||
8
inc/decision/decision.go_to_toilet.lua
Normal file
8
inc/decision/decision.go_to_toilet.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
DecisionManager.register({
|
||||
id = "go_to_toilet",
|
||||
label = "Go to Toilet",
|
||||
handle = function()
|
||||
Util.go_to_screen_by_id("toilet")
|
||||
end,
|
||||
condition = function() return true end
|
||||
})
|
||||
8
inc/decision/decision.go_to_walking_to_home.lua
Normal file
8
inc/decision/decision.go_to_walking_to_home.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
DecisionManager.register({
|
||||
id = "go_to_walking_to_home",
|
||||
label = "Walking to home",
|
||||
handle = function()
|
||||
Util.go_to_screen_by_id("walking_to_home")
|
||||
end,
|
||||
condition = function() return true end
|
||||
})
|
||||
8
inc/decision/decision.go_to_walking_to_office.lua
Normal file
8
inc/decision/decision.go_to_walking_to_office.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
DecisionManager.register({
|
||||
id = "go_to_walking_to_office",
|
||||
label = "Walking to office",
|
||||
handle = function()
|
||||
Util.go_to_screen_by_id("walking_to_office")
|
||||
end,
|
||||
condition = function() return true end
|
||||
})
|
||||
31
inc/decision/decision.manager.lua
Normal file
31
inc/decision/decision.manager.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
local _decisions = {}
|
||||
|
||||
function DecisionManager.register(decision)
|
||||
if not decision or not decision.id then
|
||||
PopupWindow.show({"Error: Invalid decision object registered (missing id)!"})
|
||||
return
|
||||
end
|
||||
if not decision.label then
|
||||
PopupWindow.show({"Error: Invalid decision object registered (missing label)!"})
|
||||
return
|
||||
end
|
||||
|
||||
if not decision.condition then
|
||||
decision.condition = function() return true end
|
||||
end
|
||||
if not decision.handle then
|
||||
decision.handle = function() end
|
||||
end
|
||||
if _decisions[decision.id] then
|
||||
trace("Warning: Overwriting decision with id: " .. decision.id)
|
||||
end
|
||||
_decisions[decision.id] = decision
|
||||
end
|
||||
|
||||
function DecisionManager.get(id)
|
||||
return _decisions[id]
|
||||
end
|
||||
|
||||
function DecisionManager.get_all()
|
||||
return _decisions
|
||||
end
|
||||
6
inc/decision/decision.play_button_mash.lua
Normal file
6
inc/decision/decision.play_button_mash.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
DecisionManager.register({
|
||||
id = "play_button_mash",
|
||||
label = "Play Button Mash",
|
||||
handle = function() MinigameButtonMashWindow.start(WINDOW_GAME) end,
|
||||
condition = function() return true end
|
||||
})
|
||||
6
inc/decision/decision.play_ddr.lua
Normal file
6
inc/decision/decision.play_ddr.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
DecisionManager.register({
|
||||
id = "play_ddr",
|
||||
label = "Play DDR (Random)",
|
||||
handle = function() MinigameDDRWindow.start(WINDOW_GAME, nil) end,
|
||||
condition = function() return true end
|
||||
})
|
||||
6
inc/decision/decision.play_rhythm.lua
Normal file
6
inc/decision/decision.play_rhythm.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
DecisionManager.register({
|
||||
id = "play_rhythm",
|
||||
label = "Play Rhythm Game",
|
||||
handle = function() MinigameRhythmWindow.start(WINDOW_GAME) end,
|
||||
condition = function() return true end
|
||||
})
|
||||
Reference in New Issue
Block a user