Merge branch 'main' into dec-2014

This commit is contained in:
Loki Rautio
2026-03-01 13:18:37 -06:00
10 changed files with 86 additions and 32 deletions

22
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,22 @@
# Pull Request Template
## Description
Briefly describe the changes this PR introduces.
## Changes
### Previous Behavior
*Describe how the code behaved before this change.*
### Root Cause
*Explain the core reason behind the erroneous/old behavior (e.g., bug, design flaw, missing edge case).*
### New Behavior
*Describe how the code behaves after this change.*
### Fix Implementation
*Detail exactly how the issue was resolved (specific code changes, algorithms, logic flows).*
## Related Issues
- Fixes #[issue-number]
- Related to #[issue-number]

View File

@@ -384,7 +384,10 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
{
if(type == DLCManager::e_DLCType_All)
// Patch all DLC to be "purchased"
return true;
/*if(type == DLCManager::e_DLCType_All)
{
app.DebugPrintf("Unimplemented\n");
#ifndef _CONTENT_PACKAGE
@@ -408,7 +411,7 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
{
//purchased
return true;
}
}*/
}
void DLCPack::UpdateLanguage()

View File

@@ -205,7 +205,9 @@ bool DLCSkinFile::getParameterAsBool(DLCManager::EDLCParameterType type)
switch(type)
{
case DLCManager::e_DLCParamType_Free:
return m_bIsFree;
// Patch all DLC to be "paid"
return false;
// return m_bIsFree;
default:
return false;
}

View File

@@ -65,7 +65,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
LoadMenuInitData *params = (LoadMenuInitData *)initData;
//m_labelGameName.init(app.GetString(IDS_WORLD_NAME));
m_labelGameName.init(app.GetString(IDS_WORLD_NAME));
m_labelSeed.init(L"");
m_labelCreatedMode.init(app.GetString(IDS_CREATED_IN_SURVIVAL));

View File

