Merge branch 'achievement-integration' into 'main'

Achievement integration

See merge request whispers-lce/client!2
This commit is contained in:
Whisper W
2026-03-02 08:14:25 -05:00
33 changed files with 148 additions and 69 deletions

View File

@@ -25,7 +25,12 @@ AchievementPopup::AchievementPopup(Minecraft *mc)
void AchievementPopup::popup(Achievement *ach)
{
title = I18n::get(L"achievement.get");
desc = ach->name;
if (title == L"achievement.get")
title = L"Achievement Get!";
desc = I18n::get(ach->name);
if (desc == ach->name)
desc = ach->getDescription();
startTime = System::currentTimeMillis();
this->ach = ach;
isHelper = false;
@@ -69,7 +74,7 @@ void AchievementPopup::prepareWindow()
void AchievementPopup::render()
{
// 4J Unused
#if 0
if (Minecraft::warezTime > 0)
{
glDisable(GL_DEPTH_TEST);
@@ -115,17 +120,17 @@ void AchievementPopup::render()
int xx = width - 160;
int yy = 0 - (int) (yo * 36);
int tex = mc->textures->loadTexture(L"/achievement/bg.png");
glColor4f(1, 1, 1, 1);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, tex);
mc->textures->bindTexture(L"/achievement/bg.png");
glColor4f(1, 1, 1, 1);
glDisable(GL_LIGHTING);
blit(xx, yy, 96, 202, 160, 32);
if (isHelper)
{
mc->font->drawWordWrap(desc, xx + 30, yy + 7, 120, 0xffffffff);
mc->font->draw(title, xx + 30, yy + 7, 0xffffff00);
mc->font->draw(desc, xx + 30, yy + 18, 0xffffffff);
}
else
{
@@ -147,5 +152,5 @@ void AchievementPopup::render()
glDepthMask(true);
glEnable(GL_DEPTH_TEST);
#endif
}

View File

@@ -157,8 +157,6 @@ void AchievementScreen::renderLabels()
void AchievementScreen::renderBg(int xm, int ym, float a)
{
// 4J Unused
#if 0
int xScroll = Mth::floor(xScrollO + (xScrollP - xScrollO) * a);
int yScroll = Mth::floor(yScrollO + (yScrollP - yScrollO) * a);
@@ -168,8 +166,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
if (yScroll >= yMax) yScroll = yMax - 1;
int terrainTex = minecraft->textures->loadTexture(L"/terrain.png");
int tex = minecraft->textures->loadTexture(L"/achievement/bg.png");
// Textures bound inline at usage sites via bindTexture()
int xo = (width - imageWidth) / 2;
int yo = (height - imageHeight) / 2;
@@ -189,7 +186,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
glEnable(GL_RESCALE_NORMAL);
glEnable(GL_COLOR_MATERIAL);
minecraft->textures->bind(terrainTex);
minecraft->textures->bindTexture(L"/terrain.png");
int leftTile = (xScroll + EDGE_VALUE_X) >> 4;
int topTile = (yScroll + EDGE_VALUE_Y) >> 4;
@@ -202,6 +199,16 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
const int diamondLevel = (Achievements::ACHIEVEMENT_HEIGHT_POSITION * 19) / 10;
const int bedrockLevel = (Achievements::ACHIEVEMENT_HEIGHT_POSITION * 31) / 10;
// Standard terrain.png tile indices (16-wide atlas, row*16+col)
const int TEX_SAND = 18; // row 1, col 2
const int TEX_BEDROCK = 17; // row 1, col 1
const int TEX_DIAMOND_ORE = 50; // row 3, col 2
const int TEX_REDSTONE_ORE = 51; // row 3, col 3
const int TEX_IRON_ORE = 33; // row 2, col 1
const int TEX_COAL_ORE = 34; // row 2, col 2
const int TEX_STONE = 1; // row 0, col 1
const int TEX_DIRT = 2; // row 0, col 2
Random *random = new Random();
for (int tileY = 0; (tileY * 16) - yMod < BIGMAP_HEIGHT; tileY++)
@@ -216,38 +223,38 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
random->setSeed(1234 + leftTile + tileX);
random->nextInt();
int heightValue = random->nextInt(1 + topTile + tileY) + (topTile + tileY) / 2;
int tileType = Tile::sand->tex;
int tileType = TEX_SAND;
if (heightValue > bedrockLevel || (topTile + tileY) == MAX_BG_TILE_Y)
{
tileType = Tile::unbreakable->tex;
tileType = TEX_BEDROCK;
}
else if (heightValue == diamondLevel)
{
if (random->nextInt(2) == 0)
{
tileType = Tile::diamondOre->tex;
tileType = TEX_DIAMOND_ORE;
}
else
{
tileType = Tile::redStoneOre->tex;
tileType = TEX_REDSTONE_ORE;
}
}
else if (heightValue == ironLevel)
{
tileType = Tile::ironOre->tex;
tileType = TEX_IRON_ORE;
}
else if (heightValue == coalLevel)
{
tileType = Tile::coalOre->tex;
tileType = TEX_COAL_ORE;
}
else if (heightValue > rockLevel)
{
tileType = Tile::rock->tex;
tileType = TEX_STONE;
}
else if (heightValue > 0)
{
tileType = Tile::dirt->tex;
tileType = TEX_DIRT;
}
this->blit(xBigMap + tileX * 16 - xMod, yBigMap + tileY * 16 - yMod, (tileType % 16) << 4, (tileType >> 4) << 4, 16, 16);
@@ -326,7 +333,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
glColor4f(br, br, br, 1);
}
minecraft->textures->bind(tex);
minecraft->textures->bindTexture(L"/achievement/bg.png");
int xx = xBigMap + x;
int yy = yBigMap + y;
if (ach->isGolden())
@@ -364,7 +371,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glColor4f(1, 1, 1, 1);
minecraft->textures->bind(tex);
minecraft->textures->bindTexture(L"/achievement/bg.png");
blit(xo, yo, 0, 0, imageWidth, imageHeight);
@@ -396,7 +403,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
}
fillGradient(x - 3, y - 3, x + width + 3, y + height + 3 + 12, 0xc0000000, 0xc0000000);
font->drawWordWrap(descr, x, y + 12, width, 0xffa0a0a0);
font->drawWordWrap(descr, x, y + 12, width, 0xffa0a0a0, font->wordWrapHeight(descr, width));
if (statsCounter->hasTaken(ach))
{
font->drawShadow(I18n::get(L"achievement.taken"), x, y + height + 4, 0xff9090ff);
@@ -408,7 +415,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
wstring msg = I18n::get(L"achievement.requires", ach->requires->name);
int height = font->wordWrapHeight(msg, width);
fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000);
font->drawWordWrap(msg, x, y + 12, width, 0xff705050);
font->drawWordWrap(msg, x, y + 12, width, 0xff705050, font->wordWrapHeight(msg, width));
}
font->drawShadow(name, x, y, statsCounter->canTake(ach) ? ach->isGolden() ? 0xffffff80 : 0xffffffff : ach->isGolden() ? 0xff808040 : 0xff808080);
@@ -417,7 +424,6 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
Lighting::turnOff();
#endif
}
bool AchievementScreen::isPauseScreen()

