Skip to content

Commit

Permalink
feat: continue work on new version of the game's main menu
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 372676bf2bf269a4bace2c757b02169ccc5ed910b99fea03a15fa05dd64e4867
  • Loading branch information
thindil committed Nov 4, 2024
1 parent d539dfc commit 8fb36ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/newui/mainmenu.nim
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ proc showNews*(state: var GameState) {.raises: [], tags: [ReadDirEffect,
## Returns the modified parameter state.
if gameSettings.showTooltips:
resetTooltips()
setLayoutRowDynamic(height = 30, cols = 1)
setLayoutRowDynamic(height = (windowHeight - 50).float, cols = 1)
var newsText: string = ""
if fileExists(filename = docDirectory & "CHANGELOG.md"):
try:
var index = 0
Expand All @@ -54,9 +55,10 @@ proc showNews*(state: var GameState) {.raises: [], tags: [ReadDirEffect,
continue
if state == news and line.len > 1 and line[0 .. 2] == "## ":
break
wrapLabel(str = line)
newsText.add(y = line & '\n')
except:
discard
editString(text = newsText, maxLen = newsText.len, editType = editor)
else:
wrapLabel(str ="Can't find file to load. Did 'CHANGELOG.md' file is in '" &
docDirectory & "' directory?")
Expand Down

0 comments on commit 8fb36ae

Please sign in to comment.