DEADSOFTWARE

Updated indicator options
authorJoseph Stalin <granminigun@pm.me>
Sat, 14 Sep 2019 09:39:17 +0000 (14:39 +0500)
committerJoseph Stalin <granminigun@pm.me>
Sun, 22 Sep 2019 15:29:34 +0000 (20:29 +0500)
src/game/g_game.pas
src/game/g_language.pas
src/game/g_menu.pas
src/game/g_options.pas
src/game/g_player.pas

index b89b03736ce7c8d0f7b62425729ff69d3a3e856b..3f328d493c30067afc7bf9798db2688b0ea5c514 100644 (file)
@@ -3666,13 +3666,19 @@ begin
 
   renderMapInternal(-c, -d, true);
 
-  if (gGameSettings.GameMode <> GM_SINGLE) and gPlayerIndicator then
-    if gPlayers[i] <> nil then
-      for i := 0 to High(gPlayers) do
-        if gPlayers[i] = p then gPlayers[i].DrawIndicator(_RGB(255, 255, 255))
-        else if (gPlayers[i].Team = p.Team) and (gPlayers[i].Team <> TEAM_NONE)
-        then
-          gPlayers[i].DrawIndicator(gPlayers[i].GetColor);
+  if (gGameSettings.GameMode <> GM_SINGLE) and (gPlayerIndicator > 0) then
+    case gPlayerIndicator of
+      1:
+        p.DrawIndicator(_RGB(255, 255, 255));
+
+      2:
+        for i := 0 to High(gPlayers) do
+          if gPlayers[i] <> nil then
+            if gPlayers[i] = p then p.DrawIndicator(_RGB(255, 255, 255))
+            else if (gPlayers[i].Team = p.Team) and (gPlayers[i].Team <> TEAM_NONE)
+            then
+              gPlayers[i].DrawIndicator(gPlayers[i].GetColor);
+    end;
 
   if p.FSpectator then
     e_TextureFontPrintEx(p.GameX + PLAYER_RECT_CX - 4,
index 06769e1f15d4e186ce3f68e0a24143e5bdf5a5c9..cccffd6ec8dd8dc2db47f92b6b05cef49ec13dc9 100644 (file)
@@ -253,12 +253,15 @@ type
     I_MENU_GAME_MESSAGES,
     I_MENU_GAME_REVERT_PLAYERS,
     I_MENU_GAME_CHAT_BUBBLE,
-    I_MENU_GAME_PLAYER_INDICATOR,
     I_MENU_GAME_CHAT_TYPE_NONE,
     I_MENU_GAME_CHAT_TYPE_SIMPLE,
     I_MENU_GAME_CHAT_TYPE_ADV,
     I_MENU_GAME_CHAT_TYPE_COLOR,
     I_MENU_GAME_CHAT_TYPE_TEXTURE,
+    I_MENU_GAME_PLAYER_INDICATOR,
+    I_MENU_GAME_INDICATOR_NONE,
+    I_MENU_GAME_INDICATOR_OWN,
+    I_MENU_GAME_INDICATOR_ALL,
     I_MENU_GAME_SCALE_FACTOR,
 
     I_MENU_VIDEO_RESOLUTION,
@@ -1085,8 +1088,6 @@ const
                                        'Âòîðîé èãðîê ñâåðõó:'),
     ('MENU GAME CHAT BUBBLE',          'Chat bubbles:',
                                        'Èêîíêà ÷àòà:'),
-    ('MENU GAME PLAYER INDICATOR',     'Player indicator:',
-                                       'Èíäèêàòîð èãðîêà:'),
     ('MENU GAME CHAT TYPE NONE',       'None',
                                        'Íåò'),
     ('MENU GAME CHAT TYPE SIMPLE',     'Simple',
@@ -1097,6 +1098,14 @@ const
                                        'Öâåòíàÿ'),
     ('MENU GAME CHAT TYPE TEXTURE',    'Textured',
                                        'Òåêñòóðà'),
+    ('MENU GAME PLAYER INDICATOR',     'Player indicator:',
+                                       'Èíäèêàòîð èãðîêà:'),
+    ('MENU GAME INDICATOR TYPE NONE',  'None',
+                                       'Íåò'),
+    ('MENU GAME INDICATOR TYPE OWN',   'Own',
+                                       'Ñâîé'),
+    ('MENU GAME INDICATOR TYPE ALL',   'Own + Teammates',
+                                       'Ñâîé + Ñîþçíèêè'),
     ('MENU GAME SCALE FACTOR',         'Scale:',
                                        'Ìàñøòàá:'),
 
