X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=3d1b927b6f7f78bea422f0cf7a480dead5133473;hb=87d25f00069abd99b5e60eb95db44c350a87d5f6;hp=e0a04f5354833be34d1bbe88fdeb8877a5237820;hpb=fd7ac4cd55502ecbb2a77e3f603ac0f899c1064d;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index e0a04f5..3d1b927 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -310,6 +310,7 @@ type procedure DrawPickup(); procedure DrawRulez(); procedure DrawAim(); + procedure DrawIndicator(); procedure DrawBubble(); procedure DrawGUI(); procedure Update(); virtual; @@ -542,6 +543,7 @@ var gFly: Boolean = False; gAimLine: Boolean = False; gChatBubble: Byte = 0; + gPlayerIndicator: Boolean = True; gNumBots: Word = 0; gLMSPID1: Word = 0; gLMSPID2: Word = 0; @@ -2273,6 +2275,25 @@ begin inherited; end; +procedure TPlayer.DrawIndicator(); +var + indX, indY: Integer; + indW, indH: Word; + ID: DWORD; +begin + if FAlive then + begin + indX := FObj.X+FObj.Rect.X; + indY := FObj.Y - 12; + if g_Texture_Get('TEXTURE_PLAYER_INDICATOR', ID) then + begin + e_GetTextureSize(ID, @indW, @indH); + e_Draw(ID, indX + indW div 2, indY, 0, True, False); + end; + end; + //e_TextureFontPrint(indX, indY, FName, gStdFont); // Shows player name overhead +end; + procedure TPlayer.DrawBubble(); var bubX, bubY: Integer; @@ -3709,14 +3730,14 @@ begin // find next weapon to switch onto cwi := curlidx; - for i := 0 to High(weaponOrder) do + for i := 0 to High(FWeapon) do begin - cwi := (cwi+length(weaponOrder)+1) mod length(weaponOrder); + cwi := (cwi+length(FWeapon)+1) mod length(FWeapon); if (cwi = curlidx) then continue; // skip current weapon if not wantThisWeapon[cwi] then continue; rwidx := weaponOrder[cwi]; if (rwidx < 0) then continue; - //e_WriteLog(Format(' trying logical %d (real %d); has=%d, hasammo=%d', [cwi, rwidx, Integer(FWeapon[rwidx]), Integer(hasAmmoForWeapon(rwidx))]), TMsgType.Warning); + //e_WriteLog(Format(' trying logical %d (real %d)', [cwi, rwidx]), TMsgType.Warning); if FWeapon[rwidx] and ((wwc = 1) or hasAmmoForWeapon(rwidx)) then begin //e_WriteLog(' I FOUND HER!', TMsgType.Warning);