Fix up the pick custom scenario dialog
This commit is contained in:
@@ -1420,16 +1420,18 @@ static void put_scen_info(cDialog& me)
|
||||
const char *difficulty[] = {"Low","Medium","High","Very High"};
|
||||
|
||||
for(i = 0; i < 3; i++) {
|
||||
sout.clear();
|
||||
sout.str("");
|
||||
sout << i + 1;
|
||||
std::string n = sout.str();
|
||||
if (scen_headers.size() > (store_scen_page_on * 3 + i) && scen_headers.data(store_scen_page_on * 3 + i).flag1 != 0) {
|
||||
me["pict" + n].show();
|
||||
me["pic" + n].show();
|
||||
dynamic_cast<cPict&>(me["pic" + n]).setPict(scen_headers.data(store_scen_page_on * 3 + i).intro_pic);
|
||||
sout.str("");
|
||||
sout << scen_headers.strs(store_scen_page_on * 3 + i).name;
|
||||
sout << " v" << scen_headers.data(store_scen_page_on * 3 + i).ver[0];
|
||||
sout << '.' << scen_headers.data(store_scen_page_on * 3 + i).ver[1];
|
||||
sout << '.' << scen_headers.data(store_scen_page_on * 3 + i).ver[2];
|
||||
sout << " v" << int(scen_headers.data(store_scen_page_on * 3 + i).ver[0]);
|
||||
sout << '.' << int(scen_headers.data(store_scen_page_on * 3 + i).ver[1]);
|
||||
sout << '.' << int(scen_headers.data(store_scen_page_on * 3 + i).ver[2]);
|
||||
sout << " - | Difficulty: " << difficulty[scen_headers.data(store_scen_page_on * 3 + i).difficulty];
|
||||
sout << ", Rating: " << ratings[scen_headers.data(store_scen_page_on * 3 + i).rating];
|
||||
sout << " |" << scen_headers.strs(store_scen_page_on * 3 + i).who1;
|
||||
@@ -1438,7 +1440,7 @@ static void put_scen_info(cDialog& me)
|
||||
me["start" + n].show();
|
||||
}
|
||||
else {
|
||||
me["pict" + n].hide();
|
||||
me["pic" + n].hide();
|
||||
me["desc" + n].setText("");
|
||||
me["start" + n].hide();
|
||||
}
|
||||
|
||||
@@ -1023,7 +1023,6 @@ typedef struct {
|
||||
*/
|
||||
void build_scen_headers()
|
||||
{
|
||||
unsigned short cur_entry = 0;
|
||||
fs::path scenDir = progDir;
|
||||
// scenDir.erase(scenDir.find_last_of("/"));
|
||||
scenDir /= "Blades of Exile Scenarios";
|
||||
@@ -1057,10 +1056,9 @@ void build_scen_headers()
|
||||
// FSGetCatalogInfoBulk (files,(ItemCount)MAXSHEETS,(ItemCount*)&numFound,NULL,kFSCatInfoNone,NULL,NULL,locations, names)
|
||||
while(iter != fs::directory_iterator()) {
|
||||
fs::file_status stat = iter->status();
|
||||
if(stat.type() == fs::regular_file) {
|
||||
if(stat.type() == fs::regular_file)
|
||||
load_scenario_header(iter->path());
|
||||
cur_entry++;
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
if (scen_headers.size() == 0) { // no scens present
|
||||
// TODO: Should something be done here?
|
||||
|
||||
@@ -82,6 +82,7 @@ struct cCustomGraphics {
|
||||
bool is_old = false;
|
||||
void clear() {
|
||||
if(sheets != NULL) delete[] sheets;
|
||||
sheets = NULL;
|
||||
}
|
||||
~cCustomGraphics() {
|
||||
if(party != NULL) delete party;
|
||||
|
||||
Reference in New Issue
Block a user