View File

@@ -992,6 +992,7 @@ bool UIScene::allowRepeat(int key)
void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{
printf("externalCallback: [%S]\n", call->function_name.string);
if(wcscmp((wchar_t *)call->function_name.string,L"handlePress")==0)
{
if(call->num_arguments != 2)

View File

@@ -57,7 +57,7 @@ UIScene_DLCMainMenu::UIScene_DLCMainMenu(int iPad, void *initData, UILayer *pare
m_buttonListOffers.addItem(app.GetString(IDS_DLC_MENU_SKINPACKS), e_DLC_SkinPack);
m_buttonListOffers.addItem(app.GetString(IDS_DLC_MENU_TEXTUREPACKS), e_DLC_TexturePacks);
m_buttonListOffers.addItem(app.GetString(IDS_DLC_MENU_MASHUPPACKS), e_DLC_MashupPacks);
m_buttonListOffers.addItem(app.GetString(IDS_DLC_MENU_WORLDS), e_DLC_Worlds);
m_buttonListOffers.addItem("Worlds", e_DLC_Worlds);
app.AddDLCRequest(e_Marketplace_Content);
app.StartInstallDLCProcess(iPad);
@@ -74,6 +74,7 @@ UIScene_DLCMainMenu::UIScene_DLCMainMenu(int iPad, void *initData, UILayer *pare
if (wcscmp(offer.wszType, L"SkinPack") == 0) eType = e_DLC_SkinPack;
else if (wcscmp(offer.wszType, L"TexturePack") == 0) eType = e_DLC_TexturePacks;
else if (wcscmp(offer.wszType, L"MashUp") == 0) eType = e_DLC_MashupPacks;
else if (wcscmp(offer.wszType, L"World") == 0) eType = e_DLC_Worlds;
CMinecraftApp::RegisterW64DLC(
eType,

View File

@@ -6,6 +6,10 @@
#include "..\..\MinecraftServer.h"
#include "UI.h"
#include "UIScene_MainMenu.h"
#ifdef _WINDOWS64
#include "AchievementScreen.h"
#include "StatsCounter.h"
#endif
#ifdef __ORBIS__
#include <error_dialog.h>
#endif
@@ -279,6 +283,8 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
{
printf("[DBG] handlePress controlId=%d childId=%d\n", (int)controlId, (int)childId);
int primaryPad = ProfileManager.GetPrimaryPad();
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL;
@@ -942,7 +948,11 @@ int UIScene_MainMenu::Achievements_SignInReturned(void *pParam,bool bContinue,in
// 4J-JEV: We only need to update rich-presence if the sign-in status changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#ifdef _WINDOWS64
pClass->RunAchievements(iPad);
#else
XShowAchievementsUI( ProfileManager.GetPrimaryPad() );
#endif
}
else
{
@@ -1908,7 +1918,28 @@ void UIScene_MainMenu::tick()
void UIScene_MainMenu::RunAchievements(int iPad)
{
#if TO_BE_IMPLEMENTED
#ifdef _WINDOWS64
printf("[DBG] RunAchievements called\n");
if(ProfileManager.IsGuest(iPad))
{
printf("[DBG] IsGuest - showing message\n");
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
}
else
{
printf("[DBG] Getting minecraft instance\n");
Minecraft *minecraft = Minecraft::GetInstance();
printf("[DBG] minecraft=%p\n", minecraft);
if (minecraft)
{
printf("[DBG] Calling setScreen\n");
minecraft->setScreen(new AchievementScreen(new StatsCounter()));
printf("[DBG] setScreen returned\n");
}
}
#elif TO_BE_IMPLEMENTED
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
@@ -2051,4 +2082,4 @@ int UIScene_MainMenu::SelectNetworkModeReturned(void *pParam,int iPad,C4JStorage
pClass->updateTooltips();
return 0;
}
#endif //__PSVITA__
#endif //__PSVITA__

View File

@@ -619,11 +619,11 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
Windows::Xbox::ApplicationModel::Help::Show(user);
}
break;
#elif TO_BE_IMPLEMENTED
#endif
case BUTTON_PAUSE_ACHIEVEMENTS:
// guests can't look at achievements
if(ProfileManager.IsGuest(pNotifyPressData->UserIndex))
if(ProfileManager.IsGuest(m_iPad))
{
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
@@ -631,10 +631,10 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
}
else
{
XShowAchievementsUI( pNotifyPressData->UserIndex );
XShowAchievementsUI( m_iPad );
}
break;
#endif
case BUTTON_PAUSE_HELPANDOPTIONS:
ui.NavigateToScene(m_iPad,eUIScene_HelpAndOptionsMenu);

View File

@@ -20,6 +20,8 @@
#include "StatsCounter.h"
#include "Windows64\Social\SocialManager.h"
#include "Windows64\Sentient\DynamicConfigurations.h"
#include "AchievementScreen.h"
#include "Minecraft.h"
#elif defined __PSVITA__
#include "PSVita\Sentient\SentientManager.h"
#include "StatsCounter.h"
@@ -76,7 +78,17 @@ DWORD XShowPartyUI(DWORD dwUserIndex) { return 0; }
DWORD XShowFriendsUI(DWORD dwUserIndex) { return 0; }
HRESULT XPartyGetUserList(XPARTY_USER_LIST *pUserList) { return S_OK; }
DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, PBYTE pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped) { return 0; }
void XShowAchievementsUI(int i) {}
void XShowAchievementsUI(int i)
{
Minecraft *minecraft = Minecraft::GetInstance();
if (minecraft && i >= 0 && i < 4 && minecraft->stats[i] != NULL)
{
minecraft->setScreen(NULL);
minecraft->setScreen(new AchievementScreen(minecraft->stats[i]));
}
}
DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; }
#ifndef _DURANGO
@@ -903,7 +915,7 @@ wstring C_4JProfile::GetDisplayName(int iPad)
return displayName;
}
#endif
bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; }
bool C_4JProfile::IsFullVersion() { return true; }
void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {}
void C_4JProfile::SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam) {}
bool C_4JProfile::RegionIsNorthAmerica(void) { return false; }
@@ -924,6 +936,10 @@ int C_4JProfile::SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned ch
// To store the dashboard preferences for controller flipped, etc.
C_4JProfile::PROFILESETTINGS ProfileSettingsA[XUSER_MAX_COUNT];
#define MAX_AWARDS 32
static bool s_awardsUnlocked[XUSER_MAX_COUNT][MAX_AWARDS] = {};
C_4JProfile::PROFILESETTINGS * C_4JProfile::GetDashboardProfileSettings(int iPad) { return &ProfileSettingsA[iPad]; }
void C_4JProfile::WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged, bool bOverride5MinuteLimitOnProfileWrites) {}
void C_4JProfile::ForceQueuedProfileWrites(int iPad) {}
@@ -941,9 +957,24 @@ void C_4JProfile::RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardTy
CXuiStringTable*pStringTable, int iTitleStr, int iTextStr, int iAcceptStr, char *pszThemeName, unsigned int ulThemeSize) {}
int C_4JProfile::GetAwardId(int iAwardNumber) { return 0; }
eAwardType C_4JProfile::GetAwardType(int iAwardNumber) { return eAwardType_Achievement; }
bool C_4JProfile::CanBeAwarded(int iQuadrant, int iAwardNumber) { return false; }
void C_4JProfile::Award(int iQuadrant, int iAwardNumber, bool bForce) {}
bool C_4JProfile::IsAwardsFlagSet(int iQuadrant, int iAward) { return false; }
bool C_4JProfile::CanBeAwarded(int iQuadrant, int iAwardNumber)
{
if (iQuadrant < 0 || iQuadrant >= XUSER_MAX_COUNT) return false;
if (iAwardNumber < 0 || iAwardNumber >= MAX_AWARDS) return false;
return !s_awardsUnlocked[iQuadrant][iAwardNumber];
}
void C_4JProfile::Award(int iQuadrant, int iAwardNumber, bool bForce)
{
if (iQuadrant < 0 || iQuadrant >= XUSER_MAX_COUNT) return;
if (iAwardNumber < 0 || iAwardNumber >= MAX_AWARDS) return;
s_awardsUnlocked[iQuadrant][iAwardNumber] = true;
}
bool C_4JProfile::IsAwardsFlagSet(int iQuadrant, int iAward)
{
if (iQuadrant < 0 || iQuadrant >= XUSER_MAX_COUNT) return false;
if (iAward < 0 || iAward >= MAX_AWARDS) return false;
return s_awardsUnlocked[iQuadrant][iAward];
}
void C_4JProfile::RichPresenceInit(int iPresenceCount, int iContextCount) {}
void C_4JProfile::RegisterRichPresenceContext(int iGameConfigContextID) {}
void C_4JProfile::SetRichPresenceContextValue(int iPad,int iContextID, int iVal) {}
@@ -1063,4 +1094,4 @@ void StatsCounter::setupStatBoards() {}
#ifdef _DEBUG
void StatsCounter::WipeLeaderboards() {}
#endif
*/
*/

