X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=d6914b1c6fd40425ca90bfcfe7e3434e514ba162;hb=24f025e51e5faa8c8f28f6ec6614335a5977303a;hp=962db668f7e716e36fc086c51cd19779f391d3b6;hpb=987c4a835a103345b59937e8e1be8524a6228712;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 962db66..d6914b1 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -282,6 +282,7 @@ type procedure ReleaseKeys(); procedure SetModel(ModelName: String); procedure SetColor(Color: TRGB); + function GetColor(): TRGB; procedure SetWeapon(W: Byte); function IsKeyPressed(K: Byte): Boolean; function GetKeys(): Byte; @@ -319,7 +320,7 @@ type procedure DrawPickup(); procedure DrawRulez(); procedure DrawAim(); - procedure DrawIndicator(); + procedure DrawIndicator(Color: TRGB); procedure DrawBubble(); procedure DrawGUI(); procedure Update(); virtual; @@ -554,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; @@ -2034,6 +2035,11 @@ begin if FModel <> nil then FModel.Color := Color; end; +function TPlayer.GetColor(): TRGB; +begin + result := FModel.Color; +end; + procedure TPlayer.SwitchTeam; begin if g_Game_IsClient then @@ -2321,23 +2327,28 @@ begin inherited; end; -procedure TPlayer.DrawIndicator(); +procedure TPlayer.DrawIndicator(Color: TRGB); var indX, indY: Integer; indW, indH: Word; ID: DWORD; + c: TRGB; begin if FAlive then + begin + if g_Texture_Get('TEXTURE_PLAYER_INDICATOR', ID) then begin - if g_Texture_Get('TEXTURE_PLAYER_INDICATOR', ID) then - begin - e_GetTextureSize(ID, @indW, @indH); - indX := FObj.X + FObj.Rect.X + (FObj.Rect.Width - indW) div 2; - indY := FObj.Y; - e_Draw(ID, indX, indY - indH, 0, True, False); - end; + e_GetTextureSize(ID, @indW, @indH); + indX := FObj.X + FObj.Rect.X + (FObj.Rect.Width - indW) div 2; + indY := FObj.Y; + + c := e_Colors; + e_Colors := Color; + e_Draw(ID, indX, indY - indH, 0, True, False); + e_Colors := c; end; - //e_TextureFontPrint(indX, indY, FName, gStdFont); // Shows player name overhead + end; + //e_TextureFontPrintEx(indX, indY, FName, gStdFont, 0, 0, 255, 1.0, true); // Shows player name overhead end; procedure TPlayer.DrawBubble();