This commit is contained in:
troglodyte9 2026-03-06 21:36:02 +02:00
commit 36d2adddac
7 changed files with 76 additions and 23 deletions

View file

@ -753,7 +753,7 @@ void UIScene_HUD::handleTimerComplete(int id)
float opacity = pGui->getOpacity(m_iPad, i); float opacity = pGui->getOpacity(m_iPad, i);
if( opacity > 0 ) if( opacity > 0 )
{ {
#ifdef _WINDOWS64 #if 0 // def _WINDOWS64 // Use Iggy chat until Gui::render has visual parity
// Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats. // Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats.
m_controlLabelBackground[i].setOpacity(0); m_controlLabelBackground[i].setOpacity(0);
m_labelChatText[i].setOpacity(0); m_labelChatText[i].setOpacity(0);

View file

@ -146,6 +146,44 @@ void Font::renderStyleLine(float x0, float y0, float x1, float y1)
t->end(); t->end();
} }
void Font::addCharacterQuad(wchar_t c)
{
float xOff = c % m_cols * m_charWidth;
float yOff = c / m_cols * m_charWidth;
float width = charWidths[c] - .01f;
float height = m_charHeight - .01f;
float fontWidth = m_cols * m_charWidth;
float fontHeight = m_rows * m_charHeight;
const float shear = m_italic ? (height * 0.25f) : 0.0f;
float x0 = xPos, x1 = xPos + width + shear;
float y0 = yPos, y1 = yPos + height;
Tesselator *t = Tesselator::getInstance();
t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight);
t->vertex(x0, y1, 0.0f);
t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight);
t->vertex(x1, y1, 0.0f);
t->tex((xOff + width) / fontWidth, yOff / fontHeight);
t->vertex(x1, y0, 0.0f);
t->tex(xOff / fontWidth, yOff / fontHeight);
t->vertex(x0, y0, 0.0f);
if (m_bold)
{
float dx = 1.0f;
t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight);
t->vertex(x0 + dx, y1, 0.0f);
t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight);
t->vertex(x1 + dx, y1, 0.0f);
t->tex((xOff + width) / fontWidth, yOff / fontHeight);
t->vertex(x1 + dx, y0, 0.0f);
t->tex(xOff / fontWidth, yOff / fontHeight);
t->vertex(x0 + dx, y0, 0.0f);
}
xPos += static_cast<float>(charWidths[c]);
}
void Font::renderCharacter(wchar_t c) void Font::renderCharacter(wchar_t c)
{ {
float xOff = c % m_cols * m_charWidth; float xOff = c % m_cols * m_charWidth;
@ -255,11 +293,13 @@ void Font::draw(const wstring &str, bool dropShadow)
{ {
// Bind the texture // Bind the texture
textures->bindTexture(m_textureLocation); textures->bindTexture(m_textureLocation);
bool noise = false; bool noise = false;
m_bold = m_italic = m_underline = m_strikethrough = false; m_bold = m_italic = m_underline = m_strikethrough = false;
wstring cleanStr = sanitize(str); wstring cleanStr = sanitize(str);
Tesselator *t = Tesselator::getInstance();
t->begin();
for (int i = 0; i < static_cast<int>(cleanStr.length()); ++i) for (int i = 0; i < static_cast<int>(cleanStr.length()); ++i)
{ {
// Map character // Map character
@ -270,8 +310,10 @@ void Font::draw(const wstring &str, bool dropShadow)
wchar_t ca = cleanStr[i+1]; wchar_t ca = cleanStr[i+1];
if (!isSectionFormatCode(ca)) if (!isSectionFormatCode(ca))
{ {
t->end();
renderCharacter(167); renderCharacter(167);
renderCharacter(ca); renderCharacter(ca);
t->begin();
i += 1; i += 1;
continue; continue;
} }
@ -294,14 +336,10 @@ void Font::draw(const wstring &str, bool dropShadow)
{ {
noise = false; noise = false;
if (colorN < 0 || colorN > 15) colorN = 15; if (colorN < 0 || colorN > 15) colorN = 15;
if (dropShadow) colorN += 16; if (dropShadow) colorN += 16;
int color = colors[colorN]; int color = colors[colorN];
glColor3f((color >> 16) / 255.0F, ((color >> 8) & 255) / 255.0F, (color & 255) / 255.0F); glColor3f((color >> 16) / 255.0F, ((color >> 8) & 255) / 255.0F, (color & 255) / 255.0F);
} }
i += 1; i += 1;
continue; continue;
} }
@ -317,8 +355,10 @@ void Font::draw(const wstring &str, bool dropShadow)
c = newc; c = newc;
} }
renderCharacter(c); addCharacterQuad(c);
} }
t->end();
} }
void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow) void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow)

