DEADSOFTWARE

Map: Add rect alpha settings for monsters and areas
authorStas'M <x86corez@gmail.com>
Sun, 20 May 2018 14:31:49 +0000 (17:31 +0300)
committerStas'M <x86corez@gmail.com>
Sun, 20 May 2018 14:32:02 +0000 (17:32 +0300)
http://doom2d.org/forum/viewtopic.php?f=12&t=2400

src/editor/f_main.pas
src/editor/g_map.pas

index 578d950a500a77af475424140529b87e717e5bba..5c1e8bd728a3c914abf27ae0e72c700150e3ab89 100644 (file)
@@ -2726,6 +2726,8 @@ begin
   gAlphaTriggerArea := config.ReadInt('Editor', 'TriggerAlpha', ALPHA_AREA);
   if gAlphaTriggerArea = 255 then
     gAlphaTriggerArea := ALPHA_AREA;
+  gAlphaMonsterRect := config.ReadInt('Editor', 'MonsterRectAlpha', 0);
+  gAlphaAreaRect := config.ReadInt('Editor', 'AreaRectAlpha', 0);
   if config.ReadInt('Editor', 'Scale', 0) = 1 then
     Scale := 2
   else
@@ -4221,6 +4223,8 @@ begin
   config.WriteInt('Editor', 'EdgeAlpha', gAlphaEdge);
   config.WriteInt('Editor', 'LineAlpha', gAlphaTriggerLine);
   config.WriteInt('Editor', 'TriggerAlpha', gAlphaTriggerArea);
+  config.WriteInt('Editor', 'MonsterRectAlpha', gAlphaMonsterRect);
+  config.WriteInt('Editor', 'AreaRectAlpha', gAlphaAreaRect);
 
   for i := 0 to RecentCount-1 do
     if i < RecentFiles.Count then
index 5a17e97276fc8f681fdcd8d57b7f2cf0e0632f6b..10b8c47ce0142e11dc148650f6d2c7d0c1ad0944 100644 (file)
@@ -194,6 +194,8 @@ var
   gAlphaEdge: Byte;
   gAlphaTriggerLine: Byte;
   gAlphaTriggerArea: Byte;
+  gAlphaMonsterRect: Byte;
+  gAlphaAreaRect: Byte;
   drEdge: Array[0..3] of Byte;
   gPanels: Array of TPanel;
   gItems: Array of TItem;
@@ -2198,6 +2200,7 @@ begin
         with MonsterSize[gMonsters[a].MonsterType] do
         begin
           ID := DWORD(-1);
+          sel := ObjectSelected(OBJECT_MONSTER, a);
 
           case gMonsters[a].MonsterType of
             0: Continue;
@@ -2256,7 +2259,7 @@ begin
           begin
             e_DrawQuad(MapOffset.X+gMonsters[a].X, MapOffset.Y+gMonsters[a].Y,
                        MapOffset.X+gMonsters[a].X+Width-1, MapOffset.Y+gMonsters[a].Y+Height-1,
-                       255, 255, 255);
+                       255, 255, 255, IfThen(sel, 0, gAlphaMonsterRect));
           end;
         end;
 
@@ -2273,6 +2276,7 @@ begin
         with AreaSize[gAreas[a].AreaType] do
         begin
           ID := DWORD(-1);
+          sel := ObjectSelected(OBJECT_AREA, a);
 
           case gAreas[a].AreaType of
             AREA_PLAYERPOINT1: g_GetTexture('AREA_PLAYERPOINT1', ID);
@@ -2302,7 +2306,7 @@ begin
           begin
             e_DrawQuad(MapOffset.X+gAreas[a].X, MapOffset.Y+gAreas[a].Y,
                        MapOffset.X+gAreas[a].X+Width-1, MapOffset.Y+gAreas[a].Y+Height-1,
-                       255, 255, 255);
+                       255, 255, 255, IfThen(sel, 0, gAlphaAreaRect));
 
             e_DrawPoint(2, MapOffset.X+gAreas[a].X, MapOffset.Y+gAreas[a].Y, 255, 0, 0);
           end;