feat: durango ui parity & setting name
This commit is contained in:
1 parent
a26fa24890
commit
6878c47f24
8 files changed
+73
-39
No files matched your search
@@ -6580,16 +6580,12 @@ wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
|
||||
#ifdef __PS3__
|
||||
int size = 30;
|
||||
#elif defined _WIN64
|
||||
int size;
|
||||
int size = 30;
|
||||
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
size = 45;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = 30;
|
||||
}
|
||||
#else
|
||||
int size = 45;
|
||||
#endif
|
||||
@@ -6717,16 +6713,12 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
|
||||
#ifdef __PS3__
|
||||
int size = 30;
|
||||
#elif defined _WIN64
|
||||
int size;
|
||||
int size = 30;
|
||||
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
size = 45;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = 30;
|
||||
}
|
||||
#else
|
||||
int size = 45;
|
||||
#endif
|
||||
@@ -6756,15 +6748,11 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
|
||||
#ifdef __PS3__
|
||||
int size = 22;
|
||||
#elif defined _WIN64
|
||||
int size;
|
||||
int size = 22;
|
||||
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
int size = 33;
|
||||
}
|
||||
else
|
||||
{
|
||||
int size = 22;
|
||||
size = 33;
|
||||
}
|
||||
#else
|
||||
int size = 33;
|
||||
|
||||
@@ -151,7 +151,7 @@ void UIComponent_PressStartToPlay::showSaveIcon(bool show)
|
||||
|
||||
void UIComponent_PressStartToPlay::showPlayerDisplayName(bool show)
|
||||
{
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
if(show)
|
||||
{
|
||||
m_playerDisplayName.setLabel(ProfileManager.GetDisplayName(ProfileManager.GetPrimaryPad()));
|
||||
|
||||
@@ -71,7 +71,7 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData,
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,
|
||||
#endif
|
||||
{
|
||||
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
|
||||
@@ -773,9 +773,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
||||
// ensure we've applied this player's settings
|
||||
app.ApplyGameSettingsChanged(iPad);
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
}
|
||||
else
|
||||
@@ -836,7 +834,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
||||
// ensure we've applied this player's settings
|
||||
app.ApplyGameSettingsChanged(iPad);
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
@@ -850,7 +848,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
||||
ProfileManager.DisplayOfflineProfile(&CScene_Main::CreateLoad_OfflineProfileReturned,pClass, ProfileManager.GetPrimaryPad() );
|
||||
#else
|
||||
app.DebugPrintf("Offline Profile returned not implemented\n");
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
@@ -949,7 +947,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in
|
||||
else
|
||||
{
|
||||
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LeaderboardsMenu);
|
||||
@@ -1410,7 +1408,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad)
|
||||
}
|
||||
#else
|
||||
ProfileManager.SetLockedProfile(iPad);
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
@@ -1482,7 +1480,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad)
|
||||
// ensure we've applied this player's settings
|
||||
app.ApplyGameSettingsChanged(iPad);
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
@@ -1611,7 +1609,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad)
|
||||
// If the player was signed in before selecting play, we'll not have read the profile yet, so query the sign-in status to get this to happen
|
||||
ProfileManager.QuerySigninStatus();
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(iPad, eUIScene_LeaderboardsMenu);
|
||||
@@ -1713,7 +1711,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
|
||||
else
|
||||
{
|
||||
ProfileManager.SetLockedProfile(iPad);
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_DLCMainMenu);
|
||||
@@ -2036,7 +2034,7 @@ void UIScene_MainMenu::RunHelpAndOptions(int iPad)
|
||||
#endif
|
||||
{
|
||||
ProfileManager.SetLockedProfile(iPad);
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
|
||||
@@ -2115,7 +2113,7 @@ void UIScene_MainMenu::LoadTrial(void)
|
||||
|
||||
ui.ShowTrialTimer(true);
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
#if defined _XBOX_ONE || _WINDOWS64
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams);
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
//C_4JProfile ProfileManager; //str1k3r - appears to not be needed and this causes a build error
|
||||
wchar_t fakeGamerTagW[32] = L"PlayerName";
|
||||
#endif
|
||||
|
||||
CSentientManager SentientManager;
|
||||
CXuiStringTable StringTable;
|
||||
|
||||
@@ -194,7 +195,11 @@ bool IQNetPlayer::IsHost() { return this == &IQNet::m_player[0]; }
|
||||
bool IQNetPlayer::IsGuest() { return false; }
|
||||
bool IQNetPlayer::IsLocal() { return true; }
|
||||
PlayerUID IQNetPlayer::GetXuid() { return INVALID_XUID; }
|
||||
LPCWSTR IQNetPlayer::GetGamertag() { static const wchar_t *test = L"stub"; return test; }
|
||||
#ifdef _WINDOWS64
|
||||
LPCWSTR IQNetPlayer::GetGamertag() { return fakeGamerTagW; }
|
||||
#else
|
||||
LPCWSTR IQNetPlayer::GetGamertag() { return L"stub"; }
|
||||
#endif
|
||||
int IQNetPlayer::GetSessionIndex() { return 0; }
|
||||
bool IQNetPlayer::IsTalking() { return false; }
|
||||
bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; }
|
||||
@@ -479,12 +484,17 @@ bool C_4JProfile::GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE
|
||||
void C_4JProfile::CancelProfileAvatarRequest() {}
|
||||
int C_4JProfile::GetPrimaryPad() { return 0; }
|
||||
void C_4JProfile::SetPrimaryPad(int iPad) {}
|
||||
char fakeGamerTag[32] = "PlayerName";
|
||||
#ifdef _DURANGO
|
||||
char fakeGamerTag[32] = "PlayerName";
|
||||
void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); }
|
||||
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
|
||||
#else
|
||||
char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; }
|
||||
#elif _WINDOWS64
|
||||
void CConsoleMinecraftApp::SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); size_t chars = 0; mbstowcs_s(&chars, fakeGamerTagW, 32, name, _TRUNCATE); }
|
||||
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
|
||||
wstring C_4JProfile::GetDisplayName(int iPad){ return fakeGamerTagW; }
|
||||
#else //str1k3r - every other platform BUT Windows64 and Durango
|
||||
void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); size_t chars = 0; }
|
||||
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
|
||||
wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; }
|
||||
#endif
|
||||
bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; }
|
||||
|
||||
@@ -126,7 +126,7 @@ void CConsoleMinecraftApp::FatalLoadError()
|
||||
);
|
||||
|
||||
if (result == IDOK) {
|
||||
ExitGame();
|
||||
PostQuitMessage(1); //str1k3r - since this is a fatal load error, exit with a nonzero exitcode
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,3 +233,16 @@ std::wstring CConsoleMinecraftApp::UTF8ToWide(const char* utf8)
|
||||
wstr.resize(size - 1);
|
||||
return wstr;
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::CopyWideArgToAnsi(LPCWSTR source, char* dest, size_t destSize)
|
||||
{
|
||||
if (destSize == 0)
|
||||
return;
|
||||
|
||||
dest[0] = 0;
|
||||
if (source == nullptr)
|
||||
return;
|
||||
|
||||
WideCharToMultiByte(CP_ACP, 0, source, -1, dest, static_cast<int>(destSize), nullptr, nullptr);
|
||||
dest[destSize - 1] = 0;
|
||||
}
|
||||
@@ -5,6 +5,8 @@ class CConsoleMinecraftApp : public CMinecraftApp
|
||||
public:
|
||||
ImageFileBuffer m_ThumbnailBuffer;
|
||||
|
||||
static void SetFakeGamertag(char* name);
|
||||
|
||||
CConsoleMinecraftApp();
|
||||
|
||||
virtual void SetRichPresenceContext(int iPad, int contextId);
|
||||
@@ -27,6 +29,8 @@ public:
|
||||
|
||||
// str1k3r - UTF8 to wchar
|
||||
std::wstring UTF8ToWide(const char* utf8);
|
||||
|
||||
void CopyWideArgToAnsi(LPCWSTR source, char* dest, size_t destSize);
|
||||
};
|
||||
|
||||
extern CConsoleMinecraftApp app;
|
||||
@@ -60,6 +60,8 @@ extern "C"
|
||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
|
||||
}
|
||||
|
||||
char g_Username[32];
|
||||
|
||||
BOOL g_isFullscreen = FALSE;
|
||||
BOOL g_bWidescreen = TRUE;
|
||||
BOOL g_bResolutionSetByCMD = FALSE;
|
||||
@@ -95,6 +97,14 @@ static Windows64LaunchArgs ParseLaunchArgs()
|
||||
{
|
||||
args.resolution = argv[++i][0] - L'0';
|
||||
}
|
||||
}
|
||||
else if (_wcsicmp(argv[i], L"-name") == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
app.CopyWideArgToAnsi(argv[i + 1], g_Username, sizeof(g_Username));
|
||||
app.SetFakeGamertag(g_Username);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +296,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_ENTERMENULOOP:
|
||||
case WM_ENTERSIZEMOVE:
|
||||
SetTimer(hWnd, 1, USER_TIMER_MINIMUM, NULL);
|
||||
break;
|
||||
case WM_EXITMENULOOP:
|
||||
case WM_EXITSIZEMOVE:
|
||||
KillTimer(hWnd, 1);
|
||||
break;
|
||||
@@ -324,7 +336,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -348,7 +360,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = "Minecraft";
|
||||
wcex.lpszClassName = "MinecraftClass";
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
wcex.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MINECRAFTWINDOWS));
|
||||
|
||||
return RegisterClassEx(&wcex);
|
||||
}
|
||||
@@ -489,6 +501,7 @@ HRESULT InitDevice()
|
||||
|
||||
D3D_FEATURE_LEVEL featureLevels[] =
|
||||
{
|
||||
D3D_FEATURE_LEVEL_11_1,
|
||||
D3D_FEATURE_LEVEL_11_0,
|
||||
D3D_FEATURE_LEVEL_10_1,
|
||||
D3D_FEATURE_LEVEL_10_0,
|
||||
@@ -512,9 +525,17 @@ HRESULT InitDevice()
|
||||
for( UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ )
|
||||
{
|
||||
g_driverType = driverTypes[driverTypeIndex];
|
||||
|
||||
hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels,
|
||||
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
|
||||
if( HRESULT_SUCCEEDED( hr ) )
|
||||
|
||||
if (hr == E_INVALIDARG && numFeatureLevels > 1 && featureLevels[0] == D3D_FEATURE_LEVEL_11_1)
|
||||
{
|
||||
hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, &featureLevels[1], numFeatureLevels - 1,
|
||||
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
|
||||
}
|
||||
|
||||
if( SUCCEEDED( hr ) )
|
||||
break;
|
||||
}
|
||||
if( FAILED( hr ) )
|
||||
|
||||
Reference in new issue
Block a user