Skip to content

Commit

Permalink
Adjust position of emoji on left-side of screen; Adjust alpha channel…
Browse files Browse the repository at this point in the history
… of text
  • Loading branch information
MoosheTV committed May 4, 2020
1 parent 9791666 commit 06aaccb
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions code/components/font-renderer/src/GtaGameInterface.cpp
Expand Up @@ -351,7 +351,8 @@ static InitFunction initFunction([] ()
static bool isCanary = IsCanary();

std::wstring brandingString = L"";
std::wstring brandingEmoji;
std::wstring brandingEmoji = L"";
std::wstring brandName = L"FiveM";

if (shouldDraw) {
SYSTEMTIME systemTime;
Expand Down Expand Up @@ -393,8 +394,6 @@ static InitFunction initFunction([] ()
break;
}

std::wstring brandName = L"FiveM";

if (!CfxIsSinglePlayer() && !getenv("CitizenFX_ToolMode"))
{
#if !defined(IS_RDR3)
Expand Down Expand Up @@ -443,10 +442,23 @@ static InitFunction initFunction([] ()
brandName += L" (Canary)";
}
}
}

std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, 2);

static int anchorPos = dis(gen);

// If anchor position is on left-side, make the emoji go on the left side.
if (anchorPos < 2) {
brandingString = fmt::sprintf(L"%s %s", brandName, brandingEmoji);
} else
{
brandingString = fmt::sprintf(L"%s %s", brandingEmoji, brandName);
}


static CRect metrics;
static fwWString lastString;
static float lastHeight;
Expand All @@ -462,12 +474,6 @@ static InitFunction initFunction([] ()
lastHeight = gameHeightF;
}

std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, 2);

static int anchorPos = dis(gen);

CRect drawRect;

switch (anchorPos)
Expand All @@ -483,7 +489,7 @@ static InitFunction initFunction([] ()
break;
}

CRGBA color(180, 180, 180);
CRGBA color(180, 180, 180, 120);

g_fontRenderer.DrawText(brandingString, drawRect, color, 22.0f * (gameHeightF / 1440.0f), 1.0f, "Segoe UI");
#endif
Expand Down

0 comments on commit 06aaccb

Please sign in to comment.