DEADSOFTWARE

fixed wadeditor; added nosound mode; fixed codepage problems; fixed pointers; cleanup
[d2df-editor.git] / src / editor / f_mapoptions.pas
index a194fa929071a597c29b9eaafa08e8baba658f6c..9d3a20ce1e6b619ffa359802745d2d5068a584bd 100644 (file)
@@ -1,13 +1,13 @@
 unit f_mapoptions;
 
-{$MODE Delphi}
+{$INCLUDE ../shared/a_modes.inc}
 
 interface
 
 uses
   SysUtils, Classes, Forms, Dialogs,
   Controls, StdCtrls, ComCtrls, Buttons,
-  f_main;
+  f_main, utils;
 
 type
   TMapOptionsForm = class (TForm)
@@ -112,13 +112,13 @@ uses
 // Callbacks to receive results from resource choosing dialogs
 function SetSky: Boolean;
 begin
-  MapOptionsForm.eBack.Text := AddSkyForm.ResourceName;
+  MapOptionsForm.eBack.Text := win2utf(AddSkyForm.ResourceName);
   Result := True;
 end;
 
 function SetMusic: Boolean;
 begin
-  MapOptionsForm.eMusic.Text := AddSoundForm.ResourceName;
+  MapOptionsForm.eMusic.Text := win2utf(AddSoundForm.ResourceName);
   Result := True;
 end;
 
@@ -128,12 +128,12 @@ var
   a, b: Integer;
 begin
   // General map options
-  eMapName.Text := gMapInfo.Name;
-  eMapDescription.Text := gMapInfo.Description;
-  eAuthor.Text := gMapInfo.Author;
+  eMapName.Text := win2utf(gMapInfo.Name);
+  eMapDescription.Text := win2utf(gMapInfo.Description);
+  eAuthor.Text := win2utf(gMapInfo.Author);
 
-  eBack.Text := gMapInfo.SkyName;
-  eMusic.Text := gMapInfo.MusicName;
+  eBack.Text := win2utf(gMapInfo.SkyName);
+  eMusic.Text := win2utf(gMapInfo.MusicName);
 
   eMapWidth.Text := IntToStr(gMapInfo.Width);
   eMapHeight.Text := IntToStr(gMapInfo.Height);
@@ -191,11 +191,11 @@ begin
               
   with gMapInfo do
   begin
-    Name := eMapName.Text;
-    Description := eMapDescription.Text;
-    Author := eAuthor.Text;
-    SkyName := eBack.Text;
-    MusicName := eMusic.Text;
+    Name := utf2win(eMapName.Text);
+    Description := utf2win(eMapDescription.Text);
+    Author := utf2win(eAuthor.Text);
+    SkyName := utf2win(eBack.Text);
+    MusicName := utf2win(eMusic.Text);
 
     if Width > newWidth then
       MapOffset.X := 0;
@@ -236,7 +236,7 @@ procedure TMapOptionsForm.bSelectBackClick(Sender: TObject);
 begin
   AddSkyForm.OKFunction := SetSky;
   AddSkyForm.lbResourcesList.MultiSelect := False;
-  AddSkyForm.SetResource := eBack.Text;
+  AddSkyForm.SetResource := utf2win(eBack.Text);
   AddSkyForm.ShowModal();
 end;
 
@@ -244,7 +244,7 @@ procedure TMapOptionsForm.bSelectMusicClick(Sender: TObject);
 begin
   AddSoundForm.OKFunction := SetMusic;
   AddSoundForm.lbResourcesList.MultiSelect := False;
-  AddSoundForm.SetResource := eMusic.Text;
+  AddSoundForm.SetResource := utf2win(eMusic.Text);
   AddSoundForm.ShowModal();
 end;