index 4b6e6f2e022f8bac7ee074aa15b134ed3103760e..3a6f0e7d6efb7895642f1cd3f86bf1b5522e1354 100644 (file)
@@ -160,7 +160,7 @@ begin
   gShowMessages := TGUISwitch(menu.GetControl('swMessages')).ItemIndex = 0;
   gRevertPlayers := TGUISwitch(menu.GetControl('swRevertPlayers')).ItemIndex = 0;
   gChatBubble := TGUISwitch(menu.GetControl('swChatBubble')).ItemIndex;
-  gPlayerIndicator := TGUISwitch(menu.GetControl('swPlayerIndicator')).ItemIndex = 0;
+  gPlayerIndicator := TGUISwitch(menu.GetControl('swPlayerIndicator')).ItemIndex;
   if TGUIScroll(menu.GetControl('scScaleFactor')).Value <> TempScale then
   begin
     TempScale := TGUIScroll(menu.GetControl('scScaleFactor')).Value;
@@ -569,7 +569,7 @@ begin
     ItemIndex := gChatBubble;
 
   with TGUISwitch(menu.GetControl('swPlayerIndicator')) do
-    if gPlayerIndicator then ItemIndex := 0 else ItemIndex := 1;
+    ItemIndex := gPlayerIndicator;
 
   TempScale := Round(g_dbg_scale - 1);
   TGUIScroll(menu.GetControl('scScaleFactor')).Value := TempScale;
@@ -2780,8 +2780,9 @@ begin
     with AddSwitch(_lc[I_MENU_GAME_PLAYER_INDICATOR]) do
     begin
       Name := 'swPlayerIndicator';
-      AddItem(_lc[I_MENU_YES]);
-      AddItem(_lc[I_MENU_NO]);
+      AddItem(_lc[I_MENU_GAME_INDICATOR_NONE]);
+      AddItem(_lc[I_MENU_GAME_INDICATOR_OWN]);
+      AddItem(_lc[I_MENU_GAME_INDICATOR_ALL]);
     end;
     with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do
     begin
index 4ca52bb31583e9fd2797c71de08cd6747dad67cf..697656bffc0327903c8a970fdf125a55a82bf62c 100644 (file)
@@ -226,7 +226,7 @@ begin
   gShowMessages := True;
   gRevertPlayers := False;
   gChatBubble := 4;
-  gPlayerIndicator := True;
+  gPlayerIndicator := 1;
   gSFSDebug := False;
   gSFSFastMode := False;
   e_FastScreenshots := True;
@@ -419,7 +419,7 @@ begin
   ReadBoolean(gShowMessages, 'Messages');
   ReadBoolean(gRevertPlayers, 'RevertPlayers');
   ReadInteger(gChatBubble, 'ChatBubble', 0, 4);
-  ReadBoolean(gPlayerIndicator, 'PlayerIndicator');
+  ReadInteger(gPlayerIndicator, 'PlayerIndicator', 0, 2);
   ReadBoolean(gSFSDebug, 'SFSDebug'); wadoptDebug := gSFSDebug;
   ReadBoolean(gSFSFastMode, 'SFSFastMode'); wadoptFast := gSFSFastMode;
   ReadBoolean(e_FastScreenshots, 'FastScreenshots');
@@ -593,7 +593,7 @@ begin
   config.WriteBool('Game', 'Messages', gShowMessages);
   config.WriteBool('Game', 'RevertPlayers', gRevertPlayers);
   config.WriteInt('Game', 'ChatBubble', gChatBubble);
-  config.WriteBool('Game', 'PlayerIndicator', gPlayerIndicator);
+  config.WriteInt('Game', 'PlayerIndicator', gPlayerIndicator);
   config.WriteBool('Game', 'SFSDebug', gSFSDebug);
   config.WriteBool('Game', 'SFSFastMode', gSFSFastMode);
   config.WriteBool('Game', 'FastScreenshots', e_FastScreenshots);
index 181d7da5c090f1c306c562bd3901f5e7e8df3753..d6914b1c6fd40425ca90bfcfe7e3434e514ba162 100644 (file)
@@ -555,7 +555,7 @@ var
   gFly: Boolean = False;
   gAimLine: Boolean = False;
   gChatBubble: Byte = 0;
-  gPlayerIndicator: Boolean = True;
+  gPlayerIndicator: Byte = 1;
   gNumBots: Word = 0;
   gLMSPID1: Word = 0;
   gLMSPID2: Word = 0;
@@ -2348,7 +2348,7 @@ begin
       e_Colors := c;
     end;
   end;
-  //e_TextureFontPrint(indX, indY, FName, gStdFont); // Shows player name overhead
+  //e_TextureFontPrintEx(indX, indY, FName, gStdFont, 0, 0, 255, 1.0, true); // Shows player name overhead
 end;
 
 procedure TPlayer.DrawBubble();