View File

@@ -609,6 +609,7 @@ bool LocalPlayer::startCrafting(int x, int y, int z)
bool LocalPlayer::startEnchanting(int x, int y, int z)
{
bool success = app.LoadEnchantingMenu(GetXboxPad(), inventory, x, y, z, level );
if( success ) ui.PlayUISFX(eSFX_Press);
//minecraft.setScreen(new EnchantmentScreen(inventory, level, x, y, z));
@@ -762,7 +763,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param)
//if (!minecraft->stats[m_iPad]->hasTaken(ach))
{
// 4J-PB - Don't display the java popup
//minecraft->achievementPopup->popup(ach);
minecraft->achievementPopup->popup(ach);
// 4J Stu - Added this function in the libraries as some achievements don't get awarded to all players
// e.g. Splitscreen players cannot get theme/avatar/gamerpic and Trial players cannot get any

View File

@@ -590,6 +590,7 @@
<LinkIncremental>true</LinkIncremental>
<ImageXexOutput>$(OutDir)$(ProjectName)_D.xex</ImageXexOutput>
<IncludePath>$(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
<TargetName>Minecraft</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">
<LinkIncremental>true</LinkIncremental>
@@ -35485,6 +35486,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
</ItemGroup>
<ItemGroup>
<Image Include="Durango\WideLogo.png" />
<Image Include="icon.ico" />
<Image Include="Xbox\MinecraftWindows.ico">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Durango'">true</ExcludedFromBuild>
@@ -35507,23 +35509,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Xbox\MinecraftWindows.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugContentPackage|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
</ResourceCompile>
<ResourceCompile Include="app_icon.rc" />
</ItemGroup>
<ItemGroup>
<Object Include="PS3\SPU_Tasks\ObjFiles\ContentPackage\ChunkUpdate.ppu.o">

View File

@@ -5961,11 +5961,10 @@
<Image Include="Durango\WideLogo.png">
<Filter>Durango</Filter>
</Image>
<Image Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Xbox\MinecraftWindows.rc">
<Filter>Windows</Filter>
</ResourceCompile>
<ResourceCompile Include="app_icon.rc" />
</ItemGroup>
<ItemGroup>
<Object Include="PS3\SPU_Tasks\ObjFiles\Release\ChunkUpdate.ppu.o">

View File

@@ -9,6 +9,8 @@
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.stats.h"
#include "..\Minecraft.Client\LocalPlayer.h"
#include "AchievementScreen.h"
#include "StatsScreen.h"
PauseScreen::PauseScreen()
{
@@ -65,11 +67,11 @@ void PauseScreen::buttonClicked(Button button)
if (button.id == 5)
{
// minecraft->setScreen(new AchievementScreen(minecraft->stats)); // 4J TODO - put back
minecraft->setScreen(new AchievementScreen(minecraft->stats[button.id])); // 4J TODO - put back
}
if (button.id == 6)
{
// minecraft->setScreen(new StatsScreen(this, minecraft->stats)); // 4J TODO - put back
minecraft->setScreen(new StatsScreen(this, minecraft->stats[button.id])); // 4J TODO - put back
}
}

View File

@@ -34,6 +34,11 @@ StatsCounter::StatsCounter()
void StatsCounter::award(Stat* stat, unsigned int difficulty, unsigned int count)
{
printf("[StatsCounter] award(): %ls | isAchievement: %s | difficulty: %u | count: %u\n",
stat->name.c_str(),
stat->isAchievement() ? "YES" : "NO",
difficulty,
count);
#ifndef _DURANGO
if( stat->isAchievement() )
difficulty = 0;
@@ -204,10 +209,12 @@ void StatsCounter::save(int player, bool force)
{
#ifndef _DURANGO
// 4J-PB - If this is the trial game, don't save any stats
#ifndef _WINDOWS64
if(!ProfileManager.IsFullVersion())
{
return;
}
#endif
//Check we're going to have enough room to store all possible stats
unsigned int uiTotalStatsSize = (Stats::all->size() * 4 * sizeof(unsigned short)) - (Achievements::achievements->size() * 3 * sizeof(unsigned short)) + (LARGE_STATS_COUNT*4*(sizeof(unsigned int)-sizeof(unsigned short)));
@@ -302,6 +309,7 @@ void StatsCounter::setLeaderboardRating(XUSER_PROPERTY* prop, LONGLONG value)
void StatsCounter::flushLeaderboards()
{
#ifndef _DURANGO
#ifndef _WINDOWS64
if( LeaderboardManager::Instance()->OpenSession() )
{
writeStats();
@@ -310,18 +318,17 @@ void StatsCounter::flushLeaderboards()
else
{
app.DebugPrintf("Failed to open a session in order to write to leaderboard\n");
// 4J-JEV: If user was not signed in it would hit this.
//assert(false);// && "Failed to open a session in order to write to leaderboard");
}
modifiedBoards = 0;
#endif
#endif
}
void StatsCounter::saveLeaderboards()
{
#ifndef _DURANGO
#ifndef _WINDOWS64
// 4J-PB - If this is the trial game, no writing leaderboards
if(!ProfileManager.IsFullVersion())
{
@@ -336,13 +343,11 @@ void StatsCounter::saveLeaderboards()
else
{
app.DebugPrintf("Failed to open a session in order to write to leaderboard\n");
// 4J-JEV: If user was not signed in it would hit this.
//assert(false);// && "Failed to open a session in order to write to leaderboard");
}
modifiedBoards = 0;
#endif
#endif
}
void StatsCounter::writeStats()
@@ -1341,4 +1346,4 @@ void StatsCounter::WipeLeaderboards()
}
#endif
}
#endif
#endif

View File

@@ -844,6 +844,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
freopen("CONIN$", "r", stdin);
std::ios::sync_with_stdio(true);
#endif
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

View File

@@ -0,0 +1 @@
MAINICON ICON "icon.ico"

Binary file not shown.

BIN
Minecraft.Client/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

BIN
Minecraft.Client/mss64.dll Normal file

Binary file not shown.

View File

@@ -0,0 +1,9 @@
allow-nether=true
gamemode=0
level-name=world
level-type=default
max-build-height=256
max-players=20
spawn-animals=true
spawn-monsters=true
spawn-npcs=true

View File

@@ -60,7 +60,7 @@ wstring Achievement::getDescription()
{
if (descFormatter != NULL)
{
return descFormatter->format(desc);
return desc;
}
return desc;
}