DEADSOFTWARE

game: do not use absolute path in wad selection widgets (it looks ugly, and [almost...
[d2df-sdl.git] / src / game / g_menu.pas
index 53a1cbc6bae3cca965e73a2c6dfdd3ea144ccca3..72a5c8ceeb16317cfbaf60d737cd667dcb8726d1 100644 (file)
@@ -375,7 +375,7 @@ begin
 
   if g_Game_IsClient then MC_SEND_PlayerSettings;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write(s + '/' + CONFIG_FILENAME);
   g_Console_WriteGameConfig;
@@ -699,7 +699,7 @@ begin
     gcMap := Map;
   end;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write_Gameplay_Custom(s + '/' + CONFIG_FILENAME);
 
@@ -768,7 +768,7 @@ begin
     NetUseMaster := TGUISwitch(GetControl('swUseMaster')).ItemIndex = 0;
   end;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
   begin
     g_Options_Write_Net_Server(s + '/' + CONFIG_FILENAME);
@@ -791,7 +791,7 @@ begin
     PW := TGUIEdit(GetControl('edPW')).Text;
   end;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write_Net_Client(s + '/' + CONFIG_FILENAME);
   g_Game_StartClient(NetClientIP, NetClientPort, PW);
@@ -809,7 +809,7 @@ begin
     PW := TGUIEdit(GetControl('edPW')).Text;
   end;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write_Net_Client(s + '/' + CONFIG_FILENAME);
   g_Game_StartClient(NetClientIP, NetClientPort, PW);
@@ -860,6 +860,7 @@ begin
     WAD := TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
     TwoPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex = 1;
   end;
+  WAD := e_FindWadRel(MegawadDirs, WAD);
 
   if TwoPlayers then
     n := 2
@@ -1357,6 +1358,8 @@ begin
   if (wad = '') or (map = '') then
     Exit;
 
+  wad := e_FindWadRel(MapDirs, WAD);
+
   res := wad+':\'+map;
 
   TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res;
@@ -1661,7 +1664,7 @@ begin
     gLanguageChange := True;
     gAskLanguage := False;
 
-    s := e_GetDir(ConfigDirs);
+    s := e_GetWriteableDir(ConfigDirs);
     if s <> '' then
       g_Options_Write_Language(s + '/' + CONFIG_FILENAME);
 
@@ -1679,7 +1682,7 @@ begin
     gLanguageChange := True;
     gAskLanguage := False;
 
-    s := e_GetDir(ConfigDirs);
+    s := e_GetWriteableDir(ConfigDirs);
     if s <> '' then
       g_Options_Write_Language(s + '/' + CONFIG_FILENAME);
 
@@ -1925,7 +1928,7 @@ begin
   gLanguageChange := True;
   gAskLanguage := False;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write_Language(s + '/' + CONFIG_FILENAME)
 end;
@@ -1937,7 +1940,7 @@ begin
   gLanguageChange := True;
   gAskLanguage := False;
 
-  s := e_GetDir(ConfigDirs);
+  s := e_GetWriteableDir(ConfigDirs);
   if s <> '' then
     g_Options_Write_Language(s + '/' + CONFIG_FILENAME)
 end;