From c570601e19da0c2592ef400e201f1a9285e1f9a3 Mon Sep 17 00:00:00 2001 From: Stas'M Date: Sun, 20 May 2018 17:31:49 +0300 Subject: [PATCH] Map: Add rect alpha settings for monsters and areas http://doom2d.org/forum/viewtopic.php?f=12&t=2400 --- src/editor/f_main.pas | 4 ++++ src/editor/g_map.pas | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 578d950..5c1e8bd 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -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 diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas index 5a17e97..10b8c47 100644 --- a/src/editor/g_map.pas +++ b/src/editor/g_map.pas @@ -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; -- 2.29.2