Skip to content

Commit

Permalink
fix: some problems with creating the main menu
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 6f84b41ee7abdb9e27b1386fb3e22c55c8a5dfd813a40460e2a2821fbadaf558
  • Loading branch information
thindil committed Sep 24, 2024
1 parent 192a1d6 commit 1045396
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion nim/src/ui/mainmenu.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ proc createMainMenu*() =
uiDirectory = dataDirectory & "ui" & DirSep
iconPath = uiDirectory & "images" & DirSep & "icon.png"
mainWindow = "."
if not dirExists(iconPath):
if not fileExists(iconPath):
tclEval(script = "wm withdraw " & mainWindow)
tclEval(script = "tk_messageBox -message {Couldn't not find the game data files and the game have to stop. Are you sure that directory \"" &
dataDirectory & "\" is the proper place where the game data files exists?} -icon error -type ok")
Expand Down
20 changes: 10 additions & 10 deletions src/ui/mainmenu.adb
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ with Config; use Config;
with Dialogs; use Dialogs;
-- with Factions;
with Game; use Game;
-- with Goals.UI;
-- with MainMenu.Commands;
with Goals.UI;
with MainMenu.Commands;
-- with Maps.UI;
-- with Table;
with Table;
-- with Themes;
-- with Utils.UI;
with Utils.UI;

package body MainMenu is

Expand Down Expand Up @@ -132,7 +132,6 @@ package body MainMenu is
Import => True,
External_Name => "createAdaMainMenu";
begin
Create_Ada_Main_Menu;
-- if not Exists(Name => Icon_Path) then
-- Wm_Set(Widgt => Main_Window, Action => "withdraw");
-- if MessageBox
Expand All @@ -147,11 +146,12 @@ package body MainMenu is
-- end if;
-- Icon :=
-- Create(pathName => "logo", options => "-file {" & Icon_Path & "}");
-- MainMenu.Commands.Add_Commands;
-- Dialogs.Add_Commands;
-- Utils.UI.Add_Commands;
-- Goals.UI.Add_Commands;
-- Table.Add_Commands;
MainMenu.Commands.Add_Commands;
Dialogs.Add_Commands;
Utils.UI.Add_Commands;
Goals.UI.Add_Commands;
Table.Add_Commands;
Create_Ada_Main_Menu;
-- Wm_Set
-- (Widgt => Main_Window, Action => "iconphoto",
-- Options => "-default " & Icon);
Expand Down

0 comments on commit 1045396

Please sign in to comment.