diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2025-01-26 14:31:52 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2025-01-26 14:31:52 -0600 |
| commit | c39ff632b46c179709101c5b50a061ebd723689f (patch) | |
| tree | 23060311477b996cd11c50851e7dfb889d339346 /src/menu/main.moon | |
| parent | c1030d5ddbf34b1b19fa7fd169f3cf5a7b7f98f3 (diff) | |
| download | ggj25-c39ff632b46c179709101c5b50a061ebd723689f.tar.gz ggj25-c39ff632b46c179709101c5b50a061ebd723689f.tar.bz2 ggj25-c39ff632b46c179709101c5b50a061ebd723689f.zip | |
final commit
Diffstat (limited to 'src/menu/main.moon')
| -rw-r--r-- | src/menu/main.moon | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/src/menu/main.moon b/src/menu/main.moon index 764ce28..ee33dc9 100644 --- a/src/menu/main.moon +++ b/src/menu/main.moon @@ -12,50 +12,18 @@ buttons_data = { require("menu.settings").initalize! } { - text: "Join" + text: "Start" on: () => menu.destroy! - require("menu.join").initalize! - } - { - text: "Host" - on: () => - print("Setting co...") - if not @node.co - @node.co = coroutine.create(() -> - server = router.Router! - server\initalize! - server - ) - button = @ - @node\action(() => - print("In coroutine, menu is", menu) - if @co and coroutine.status(@co) ~= "dead" - succ, val = coroutine.resume(@co) - if not succ - error(debug.traceback(@co,val)) - if type(val) == "string" - print("Setting text", val) - button.text.text = val - else - print("Returned router") - world.router = val - menu.destroy! - require("menu.playername").initalize(true) - ) - } - { - text: "Tutorial" - on: () => - menu.destroy! - print("Load tutorial level") + require("worldgen") + --require("menu.join").initalize! } } menu.initalize = () -> starty = -200 for i = starty, ((#buttons_data-1) * (64 + 32)) + starty, 64 + 32 print("making button", #buttons + 1) - buttons[#buttons + 1] = ui.button(-100,i,200,64,buttons_data[#buttons + 1].text) + buttons[#buttons + 1] = ui.button(-200,i,400,64,buttons_data[#buttons + 1].text) buttons[#buttons].on = buttons_data[#buttons].on print("intalize") @@ -63,5 +31,6 @@ menu.initalize = () -> menu.destroy = () -> for button in *buttons ui.delete(button) + buttons = {} menu |
