aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp88
1 files changed, 87 insertions, 1 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp
index 6eb22b09..d7196849 100644
--- a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp
+++ b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp
@@ -232,6 +232,92 @@ void UIScene_InGamePlayerOptionsMenu::updateTooltips()
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
}
+void UIScene_InGamePlayerOptionsMenu::handleReload()
+{
+ UIScene::handleReload();
+
+ INetworkPlayer *localPlayer = g_NetworkManager.GetLocalPlayerByUserIndex( m_iPad );
+ INetworkPlayer *editingPlayer = g_NetworkManager.GetPlayerBySmallId(m_networkSmallId);
+
+ bool trustPlayers = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0;
+ bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
+ m_editingSelf = (localPlayer != NULL && localPlayer == editingPlayer);
+
+ if( m_editingSelf || trustPlayers || editingPlayer->IsHost())
+ {
+ removeControl( &m_checkboxes[eControl_BuildAndMine], true );
+ removeControl( &m_checkboxes[eControl_UseDoorsAndSwitches], true );
+ removeControl( &m_checkboxes[eControl_UseContainers], true );
+ removeControl( &m_checkboxes[eControl_AttackPlayers], true );
+ removeControl( &m_checkboxes[eControl_AttackAnimals], true );
+ }
+
+ if(m_editingSelf)
+ {
+#if (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED))
+ removeControl( &m_checkboxes[eControl_Op], true );
+#endif
+
+ removeControl( &m_buttonKick, true );
+ removeControl( &m_checkboxes[eControl_CheatTeleport], true );
+
+ if(cheats)
+ {
+ bool inCreativeMode = Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode) != 0;
+ if(inCreativeMode)
+ {
+ removeControl( &m_checkboxes[eControl_HostFly], true );
+ removeControl( &m_checkboxes[eControl_HostHunger], true );
+ }
+ }
+ else
+ {
+ removeControl( &m_checkboxes[eControl_HostInvisible], true );
+ removeControl( &m_checkboxes[eControl_HostFly], true );
+ removeControl( &m_checkboxes[eControl_HostHunger], true );
+ }
+ }
+ else
+ {
+ if(!localPlayer->IsHost())
+ {
+ removeControl( &m_checkboxes[eControl_Op], true );
+ }
+
+ if(localPlayer->IsHost() && cheats )
+ {
+
+ bool inCreativeMode = Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode) != 0;
+ if(inCreativeMode)
+ {
+ removeControl( &m_checkboxes[eControl_HostFly], true );
+ removeControl( &m_checkboxes[eControl_HostHunger], true );
+ }
+ }
+ else
+ {
+ removeControl( &m_checkboxes[eControl_HostInvisible], true );
+ removeControl( &m_checkboxes[eControl_HostFly], true );
+ removeControl( &m_checkboxes[eControl_HostHunger], true );
+ removeControl( &m_checkboxes[eControl_CheatTeleport], true );
+ }
+
+
+ // Can only kick people if they are not local, and not local to the host
+ if(editingPlayer->IsLocal() == TRUE || editingPlayer->IsSameSystem(g_NetworkManager.GetHostPlayer()) == TRUE)
+ {
+ removeControl( &m_buttonKick, true );
+ }
+ }
+
+ short colourIndex = app.GetPlayerColour( m_networkSmallId );
+ IggyDataValue result;
+ IggyDataValue value[1];
+ value[0].type = IGGY_DATATYPE_number;
+ value[0].number = colourIndex;
+ IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetPlayerIcon , 1 , value );
+}
+
void UIScene_InGamePlayerOptionsMenu::tick()
{
UIScene::tick();
@@ -352,7 +438,7 @@ void UIScene_InGamePlayerOptionsMenu::handlePress(F64 controlId, F64 childId)
uiIDA[0]=IDS_CONFIRM_OK;
uiIDA[1]=IDS_CONFIRM_CANCEL;
- ui.RequestMessageBox(IDS_UNLOCK_KICK_PLAYER_TITLE, IDS_UNLOCK_KICK_PLAYER, uiIDA, 2, m_iPad,&UIScene_InGamePlayerOptionsMenu::KickPlayerReturned,smallId,app.GetStringTable(),NULL,0,false);
+ ui.RequestAlertMessage(IDS_UNLOCK_KICK_PLAYER_TITLE, IDS_UNLOCK_KICK_PLAYER, uiIDA, 2, m_iPad,&UIScene_InGamePlayerOptionsMenu::KickPlayerReturned,smallId);
}
break;
};