mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-26 14:30:56 +00:00
Reverted changes to revision 45.
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@76 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
8b8fd61e6c
commit
cbd7e95495
12 changed files with 31 additions and 453 deletions
|
@ -34,10 +34,6 @@
|
|||
#include "mod/AvHNetworkMessages.h"
|
||||
#include "ui/ChatPanel.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
class CHLVoiceStatusHelper : public IVoiceStatusHelper
|
||||
{
|
||||
public:
|
||||
|
@ -196,10 +192,6 @@ void CHud :: Init( void )
|
|||
m_iLogo = 0;
|
||||
m_iFOV = 0;
|
||||
|
||||
// tankefugl: duck toggle
|
||||
g_bDuckToggled = false;
|
||||
// :tankefugl
|
||||
|
||||
CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 );
|
||||
default_fov = CVAR_CREATE( "default_fov", "90", 0 );
|
||||
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#include "common/r_efx.h"
|
||||
#include "mod/AvHNetworkMessages.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
extern bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
#define MAX_CLIENTS 32
|
||||
|
||||
#if !defined( _TFC )
|
||||
|
@ -50,10 +46,6 @@ int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
|
|||
// reset sensitivity
|
||||
m_flMouseSensitivity = 0;
|
||||
|
||||
// tankefugl: duck toggle
|
||||
g_bDuckToggled = false;
|
||||
// :tankefugl
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,10 +61,6 @@ extern "C"
|
|||
#include "engine/APIProxy.h"
|
||||
#include "Exports.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
extern bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
extern int g_iAlive;
|
||||
|
||||
extern int g_weaponselect;
|
||||
|
@ -794,12 +790,6 @@ void IN_DuckDown(void)
|
|||
}
|
||||
|
||||
void IN_DuckUp(void) {KeyUp(&in_duck);}
|
||||
// tankefugl: duck toggle
|
||||
void IN_DuckToggle(void)
|
||||
{
|
||||
g_bDuckToggled = !g_bDuckToggled;
|
||||
}
|
||||
// :tankefugl
|
||||
void IN_ReloadDown(void) {KeyDown(&in_reload);}
|
||||
void IN_ReloadUp(void) {KeyUp(&in_reload);}
|
||||
void IN_Alt1Down(void) {KeyDown(&in_alt1);}
|
||||
|
@ -1328,19 +1318,10 @@ int CL_ButtonBits( int bResetState )
|
|||
bits |= IN_ATTACK;
|
||||
}
|
||||
|
||||
// tankefugl: duck toggle
|
||||
if ( g_bDuckToggled )
|
||||
{
|
||||
if (!(in_duck.state & 3))
|
||||
if (in_duck.state & 3)
|
||||
{
|
||||
bits |= IN_DUCK;
|
||||
}
|
||||
}
|
||||
else if (in_duck.state & 3)
|
||||
{
|
||||
bits |= IN_DUCK;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
if (in_jump.state & 3)
|
||||
{
|
||||
|
@ -1508,9 +1489,6 @@ void InitInput (void)
|
|||
gEngfuncs.pfnAddCommand ("-jlook", IN_JLookUp);
|
||||
gEngfuncs.pfnAddCommand ("+duck", IN_DuckDown);
|
||||
gEngfuncs.pfnAddCommand ("-duck", IN_DuckUp);
|
||||
// tankefugl: duck toggle
|
||||
gEngfuncs.pfnAddCommand ("toggleduck", IN_DuckToggle);
|
||||
// :tankefugl
|
||||
gEngfuncs.pfnAddCommand ("+reload", IN_ReloadDown);
|
||||
gEngfuncs.pfnAddCommand ("-reload", IN_ReloadUp);
|
||||
gEngfuncs.pfnAddCommand ("+alt1", IN_Alt1Down);
|
||||
|
|
|
@ -333,7 +333,6 @@ void CVoiceStatus::CreateEntities()
|
|||
int iOutModel = 0;
|
||||
for(int i=0; i < VOICE_MAX_PLAYERS; i++)
|
||||
{
|
||||
|
||||
if(!m_VoicePlayers[i])
|
||||
continue;
|
||||
|
||||
|
@ -361,13 +360,7 @@ void CVoiceStatus::CreateEntities()
|
|||
pEnt->baseline.renderamt = 255;
|
||||
pEnt->curstate.renderfx = kRenderFxNoDissipation;
|
||||
pEnt->curstate.framerate = 1;
|
||||
// tankefugl: different sprite for each team
|
||||
if (pClient->curstate.team <= SPR_Frames(m_VoiceHeadModel))
|
||||
pEnt->curstate.frame = pClient->curstate.team;
|
||||
else
|
||||
pEnt->curstate.frame = 0;
|
||||
//pEnt->curstate.frame = 0;
|
||||
// :tankefugl
|
||||
pEnt->model = (struct model_s*)gEngfuncs.GetSpritePointer(m_VoiceHeadModel);
|
||||
pEnt->angles[0] = pEnt->angles[1] = pEnt->angles[2] = 0;
|
||||
pEnt->curstate.scale = 0.5f;
|
||||
|
@ -395,7 +388,6 @@ void CVoiceStatus::UpdateSpeakerStatus(int entindex, qboolean bTalking)
|
|||
gEngfuncs.pfnConsolePrint( msg );
|
||||
}
|
||||
|
||||
gEngfuncs.Con_Printf("\n");
|
||||
// Is it the local player talking?
|
||||
if( entindex == -1 )
|
||||
{
|
||||
|
@ -734,11 +726,9 @@ void CVoiceStatus::RepositionLabels()
|
|||
|
||||
y += bgTall + 2;
|
||||
}
|
||||
|
||||
if( m_pLocalBitmap && m_pAckBitmap && m_pLocalLabel && (m_bTalking || m_bServerAcked) )
|
||||
{
|
||||
if (m_pParentPanel) {
|
||||
int z = 3;
|
||||
}
|
||||
m_pLocalLabel->setParent(*m_pParentPanel);
|
||||
m_pLocalLabel->setVisible( true );
|
||||
|
||||
|
|
|
@ -646,10 +646,6 @@ void AvHHud::ClearData()
|
|||
this->mCurrentGhostIsValid = false;
|
||||
|
||||
this->mAmbientSounds.clear();
|
||||
|
||||
// tankefugl: 0000971
|
||||
this->mTeammateOrder.clear();
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
|
||||
|
@ -2040,41 +2036,31 @@ void AvHHud::OrderNotification(const AvHOrder& inOrder)
|
|||
AvHOrderType theOrderType = inOrder.GetOrderType();
|
||||
AvHHUDSound theSound = HUD_SOUND_INVALID;
|
||||
|
||||
// tankefugl: 0000992
|
||||
// popup indicator for order
|
||||
bool thePopup = false;
|
||||
|
||||
// Play HUD sound depending on order
|
||||
switch(theOrderType)
|
||||
{
|
||||
case ORDERTYPEL_MOVE:
|
||||
theSound = HUD_SOUND_ORDER_MOVE;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_ATTACK:
|
||||
theSound = HUD_SOUND_ORDER_ATTACK;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_BUILD:
|
||||
theSound = HUD_SOUND_ORDER_BUILD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_GUARD:
|
||||
theSound = HUD_SOUND_ORDER_GUARD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_WELD:
|
||||
theSound = HUD_SOUND_ORDER_WELD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_GET:
|
||||
theSound = HUD_SOUND_ORDER_GET;
|
||||
thePopup = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2084,13 +2070,6 @@ void AvHHud::OrderNotification(const AvHOrder& inOrder)
|
|||
}
|
||||
|
||||
this->PlayHUDSound(theSound);
|
||||
|
||||
// tankefugl: 0000992
|
||||
if (thePopup)
|
||||
{
|
||||
this->SetDisplayOrder(2, this->GetFrameForOrderType(theOrderType), "", "", "");
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
@ -2310,83 +2289,6 @@ int AvHHud::MiniMap(const char* pszName, int iSize, void* pbuf)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// tankefugl: 0000971
|
||||
BIND_MESSAGE(IssueOrder);
|
||||
int AvHHud::IssueOrder(const char* pszName, int iSize, void* pbuf)
|
||||
{
|
||||
int ordertype, ordersource, ordertarget;
|
||||
NetMsg_IssueOrder( pbuf, iSize, ordertype, ordersource, ordertarget);
|
||||
|
||||
float now = this->GetTimeOfLastUpdate();
|
||||
TeammateOrderListType::iterator theIter = this->mTeammateOrder.find(ordersource);
|
||||
if (theIter == this->mTeammateOrder.end())
|
||||
{
|
||||
this->mTeammateOrder.insert(theIter, pair<int, TeammateOrderType>(ordersource, TeammateOrderType(ordertype, now)));
|
||||
}
|
||||
else
|
||||
{
|
||||
TeammateOrderType *theOrder = &((*theIter).second);
|
||||
(*theOrder).first = ordertype;
|
||||
(*theOrder).second = now;
|
||||
}
|
||||
|
||||
if (this->GetInTopDownMode() == false)
|
||||
{
|
||||
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
|
||||
if (theLocalPlayer->index == ordertarget)
|
||||
{
|
||||
hud_player_info_t info;
|
||||
memset(&info, 0, sizeof(info));
|
||||
GetPlayerInfo(ordersource, &info);
|
||||
|
||||
string temp;
|
||||
string nameFormat;
|
||||
// TODO: fetch from titles.txt
|
||||
switch (ordertype) {
|
||||
case TEAMMATE_MARINE_ORDER_WELD:
|
||||
nameFormat = "Weld %s";
|
||||
break;
|
||||
case TEAMMATE_MARINE_ORDER_FOLLOW:
|
||||
nameFormat = "Follow %s";
|
||||
break;
|
||||
case TEAMMATE_MARINE_ORDER_COVER:
|
||||
nameFormat = "%s is covering";
|
||||
break;
|
||||
case TEAMMATE_MARINE_ORDER_UNKNOWN:
|
||||
nameFormat = "%s";
|
||||
break;
|
||||
case TEAMMATE_ALIEN_ORDER_HEAL:
|
||||
nameFormat = "Heal %s";
|
||||
break;
|
||||
case TEAMMATE_ALIEN_ORDER_FOLLOW:
|
||||
nameFormat = "Follow %s";
|
||||
break;
|
||||
case TEAMMATE_ALIEN_ORDER_COVER:
|
||||
nameFormat = "%s is covering";
|
||||
break;
|
||||
case TEAMMATE_ALIEN_ORDER_UNKNOWN:
|
||||
nameFormat = "%s";
|
||||
break;
|
||||
}
|
||||
sprintf(temp, nameFormat.c_str(), info.name);
|
||||
|
||||
this->SetDisplayOrder(1, ordertype, temp, "", "");
|
||||
}
|
||||
if (theLocalPlayer->index == ordersource)
|
||||
{
|
||||
this->mCurrentOrderTarget = ordertarget;
|
||||
this->mCurrentOrderType = ordertype;
|
||||
this->mCurrentOrderTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
// char temp[255];
|
||||
// sprintf(temp, "IssueOrder received - type %d source %d target %d at time %f\n", ordertype, ordersource, ordertarget, now);
|
||||
// gEngfuncs.Con_Printf(temp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
BIND_MESSAGE(ServerVar);
|
||||
int AvHHud::ServerVar(const char* pszName, int iSize, void* pbuf)
|
||||
|
@ -2559,20 +2461,6 @@ void AvHHud::ResetGame(bool inMapChanged)
|
|||
this->mTimeOfLastLevelUp = -1;
|
||||
|
||||
memset(this->mMenuImpulses, MESSAGE_NULL, sizeof(AvHMessageID)*kNumUpgradeLines);
|
||||
|
||||
// tankefugl: 0000992 & 0000971
|
||||
this->mTeammateOrder.clear();
|
||||
this->mCurrentOrderTarget = 0;
|
||||
this->mCurrentOrderType = 0;
|
||||
this->mCurrentOrderTime = 0.0f;
|
||||
|
||||
this->mDisplayOrderTime = 0.0f;
|
||||
this->mDisplayOrderType = 0;
|
||||
this->mDisplayOrderIndex = 0;
|
||||
this->mDisplayOrderText1 = "";
|
||||
this->mDisplayOrderText2 = "";
|
||||
this->mDisplayOrderText3 = "";
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
BIND_MESSAGE(SetGmma);
|
||||
|
@ -3587,9 +3475,6 @@ void AvHHud::Init(void)
|
|||
HOOK_MESSAGE(AlienInfo);
|
||||
HOOK_MESSAGE(DebugCSP);
|
||||
HOOK_MESSAGE(TechSlots);
|
||||
// tankefugl: 0000971
|
||||
HOOK_MESSAGE(IssueOrder);
|
||||
// :tankefugl
|
||||
|
||||
HOOK_MESSAGE(ServerVar);
|
||||
|
||||
|
|
|
@ -397,9 +397,6 @@ public:
|
|||
|
||||
int GameStatus(const char* pszName, int iSize, void* pbuf);
|
||||
int MiniMap(const char* pszName, int iSize, void* pbuf);
|
||||
// tankefugl: 0000971
|
||||
int IssueOrder(const char* pszName, int iSize, void* pbuf);
|
||||
// :tankefugl
|
||||
int Progress(const char* pszName, int iSize, void* pbuf);
|
||||
int SetGmma(const char* pszName, int iSize, void* pbuf);
|
||||
int SetSelect(const char* pszName, int iSize, void* pbuf);
|
||||
|
@ -443,20 +440,12 @@ private:
|
|||
void DrawMouseCursor(int inBaseX, int inBaseY);
|
||||
void DrawOrders();
|
||||
void DrawHelpIcons();
|
||||
// tankefugl: 0000971
|
||||
void DrawTeammateOrders();
|
||||
// tankefugl: 0000992
|
||||
void DrawDisplayOrder();
|
||||
void SetDisplayOrder(int inOrderType, int inOrderIndex, string inText1, string inText2, string inText3);
|
||||
// :tankefugl
|
||||
void DrawHUDStructureNotification();
|
||||
void DrawInfoLocationText();
|
||||
void DrawPlayerNames();
|
||||
void DrawReticleInfo();
|
||||
void DrawToolTips();
|
||||
// tankefugl: 0000971 -- added inAlpha
|
||||
void DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize, float inAlpha = 1.0f);
|
||||
// :tankefugl
|
||||
void DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize);
|
||||
void DrawOrderIcon(const AvHOrder& inOrder);
|
||||
void DrawOrderText(const AvHOrder& inOrder);
|
||||
int GetFrameForOrderType(AvHOrderType inOrderType) const;
|
||||
|
@ -595,20 +584,6 @@ private:
|
|||
OrderListType mOrders;
|
||||
//AvHOrderType mOrderMode;
|
||||
|
||||
// tankefugl: 0000971
|
||||
map< int, TeammateOrderType > mTeammateOrder;
|
||||
// tankefugl: 0000992
|
||||
float mDisplayOrderTime;
|
||||
int mDisplayOrderType;
|
||||
int mDisplayOrderIndex;
|
||||
string mDisplayOrderText1;
|
||||
string mDisplayOrderText2;
|
||||
string mDisplayOrderText3;
|
||||
int mCurrentOrderTarget;
|
||||
int mCurrentOrderType;
|
||||
float mCurrentOrderTime;
|
||||
// :tankefugl
|
||||
|
||||
AvHMessageID mTechEvent;
|
||||
AvHMessageID mAlienAbility;
|
||||
AvHMessageID mGroupEvent;
|
||||
|
@ -696,10 +671,6 @@ private:
|
|||
HSPRITE mMarineOrderIndicator;
|
||||
HSPRITE mMarineUpgradesSprite;
|
||||
|
||||
// tankefugl: 0000971
|
||||
HSPRITE mTeammateOrderSprite;
|
||||
// :tankefugl
|
||||
|
||||
typedef map<int, int> SpriteListType;
|
||||
SpriteListType mActionButtonSprites;
|
||||
//SpriteListType mHelpSprites;
|
||||
|
|
|
@ -139,7 +139,6 @@
|
|||
#include "mod/AvHSpriteAPI.h"
|
||||
#include "mod/AvHParticleEditorHandler.h"
|
||||
#include <list>
|
||||
#include "common/entity_types.h"
|
||||
|
||||
void IN_GetMousePos( int *mx, int *my );
|
||||
|
||||
|
@ -884,8 +883,7 @@ void AvHHud::DrawToolTips()
|
|||
}
|
||||
}
|
||||
|
||||
void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize, float inAlpha)
|
||||
// tankefugl: added inAlpha
|
||||
void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize)
|
||||
{
|
||||
vec3_t theUpperLeft;
|
||||
vec3_t theLowerRight;
|
||||
|
@ -970,7 +968,7 @@ void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorl
|
|||
|
||||
//DrawScaledHUDSprite(inSpriteHandle, inRenderMode, 1, theScreenX, theScreenY, theWidth, theHeight, inFrame);
|
||||
|
||||
AvHSpriteSetColor(1, 1, 1, inAlpha);
|
||||
AvHSpriteSetColor(1, 1, 1);
|
||||
AvHSpriteSetRenderMode(inRenderMode);
|
||||
AvHSpriteDraw(inSpriteHandle, inFrame, theScreenX, theScreenY, theScreenX + theWidth, theScreenY + theHeight, 0, 0, 1, 1);
|
||||
|
||||
|
@ -1062,14 +1060,6 @@ void AvHHud::DrawOrderText(const AvHOrder& inOrder)
|
|||
string theTranslatedLocation = theLocationOfOrder;
|
||||
LocalizeString(theLocationOfOrder.c_str(), theTranslatedLocation);
|
||||
|
||||
// tankefugl: 0000992
|
||||
string theFirstLine = theLocalizedTitle;
|
||||
if(theRangeDisplayString != "")
|
||||
{
|
||||
theFirstLine += string(" : ") + theRangeDisplayString;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
Vector theScreenPos;
|
||||
if(AvHCUWorldToScreen((float*)theOrderLocation, (float*)&theScreenPos))
|
||||
{
|
||||
|
@ -1081,6 +1071,12 @@ void AvHHud::DrawOrderText(const AvHOrder& inOrder)
|
|||
int theR, theG, theB;
|
||||
this->GetPrimaryHudColor(theR, theG, theB, false, false);
|
||||
|
||||
string theFirstLine = theLocalizedTitle;
|
||||
if(theRangeDisplayString != "")
|
||||
{
|
||||
theFirstLine += string(" : ") + theRangeDisplayString;
|
||||
}
|
||||
|
||||
// Draw order (icon above world position, text below it)
|
||||
int theBaseX = theScreenPos.x;
|
||||
int theBaseY = theScreenPos.y;
|
||||
|
@ -1091,181 +1087,8 @@ void AvHHud::DrawOrderText(const AvHOrder& inOrder)
|
|||
this->DrawHudStringCentered(theBaseX, theBaseY + 2*theStringHeight, ScreenWidth(), theTranslatedLocation.c_str(), theR, theG, theB);
|
||||
}
|
||||
}
|
||||
// tankefugl: 0000992
|
||||
if (this->mDisplayOrderType == 2)
|
||||
{
|
||||
// this->mDisplayOrderText1 = "The commander issued an order:";
|
||||
this->mDisplayOrderText1 = theFirstLine.c_str();
|
||||
this->mDisplayOrderText2 = theTranslatedLocation.c_str();
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
// tankefugl: 0000992
|
||||
void AvHHud::SetDisplayOrder(int inOrderType, int inOrderIndex, string inText1, string inText2, string inText3)
|
||||
{
|
||||
this->mDisplayOrderTime = this->mTimeOfLastUpdate;
|
||||
this->mDisplayOrderType = inOrderType;
|
||||
this->mDisplayOrderIndex = inOrderIndex;
|
||||
this->mDisplayOrderText1 = inText1;
|
||||
this->mDisplayOrderText2 = inText2;
|
||||
this->mDisplayOrderText3 = inText3;
|
||||
}
|
||||
|
||||
void AvHHud::DrawDisplayOrder()
|
||||
{
|
||||
const float flashLength = 1.0f;
|
||||
const float fadeLimit = 6.0f;
|
||||
const float fadeEnd = 2.0f;
|
||||
|
||||
if ((this->mDisplayOrderType > 0) && (this->mDisplayOrderTime + fadeLimit + fadeEnd) > this->mTimeOfLastUpdate && (this->GetInTopDownMode() == false))
|
||||
{
|
||||
float theFade = 1.0f;
|
||||
if ((this->mDisplayOrderTime + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
theFade = 1.0f - (this->mTimeOfLastUpdate - (this->mDisplayOrderTime + fadeLimit)) / fadeEnd;
|
||||
if(theFade < 0.0f)
|
||||
{
|
||||
this->mDisplayOrderType = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// flash the icon for the first second
|
||||
if ((this->mDisplayOrderTime + flashLength) > this->mTimeOfLastUpdate)
|
||||
{
|
||||
if (((int)((this->mTimeOfLastUpdate - this->mDisplayOrderTime) * 8)) % 2)
|
||||
{
|
||||
theFade = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// draw the panel
|
||||
// int sprite = Safe_SPR_Load(kWhiteSprite);
|
||||
|
||||
int r, g, b;
|
||||
GetPrimaryHudColor(r, g, b, true, false);
|
||||
|
||||
int theStringHeight = this->GetHudStringHeight();
|
||||
|
||||
// float mSelectionBoxX1 = 0.25f * ScreenWidth();
|
||||
// float mSelectionBoxY1 = 0.08f * ScreenHeight();
|
||||
// float mSelectionBoxX2 = mSelectionBoxX1 + 0.50f * ScreenWidth();
|
||||
// float mSelectionBoxY2 = mSelectionBoxY1 + 0.08f * ScreenWidth();
|
||||
|
||||
// float mIconX1 = mSelectionBoxX1 + 0.01f * ScreenWidth();
|
||||
// float mIconY1 = mSelectionBoxY1 + 0.01f * ScreenWidth();
|
||||
// float mIconX2 = mIconX1 + 0.06f * ScreenWidth();
|
||||
// float mIconY2 = mIconY1 + 0.06f * ScreenWidth();
|
||||
|
||||
// AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
// AvHSpriteSetColor(r / 255.0, g / 255.0, b / 255.0, 0.3 * theFade);
|
||||
// AvHSpriteSetDrawMode(kSpriteDrawModeFilled);
|
||||
// AvHSpriteDraw(sprite, 0, mSelectionBoxX1 + 1, mSelectionBoxY1 + 1, mSelectionBoxX2 - 1, mSelectionBoxY2 - 1, 0, 0, 1, 1);
|
||||
|
||||
// AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
// AvHSpriteSetColor(r / 255.0, g / 255.0, b / 255.0, 0.7 * theFade);
|
||||
// AvHSpriteSetDrawMode(kSpriteDrawModeBorder);
|
||||
// AvHSpriteDraw(sprite, 0, mSelectionBoxX1, mSelectionBoxY1, mSelectionBoxX2, mSelectionBoxY2, 0, 0, 1, 1);
|
||||
|
||||
float mIconX1 = 0.45f * ScreenWidth();
|
||||
float mIconY1 = 0.10f * ScreenHeight();
|
||||
float mIconX2 = mIconX1 + 0.10f * ScreenWidth();
|
||||
float mIconY2 = mIconY1 + 0.10f * ScreenWidth();
|
||||
|
||||
float mTextX1 = 0.50f * ScreenWidth();
|
||||
|
||||
AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
AvHSpriteSetDrawMode(kSpriteDrawModeFilled);
|
||||
AvHSpriteSetColor(1, 1, 1, 1 * theFade);
|
||||
|
||||
if (this->mDisplayOrderType == 1)
|
||||
{
|
||||
AvHSpriteDraw(this->mTeammateOrderSprite, this->mDisplayOrderIndex, mIconX1, mIconY1, mIconX2, mIconY2, 0, 0, 1, 1);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
}
|
||||
else if (this->mDisplayOrderType == 2)
|
||||
{
|
||||
AvHSpriteDraw(this->mOrderSprite, this->mDisplayOrderIndex, mIconX1, mIconY1, mIconX2, mIconY2, 0, 0, 1, 1);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2 + theStringHeight, ScreenWidth(), this->mDisplayOrderText2.c_str(), r, g, b);
|
||||
}
|
||||
|
||||
|
||||
// float mTextX1 = mIconX2 + 0.02 * ScreenWidth();
|
||||
// this->DrawHudString(mTextX1, mIconY1, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
// this->DrawHudString(mTextX1, mIconY1 + theStringHeight, ScreenWidth(), this->mDisplayOrderText2.c_str(), r, g, b);
|
||||
// this->DrawHudString(mTextX1, mIconY1 + theStringHeight * 2, ScreenWidth(), this->mDisplayOrderText3.c_str(), r, g, b);
|
||||
}
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
// tankefugl: 0000971
|
||||
void AvHHud::DrawTeammateOrders()
|
||||
{
|
||||
TeammateOrderListType::iterator toErase = NULL;
|
||||
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
|
||||
|
||||
const float flashLength = 1.0f;
|
||||
const float fadeLimit = 6.0f;
|
||||
const float fadeEnd = 2.0f;
|
||||
|
||||
for(TeammateOrderListType::iterator theIter = this->mTeammateOrder.begin(); theIter != this->mTeammateOrder.end(); theIter++)
|
||||
{
|
||||
TeammateOrderType theOrder = (*theIter).second;
|
||||
int theEntIndex = (*theIter).first;
|
||||
float theFade = 1.0f;
|
||||
|
||||
// remove the order if it has expired
|
||||
if((theOrder.second + fadeEnd + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
toErase = theIter;
|
||||
continue;
|
||||
}
|
||||
// draw the order fading away
|
||||
else if((theOrder.second + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
theFade = 1.0f - (this->mTimeOfLastUpdate - (theOrder.second + fadeLimit)) / fadeEnd;
|
||||
if(theFade < 0.0f)
|
||||
theFade = 0.0f;
|
||||
}
|
||||
// else, draw the order normally
|
||||
|
||||
cl_entity_s* theEntity = gEngfuncs.GetEntityByIndex(theEntIndex);
|
||||
if (theEntity && (theEntIndex < MAX_PLAYERS && theEntIndex >= 0) && (theEntity->index != theLocalPlayer->index))
|
||||
{
|
||||
if (AvHTraceLineAgainstWorld(theLocalPlayer->origin, theEntity->origin) == 1.0f)
|
||||
{
|
||||
vec3_t theVec;
|
||||
VectorCopy(theEntity->origin, theVec);
|
||||
theVec[2] += AvHCUGetIconHeightForPlayer((AvHUser3)theEntity->curstate.iuser3);
|
||||
this->DrawWorldSprite(this->mTeammateOrderSprite, kRenderTransAdd, theVec, theOrder.first, kHelpIconDrawSize, theFade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (toErase != NULL)
|
||||
this->mTeammateOrder.erase(toErase);
|
||||
|
||||
// flash target player
|
||||
if (((this->mCurrentOrderTime + flashLength) > this->mTimeOfLastUpdate) && (this->mCurrentOrderTarget > 0))
|
||||
{
|
||||
if (((int)((this->mTimeOfLastUpdate - (this->mCurrentOrderTime + flashLength)) * 8)) % 2)
|
||||
{
|
||||
cl_entity_s* theTargetEntity = gEngfuncs.GetEntityByIndex(this->mCurrentOrderTarget);
|
||||
|
||||
vec3_t theVec;
|
||||
VectorCopy(theTargetEntity->origin, theVec);
|
||||
theVec[2] += AvHCUGetIconHeightForPlayer((AvHUser3)theTargetEntity->curstate.iuser3);
|
||||
this->DrawWorldSprite(this->mTeammateOrderSprite, kRenderTransAdd, theVec, this->mCurrentOrderType, kHelpIconDrawSize, 1.0f);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
void AvHHud::DrawOrders()
|
||||
{
|
||||
if(1/*!this->mIsRenderingSelectionView*/)
|
||||
|
@ -2708,11 +2531,6 @@ void AvHHud::RenderCommonUI()
|
|||
|
||||
this->DrawOrders();
|
||||
this->DrawHelpIcons();
|
||||
// tankefugl: 0000971
|
||||
this->DrawTeammateOrders();
|
||||
// tankefugl: 0000992
|
||||
this->DrawDisplayOrder();
|
||||
// :tankefugl
|
||||
|
||||
if (this->GetIsCombatMode())
|
||||
{
|
||||
|
@ -4170,10 +3988,6 @@ void AvHHud::VidInit(void)
|
|||
string theIconName = string(kHelpIconPrefix) + ".spr";
|
||||
this->mHelpSprite = Safe_SPR_Load(theIconName.c_str());
|
||||
|
||||
// tankefugl: 0000971
|
||||
this->mTeammateOrderSprite = Safe_SPR_Load(kTeammateOrderSprite);
|
||||
// :tankefugl
|
||||
|
||||
this->mEnemyBlips.VidInit();
|
||||
this->mFriendlyBlips.VidInit();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ int g_msgAmmoPickup = 0, g_msgAmmoX, g_msgBattery, g_msgCurWeapon, g_msgDamage,
|
|||
g_msgServerVar, g_msgSetGammaRamp, g_msgSetOrder, g_msgSetParticleTemplates,
|
||||
g_msgSetSelect, g_msgSetRequest, g_msgSetSoundNames, g_msgSetTechNodes, g_msgSetTechSlots,
|
||||
g_msgSetTopDown, g_msgSetupMap, g_msgUpdateCountdown, g_msgUpdateEntityHierarchy,
|
||||
g_msgProfileInfo, g_msgNexusBytes, g_msgIssueOrder;
|
||||
g_msgProfileInfo, g_msgNexusBytes;
|
||||
|
||||
void Net_InitializeMessages(void)
|
||||
{
|
||||
|
@ -87,9 +87,6 @@ void Net_InitializeMessages(void)
|
|||
g_msgUpdateEntityHierarchy = REG_USER_MSG( "EntHier", -1 );
|
||||
g_msgProfileInfo = REG_USER_MSG( "ProfileInfo", 8 );
|
||||
g_msgNexusBytes = REG_USER_MSG( "NexusBytes", -1 );
|
||||
// tankefugl: 0000971
|
||||
g_msgIssueOrder = REG_USER_MSG( "IssueOrder", 9);
|
||||
// :tankefugl
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2027,27 +2024,3 @@ const int kPositionNetworkConstant = 25;
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// tankefugl: 0000971
|
||||
#ifndef AVH_SERVER
|
||||
void NetMsg_IssueOrder( void* const buffer, const int size, int& ordertype, int& ordersource, int& ordertarget )
|
||||
{
|
||||
BEGIN_READ( buffer, size );
|
||||
ordertype = READ_BYTE();
|
||||
ordersource = READ_LONG();
|
||||
ordertarget = READ_LONG();
|
||||
END_READ();
|
||||
}
|
||||
#else
|
||||
void NetMsg_IssueOrder( entvars_t* const pev, const int ordertype, const int ordersource, const int ordertarget)
|
||||
{
|
||||
MESSAGE_BEGIN( MSG_ONE, g_msgIssueOrder, NULL, pev );
|
||||
WRITE_BYTE( ordertype );
|
||||
WRITE_LONG( ordersource );
|
||||
WRITE_LONG( ordertarget );
|
||||
MESSAGE_END();
|
||||
}
|
||||
#endif
|
||||
// :tankefugl
|
|
@ -106,7 +106,6 @@
|
|||
void NetMsg_SetupMap_Extents( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents, const bool draw_background );
|
||||
void NetMsg_SetupMap_Location( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents );
|
||||
void NetMsg_UpdateEntityHierarchy( entvars_t* const pev, const MapEntityMap& NewItems, const EntityListType& OldItems );
|
||||
void NetMsg_IssueOrder(entvars_t* const pev, const int ordertype, const int ordersource, const int ordertarget);
|
||||
|
||||
//BROADCAST MESSAGE TRANSMISSION
|
||||
void NetMsg_DeathMsg( const int killer_index, const int victim_index, string& weapon_name );
|
||||
|
@ -196,7 +195,6 @@
|
|||
void NetMsg_SetupMap( void* const buffer, const int size, bool& is_location, string& name, float* min_extents, float* max_extents, bool& draw_background );
|
||||
void NetMsg_UpdateCountdown( void* const buffer, const int size, int& countdown );
|
||||
void NetMsg_UpdateEntityHierarchy( void* const buffer, const int size, MapEntityMap& NewItems, EntityListType& OldItems );
|
||||
void NetMsg_IssueOrder( void* const buffer, const int size, int& ordertype, int& ordersource, int& ordertarget );
|
||||
|
||||
#endif //AVH_SERVER
|
||||
|
||||
|
|
|
@ -82,20 +82,6 @@ private:
|
|||
};
|
||||
|
||||
typedef vector<AvHOrder> OrderListType;
|
||||
// tankefugl: 0000971
|
||||
typedef enum {
|
||||
TEAMMATE_MARINE_ORDER_WELD = 0,
|
||||
TEAMMATE_MARINE_ORDER_FOLLOW,
|
||||
TEAMMATE_MARINE_ORDER_COVER,
|
||||
TEAMMATE_MARINE_ORDER_UNKNOWN,
|
||||
TEAMMATE_ALIEN_ORDER_HEAL,
|
||||
TEAMMATE_ALIEN_ORDER_FOLLOW,
|
||||
TEAMMATE_ALIEN_ORDER_COVER,
|
||||
TEAMMATE_ALIEN_ORDER_UNKNOWN
|
||||
} TeammateOrderEnum;
|
||||
typedef pair<int, float> TeammateOrderType;
|
||||
typedef map<int, TeammateOrderType> TeammateOrderListType;
|
||||
// :tankefugl
|
||||
|
||||
void AvHChangeOrder(OrderListType& inList, const AvHOrder& inOrder);
|
||||
//void AvHRemovePlayerFromOrders(OrderListType& inList, int inPlayerIndex);
|
||||
|
|
|
@ -4075,8 +4075,7 @@ void PM_UnDuck( void )
|
|||
|
||||
VectorCopy( pmove->origin, newOrigin );
|
||||
|
||||
// tankefugl: remove the jump when pressing and releasing duck quickly
|
||||
if ( pmove->onground != -1 && pmove->flags & FL_DUCKING && pmove->bInDuck == false)
|
||||
if ( pmove->onground != -1 )
|
||||
{
|
||||
int theStandingHull = AvHMUGetHull(false, pmove->iuser3);
|
||||
int theCrouchingHull = AvHMUGetHull(true, pmove->iuser3);
|
||||
|
|
Loading…
Reference in a new issue