mod menu can display descriptions now, endgame stat with gold instead of green, minimap has smaller border and is a tiny bit less transparent

This commit is contained in:
Titus Tscharntke 2011-04-07 00:09:57 +00:00
parent cd3451b1f4
commit 556b190d3a
4 changed files with 145 additions and 81 deletions

View File

@ -2887,23 +2887,24 @@ void Renderer::renderMinimap(){
Vec4f col= game->getGui()->getDisplay()->getColor(); Vec4f col= game->getGui()->getDisplay()->getColor();
glColor4f(col.x*0.5f,col.y*0.5f,col.z*0.5f,1.0 ); glColor4f(col.x*0.5f,col.y*0.5f,col.z*0.5f,1.0 );
int borderWidth=2;
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2i(mx-4, my-4); glVertex2i(mx-borderWidth, my-borderWidth);
glVertex2i(mx-4, my); glVertex2i(mx-borderWidth, my);
glVertex2i(mx+mw+4, my); glVertex2i(mx+mw+borderWidth, my);
glVertex2i(mx+mw+4, my-4); glVertex2i(mx+mw+borderWidth, my-borderWidth);
glEnd(); glEnd();
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2i(mx-4, my+mh+4); glVertex2i(mx-borderWidth, my+mh+borderWidth);
glVertex2i(mx-4, my+mh); glVertex2i(mx-borderWidth, my+mh);
glVertex2i(mx+mw+4, my+mh); glVertex2i(mx+mw+borderWidth, my+mh);
glVertex2i(mx+mw+4, my+mh+4); glVertex2i(mx+mw+borderWidth, my+mh+borderWidth);
glEnd(); glEnd();
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2i(mx-4, my); glVertex2i(mx-borderWidth, my);
glVertex2i(mx-4, my+mh); glVertex2i(mx-borderWidth, my+mh);
glVertex2i(mx, my+mh); glVertex2i(mx, my+mh);
glVertex2i(mx, my); glVertex2i(mx, my);
glEnd(); glEnd();
@ -2911,8 +2912,8 @@ void Renderer::renderMinimap(){
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2i(mx+mw, my); glVertex2i(mx+mw, my);
glVertex2i(mx+mw, my+mh); glVertex2i(mx+mw, my+mh);
glVertex2i(mx+mw+4, my+mh); glVertex2i(mx+mw+borderWidth, my+mh);
glVertex2i(mx+mw+4, my); glVertex2i(mx+mw+borderWidth, my);
glEnd(); glEnd();
@ -2996,7 +2997,7 @@ void Renderer::renderMinimap(){
*/ */
//glColor4f(0.3f, 0.3f, 0.3f, 0.90f); //glColor4f(0.3f, 0.3f, 0.3f, 0.90f);
glColor4f(0.5f, 0.5f, 0.5f, 0.1f); glColor4f(0.5f, 0.5f, 0.5f, 0.2f);
glBegin(GL_TRIANGLE_STRIP); glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(0.0f, 1.0f); glTexCoord2f(0.0f, 1.0f);

View File

@ -211,9 +211,9 @@ void BattleEnd::render(){
} }
if(disableStatsColorCoding == false) { if(disableStatsColorCoding == false) {
color.x = 0.2; color.x = 0.85;
color.y = 1; color.y = 0.8;
color.z = 0.2; color.z = 0.07;
} }
else { else {
color.x = WHITE.x; color.x = WHITE.x;

View File

@ -36,6 +36,23 @@ struct FormatString {
} }
}; };
// ===============================
// class ModInfo
// ===============================
ModInfo::ModInfo(){
name= "";
url= "";
imageUrl= "";
description= "";
count= "";
crc= "";
}
// ===================================================== // =====================================================
// class MenuStateConnectedGame // class MenuStateConnectedGame
// ===================================================== // =====================================================
@ -71,33 +88,33 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
keyTechScrollBarTitle1.registerGraphicComponent(containerName,"keyTechScrollBarTitle1"); keyTechScrollBarTitle1.registerGraphicComponent(containerName,"keyTechScrollBarTitle1");
keyTechScrollBarTitle1.init(techInfoXPos,scrollListsYPos + 20,labelWidth,20); keyTechScrollBarTitle1.init(techInfoXPos,scrollListsYPos + 20,labelWidth,20);
keyTechScrollBarTitle1.setText(lang.get("TechTitle1")); keyTechScrollBarTitle1.setText(lang.get("TechTitle1"));
keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal());
keyTechScrollBarTitle2.registerGraphicComponent(containerName,"keyTechScrollBarTitle2"); keyTechScrollBarTitle2.registerGraphicComponent(containerName,"keyTechScrollBarTitle2");
keyTechScrollBarTitle2.init(techInfoXPos + 200,scrollListsYPos + 20,labelWidth,20); keyTechScrollBarTitle2.init(techInfoXPos + 200,scrollListsYPos + 20,labelWidth,20);
keyTechScrollBarTitle2.setText(lang.get("TechTitle2")); keyTechScrollBarTitle2.setText(lang.get("TechTitle2"));
keyTechScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontBig()); keyTechScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
mapInfoXPos = 270; mapInfoXPos = 270;
keyMapScrollBarTitle1.registerGraphicComponent(containerName,"keyMapScrollBarTitle1"); keyMapScrollBarTitle1.registerGraphicComponent(containerName,"keyMapScrollBarTitle1");
keyMapScrollBarTitle1.init(mapInfoXPos,scrollListsYPos + 20,labelWidth,20); keyMapScrollBarTitle1.init(mapInfoXPos,scrollListsYPos + 20,labelWidth,20);
keyMapScrollBarTitle1.setText(lang.get("MapTitle1")); keyMapScrollBarTitle1.setText(lang.get("MapTitle1"));
keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal());
keyMapScrollBarTitle2.registerGraphicComponent(containerName,"keyMapScrollBarTitle2"); keyMapScrollBarTitle2.registerGraphicComponent(containerName,"keyMapScrollBarTitle2");
keyMapScrollBarTitle2.init(mapInfoXPos + 200,scrollListsYPos + 20,labelWidth,20); keyMapScrollBarTitle2.init(mapInfoXPos + 200,scrollListsYPos + 20,labelWidth,20);
keyMapScrollBarTitle2.setText(lang.get("MapTitle2")); keyMapScrollBarTitle2.setText(lang.get("MapTitle2"));
keyMapScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontBig()); keyMapScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
tilesetInfoXPos = 530; tilesetInfoXPos = 530;
keyTilesetScrollBarTitle1.registerGraphicComponent(containerName,"keyTilesetScrollBarTitle1"); keyTilesetScrollBarTitle1.registerGraphicComponent(containerName,"keyTilesetScrollBarTitle1");
keyTilesetScrollBarTitle1.init(tilesetInfoXPos,scrollListsYPos + 20,labelWidth,20); keyTilesetScrollBarTitle1.init(tilesetInfoXPos,scrollListsYPos + 20,labelWidth,20);
keyTilesetScrollBarTitle1.setText(lang.get("TilesetTitle1")); keyTilesetScrollBarTitle1.setText(lang.get("TilesetTitle1"));
keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal());
scenarioInfoXPos = 760; scenarioInfoXPos = 760;
keyScenarioScrollBarTitle1.registerGraphicComponent(containerName,"keyScenarioScrollBarTitle1"); keyScenarioScrollBarTitle1.registerGraphicComponent(containerName,"keyScenarioScrollBarTitle1");
keyScenarioScrollBarTitle1.init(scenarioInfoXPos,scrollListsYPos + 20,labelWidth,20); keyScenarioScrollBarTitle1.init(scenarioInfoXPos,scrollListsYPos + 20,labelWidth,20);
keyScenarioScrollBarTitle1.setText(lang.get("ScenarioTitle1")); keyScenarioScrollBarTitle1.setText(lang.get("ScenarioTitle1"));
keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal());
mainMessageBoxState = ftpmsg_None; mainMessageBoxState = ftpmsg_None;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox"); mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
@ -110,6 +127,9 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
lineVertical.setHorizontal(false); lineVertical.setHorizontal(false);
lineReturn.init(0, returnLineY); lineReturn.init(0, returnLineY);
modDescrLabel.registerGraphicComponent(containerName,"modDescrLabel");
modDescrLabel.init(50,installButtonYPos-60 - 20,450,20);
modDescrLabel.setText("description is empty");
buttonReturn.registerGraphicComponent(containerName,"buttonReturn"); buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(450, returnLineY - 40, 125); buttonReturn.init(450, returnLineY - 40, 125);
@ -355,16 +375,19 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("tilesetInfoList.size() [%d]\n",(int)tilesetInfoList.size()); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("tilesetInfoList.size() [%d]\n",(int)tilesetInfoList.size());
if(tilesetInfoList.size() >= 4) { if(tilesetInfoList.size() >= 4) {
string tilesetName = tilesetInfoList[0]; ModInfo modinfo;
string tilesetCRC = tilesetInfoList[1]; modinfo.name = tilesetInfoList[0];
string tilesetDescription = tilesetInfoList[2]; modinfo.crc = tilesetInfoList[1];
string tilesetURL = tilesetInfoList[3]; modinfo.description = tilesetInfoList[2];
modinfo.url = tilesetInfoList[3];
//bool alreadyHasTileset = (std::find(tilesetFiles.begin(),tilesetFiles.end(),tilesetName) != tilesetFiles.end()); //bool alreadyHasTileset = (std::find(tilesetFiles.begin(),tilesetFiles.end(),tilesetName) != tilesetFiles.end());
tilesetCacheList[tilesetName] = tilesetURL; tilesetCacheList[modinfo.name] = modinfo;
GraphicButton *button=new GraphicButton(); GraphicButton *button=new GraphicButton();
button->init(tilesetInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight); button->init(tilesetInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight);
button->setText(tilesetName); button->setText(modinfo.name);
button->setUseCustomTexture(true); button->setUseCustomTexture(true);
button->setCustomTexture(CoreData::getInstance().getCustomTexture()); button->setCustomTexture(CoreData::getInstance().getCustomTexture());
@ -407,17 +430,19 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("techInfoList.size() [%d]\n",(int)techInfoList.size()); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("techInfoList.size() [%d]\n",(int)techInfoList.size());
if(techInfoList.size() >= 5) { if(techInfoList.size() >= 5) {
string techName = techInfoList[0]; ModInfo modinfo;
string techFactionCount = techInfoList[1]; modinfo.name = techInfoList[0];
string techCRC = techInfoList[2]; modinfo.count = techInfoList[1];
string techDescription = techInfoList[3]; modinfo.crc = techInfoList[2];
string techURL = techInfoList[4]; modinfo.description = techInfoList[3];
modinfo.url = techInfoList[4];
//bool alreadyHasTech = (std::find(techTreeFiles.begin(),techTreeFiles.end(),techName) != techTreeFiles.end()); //bool alreadyHasTech = (std::find(techTreeFiles.begin(),techTreeFiles.end(),techName) != techTreeFiles.end());
techCacheList[techName] = techURL; techCacheList[modinfo.name] = modinfo;
GraphicButton *button=new GraphicButton(); GraphicButton *button=new GraphicButton();
button->init(techInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight); button->init(techInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight);
button->setText(techName); button->setText(modinfo.name);
button->setUseCustomTexture(true); button->setUseCustomTexture(true);
button->setCustomTexture(CoreData::getInstance().getCustomTexture()); button->setCustomTexture(CoreData::getInstance().getCustomTexture());
@ -427,7 +452,7 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
keyTechButtons.push_back(button); keyTechButtons.push_back(button);
GraphicLabel *label=new GraphicLabel(); GraphicLabel *label=new GraphicLabel();
label->init(techInfoXPos + keyButtonsWidth+10,keyButtonsYBase,labelWidth,20); label->init(techInfoXPos + keyButtonsWidth+10,keyButtonsYBase,labelWidth,20);
label->setText(techFactionCount); label->setText(modinfo.count);
labelsTech.push_back(label); labelsTech.push_back(label);
} }
} }
@ -476,24 +501,26 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("mapInfoList.size() [%d]\n",(int)mapInfoList.size()); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("mapInfoList.size() [%d]\n",(int)mapInfoList.size());
if(mapInfoList.size() >= 5) { if(mapInfoList.size() >= 5) {
string mapName = mapInfoList[0]; ModInfo modinfo;
string mapPlayerCount = mapInfoList[1]; modinfo.name = mapInfoList[0];
string mapCRC = mapInfoList[2]; modinfo.count = mapInfoList[1];
string mapDescription = mapInfoList[3]; modinfo.crc = mapInfoList[2];
string mapURL = mapInfoList[4]; modinfo.description = mapInfoList[3];
modinfo.url = mapInfoList[4];
//bool alreadyHasMap = (std::find(mapFiles.begin(),mapFiles.end(),mapName) != mapFiles.end()); //bool alreadyHasMap = (std::find(mapFiles.begin(),mapFiles.end(),mapName) != mapFiles.end());
mapCacheList[mapName] = mapURL; mapCacheList[modinfo.name] = modinfo;
GraphicButton *button=new GraphicButton(); GraphicButton *button=new GraphicButton();
button->init(mapInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight); button->init(mapInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight);
button->setText(mapName); button->setText(modinfo.name);
button->setUseCustomTexture(true); button->setUseCustomTexture(true);
button->setCustomTexture(CoreData::getInstance().getCustomTexture()); button->setCustomTexture(CoreData::getInstance().getCustomTexture());
keyMapButtons.push_back(button); keyMapButtons.push_back(button);
GraphicLabel *label=new GraphicLabel(); GraphicLabel *label=new GraphicLabel();
label->init(mapInfoXPos + keyButtonsWidth + 10,keyButtonsYBase,labelWidth,20); label->init(mapInfoXPos + keyButtonsWidth + 10,keyButtonsYBase,labelWidth,20);
label->setText(mapPlayerCount); label->setText(modinfo.count);
labelsMap.push_back(label); labelsMap.push_back(label);
} }
} }
@ -542,15 +569,18 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("scenarioInfoList.size() [%d]\n",(int)scenarioInfoList.size()); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("scenarioInfoList.size() [%d]\n",(int)scenarioInfoList.size());
if(scenarioInfoList.size() >= 4) { if(scenarioInfoList.size() >= 4) {
string scenarioName = scenarioInfoList[0]; ModInfo modinfo;
string scenarioCRC = scenarioInfoList[1]; modinfo.name = scenarioInfoList[0];
string scenarioDescription = scenarioInfoList[2]; modinfo.crc = scenarioInfoList[1];
string scenarioURL = scenarioInfoList[3]; modinfo.description = scenarioInfoList[2];
scenarioCacheList[scenarioName] = scenarioURL; modinfo.url = scenarioInfoList[3];
scenarioCacheList[modinfo.name] = modinfo;
GraphicButton *button=new GraphicButton(); GraphicButton *button=new GraphicButton();
button->init(scenarioInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight); button->init(scenarioInfoXPos, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight);
button->setText(scenarioName); button->setText(modinfo.name);
button->setUseCustomTexture(true); button->setUseCustomTexture(true);
button->setCustomTexture(CoreData::getInstance().getCustomTexture()); button->setCustomTexture(CoreData::getInstance().getCustomTexture());
keyScenarioButtons.push_back(button); keyScenarioButtons.push_back(button);
@ -666,12 +696,13 @@ void MenuStateMods::refreshTechs() {
std::vector<std::string> techInfoList; std::vector<std::string> techInfoList;
Tokenize(techInfo,techInfoList,"|"); Tokenize(techInfo,techInfoList,"|");
if(techInfoList.size() >= 5) { if(techInfoList.size() >= 5) {
string techName = techInfoList[0]; ModInfo modinfo;
string techFactionCount = techInfoList[1]; modinfo.name = techInfoList[0];
string techCRC = techInfoList[2]; modinfo.count = techInfoList[1];
string techDescription = techInfoList[3]; modinfo.crc = techInfoList[2];
string techURL = techInfoList[4]; modinfo.description = techInfoList[3];
techCacheList[techName] = techURL; modinfo.url = techInfoList[4];
techCacheList[modinfo.name] = modinfo;
} }
} }
} }
@ -697,11 +728,13 @@ void MenuStateMods::refreshTilesets() {
std::vector<std::string> tilesetInfoList; std::vector<std::string> tilesetInfoList;
Tokenize(tilesetInfo,tilesetInfoList,"|"); Tokenize(tilesetInfo,tilesetInfoList,"|");
if(tilesetInfoList.size() >= 4) { if(tilesetInfoList.size() >= 4) {
string tilesetName = tilesetInfoList[0]; ModInfo modinfo;
string tilesetCRC = tilesetInfoList[1]; modinfo.name = tilesetInfoList[0];
string tilesetDescription = tilesetInfoList[2]; modinfo.crc = tilesetInfoList[1];
string tilesetURL = tilesetInfoList[3]; modinfo.description = tilesetInfoList[2];
tilesetCacheList[tilesetName] = tilesetURL; modinfo.url = tilesetInfoList[3];
tilesetCacheList[modinfo.name] = modinfo;
} }
} }
} }
@ -748,12 +781,13 @@ void MenuStateMods::refreshMaps() {
std::vector<std::string> mapInfoList; std::vector<std::string> mapInfoList;
Tokenize(mapInfo,mapInfoList,"|"); Tokenize(mapInfo,mapInfoList,"|");
if(mapInfoList.size() >= 5) { if(mapInfoList.size() >= 5) {
string mapName = mapInfoList[0]; ModInfo modinfo;
string mapPlayerCount = mapInfoList[1]; modinfo.name = mapInfoList[0];
string mapCRC = mapInfoList[2]; modinfo.count = mapInfoList[1];
string mapDescription = mapInfoList[3]; modinfo.crc = mapInfoList[2];
string mapURL = mapInfoList[4]; modinfo.description = mapInfoList[3];
mapCacheList[mapName] = mapURL; modinfo.url = mapInfoList[4];
mapCacheList[modinfo.name] = modinfo;
} }
} }
} }
@ -780,11 +814,11 @@ void MenuStateMods::refreshScenarios() {
std::vector<std::string> scenarioInfoList; std::vector<std::string> scenarioInfoList;
Tokenize(scenarioInfo,scenarioInfoList,"|"); Tokenize(scenarioInfo,scenarioInfoList,"|");
if(scenarioInfoList.size() >= 4) { if(scenarioInfoList.size() >= 4) {
string scenarioName = scenarioInfoList[0]; ModInfo modinfo;
string scenarioCRC = scenarioInfoList[1]; modinfo.name = scenarioInfoList[0];
string scenarioDescription = scenarioInfoList[2]; modinfo.crc = scenarioInfoList[1];
string scenarioURL = scenarioInfoList[3]; modinfo.description = scenarioInfoList[2];
scenarioCacheList[scenarioName] = scenarioURL; modinfo.url = scenarioInfoList[3];
} }
} }
} }
@ -1090,7 +1124,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
} }
else { else {
string techName = selectedTechName; string techName = selectedTechName;
string techURL = techCacheList[techName]; string techURL = techCacheList[techName].url;
ftpClientThread->addTechtreeToRequests(techName,techURL); ftpClientThread->addTechtreeToRequests(techName,techURL);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
fileFTPProgressList[techName] = pair<int,string>(0,""); fileFTPProgressList[techName] = pair<int,string>(0,"");
@ -1145,7 +1179,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
} }
else { else {
string tilesetName = selectedTilesetName; string tilesetName = selectedTilesetName;
string tilesetURL = tilesetCacheList[tilesetName]; string tilesetURL = tilesetCacheList[tilesetName].url;
ftpClientThread->addTilesetToRequests(tilesetName,tilesetURL); ftpClientThread->addTilesetToRequests(tilesetName,tilesetURL);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
fileFTPProgressList[tilesetName] = pair<int,string>(0,""); fileFTPProgressList[tilesetName] = pair<int,string>(0,"");
@ -1199,7 +1233,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
} }
else { else {
string mapName = selectedMapName; string mapName = selectedMapName;
string mapURL = mapCacheList[mapName]; string mapURL = mapCacheList[mapName].url;
ftpClientThread->addMapToRequests(mapName,mapURL); ftpClientThread->addMapToRequests(mapName,mapURL);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
fileFTPProgressList[mapName] = pair<int,string>(0,""); fileFTPProgressList[mapName] = pair<int,string>(0,"");
@ -1253,7 +1287,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
} }
else { else {
string scenarioName = selectedScenarioName; string scenarioName = selectedScenarioName;
string scenarioURL = scenarioCacheList[scenarioName]; string scenarioURL = scenarioCacheList[scenarioName].url;
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] adding file to download [%s]\n",__FILE__,__FUNCTION__,__LINE__,scenarioURL.c_str()); //if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] adding file to download [%s]\n",__FILE__,__FUNCTION__,__LINE__,scenarioURL.c_str());
ftpClientThread->addScenarioToRequests(scenarioName,scenarioURL); ftpClientThread->addScenarioToRequests(scenarioName,scenarioURL);
@ -1308,6 +1342,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
selectedScenarioName = ""; selectedScenarioName = "";
if(mapName != "") { if(mapName != "") {
selectedMapName = mapName; selectedMapName = mapName;
showDesription(&mapCacheList[selectedMapName]);
} }
break; break;
} }
@ -1324,6 +1359,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
selectedScenarioName = ""; selectedScenarioName = "";
if(techName != "") { if(techName != "") {
selectedTechName = techName; selectedTechName = techName;
showDesription(&techCacheList[selectedTechName]);
} }
break; break;
} }
@ -1340,6 +1376,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
selectedScenarioName = ""; selectedScenarioName = "";
if(tilesetName != "") { if(tilesetName != "") {
selectedTilesetName = tilesetName; selectedTilesetName = tilesetName;
showDesription(&tilesetCacheList[selectedTilesetName]);
} }
break; break;
} }
@ -1356,6 +1393,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
selectedScenarioName = ""; selectedScenarioName = "";
if(scenarioName != "") { if(scenarioName != "") {
selectedScenarioName = scenarioName; selectedScenarioName = scenarioName;
showDesription(&scenarioCacheList[selectedScenarioName]);
} }
break; break;
} }
@ -1368,6 +1406,10 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
} }
void MenuStateMods::showDesription(const ModInfo *modInfo) {
modDescrLabel.setText(modInfo->description);
}
void MenuStateMods::mouseMove(int x, int y, const MouseState *ms) { void MenuStateMods::mouseMove(int x, int y, const MouseState *ms) {
buttonReturn.mouseMove(x, y); buttonReturn.mouseMove(x, y);
@ -1437,6 +1479,8 @@ void MenuStateMods::render() {
renderer.renderButton(&buttonInstallScenario); renderer.renderButton(&buttonInstallScenario);
renderer.renderButton(&buttonRemoveScenario); renderer.renderButton(&buttonRemoveScenario);
renderer.renderLabel(&modDescrLabel);
// Render Tech List // Render Tech List
renderer.renderLabel(&keyTechScrollBarTitle1); renderer.renderLabel(&keyTechScrollBarTitle1);
renderer.renderLabel(&keyTechScrollBarTitle2); renderer.renderLabel(&keyTechScrollBarTitle2);

View File

@ -35,9 +35,24 @@ typedef vector<GraphicButton*> UserButtons;
typedef vector<GraphicLabel*> GraphicLabels; typedef vector<GraphicLabel*> GraphicLabels;
// =============================== // ===============================
// class MenuStateMods // class ModInfo
// =============================== // ===============================
class ModInfo{
public:
string name;
string url;
string imageUrl;
string description;
string count; // used for faction count for example
string crc;
public:
ModInfo();
};
// ===============================
// class MenuStateMods
// ===============================
class MenuStateMods: public MenuState, public FTPClientCallbackInterface, public SimpleTaskCallbackInterface { class MenuStateMods: public MenuState, public FTPClientCallbackInterface, public SimpleTaskCallbackInterface {
private: private:
@ -86,6 +101,8 @@ private:
GraphicScrollBar keyScenarioScrollBar; GraphicScrollBar keyScenarioScrollBar;
UserButtons keyScenarioButtons; UserButtons keyScenarioButtons;
GraphicLabel modDescrLabel;
int keyButtonsToRender; int keyButtonsToRender;
int keyButtonsYBase; int keyButtonsYBase;
int keyButtonsXBase; int keyButtonsXBase;
@ -98,25 +115,25 @@ private:
string selectedTechName; string selectedTechName;
std::vector<std::string> techListRemote; std::vector<std::string> techListRemote;
std::map<string, string> techCacheList; std::map<string, ModInfo> techCacheList;
vector<string> techTreeFiles; vector<string> techTreeFiles;
vector<string> techTreeFilesUserData; vector<string> techTreeFilesUserData;
string selectedTilesetName; string selectedTilesetName;
std::vector<std::string> tilesetListRemote; std::vector<std::string> tilesetListRemote;
std::map<string, string> tilesetCacheList; std::map<string, ModInfo> tilesetCacheList;
vector<string> tilesetFiles; vector<string> tilesetFiles;
vector<string> tilesetFilesUserData; vector<string> tilesetFilesUserData;
string selectedMapName; string selectedMapName;
std::vector<std::string> mapListRemote; std::vector<std::string> mapListRemote;
std::map<string, string> mapCacheList; std::map<string, ModInfo> mapCacheList;
vector<string> mapFiles; vector<string> mapFiles;
vector<string> mapFilesUserData; vector<string> mapFilesUserData;
string selectedScenarioName; string selectedScenarioName;
std::vector<std::string> scenarioListRemote; std::vector<std::string> scenarioListRemote;
std::map<string, string> scenarioCacheList; std::map<string, ModInfo> scenarioCacheList;
vector<string> scenarioFiles; vector<string> scenarioFiles;
vector<string> scenarioFilesUserData; vector<string> scenarioFilesUserData;
@ -137,6 +154,8 @@ private:
void getScenariosLocalList(); void getScenariosLocalList();
void refreshScenarios(); void refreshScenarios();
void showDesription(const ModInfo *modInfo);
public: public:
MenuStateMods(Program *program, MainMenu *mainMenu); MenuStateMods(Program *program, MainMenu *mainMenu);