DEADSOFTWARE

changed some backslashes to forward slashes
[d2df-editor.git] / src / editor / f_main.pas
index 9167af7bd3a34d88085e7006fc671d0d9ac12ec7..9a976f65c8ec3d453ad6af3a3b1258005105ddc2 100644 (file)
@@ -1461,7 +1461,13 @@ begin
                   MaxLength := 3;
                 end;
 
-                with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_ALLMAP], BoolNames[Data.ShotAllMap], True)] do
+                case Data.ShotAim of
+                  1: str := _lc[I_PROP_TR_SHOT_AIM_1];
+                  2: str := _lc[I_PROP_TR_SHOT_AIM_2];
+                  3: str := _lc[I_PROP_TR_SHOT_AIM_3];
+                  else str := _lc[I_PROP_TR_SHOT_AIM_0];
+                end;
+                with ItemProps[InsertRow(_lc[I_PROP_TR_SHOT_AIM], str, True)-1] do
                 begin
                   EditStyle := esPickList;
                   ReadOnly := True;
@@ -1900,7 +1906,7 @@ begin
       end
     else
       begin // Внешний WAD
-        FileName := EditorDir+'wads\'+aWAD;
+        FileName := EditorDir+'wads/'+aWAD;
         ResourceName := aWAD+':'+SectionName+'\'+aTex;
       end;
 
@@ -2534,13 +2540,13 @@ begin
   cfglen := 0;
 
   wad := TWADEditor_1.Create;
-  if wad.ReadFile(EditorDir+'data\Game.wad') then
+  if wad.ReadFile(EditorDir+'data/Game.wad') then
     wad.GetResource('FONTS', cfgres, cfgdata, cfglen);
   wad.Free();
 
   if cfglen <> 0 then
   begin
-    if not g_CreateTextureWAD('FONT_STD', EditorDir+'data\Game.wad:FONTS\'+texture) then
+    if not g_CreateTextureWAD('FONT_STD', EditorDir+'data/Game.wad:FONTS\'+texture) then
       e_WriteLog('ERROR ERROR ERROR', MSG_WARNING);
 
     config := TConfig.CreateMem(cfgdata, cfglen);
@@ -2589,7 +2595,7 @@ begin
   OpenedMap := '';
   OpenedWAD := '';
 
-  config := TConfig.CreateFile(EditorDir+'\Editor.cfg');
+  config := TConfig.CreateFile(EditorDir+'/Editor.cfg');
 
   if config.ReadBool('Editor', 'Maximize', False) then
     WindowState := wsMaximized;
@@ -2674,7 +2680,7 @@ procedure TMainForm.Draw();
 var
   x, y: Integer;
   a, b: Integer;
-  ID: DWORD;
+  ID, PID: DWORD;
   Width, Height: Word;
   Rect: TRectWH;
   ObjCount: Word;
@@ -2746,10 +2752,9 @@ begin
     if not g_GetTexture(SelectedTexture(), ID) then
       g_GetTexture('NOTEXTURE', ID);
     g_GetTextureSizeByID(ID, Width, Height);
-    e_DrawFillQuad(RenderPanel.Width-Width-2, RenderPanel.Height-Height-2,
-                   RenderPanel.Width-1, RenderPanel.Height-1,
-                   GetRValue(PreviewColor), GetGValue(PreviewColor), GetBValue(PreviewColor), 0);
-    e_Draw(ID, RenderPanel.Width-Width-1, RenderPanel.Height-Height-1, 0, True, False);
+    if g_GetTexture('PREVIEW', PID) then
+       e_DrawFill(PID, RenderPanel.Width-Width, RenderPanel.Height-Height, Width div 16 + 1, Height div 16 + 1, 0, True, False);
+    e_Draw(ID, RenderPanel.Width-Width, RenderPanel.Height-Height, 0, True, False);
   end;
 
 // Подсказка при выборе точки Телепорта:
@@ -3735,7 +3740,7 @@ begin
                       trigger.Data.ShotPanelID := -1;
                       trigger.Data.ShotTarget := 0;
                       trigger.Data.ShotIntSight := 0;
-                      trigger.Data.ShotAllMap := False;
+                      trigger.Data.ShotAim := TRIGGER_SHOT_AIM_DEFAULT;
                       trigger.Data.ShotPos.X := trigger.X-64;
                       trigger.Data.ShotPos.Y := trigger.Y-64;
                       trigger.Data.ShotAngle := 0;
@@ -4015,7 +4020,7 @@ var
   config: TConfig;
   i: Integer;
 begin
-  config := TConfig.CreateFile(EditorDir+'\Editor.cfg');
+  config := TConfig.CreateFile(EditorDir+'/Editor.cfg');
 
   config.WriteBool('Editor', 'Maximize', WindowState = wsMaximized);
   config.WriteBool('Editor', 'Minimap', ShowMap);
@@ -4038,7 +4043,7 @@ begin
       config.WriteStr('RecentFiles', IntToStr(i+1), '');
   RecentFiles.Free();
 
-  config.SaveFile(EditorDir+'\Editor.cfg');
+  config.SaveFile(EditorDir+'/Editor.cfg');
   config.Free();
 
   slInvalidTextures.Free;
@@ -4416,6 +4421,13 @@ begin
         Values.Add(_lc[I_PROP_TR_SHOT_TO_5]);
         Values.Add(_lc[I_PROP_TR_SHOT_TO_6]);
       end
+    else if KeyName = _lc[I_PROP_TR_SHOT_AIM] then
+      begin
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_0]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_1]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_2]);
+        Values.Add(_lc[I_PROP_TR_SHOT_AIM_3]);
+      end
     else if (KeyName = _lc[I_PROP_PANEL_BLEND]) or
             (KeyName = _lc[I_PROP_DM_ONLY]) or
             (KeyName = _lc[I_PROP_ITEM_FALLS]) or
