mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
add method for drawing shadows with custom shadow color & added scale formatting to chat history
This commit is contained in:
parent
38e25b1670
commit
a03bfc8789
|
|
@ -251,6 +251,12 @@ void Font::drawShadowLiteral(const wstring& str, int x, int y, int color)
|
|||
drawLiteral(str, x, y, color);
|
||||
}
|
||||
|
||||
void Font::drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor)
|
||||
{
|
||||
drawLiteral(str, x + 1, y + 1, shadowColor);
|
||||
drawLiteral(str, x, y, color);
|
||||
}
|
||||
|
||||
void Font::drawLiteral(const wstring& str, int x, int y, int color)
|
||||
{
|
||||
if (str.empty()) return;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ private:
|
|||
public:
|
||||
void drawShadow(const wstring& str, int x, int y, int color);
|
||||
void drawShadowLiteral(const wstring& str, int x, int y, int color); // draw without interpreting § codes
|
||||
void drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor); // custom shadow color
|
||||
void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param
|
||||
void draw(const wstring &str, int x, int y, int color);
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -972,6 +972,28 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
glDisable(GL_ALPHA_TEST);
|
||||
|
||||
#if defined(_WINDOWS64)
|
||||
int uiSetting = app.GetGameSettings(iPad, eGameSetting_UISize);
|
||||
|
||||
float scaleFactor = 1.0f;
|
||||
float textScale = 0.6f;
|
||||
int backgroundtop = 13;
|
||||
|
||||
if (uiSetting == 0)
|
||||
{
|
||||
textScale = textScale * 1.5;
|
||||
int backgroundtop = 10;
|
||||
}
|
||||
else if (uiSetting == 1)
|
||||
{
|
||||
textScale = textScale * 1;
|
||||
int backgroundtop = 13;
|
||||
}
|
||||
else if (uiSetting == 2)
|
||||
{
|
||||
textScale = textScale * 0.75;
|
||||
int backgroundtop = 16;
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0f, static_cast<float>(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f);
|
||||
|
||||
|
|
@ -1007,8 +1029,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
|
||||
glPushMatrix();
|
||||
glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0);
|
||||
glScalef(0.6f, 0.6f, 1.0f);
|
||||
font->drawShadowLiteral(msg, 0, 0, 0xffffff + (alpha << 24));
|
||||
glScalef(textScale, textScale, scaleFactor);
|
||||
font->drawShadowLiteralCustom(msg, 0, 0, 0xffffff + (alpha << 24), 0x000000 + (alpha << 24));
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue