Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
FIX the OUTLINES, fuck kisao code
Browse files Browse the repository at this point in the history
  • Loading branch information
StormAxs committed May 28, 2024
1 parent bd31047 commit b129991
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 24 deletions.
29 changes: 23 additions & 6 deletions src/game/client/components/bindwheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,32 @@ bool CBindWheel::OnCursorMove(float x, float y, IInput::ECursorType CursorType)

void CBindWheel::OnRender()
{
if(!m_Active)
//FUCK YOU!!!
{
if(m_WasActive && !m_vBinds.empty() && m_Choose != -1)
UseBind();
m_WasActive = false;
static int outliner = -1;

return;
if (!m_Active)
{
// Restore the original value only if it was altered
if (outliner != -1)
{
g_Config.m_ClOutline = outliner;
outliner = -1;
}
return;

}

if (m_Active)
{
if (outliner == -1)
{

outliner = g_Config.m_ClOutline;
}
g_Config.m_ClOutline = 0;
}
}
m_WasActive = true;

CUIRect Screen = *UI()->Screen();

Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/bindwheel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ enum
class CBindWheel : public CComponent
{
vec2 m_MousePos;
bool m_WasActive;
int m_Choose;
bool m_Active;

static void ConBindWheel(IConsole::IResult *pResult, void *pUserData);
static void ConNewBindWheel(IConsole::IResult *pResult, void *pUserData);
Expand All @@ -24,7 +24,7 @@ class CBindWheel : public CComponent
void UseBind();

public:
bool m_Active;

virtual int Sizeof() const override { return sizeof(*this); }
struct SBind
{
Expand Down
25 changes: 15 additions & 10 deletions src/game/client/components/menus_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,27 @@ std::vector<std::string> quotes = {
"there's 0.0001% to get special rainbow text, gl^^",
"https://open.spotify.com/track/1SQDvOrbSykg0lP5y7EQ8o?si=a002ae00a4eb4935",
"Don't use M-Client V3",
"Super rare text you might see once in your life",

};

// Function to get a random quote
std::string GetRandomQuote() {
std::vector<std::string> rares = {
"no fucking way you read this..."
};

std::srand(std::time(nullptr));

// Function to get a random quote
std::string GetRandomQuote() {
// Seed the random number generator
std::srand(static_cast<unsigned>(std::time(nullptr)));

int randomNum = std::rand() % 10000 + 1;
// Generate a random number between 0 and 9999
int randomNum = std::rand() % 10000;

if (randomNum == 1) {
return quotes.back(); // Return the super rare quote
// Check if the random number falls in the 0.01% range
if (randomNum < 1) {
return rares[0]; // Return the super rare quote
} else {

// Otherwise, return a regular quote
int index = std::rand() % quotes.size();
return quotes[index];
}
Expand Down Expand Up @@ -355,13 +360,13 @@ void CMenus::RenderStartMenu(CUIRect MainView)
dbg_msg("Quotes", "%s", randomQuote.c_str());
}

if(!str_comp(randomQuote.c_str(), "Super rare text you might see once in your life"))
if(!str_comp(randomQuote.c_str(), "no fucking way you read this..."))
{
ColorRGBA color = color_cast<ColorRGBA>(ColorHSVA(round_to_int(LocalTime() * 25) % 255 / 255.f, 1.f, 1.f));
color.a = 0.9f;
TextRender()->TextColor(color);

UI()->DoLabel(&RandomText, "Super rare text you might see once in your life", 20.0f, TEXTALIGN_ML);
UI()->DoLabel(&RandomText, "no fucking way you read this...", 20.0f, TEXTALIGN_ML);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
}
else
Expand Down
3 changes: 0 additions & 3 deletions src/game/client/components/outlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
#include <game/generated/protocol.h>
#include <game/mapitems.h>
#include "outlines.h"
#include "bindwheel.h"

void COutlines::OnRender()
{
if(CBindWheel().m_Active)
return;

if(GameClient()->m_MapLayersBackground.m_OnlineOnly && Client()->State() != IClient::STATE_ONLINE && Client()->State() != IClient::STATE_DEMOPLAYBACK)
return;
Expand Down
5 changes: 2 additions & 3 deletions src/game/client/components/scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,19 +466,18 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
// Set the cursor for the name rendering
TextRender()->SetCursor(&Cursor, NameOffset, y + (LineHeight - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);

// Check if the player is authorized and apply the authorization color if they are

if(m_pClient->m_aClients[pInfo->m_ClientID].m_AuthLevel)
{
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClAuthedPlayerColor));
TextRender()->TextColor(Color);
}
else if(m_pClient->m_aClients[pInfo->m_ClientID].m_Friend) // Check if the player is a friend only if they are not authorized
else if(m_pClient->m_aClients[pInfo->m_ClientID].m_Friend)
{
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ScFriendColor));
TextRender()->TextColor(Color);
}

//not fwends:3
TextRender()->SetCursor(&Cursor, NameOffset, y + (LineHeight - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
if(m_pClient->m_aClients[pInfo->m_ClientID].m_Foe)
{
Expand Down

0 comments on commit b129991

Please sign in to comment.