DEADSOFTWARE

fix map options on win32
[d2df-editor.git] / src / editor / f_mapoptions.pas
index 9d3a20ce1e6b619ffa359802745d2d5068a584bd..22d74cc5f8d4699f50e8802ae9d3f2cc99b605e6 100644 (file)
@@ -77,7 +77,7 @@ type
     bOK: TButton;
     bCancel: TButton;
     
-    procedure FormActivate(Sender: TObject);
+    procedure FormShow(Sender: TObject);
     procedure bCancelClick(Sender: TObject);
     procedure bOKClick(Sender: TObject);
 
@@ -112,28 +112,26 @@ uses
 // Callbacks to receive results from resource choosing dialogs
 function SetSky: Boolean;
 begin
-  MapOptionsForm.eBack.Text := win2utf(AddSkyForm.ResourceName);
+  MapOptionsForm.eBack.Text := AddSkyForm.ResourceName;
   Result := True;
 end;
 
 function SetMusic: Boolean;
 begin
-  MapOptionsForm.eMusic.Text := win2utf(AddSoundForm.ResourceName);
+  MapOptionsForm.eMusic.Text := AddSoundForm.ResourceName;
   Result := True;
 end;
 
-// Form processing
-procedure TMapOptionsForm.FormActivate(Sender: TObject);
-var
-  a, b: Integer;
+procedure TMapOptionsForm.FormShow(Sender: TObject);
+  var a, b: Integer;
 begin
   // General map options
-  eMapName.Text := win2utf(gMapInfo.Name);
-  eMapDescription.Text := win2utf(gMapInfo.Description);
-  eAuthor.Text := win2utf(gMapInfo.Author);
+  eMapName.Text := gMapInfo.Name;
+  eMapDescription.Text := gMapInfo.Description;
+  eAuthor.Text := gMapInfo.Author;
 
-  eBack.Text := win2utf(gMapInfo.SkyName);
-  eMusic.Text := win2utf(gMapInfo.MusicName);
+  eBack.Text := gMapInfo.SkyName;
+  eMusic.Text := gMapInfo.MusicName;
 
   eMapWidth.Text := IntToStr(gMapInfo.Width);
   eMapHeight.Text := IntToStr(gMapInfo.Height);
@@ -174,7 +172,6 @@ begin
       if gTriggers[a].TriggerType <> 0 then
         b := b + 1;
   lTriggerCount.Caption := IntToStr(b);
-
 end;
 
 procedure TMapOptionsForm.bCancelClick(Sender: TObject);
@@ -191,11 +188,11 @@ begin
               
   with gMapInfo do
   begin
-    Name := utf2win(eMapName.Text);
-    Description := utf2win(eMapDescription.Text);
-    Author := utf2win(eAuthor.Text);
-    SkyName := utf2win(eBack.Text);
-    MusicName := utf2win(eMusic.Text);
+    Name := eMapName.Text;
+    Description := eMapDescription.Text;
+    Author := eAuthor.Text;
+    SkyName := eBack.Text;
+    MusicName := eMusic.Text;
 
     if Width > newWidth then
       MapOffset.X := 0;
@@ -236,7 +233,7 @@ procedure TMapOptionsForm.bSelectBackClick(Sender: TObject);
 begin
   AddSkyForm.OKFunction := SetSky;
   AddSkyForm.lbResourcesList.MultiSelect := False;
-  AddSkyForm.SetResource := utf2win(eBack.Text);
+  AddSkyForm.SetResource := eBack.Text;
   AddSkyForm.ShowModal();
 end;
 
@@ -244,7 +241,7 @@ procedure TMapOptionsForm.bSelectMusicClick(Sender: TObject);
 begin
   AddSoundForm.OKFunction := SetMusic;
   AddSoundForm.lbResourcesList.MultiSelect := False;
-  AddSoundForm.SetResource := utf2win(eMusic.Text);
+  AddSoundForm.SetResource := eMusic.Text;
   AddSoundForm.ShowModal();
 end;