@@ -4433,7 +4445,6 @@ begin
             (KeyName = _lc[I_PROP_TR_SCORE_CON]) or
             (KeyName = _lc[I_PROP_TR_SCORE_MSG]) or
             (KeyName = _lc[I_PROP_TR_HEALTH_MAX]) or
-            (KeyName = _lc[I_PROP_TR_SHOT_ALLMAP]) or
             (KeyName = _lc[I_PROP_TR_SHOT_SOUND]) or
             (KeyName = _lc[I_PROP_TR_EFFECT_CENTER]) then
       begin
@@ -4847,7 +4858,13 @@ begin
                   Data.ShotTarget := 6;
                 Data.ShotIntSight := Min(Max(
                   StrToIntDef(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_SIGHT]], 0), 0), 65535);
-                Data.ShotAllMap := NameToBool(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_ALLMAP]]);
+                Data.ShotAim := 0;
+                if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_1] then
+                  Data.ShotAim := 1
+                else if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_2] then
+                  Data.ShotAim := 2
+                else if vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_AIM]] = _lc[I_PROP_TR_SHOT_AIM_3] then
+                  Data.ShotAim := 3;
                 Data.ShotAngle := Min(
                   StrToIntDef(vleObjectProperty.Values[_lc[I_PROP_TR_SHOT_ANGLE]], 0), 360);
                 Data.ShotWait := Min(Max(
@@ -5539,6 +5556,8 @@ begin
       lbTypeSelect.Items.Add(ItemToStr(ITEM_HELMET));
       lbTypeSelect.Items.Add(ItemToStr(ITEM_JETPACK));
       lbTypeSelect.Items.Add(ItemToStr(ITEM_INVIS));
+      lbTypeSelect.Items.Add(ItemToStr(ITEM_WEAPON_FLAMETHROWER));
+      lbTypeSelect.Items.Add(ItemToStr(ITEM_AMMO_FUELCAN));
 
       b := StrToItem(Values[Key]);
       if b >= ITEM_BOTTLE then
@@ -5732,9 +5751,9 @@ begin
       else gLanguage := LANGUAGE_RUSSIAN;
     end;
 
-    config := TConfig.CreateFile(EditorDir+'\Editor.cfg');
+    config := TConfig.CreateFile(EditorDir+'/Editor.cfg');
     config.WriteStr('Editor', 'Language', gLanguage);
-    config.SaveFile(EditorDir+'\Editor.cfg');
+    config.SaveFile(EditorDir+'/Editor.cfg');
     config.Free();
   end;
 
@@ -6212,13 +6231,13 @@ begin
   // Сохраняем временную карту:
   time := 0;
   repeat
-    mapWAD := ExtractFilePath(TestD2dExe) + Format('maps\temp%.4d.wad', [time]);
+    mapWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d.wad', [time]);
     Inc(time);
   until not FileExists(mapWAD);
   mapToRun := mapWAD + ':\' + TEST_MAP_NAME;
   SaveMap(mapToRun);
 
-  mapToRun := ExtractRelativePath(ExtractFilePath(TestD2dExe) + 'maps\', mapToRun);
+  mapToRun := ExtractRelativePath(ExtractFilePath(TestD2dExe) + 'maps/', mapToRun);
 
 // Опции игры:
   opt := 32 + 64;