@@ -1134,7 +1134,13 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
if(m_packIndex >= SKIN_SELECT_MAX_DEFAULTS)
{
DLCPack *thisPack = app.m_dlcManager.getPack(m_packIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
setCentreLabel(thisPack->getName().c_str());
// Fix the incorrect string type on title to display correctly
const char* name = static_cast<const char*>(thisPack->getName().c_str());
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0);
std::wstring wName(len, 0);
MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len);
setCentreLabel(wName.c_str());
//setCentreLabel(thisPack->getName().c_str());
}
else
{
@@ -1153,7 +1159,13 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
if(nextPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
{
DLCPack *thisPack = app.m_dlcManager.getPack(nextPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
setRightLabel(thisPack->getName().c_str());
// Fix the incorrect string type on title to display correctly
const char* name = static_cast<const char*>(thisPack->getName().c_str());
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0);
std::wstring wName(len, 0);
MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len);
setRightLabel(wName.c_str());
//setRightLabel(thisPack->getName().c_str());
}
else
{
@@ -1172,7 +1184,13 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
if(previousPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
{
DLCPack *thisPack = app.m_dlcManager.getPack(previousPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
setLeftLabel(thisPack->getName().c_str());
// Fix the incorrect string type on title to display correctly
const char* name = static_cast<const char*>(thisPack->getName().c_str());
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0);
std::wstring wName(len, 0);
MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len);
setLeftLabel(wName.c_str());
//setLeftLabel(thisPack->getName().c_str());
}
else
{

View File

@@ -1468,7 +1468,12 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata"</Command>
<PostBuildEvent>
<Message>Copying sound assets to output directory</Message>
<Command>xcopy /q /y /i /s /e "$(ProjectDir)Durango\Sound" "$(OutDir)Durango\Sound"
xcopy /q /y /i /s /e "$(ProjectDir)music" "$(OutDir)music"</Command>
xcopy /q /y /i /s /e "$(ProjectDir)music" "$(OutDir)music"
xcopy /q /y /i /s /e "$(ProjectDir)Windows64\GameHDD" "$(OutDir)Windows64\GameHDD"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Media" "$(OutDir)Common\Media"
xcopy /q /y /i /s /e "$(ProjectDir)Common\res" "$(OutDir)Common\res"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Trial" "$(OutDir)Common\Trial"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Tutorial" "$(OutDir)Common\Tutorial"</Command>
</PostBuildEvent>
<ImageXex>
<ConfigurationFile>$(ProjectDir)xbox\xex-dev.xml</ConfigurationFile>
@@ -1602,7 +1607,12 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU</C
<PostBuildEvent>
<Message>Copying sound assets to output directory</Message>
<Command>xcopy /q /y /i /s /e "$(ProjectDir)Durango\Sound" "$(OutDir)Durango\Sound"
xcopy /q /y /i /s /e "$(ProjectDir)music" "$(OutDir)music"</Command>
xcopy /q /y /i /s /e "$(ProjectDir)music" "$(OutDir)music"
xcopy /q /y /i /s /e "$(ProjectDir)Windows64\GameHDD" "$(OutDir)Windows64\GameHDD"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Media" "$(OutDir)Common\Media"
xcopy /q /y /i /s /e "$(ProjectDir)Common\res" "$(OutDir)Common\res"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Trial" "$(OutDir)Common\Trial"
xcopy /q /y /i /s /e "$(ProjectDir)Common\Tutorial" "$(OutDir)Common\Tutorial"</Command>
</PostBuildEvent>
<ImageXex>
<ConfigurationFile>$(ProjectDir)xbox\xex-dev.xml</ConfigurationFile>

View File

@@ -14,6 +14,7 @@ CConsoleMinecraftApp app;
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
{
m_bShutdown = false;
}
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId)
@@ -26,8 +27,7 @@ void CConsoleMinecraftApp::StoreLaunchData()
}
void CConsoleMinecraftApp::ExitGame()
{
// This is likely not the correct way to exit the game, but it will do for now
ExitProcess(0);
m_bShutdown = true;
}
void CConsoleMinecraftApp::FatalLoadError()
{

View File

@@ -29,6 +29,8 @@ public:
// original code
virtual void TemporaryCreateGameStart();
bool m_bShutdown;
};
extern CConsoleMinecraftApp app;

View File

@@ -716,26 +716,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
WCHAR exePath[MAX_PATH] = { 0 };
GetModuleFileNameW(NULL, exePath, MAX_PATH);
WCHAR* lastSlash = wcsrchr(exePath, L'\\');
if (lastSlash) {
*lastSlash = L'\0';
WCHAR devCheckPath[MAX_PATH] = { 0 };
swprintf_s(devCheckPath, MAX_PATH, L"%s\\..\\..\\Minecraft.Client\\Minecraft.Client.vcxproj", exePath);
if (GetFileAttributesW(devCheckPath) != INVALID_FILE_ATTRIBUTES) {
WCHAR projectPath[MAX_PATH] = { 0 };
swprintf_s(projectPath, MAX_PATH, L"%s\\..\\..\\Minecraft.Client", exePath);
SetCurrentDirectoryW(projectPath);
}
else {
SetCurrentDirectoryW(exePath);
}
}
// Declare DPI awareness so GetSystemMetrics returns physical pixels
SetProcessDPIAware();
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
@@ -1054,7 +1034,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
#endif
MSG msg = {0};
while( WM_QUIT != msg.message )
while( WM_QUIT != msg.message && !app.m_bShutdown)
{
if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{

View File

@@ -15,6 +15,23 @@ This project contains the source code of Minecraft Legacy Console Edition v1.3.0
- Added fullscreen mode support (toggle using F11)
- Disabled V-Sync for better performance
- Auto-detect native monitor resolution with DPI awareness, resulting in sharper visuals on high-resolution displays
- Full support for keyboard and mouse input
## Controls (Keyboard & Mouse)
- **Movement**: `W` `A` `S` `D`
- **Jump / Fly (Up)**: `Space`
- **Sneak / Fly (Down)**: `Shift` (Hold)
- **Sprint**: `Ctrl` (Hold)
- **Inventory**: `E`
- **Drop Item**: `Q`
- **Crafting**: `C`
- **Toggle View (FPS/TPS)**: `F5`
- **Fullscreen**: `F11`
- **Pause Menu**: `Esc`
- **Attack / Destroy**: `Left Click`
- **Use / Place**: `Right Click`
- **Select Item**: `Mouse Wheel` or keys `1` to `9`
## Build & Run