Merge remote-tracking branch 'itsRevela/main'
# Conflicts: # .github/workflows/nightly.yml # .gitignore # Minecraft.Client/ChatScreen.cpp # Minecraft.Client/ClientConnection.cpp # Minecraft.Client/Common/Audio/SoundEngine.cpp # Minecraft.Client/Common/Audio/SoundEngine.h # Minecraft.Client/Common/Media/MediaWindows64.arc # Minecraft.Client/Common/UI/IUIScene_HUD.cpp # Minecraft.Client/Common/UI/UIControl_Base.cpp # Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp # Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp # Minecraft.Client/Common/XUI/XUI_Chat.cpp # Minecraft.Client/Common/XUI/XUI_Death.cpp # Minecraft.Client/Font.cpp # Minecraft.Client/Gui.cpp # Minecraft.Client/PendingConnection.cpp # Minecraft.Client/PlayerConnection.cpp # Minecraft.Client/PlayerConnection.h # Minecraft.Client/PlayerList.cpp # Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp # Minecraft.Client/Windows64/Network/WinsockNetLayer.h # Minecraft.Client/Windows64Media/strings.h # Minecraft.Client/cmake/sources/Common.cmake # Minecraft.Server/Console/ServerCliEngine.cpp # Minecraft.Server/Console/commands/whitelist/CliCommandWhitelist.cpp # Minecraft.Server/Windows64/ServerMain.cpp # Minecraft.World/WitherBoss.h # Minecraft.World/cmake/sources/Common.cmake # README.md
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "XUI_Chat.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../Gui.h"
|
||||
#include "../../../Minecraft.World\ArabicShaping.h"
|
||||
|
||||
HRESULT CScene_Chat::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
@@ -29,7 +30,8 @@ HRESULT CScene_Chat::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled)
|
||||
{
|
||||
m_Backgrounds[i].SetOpacity(opacity);
|
||||
m_Labels[i].SetOpacity(opacity);
|
||||
m_Labels[i].SetText( pGui->getMessage(m_iPad,i).c_str() );
|
||||
wstring shaped = shapeArabicText(pGui->getMessage(m_iPad, i));
|
||||
m_Labels[i].SetText( shaped.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "XUI_Ctrl_4JList.h"
|
||||
#include "..\..\..\Minecraft.World\ArabicShaping.h"
|
||||
|
||||
static bool TimeSortFn(const void *a, const void *b);
|
||||
|
||||
@@ -294,8 +295,16 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceT
|
||||
if( ( 0 == pGetSourceTextData->iData ) && ( ( pGetSourceTextData->bItemData ) ) )
|
||||
{
|
||||
EnterCriticalSection(&m_AccessListData);
|
||||
pGetSourceTextData->szText =
|
||||
GetData(pGetSourceTextData->iItem).pwszText;
|
||||
LPCWSTR rawText = GetData(pGetSourceTextData->iItem).pwszText;
|
||||
if (rawText)
|
||||
{
|
||||
m_shapedTextCache = shapeArabicText(rawText);
|
||||
pGetSourceTextData->szText = m_shapedTextCache.c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
pGetSourceTextData->szText = rawText;
|
||||
}
|
||||
LeaveCriticalSection(&m_AccessListData);
|
||||
bHandled = TRUE;
|
||||
}
|
||||
|
||||
@@ -75,4 +75,5 @@ private:
|
||||
static bool IndexSortFn(const void *a, const void *b);
|
||||
|
||||
HXUIOBJ m_hSelectionChangedHandlerObj;
|
||||
std::wstring m_shapedTextCache; // temp buffer for Arabic-shaped text in OnGetSourceDataText
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "../XUI/XUI_Death.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include "../../../Minecraft.World/AABB.h"
|
||||
#include "../../../Minecraft.World/Vec3.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.stats.h"
|
||||
@@ -17,10 +18,13 @@
|
||||
#include "../../../Minecraft.Client/LevelRenderer.h"
|
||||
#include "../../../Minecraft.World/Pos.h"
|
||||
#include "../../../Minecraft.World/Dimension.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.level.storage.h"
|
||||
#include "../../../Minecraft.World/compression.h"
|
||||
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../MinecraftServer.h"
|
||||
#include "../../Options.h"
|
||||
#include "../../LocalPlayer.h"
|
||||
#include "../../../Minecraft.World/compression.h"
|
||||
//----------------------------------------------------------------------------------
|
||||
// Performs initialization tasks - retrieves controls.
|
||||
//----------------------------------------------------------------------------------
|
||||
@@ -37,9 +41,26 @@ HRESULT CScene_Death::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
}
|
||||
|
||||
XuiControlSetText(m_Title,app.GetString(IDS_YOU_DIED));
|
||||
XuiControlSetText(m_Buttons[BUTTON_DEATH_RESPAWN],app.GetString(IDS_RESPAWN));
|
||||
XuiControlSetText(m_Buttons[BUTTON_DEATH_EXITGAME],app.GetString(IDS_EXIT_GAME));
|
||||
|
||||
// 4J Added: In hardcore mode, disable respawn and show hardcore death message
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
bool isHardcore = false;
|
||||
if (pMinecraft != nullptr && pMinecraft->level != nullptr)
|
||||
{
|
||||
isHardcore = pMinecraft->level->getLevelData()->isHardcore();
|
||||
}
|
||||
|
||||
if (isHardcore)
|
||||
{
|
||||
XuiControlSetText(m_Buttons[BUTTON_DEATH_RESPAWN], app.GetString(IDS_HARDCORE_DEATH_MESSAGE));
|
||||
XuiElementSetShow(m_Buttons[BUTTON_DEATH_RESPAWN], FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
XuiControlSetText(m_Buttons[BUTTON_DEATH_RESPAWN], app.GetString(IDS_RESPAWN));
|
||||
}
|
||||
|
||||
// Display the tooltips
|
||||
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT);
|
||||
|
||||
@@ -110,7 +131,16 @@ HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti
|
||||
playTime = static_cast<int>(pMinecraft->localplayers[pNotifyPressData->UserIndex]->getSessionTimer());
|
||||
}
|
||||
TelemetryManager->RecordLevelExit(pNotifyPressData->UserIndex, eSen_LevelExitStatus_Failed);
|
||||
|
||||
|
||||
// 4J Added: Hardcore mode — skip save dialog, exit without saving, delete world
|
||||
if (pMinecraft->level != nullptr && pMinecraft->level->getLevelData()->isHardcore() && g_NetworkManager.IsHost())
|
||||
{
|
||||
MinecraftServer::getInstance()->setSaveOnExit(false);
|
||||
MinecraftServer::getInstance()->setDeleteWorldOnExit(true);
|
||||
app.SetAction(pNotifyPressData->UserIndex, eAppAction_ExitWorld);
|
||||
break;
|
||||
}
|
||||
|
||||
if(StorageManager.GetSaveDisabled())
|
||||
{
|
||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||
@@ -172,6 +202,12 @@ HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti
|
||||
break;
|
||||
case BUTTON_DEATH_RESPAWN:
|
||||
{
|
||||
// 4J Added: Safeguard - don't respawn in hardcore mode
|
||||
Minecraft *pMC = Minecraft::GetInstance();
|
||||
if (pMC != nullptr && pMC->level != nullptr && pMC->level->getLevelData()->isHardcore())
|
||||
{
|
||||
break;
|
||||
}
|
||||
m_bIgnoreInput = true;
|
||||
app.SetAction(pNotifyPressData->UserIndex,eAppAction_Respawn);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,8 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
if (pMinecraft->localplayers[m_iPad]->invulnerableTime < 10) blink = false;
|
||||
int iHealth = pMinecraft->localplayers[m_iPad]->getHealth();
|
||||
int iLastHealth = pMinecraft->localplayers[m_iPad]->lastHealth;
|
||||
bool bHasPoison = pMinecraft->localplayers[m_iPad]->hasEffect(MobEffect::poison);
|
||||
bool bHasPoison = pMinecraft->localplayers[m_iPad]->hasEffect(MobEffect::poison);
|
||||
bool isHardcore = pMinecraft->level != nullptr && pMinecraft->level->getLevelData()->isHardcore();
|
||||
for (int icon = 0; icon < Player::MAX_HEALTH / 2; icon++)
|
||||
{
|
||||
if(blink)
|
||||
@@ -196,11 +197,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
// Full
|
||||
if(bHasPoison)
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"FullPoisonFlash",nullptr,L"FullPoisonFlash");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"FullPoisonFlashHardcore" : L"FullPoisonFlash", nullptr,
|
||||
isHardcore ? L"FullPoisonFlashHardcore" : L"FullPoisonFlash");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"FullFlash",nullptr,L"FullFlash");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"FullFlashHardcore" : L"FullFlash", nullptr,
|
||||
isHardcore ? L"FullFlashHardcore" : L"FullFlash");
|
||||
}
|
||||
}
|
||||
else if (icon * 2 + 1 == iLastHealth || icon * 2 + 1 == iHealth)
|
||||
@@ -208,17 +213,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
// Half
|
||||
if(bHasPoison)
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"HalfPoisonFlash",nullptr,L"HalfPoisonFlash");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"HalfPoisonFlashHardcore" : L"HalfPoisonFlash", nullptr,
|
||||
isHardcore ? L"HalfPoisonFlashHardcore" : L"HalfPoisonFlash");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"HalfFlash",nullptr,L"HalfFlash");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"HalfFlashHardcore" : L"HalfFlash", nullptr,
|
||||
isHardcore ? L"HalfFlashHardcore" : L"HalfFlash");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Empty
|
||||
m_healthIcon[icon].PlayVisualRange(L"NormalFlash",nullptr,L"NormalFlash");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"NormalFlashHardcore" : L"NormalFlash", nullptr,
|
||||
isHardcore ? L"NormalFlashHardcore" : L"NormalFlash");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -228,11 +239,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
// Full
|
||||
if(bHasPoison)
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"FullPoison",nullptr,L"FullPoison");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"FullPoisonHardcore" : L"FullPoison", nullptr,
|
||||
isHardcore ? L"FullPoisonHardcore" : L"FullPoison");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"Full",nullptr,L"Full");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"FullHardcore" : L"Full", nullptr,
|
||||
isHardcore ? L"FullHardcore" : L"Full");
|
||||
}
|
||||
}
|
||||
else if (icon * 2 + 1 == iHealth)
|
||||
@@ -240,17 +255,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
// Half
|
||||
if(bHasPoison)
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"HalfPoison",nullptr,L"HalfPoison");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"HalfPoisonHardcore" : L"HalfPoison", nullptr,
|
||||
isHardcore ? L"HalfPoisonHardcore" : L"HalfPoison");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_healthIcon[icon].PlayVisualRange(L"Half",nullptr,L"Half");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"HalfHardcore" : L"Half", nullptr,
|
||||
isHardcore ? L"HalfHardcore" : L"Half");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Empty
|
||||
m_healthIcon[icon].PlayVisualRange(L"Normal",nullptr,L"Normal");
|
||||
m_healthIcon[icon].PlayVisualRange(
|
||||
isHardcore ? L"NormalHardcore" : L"Normal", nullptr,
|
||||
isHardcore ? L"NormalHardcore" : L"Normal");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user