Made dialog boxes
This commit is contained in:
@@ -27,9 +27,12 @@ function MenuStep(menu)
|
||||
for _, element in pairs(UIElement) do
|
||||
if element.type == "Button" then
|
||||
element:checkMouse(mouse_x, mouse_y)
|
||||
elseif element.type == "Dialog" then
|
||||
element:checkConfirm()
|
||||
end
|
||||
end
|
||||
if menu == "pauseMenu" then
|
||||
if menu == 0 then
|
||||
elseif menu == "pauseMenu" then
|
||||
if PauseResume:getVariable() == true then
|
||||
MenuExit(menu,0)
|
||||
do_pause = false
|
||||
@@ -37,7 +40,13 @@ function MenuStep(menu)
|
||||
love.event.quit()
|
||||
end
|
||||
else
|
||||
|
||||
for name, dialogbox in pairs(dialogboxes) do
|
||||
if name == menu then
|
||||
if dialogbox.object:getVariable() then
|
||||
MenuExit(dialogbox.exit[1],dialogbox.exit[2])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,6 +59,10 @@ function MenuExit(from,to)
|
||||
PauseResume = nil
|
||||
PauseOptions = nil
|
||||
PauseExit = nil
|
||||
else
|
||||
for name, dialogbox in pairs(dialogboxes) do
|
||||
if name == menu then dialogbox.object = nil end
|
||||
end
|
||||
end
|
||||
menuPage = to or nil
|
||||
end
|
||||
@@ -98,8 +111,14 @@ function MenuInit(menu)
|
||||
color2 = {1,1,1}
|
||||
}
|
||||
)
|
||||
else
|
||||
for name, dialogbox in pairs(dialogboxes) do
|
||||
if name == menu then dialogbox.object = interfaceDialog:New(dialogbox.style) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
UIElement = {}
|
||||
require "data/scripts/ui/button"
|
||||
require "data/scripts/ui/dialog"
|
||||
require "data/scripts/ui/dialogboxes"
|
||||
|
||||
Reference in New Issue
Block a user