Constants for easy/normal/ultra/mega default multipliers
Multiplier example for scenarios Version number is only shown with build date and so on for dev versions
This commit is contained in:
parent
1ff84eaddb
commit
ebcadc13f0
|
@ -113,6 +113,12 @@ public:
|
|||
static const char *path_logs_CacheLookupKey;
|
||||
|
||||
static const char *application_name;
|
||||
|
||||
static const float normalMultiplier= 1.0f;
|
||||
static const float easyMultiplier= 0.8f;
|
||||
static const float ultraMultiplier= 3.0f;
|
||||
static const float megaMultiplier= 4.0f;
|
||||
|
||||
};
|
||||
|
||||
enum PathType {
|
||||
|
|
|
@ -927,26 +927,26 @@ void MenuStateCustomGame::updateAllResourceMultiplier() {
|
|||
void MenuStateCustomGame::updateResourceMultiplier(const int index) {
|
||||
ControlType ct= static_cast<ControlType>(listBoxControls[index].getSelectedItemIndex());
|
||||
if(ct == ctHuman || ct == ctNetwork || ct == ctClosed) {
|
||||
listBoxRMultiplier[index].setSelectedItemIndex(5);
|
||||
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::normalMultiplier-0.5f)*10);
|
||||
listBoxRMultiplier[index].setEnabled(false);
|
||||
}
|
||||
else if(ct == ctCpuEasy || ct == ctNetworkCpuEasy)
|
||||
{
|
||||
listBoxRMultiplier[index].setSelectedItemIndex(3);
|
||||
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::easyMultiplier-0.5f)*10);
|
||||
listBoxRMultiplier[index].setEnabled(true);
|
||||
}
|
||||
else if(ct == ctCpu || ct == ctNetworkCpu) {
|
||||
listBoxRMultiplier[index].setSelectedItemIndex(5);
|
||||
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::normalMultiplier-0.5f)*10);
|
||||
listBoxRMultiplier[index].setEnabled(true);
|
||||
}
|
||||
else if(ct == ctCpuUltra || ct == ctNetworkCpuUltra)
|
||||
{
|
||||
listBoxRMultiplier[index].setSelectedItemIndex(25);
|
||||
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::ultraMultiplier-0.5f)*10);
|
||||
listBoxRMultiplier[index].setEnabled(true);
|
||||
}
|
||||
else if(ct == ctCpuMega || ct == ctNetworkCpuMega)
|
||||
{
|
||||
listBoxRMultiplier[index].setSelectedItemIndex(35);
|
||||
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::megaMultiplier-0.5f)*10);
|
||||
listBoxRMultiplier[index].setEnabled(true);
|
||||
}
|
||||
listBoxRMultiplier[index].setEditable(listBoxRMultiplier[index].getEnabled());
|
||||
|
|
|
@ -58,8 +58,6 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
|
|||
i-=40;
|
||||
buttonExit.registerGraphicComponent(containerName,"buttonExit");
|
||||
buttonExit.init(425, i, 150);
|
||||
labelVersion.registerGraphicComponent(containerName,"labelVersion");
|
||||
labelVersion.init(405, 420);
|
||||
|
||||
buttonNewGame.setText(lang.get("NewGame"));
|
||||
buttonJoinGame.setText(lang.get("JoinGame"));
|
||||
|
@ -67,8 +65,16 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
|
|||
buttonOptions.setText(lang.get("Options"));
|
||||
buttonAbout.setText(lang.get("About"));
|
||||
buttonExit.setText(lang.get("Exit"));
|
||||
labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
|
||||
|
||||
|
||||
labelVersion.registerGraphicComponent(containerName,"labelVersion");
|
||||
if(EndsWith(glestVersionString, "-dev") == false){
|
||||
labelVersion.init(525, 420);
|
||||
labelVersion.setText(glestVersionString);
|
||||
}
|
||||
else {
|
||||
labelVersion.init(405, 420);
|
||||
labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
|
||||
}
|
||||
//mesage box
|
||||
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
|
||||
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
|
||||
|
|
|
@ -215,18 +215,18 @@ void MenuStateScenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo
|
|||
}
|
||||
else
|
||||
{// if no multiplier exists use defaults
|
||||
scenarioInfo->resourceMultipliers[i]=1.0f;
|
||||
scenarioInfo->resourceMultipliers[i]=GameConstants::normalMultiplier;
|
||||
if(factionControl==ctCpuEasy)
|
||||
{
|
||||
scenarioInfo->resourceMultipliers[i]=0.8f;
|
||||
scenarioInfo->resourceMultipliers[i]=GameConstants::easyMultiplier;
|
||||
}
|
||||
if(factionControl==ctCpuUltra)
|
||||
{
|
||||
scenarioInfo->resourceMultipliers[i]=2.0f;
|
||||
scenarioInfo->resourceMultipliers[i]=GameConstants::ultraMultiplier;
|
||||
}
|
||||
else if(factionControl==ctCpuMega)
|
||||
{
|
||||
scenarioInfo->resourceMultipliers[i]=3.5f;
|
||||
scenarioInfo->resourceMultipliers[i]=GameConstants::megaMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue