Skip to content

Commit

Permalink
add highlighting to view leaderboard as
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Dec 6, 2023
1 parent 355bf84 commit fa49433
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 64 deletions.
39 changes: 0 additions & 39 deletions src/layers/LeaderboardListView.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions src/layers/LeaderboardListView.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/layers/LeaderboardViewLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void LeaderboardViewLayer::loadPage(){
if(m_listLayer != nullptr) m_listLayer->removeFromParentAndCleanup(true);

if(m_leaderboardView) m_leaderboardView->release();
m_leaderboardView = LeaderboardListView::create(m_scores, 356.f, 220.f);
m_listLayer = GJListLayer::create(m_leaderboardView, "Scores", {191, 114, 62, 255}, 356.f, 220.f);
m_leaderboardView = CustomListView::create(m_scores, BoomListType::Score, 220.f, 356.f);
m_listLayer = GJListLayer::create(m_leaderboardView, "Global Leaderboards", {191, 114, 62, 255}, 356.f, 220.f);
m_listLayer->setPosition(winSize / 2 - m_listLayer->getScaledContentSize() / 2 - CCPoint(0,5));
addChild(m_listLayer);
}
Expand Down
3 changes: 1 addition & 2 deletions src/layers/LeaderboardViewLayer.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#pragma once

#include "LeaderboardListView.h"
#include "../delegates/BILeaderboardDelegate.h"

class LeaderboardViewLayer : public cocos2d::CCLayer, public BILeaderboardDelegate {
LeaderboardListView* m_leaderboardView = nullptr;
CustomListView* m_leaderboardView = nullptr;
GJListLayer* m_listLayer = nullptr;
cocos2d::CCArray* m_scores = nullptr;
LoadingCircle* m_circle = nullptr;
Expand Down
9 changes: 4 additions & 5 deletions src/managers/BetterInfoOnline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void BetterInfoOnline::loadScores(int accountID, bool force){
}

void BetterInfoOnline::generateScores(const std::string& response, int accountID){
auto GM = GameManager::sharedState();

if(m_scoreDict.contains(accountID)) {
m_scoreDict[accountID]->release();
Expand All @@ -55,16 +56,14 @@ void BetterInfoOnline::generateScores(const std::string& response, int accountID
std::string current;

while(getline(responseStream, current, '|')){

//auto CM = CvoltonManager::sharedState();
auto GLM = GameLevelManager::sharedState();

auto score = GJUserScore::create(
//CM->responseToDict(current)
//GLM->responseToDict(current, false)
BetterInfo::responseToDict(current)
);

// workaround for leaderboard highlighting
if(std::string(score->m_userUDID) != "") score->m_userUDID = GM->m_playerUDID;

scores->addObject(score);
}
}
Expand Down

0 comments on commit fa49433

Please sign in to comment.