mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
add wip alternatecenterkeys for css linux gamers
This commit is contained in:
parent
c5d4679c9a
commit
a0a2cce04a
@ -124,6 +124,7 @@ float gF_AngleDiff[MAXPLAYERS+1];
|
||||
|
||||
bool gB_Late = false;
|
||||
char gS_HintPadding[MAX_HINT_SIZE];
|
||||
bool gB_AlternateCenterKeys[MAXPLAYERS+1]; // use for css linux gamers
|
||||
|
||||
// hud handle
|
||||
Handle gH_HUD = null;
|
||||
@ -412,11 +413,35 @@ public void OnClientPutInServer(int client)
|
||||
gI_LastScrollCount[client] = 0;
|
||||
gI_ScrollCount[client] = 0;
|
||||
gB_FirstPrint[client] = false;
|
||||
gB_AlternateCenterKeys[client] = false;
|
||||
|
||||
if(IsFakeClient(client))
|
||||
{
|
||||
SDKHook(client, SDKHook_PostThinkPost, PostThinkPost);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gEV_Type != Engine_CSGO)
|
||||
{
|
||||
CreateTimer(5.0, Timer_QueryWindowsCvar, GetClientSerial(client), TIMER_FLAG_NO_MAPCHANGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Action Timer_QueryWindowsCvar(Handle timer, any data)
|
||||
{
|
||||
int client = GetClientFromSerial(data);
|
||||
|
||||
if (client > 0)
|
||||
{
|
||||
QueryClientConVar(client, "windows_speaker_config", OnWindowsCvarQueried);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnWindowsCvarQueried(QueryCookie cookie, int client, ConVarQueryResult result, const char[] cvarName, const char[] cvarValue, any value)
|
||||
{
|
||||
gB_AlternateCenterKeys[client] = (result == ConVarQuery_NotFound);
|
||||
PrintToChat(client, "gB_AlternateCenterKeys[client] = %d", gB_AlternateCenterKeys[client]);
|
||||
}
|
||||
|
||||
public void PostThinkPost(int client)
|
||||
@ -1684,11 +1709,23 @@ void UpdateCenterKeys(int client)
|
||||
}
|
||||
|
||||
char sCenterText[80];
|
||||
|
||||
if (gB_AlternateCenterKeys[client])
|
||||
{
|
||||
FormatEx(sCenterText, sizeof(sCenterText), " %s %s\n%s %s %s\n%s %s %s\n %s %s",
|
||||
(buttons & IN_JUMP) > 0? "J":"_", (buttons & IN_DUCK) > 0? "C":"_",
|
||||
(fAngleDiff > 0) ? "<":" ", (buttons & IN_FORWARD) > 0 ? "W":" _", (fAngleDiff < 0) ? ">":"",
|
||||
(buttons & IN_MOVELEFT) > 0? "A":"_", (buttons & IN_BACK) > 0? "S":"_", (buttons & IN_MOVERIGHT) > 0? "D":"_",
|
||||
(buttons & IN_LEFT) > 0? "L":" ", (buttons & IN_RIGHT) > 0? "R":" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
FormatEx(sCenterText, sizeof(sCenterText), " %s %s\n%s %s %s\n%s %s %s\n %s %s",
|
||||
(buttons & IN_JUMP) > 0? "J":"ー", (buttons & IN_DUCK) > 0? "C":"ー",
|
||||
(fAngleDiff > 0) ? "<":" ", (buttons & IN_FORWARD) > 0 ? "W":" ー", (fAngleDiff < 0) ? ">":"",
|
||||
(buttons & IN_MOVELEFT) > 0? "A":"ー", (buttons & IN_BACK) > 0? "S":"ー", (buttons & IN_MOVERIGHT) > 0? "D":"ー",
|
||||
(buttons & IN_LEFT) > 0? "L":" ", (buttons & IN_RIGHT) > 0? "R":" ");
|
||||
}
|
||||
|
||||
int style = (gB_Replay && Shavit_IsReplayEntity(target))? Shavit_GetReplayBotStyle(target):Shavit_GetBhopStyle(target);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user