forked from Mirrors/openclonk
Move Game.Rank to ::DefaultRanks
parent
25639bc659
commit
a0bbab441f
|
@ -90,7 +90,6 @@ class C4Game
|
|||
~C4Game();
|
||||
public:
|
||||
C4DefList Defs;
|
||||
C4RankSystem Rank;
|
||||
C4GraphicsSystem GraphicsSystem;
|
||||
C4MessageInput MessageInput;
|
||||
C4GraphicsResource GraphicsResource;
|
||||
|
|
|
@ -55,4 +55,6 @@ class C4RankSystem
|
|||
#endif
|
||||
};
|
||||
|
||||
extern C4RankSystem DefaultRanks;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -232,8 +232,8 @@ void C4ControlSet::Execute() const
|
|||
// show msg
|
||||
if(Game.Parameters.UseFairCrew)
|
||||
{
|
||||
int iRank = Game.Rank.RankByExperience(Game.Parameters.FairCrewStrength);
|
||||
Game.GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_FAIRCREW_ACTIVATED"), Game.Rank.GetRankName(iRank, true).getData()).getData());
|
||||
int iRank = ::DefaultRanks.RankByExperience(Game.Parameters.FairCrewStrength);
|
||||
Game.GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_FAIRCREW_ACTIVATED"), ::DefaultRanks.GetRankName(iRank, true).getData()).getData());
|
||||
}
|
||||
else
|
||||
Game.GraphicsSystem.FlashMessage(LoadResStr("IDS_MSG_FAIRCREW_DEACTIVATED"));
|
||||
|
|
|
@ -959,7 +959,7 @@ C4PhysicalInfo *C4Def::GetFairCrewPhysicals()
|
|||
pFairCrewPhysical = new C4PhysicalInfo(Physical);
|
||||
// determine the rank
|
||||
int32_t iExpGain = Game.Parameters.FairCrewStrength;
|
||||
C4RankSystem *pRankSys=&Game.Rank;
|
||||
C4RankSystem *pRankSys=&::DefaultRanks;
|
||||
if (pRankNames) pRankSys = pRankNames;
|
||||
int32_t iRank = pRankSys->RankByExperience(iExpGain);
|
||||
// promote physicals for rank
|
||||
|
|
|
@ -1684,7 +1684,7 @@ void C4Game::Default()
|
|||
Weather.Default();
|
||||
Landscape.Default();
|
||||
TextureMap.Default();
|
||||
Rank.Default();
|
||||
::DefaultRanks.Default();
|
||||
MassMover.Default();
|
||||
PXS.Default();
|
||||
GraphicsSystem.Default();
|
||||
|
@ -3243,7 +3243,7 @@ bool C4Game::InitSystem()
|
|||
if (!InitKeyboard())
|
||||
{ LogFatal(LoadResStr("IDS_ERR_NOKEYBOARD")); return false; }
|
||||
// Rank system
|
||||
Rank.Init(Config.GetSubkeyPath("ClonkRanks"), LoadResStr("IDS_GAME_DEFRANKS"), 1000);
|
||||
::DefaultRanks.Init(Config.GetSubkeyPath("ClonkRanks"), LoadResStr("IDS_GAME_DEFRANKS"), 1000);
|
||||
// done, success
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1500,7 +1500,7 @@ void C4Object::DoExperience(int32_t change)
|
|||
|
||||
// Promotion check
|
||||
if (Info->Experience<MaxExperience)
|
||||
if (Info->Experience>=Game.Rank.Experience(Info->Rank+1))
|
||||
if (Info->Experience>=::DefaultRanks.Experience(Info->Rank+1))
|
||||
Promote(Info->Rank+1, FALSE, false);
|
||||
}
|
||||
|
||||
|
@ -2155,7 +2155,7 @@ BOOL C4Object::Promote(int32_t torank, BOOL exception, bool fForceRankName)
|
|||
if (pUseDef && pUseDef->pRankNames)
|
||||
pRankSys = pUseDef->pRankNames;
|
||||
else
|
||||
pRankSys = &Game.Rank;
|
||||
pRankSys = &::DefaultRanks;
|
||||
// always promote info
|
||||
Info->Promote(torank,*pRankSys, fForceRankName);
|
||||
// silent update?
|
||||
|
|
|
@ -337,7 +337,7 @@ void C4ObjectInfo::Draw(C4Facet &cgo, BOOL fShowPortrait, BOOL fCaptain, C4Objec
|
|||
}
|
||||
|
||||
// Rank symbol
|
||||
C4RankSystem *pRankSys = &Game.Rank;
|
||||
C4RankSystem *pRankSys = &::DefaultRanks;
|
||||
C4Facet *pRankRes=&Game.GraphicsResource.fctRank;
|
||||
int iRankCnt=Game.GraphicsResource.iNumRanks;
|
||||
if (pOfObj)
|
||||
|
|
|
@ -341,5 +341,6 @@ bool C4RankSystem::DrawRankSymbol(C4FacetSurface *fctSymbol, int32_t iRank, C4Fa
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
C4RankSystem DefaultRanks;
|
||||
|
|
|
@ -489,7 +489,7 @@ void C4StartupPlrSelDlg::CrewListItem::SetSelectionInfo(C4GUI::TextWindow *pSele
|
|||
pSelectionInfo->AddTextLine(FormatString("%s %s", Core.sRankName.getData(), Core.Name).getData(), &C4Startup::Get()->Graphics.BookFontCapt, ClrPlayerItem, false, false);
|
||||
StdStrBuf sPromo;
|
||||
int32_t iNextRankExp; StdStrBuf sNextRankName;
|
||||
if (Core.GetNextRankInfo(Game.Rank, &iNextRankExp, &sNextRankName))
|
||||
if (Core.GetNextRankInfo(::DefaultRanks, &iNextRankExp, &sNextRankName))
|
||||
sPromo.Format(LoadResStr("IDS_DESC_PROMO"),sNextRankName.getData(),(int) iNextRankExp);
|
||||
else
|
||||
sPromo.Copy(LoadResStr("IDS_DESC_NOPROMO"));
|
||||
|
@ -1129,7 +1129,7 @@ C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(C4StartupPlrSelDlg::PlayerL
|
|||
{
|
||||
// create new player: Use default C4P values, with a few exceptions
|
||||
// FIXME: Use Player, not Clonkranks
|
||||
C4P.Default(&Game.Rank);
|
||||
C4P.Default(&::DefaultRanks);
|
||||
// Set name, color, comment
|
||||
SCopy(LoadResStr("IDS_PLR_NEWCOMMENT"), C4P.Comment, C4MaxComment);
|
||||
C4P.PrefColor = SafeRandom(8);
|
||||
|
|
Loading…
Reference in New Issue