Skip to content

Commit

Permalink
refactor: continue work on move createGameUi to Nim
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 8347414ed49ecff8c5ef574f6fbe7d4bb60e4096bd714471bbbcb1d0e179ef88
  • Loading branch information
thindil committed Sep 8, 2024
1 parent d97d33f commit 196ebce
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions nim/src/ui/mapsui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -752,15 +752,24 @@ proc createGameUi*() =
tclEval(script = "wm attributes . -fullscreen 1")
for index, accel in mapAccelerators.mpairs:
let pos = accel.rfind(sub = '-')
tclEval(script = "bind . <" & accel[0..pos] & "KeyPress-" & accel[pos + 1..^1] & "> {InvokeMenu " & accel & "}")
tclEval(script = "bind . <" & accel[0..pos] & "KeyPress-" & accel[pos +
1..^1] & "> {InvokeMenu " & accel & "}")
if not tclEval2(script = "grid slaves .").contains(sub = ".gameframe.header"):
let header = gameFrame & ".header"
tclEval(script = "grid " & header)
updateHeader()
centerX = playerShip.skyX
centerY = playerShip.skyY
for baseType in basesTypesList:
tclEval(script = mapView & " tag configure " & baseType.name & " -foreground #" & baseType.color)
for baseType in basesTypesList.values:
tclEval(script = mapView & " tag configure " & baseType.name &
" -foreground #" & baseType.color)
let panedPosition = (if gameSettings.windowHeight -
gameSettings.messagesPosition <
0: gameSettings.windowHeight else: gameSettings.windowHeight -
gameSettings.messagesPosition)
tclEval(script = paned & " sashpos 0 " & $panedPosition)
if not tclEval2(script = "grid slaves .").contains(sub = ".gameframe.paned"):
tclEval(script = "grid " & paned)

# Temporary code for interfacing with Ada

Expand Down

0 comments on commit 196ebce

Please sign in to comment.