1function modalDungeon(player)
2
3 player:registerEvent("DungeonSystem_Modal")
4
5 local window = ModalWindow(DUNGEON_SYSTEM.Modal.ID, DUNGEON_SYSTEM.Modal.Title, DUNGEON_SYSTEM.Modal.Msg)
6
7 window:addButton(200, "Confirm")
8 window:addButton(201, "Details")
9 window:addButton(202, "Exit")
10
11 for k,v in pairs(DUNGEON_SYSTEM.Dungeons) do
12 window:addChoice(k, v.Name)
13 end
14
15 window:setDefaultEnterButton(200)
16 window:setDefaultEscapeButton(202)
17
18 window:sendToPlayer(player)
19
20end
21
22function onModalWindow(player, modalWindowId, buttonId, choiceId)
23
24 player:unregisterEvent("DungeonSystemType_Modal")
25
26 local dg = DUNGEON_SYSTEM.Dungeons
27 local msg = DUNGEON_SYSTEM.Messages
28 local modal = DUNGEON_SYSTEM.Modal
29 local sto = DUNGEON_SYSTEM.Storages
30
31 if buttonId == 100 then
32
33 modalDungeon(player)
34
35 end
36
37end