View file

@ -47,6 +47,7 @@ public:
private: private:
void renderCharacter(wchar_t c); // 4J added void renderCharacter(wchar_t c); // 4J added
void addCharacterQuad(wchar_t c);
void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough
public: public:

View file

@ -971,7 +971,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
#if defined(_WINDOWS64) #if 0 // defined(_WINDOWS64) // Temporarily disable this chat in favor of iggy chat until we have better visual parity
glPushMatrix(); glPushMatrix();
glTranslatef(0.0f, static_cast<float>(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); glTranslatef(0.0f, static_cast<float>(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f);

View file

@ -1522,7 +1522,7 @@ void Minecraft::run_middle()
} }
#endif #endif
#ifndef _FINAL_BUILD #if _DEBUG // ndef _FINAL_BUILD // Disable conflicting debug functionality in release builds
if( app.DebugSettingsOn() && app.GetUseDPadForDebug() ) if( app.DebugSettingsOn() && app.GetUseDPadForDebug() )
{ {
localplayers[i]->ullDpad_last = 0; localplayers[i]->ullDpad_last = 0;
@ -3651,7 +3651,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
if (player->missTime > 0) player->missTime--; if (player->missTime > 0) player->missTime--;
#ifdef _DEBUG_MENUS_ENABLED #ifdef _DEBUG//_MENUS_ENABLED // disable DPad cheats on release builds
if(app.DebugSettingsOn()) if(app.DebugSettingsOn())
{ {
#ifndef __PSVITA__ #ifndef __PSVITA__

View file

@ -587,7 +587,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
else if (vk == VK_MENU) else if (vk == VK_MENU)
vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU; vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU;
g_KBMInput.OnKeyDown(vk); g_KBMInput.OnKeyDown(vk);
break; return DefWindowProc(hWnd, message, wParam, lParam);
} }
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYUP: case WM_SYSKEYUP:

View file

@ -34,30 +34,42 @@ Basic LAN multiplayer is available on the Windows build
- Other players on the same LAN can discover the session from the in-game Join Game menu - Other players on the same LAN can discover the session from the in-game Join Game menu
- Game connections use TCP port `25565` by default - Game connections use TCP port `25565` by default
- LAN discovery uses UDP port `25566` - LAN discovery uses UDP port `25566`
- Add servers to your server list with `servers.txt` (temp solution)
- Rename yourself without losing data by keeping your `uid.dat`
This feature is based on [LCEMP](https://github.com/LCEMP/LCEMP) Parts of this feature are based on code from [LCEMP](https://github.com/LCEMP/LCEMP) (thanks!)
### servers.txt
To add a server to your game, create the `servers.txt` file in the same directory as you have `Minecraft.Client.exe`. Inside, follow this format:
```
serverip.example.com
25565
The name of your server in UI!
```
For example, here's a valid servers.txt
```
1.1.1.1
25565
Cloudflare's Very Own LCE Server
127.0.0.1
25565
Localhost Test Crap
```
### Launch Arguments ### Launch Arguments
| Argument | Description | | Argument | Description |
|--------------------|-----------------------------------------------------------------------------------------------------| |--------------------|-----------------------------------------------------------------------------------------------------|
| `-name <username>` | Sets your in-game username. | | `-name <username>` | Sets your in-game username. |
| `-server` | Launches a headless server instead of the client. | | `-fullscreen` | Launches the game in Fullscreen mode |
| `-ip <address>` | Client mode: manually connect to an IP. Server mode: override the bind IP from `server.properties`. |
| `-port <port>` | Client mode: override the join port. Server mode: override the listen port from `server.properties`.|
Example: Example:
``` ```
Minecraft.Client.exe -name Steve -ip 192.168.0.25 -port 25565 Minecraft.Client.exe -name Steve -fullscreen
``` ```
Headless server example:
```
Minecraft.Client.exe -server -ip 0.0.0.0 -port 25565
```
The headless server also reads and writes `server.properties` in the working directory. If `-ip` / `-port` are omitted in `-server` mode, it falls back to `server-ip` / `server-port` from that file. Dedicated-server host options such as `trust-players`, `pvp`, `fire-spreads`, `tnt`, `difficulty`, `gamemode`, `spawn-animals`, and `spawn-npcs` are persisted there as well.
## Controls (Keyboard & Mouse) ## Controls (Keyboard & Mouse)
- **Movement**: `W` `A` `S` `D` - **Movement**: `W` `A` `S` `D`