Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1fac99f882 | |||
dddae03915 | |||
dee6d988a6 |
@@ -46,7 +46,9 @@
|
||||
<text outline='double' name='start3' top='205' left='59' width='342' height='84'/>
|
||||
</page>
|
||||
</stack>
|
||||
<button name='prev' type='left' def-key='left' top='294' left='62'/>
|
||||
<button name='next' type='right' def-key='right' top='294' left='125'/>
|
||||
<button name='cancel' type='regular' top='294' left='337'>Cancel</button>
|
||||
<button name='cancel' type='regular' top='294' left='5'>Cancel</button>
|
||||
<button name='prev' type='left' def-key='left' relative='pos pos-in' rel-anchor='prev' top='0' left='14'/>
|
||||
<button name='next' type='right' def-key='right' relative='pos pos-in' rel-anchor='prev' top='0' left='0'/>
|
||||
<button name='folder' type='large' relative='pos pos-in' rel-anchor='prev' top='0' left='14'>Show Folder</button>
|
||||
<button name='refresh' type='regular' relative='pos pos-in' rel-anchor='prev' top='0' left='7'>Refresh</button>
|
||||
</dialog>
|
||||
|
@@ -96,6 +96,7 @@ std::vector<fs::path> all_scen_dirs() {
|
||||
if(fs::is_directory(itch_apps_path)){
|
||||
for(fs::directory_iterator app_iter(itch_apps_path); app_iter != fs::directory_iterator(); app_iter++){
|
||||
fs::path app = *app_iter;
|
||||
if(!fs::is_directory(app)) continue;
|
||||
for(fs::directory_iterator file_iter(app); file_iter != fs::directory_iterator(); file_iter++){
|
||||
fs::path file = *file_iter;
|
||||
if(file.extension() == ".boes"){
|
||||
|
@@ -1810,11 +1810,28 @@ class cChooseScenario {
|
||||
me.toast(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Show the custom scenario folder
|
||||
bool showFolder() {
|
||||
extern fs::path scenDir;
|
||||
launchURL("file://" + scenDir.string());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Refresh the scenario list (check if custom scenarios added/removed)
|
||||
bool refreshList() {
|
||||
scen_headers = build_scen_headers();
|
||||
auto& stk = dynamic_cast<cStack&>(me["list"]);
|
||||
short page = stk.getPage();
|
||||
// Redo the stack
|
||||
put_scen_info();
|
||||
// Put the viewer to the same page it was (clamped in case the list got shorter)
|
||||
stk.setPage(min(page, stk.getPageCount() - 1));
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
cChooseScenario() {
|
||||
// TODO: Add a button to jump to the scenarios folder
|
||||
// Note: if the player jumps to the scenarios folder and adds scenarios, build_scen_headers() must be called again
|
||||
scen_headers = build_scen_headers(); // TODO: Either make this local to this class, or make it take scen_headers by reference
|
||||
scen_headers = build_scen_headers();
|
||||
}
|
||||
scen_header_type run() {
|
||||
using namespace std::placeholders;
|
||||
@@ -1831,6 +1848,8 @@ public:
|
||||
me["scen1"].attachClickHandler(std::bind(&cChooseScenario::doSelectScenario, this, 0));
|
||||
me["scen2"].attachClickHandler(std::bind(&cChooseScenario::doSelectScenario, this, 1));
|
||||
me["scen3"].attachClickHandler(std::bind(&cChooseScenario::doSelectScenario, this, 2));
|
||||
me["folder"].attachClickHandler(std::bind(&cChooseScenario::showFolder, this));
|
||||
me["refresh"].attachClickHandler(std::bind(&cChooseScenario::refreshList, this));
|
||||
|
||||
put_scen_info();
|
||||
|
||||
|
@@ -1244,8 +1244,8 @@ void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y) {
|
||||
for(short tile_index = 0; tile_index < sector.city_locs.size(); tile_index++) {
|
||||
auto city_loc = sector.city_locs[tile_index];
|
||||
if(!univ.scenario.is_town_entrance_valid(city_loc) ||
|
||||
!does_location_have_special(sector, city_loc, eTerSpec::TOWN_ENTRANCE) ||
|
||||
!sector.is_on_map(city_loc)) {
|
||||
!sector.is_on_map(city_loc) ||
|
||||
!does_location_have_special(sector, city_loc, eTerSpec::TOWN_ENTRANCE)) {
|
||||
continue;
|
||||
}
|
||||
auto town_pos_x = AREA_MEDIUM * quadrant_x + sector.city_locs[tile_index].x;
|
||||
|
Reference in New Issue
Block a user