Skip to content

Commit

Permalink
feat: continue work on the new game UI
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 2c4f878e80027e0f4a9e58fe707c513e46bbc55d228d7127d20e5da11d3c8c8d
  • Loading branch information
thindil committed Oct 24, 2024
1 parent 76dec9e commit fde8a85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/newsteamsky.nim
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ proc steamsky() {.raises: [], tags: [ReadIOEffect, RootEffect], contractual.} =
case state
of mainMenu:
showMainMenu(state = state)
of quitGame:
break

# Draw
nuklearDraw()
Expand Down
2 changes: 1 addition & 1 deletion src/newui/coreui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

type GameState* = enum
## Used to determine the current game's state.
mainMenu
mainMenu, quitGame

var
windowWidth*: cint = 600 ## The width of the game's main window
Expand Down
5 changes: 4 additions & 1 deletion src/newui/mainmenu.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ proc showMainMenu*(state: var GameState) {.raises: [], tags: [], contractual.} =
## * state - the current game's state
##
## Returns the modified parameter state.
state = mainMenu
window(name = "MainMenu", x = 0, y = 0, w = windowWidth.float,
h = windowHeight.float, {windowNoFlags}):
setLayoutRowStatic(30.0, 80, 1)
labelButton("New game"):
echo "button pressed"
labelButton("Quit"):
state = quitGame
return
state = mainMenu

0 comments on commit fde8a85

Please sign in to comment.