Skip to content

Commit

Permalink
groundwork for monthly challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Jul 31, 2023
1 parent ef2d713 commit 9e1124d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions libsocial/include/Achievements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ struct AchievementImage final
cro::FloatRect textureRect;
};

class MonthlyChallenge;

//base class for different implementations
class AchievementImpl
{
Expand Down Expand Up @@ -131,6 +133,8 @@ class Achievements final

static void refreshGlobalStats() {}

static MonthlyChallenge* getMonthlyChallenge() { return nullptr; }

private:
static AchievementImpl* m_impl;
static bool m_active;
Expand Down
9 changes: 5 additions & 4 deletions libsocial/include/Social.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ class Social final
LevelUp,
XPAwarded,
OverlayActivated,
PlayerAchievement
PlayerAchievement, //as in we should cheer, not an actual achievement
MonthlyProgress
}type = LevelUp;
std::int32_t level = 0;
std::int32_t reason = -1;
std::uint64_t playerID = 0;
std::int32_t level = 0; //if monthly progress then current value
std::int32_t reason = -1; //if monthly progress then target value
std::uint64_t playerID = 0; //id of monthly challenge
};

struct ProgressData final
Expand Down
4 changes: 2 additions & 2 deletions samples/golf/buildnumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef BUILD_NUMBER_H_
#define BUILD_NUMBER_H_

#define BUILDNUMBER 1018
#define BUILDNUMBER_STR "1018"
#define BUILDNUMBER 1021
#define BUILDNUMBER_STR "1021"

#endif /* BUILD_NUMBER_H_ */
4 changes: 2 additions & 2 deletions samples/golf/src/GolfGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ bool GolfGame::initialise()
#ifdef CRO_DEBUG_
//m_stateStack.pushState(StateID::DrivingRange); //can't go straight to this because menu needs to parse avatar data
//m_stateStack.pushState(StateID::Bush);
//m_stateStack.pushState(StateID::Clubhouse);
m_stateStack.pushState(StateID::Clubhouse);
//m_stateStack.pushState(StateID::SplashScreen);
m_stateStack.pushState(StateID::Menu);
//m_stateStack.pushState(StateID::Menu);
//m_stateStack.pushState(StateID::SQLite);
#else
m_stateStack.pushState(StateID::SplashScreen);
Expand Down
6 changes: 4 additions & 2 deletions samples/golf/src/golf/MenuCreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,18 +2064,20 @@ void MenuState::createLobbyMenu(cro::Entity parent, std::uint32_t mouseEnter, st
entity.getComponent<cro::UIInput>().setPrevIndex(LobbyCourseB, LobbyCourseB); // and this
entity.getComponent<cro::UIInput>().callbacks[cro::UIInput::Selected] = m_courseSelectCallbacks.selectHighlight;
entity.getComponent<cro::UIInput>().callbacks[cro::UIInput::Unselected] = m_courseSelectCallbacks.unselectHighlight;
#ifdef USE_GNS
entity.getComponent<cro::UIInput>().callbacks[cro::UIInput::ButtonUp] = m_uiScene.getSystem<cro::UISystem>()->addCallback(
[&](cro::Entity, const cro::ButtonEvent& evt)
{
if (activated(evt))
{
#ifdef USE_GNS
requestStackPush(StateID::Leaderboard);
#else
cro::Util::String::parseURL("https://steamcommunity.com/stats/2173760/leaderboards/10082641/");
#endif
m_audioEnts[AudioID::Accept].getComponent<cro::AudioEmitter>().play();
}
}
);
#endif
entity.addComponent<cro::CommandTarget>().ID = CommandID::Menu::UIElement;
entity.addComponent<cro::Callback>().active = true;
entity.getComponent<cro::Callback>().function = infoButtonEnable;
Expand Down

0 comments on commit 9e1124d

Please sign in to comment.