aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp
index 80db57f8..12b21905 100644
--- a/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp
+++ b/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp
@@ -12,8 +12,8 @@
const int UIScene_LeaderboardsMenu::TitleIcons[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][7] =
{
{ UIControl_LeaderboardList::e_ICON_TYPE_WALKED, UIControl_LeaderboardList::e_ICON_TYPE_FALLEN, Item::minecart_Id, Item::boat_Id, NULL },
- { Tile::dirt_Id, Tile::stoneBrick_Id, Tile::sand_Id, Tile::rock_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id },
- { Item::egg_Id, Item::wheat_Id, Tile::mushroom1_Id, Tile::reeds_Id, Item::milk_Id, Tile::pumpkin_Id, NULL },
+ { Tile::dirt_Id, Tile::cobblestone_Id, Tile::sand_Id, Tile::stone_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id },
+ { Item::egg_Id, Item::wheat_Id, Tile::mushroom_brown_Id, Tile::reeds_Id, Item::bucket_milk_Id, Tile::pumpkin_Id, NULL },
{ UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIE, UIControl_LeaderboardList::e_ICON_TYPE_SKELETON, UIControl_LeaderboardList::e_ICON_TYPE_CREEPER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDERJOKEY, UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIEPIGMAN, UIControl_LeaderboardList::e_ICON_TYPE_SLIME },
};
const UIScene_LeaderboardsMenu::LeaderboardDescriptor UIScene_LeaderboardsMenu::LEADERBOARD_DESCRIPTORS[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][4] = {
@@ -43,7 +43,8 @@ const UIScene_LeaderboardsMenu::LeaderboardDescriptor UIScene_LeaderboardsMenu::
},
};
-UIScene_LeaderboardsMenu::UIScene_LeaderboardsMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
+UIScene_LeaderboardsMenu::UIScene_LeaderboardsMenu(int iPad, void *initData, UILayer *parentLayer)
+ : UIScene(iPad, parentLayer), m_interface(LeaderboardManager::Instance())
{
// Setup all the Iggy references we need for this scene
initialiseMovie();
@@ -60,8 +61,6 @@ UIScene_LeaderboardsMenu::UIScene_LeaderboardsMenu(int iPad, void *initData, UIL
// Alert the app the we want to be informed of ethernet connections
app.SetLiveLinkRequired( true );
- LeaderboardManager::Instance()->OpenSession();
-
//GetFriends();
m_currentLeaderboard = 0;
@@ -86,9 +85,6 @@ UIScene_LeaderboardsMenu::UIScene_LeaderboardsMenu(int iPad, void *initData, UIL
UIScene_LeaderboardsMenu::~UIScene_LeaderboardsMenu()
{
- LeaderboardManager::Instance()->CancelOperation();
- LeaderboardManager::Instance()->CloseSession();
-
// Alert the app the we no longer want to be informed of ethernet connections
app.SetLiveLinkRequired( false );
}
@@ -159,6 +155,12 @@ wstring UIScene_LeaderboardsMenu::getMoviePath()
return L"LeaderboardMenu";
}
+void UIScene_LeaderboardsMenu::tick()
+{
+ UIScene::tick();
+ m_interface.tick();
+}
+
void UIScene_LeaderboardsMenu::handleReload()
{
// We don't allow this in splitscreen, so just go back
@@ -457,16 +459,19 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
switch (filtermode)
{
case LeaderboardManager::eFM_TopRank:
- LeaderboardManager::Instance()->ReadStats_TopRank( this,
- m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
- m_newEntryIndex, m_newReadSize
- );
+ {
+ m_interface.ReadStats_TopRank(
+ this,
+ m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
+ m_newEntryIndex, m_newReadSize
+ );
+ }
break;
case LeaderboardManager::eFM_MyScore:
{
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(),&uid, true);
- LeaderboardManager::Instance()->ReadStats_MyScore( this,
+ m_interface.ReadStats_MyScore( this,
m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
uid /*ignored on PS3*/,
m_newReadSize
@@ -477,7 +482,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
{
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(),&uid, true);
- LeaderboardManager::Instance()->ReadStats_Friends( this,
+ m_interface.ReadStats_Friends( this,
m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
uid /*ignored on PS3*/,
m_newEntryIndex, m_newReadSize
@@ -501,14 +506,11 @@ bool UIScene_LeaderboardsMenu::OnStatsReadComplete(LeaderboardManager::eStatsRet
bool ret;
//app.DebugPrintf("Leaderboards read %d stats\n", numResults);
- if (retIn == LeaderboardManager::eStatsReturn_Success)
- {
- m_numStats = numResults;
- m_stats = results;
- ret = RetrieveStats();
- }
- else ret = true;
-
+
+ m_numStats = numResults;
+ m_stats = results;
+ ret = RetrieveStats();
+
//else LeaderboardManager::Instance()->SetStatsRetrieved(false);
PopulateLeaderboard(retIn);
@@ -632,7 +634,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats()
}
break;
}
- }
+ }
}
// If not set, default to start index
@@ -1021,7 +1023,7 @@ void UIScene_LeaderboardsMenu::handleTimerComplete(int id)
// If they have, bring up the PSN warning and exit from the leaderboards
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
- C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CONNECTION_LOST, g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT), uiIDA,1,ProfileManager.GetPrimaryPad(),UIScene_LeaderboardsMenu::ExitLeaderboards,this, app.GetStringTable());
+ C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CONNECTION_LOST, g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT), uiIDA,1,ProfileManager.GetPrimaryPad(),UIScene_LeaderboardsMenu::ExitLeaderboards,this);
}
#endif
break;