Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
c915b34bf1 | |||
3aa35cf151 | |||
dddae03915 | |||
dee6d988a6 | |||
e7bf5847d0 | |||
e846540ebd | |||
4ed73bf72d | |||
1084f26a88 | |||
b7c1089508 | |||
1734e7b055 | |||
42cffb6704 |
@@ -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>
|
||||
|
@@ -39,7 +39,7 @@
|
||||
2,111,2,2,2,3,2,58,51,59,61,54,31,32,22,22,22,35,25,49,39,4,3,3,43,42,42,47,36,49,38,38,39,2,87,2,44,30,26,36,36,30,23,23,22,22,22,22
|
||||
4,2,3,111,3,111,3,2,2,57,50,61,54,30,35,240@5,32,26,49,39,3,2,2,2,44,36,37,37,37,40,2,3,2,3,2,4,44,30,34,27,36,31,32,23,23,22,22,22
|
||||
4,3,2,3,2,3,111,3,2,58,59,50,53,31,25,36,31,25,40,3,4,2,3,2,45,46,36,36,37,48,41,2,2,2,2,2,44,30,22,26,36,36,30,23,23,22,22,22
|
||||
2,2,4,111,2,2,111,3,2:22,2,57,50,53,45,38,38,38,38,39,2,3,4,3,2,2,45*1,38,38,46,36,40,3,2,2,2,2,44,31,32,34,27,36,30,23,23,23,22,22
|
||||
2,2,4,111,2,2,111,3,2,2,57,50,53,45,38,38,38,38,39,2,3,4,3,2,2,45*1,38,38,46,36,40,3,2,2,2,2,44,31,32,34,27,36,30,23,23,23,22,22
|
||||
2,2,3,2,2,2,2,111,111,2,57,50,53,3,111,2,4,113,2,2,4,2,4,2,87,2,2,3,45,46,48,41,2,2,3,2,45,46,31,32,26,36,30,23,23,23,22,22
|
||||
111,3,3,2,111,111,2,111,2,2,57,50,53,2&9:1,111,112,4,2,2,2,3,2,3,43,41,2,2,2,87,44,37,40,2,2,2,4,3,45,46,30:17,26:17,36,30,22,23,23,22,22
|
||||
3,2,110,110:20,110,4,111,111,111,3,57,50,53,3,112,3,3,2,111,112,2,2,2,44,40,2,2,2,2,45,38,39,2,2,2,2,3,2,44,30,34,28,33,22,23,22,22,22
|
||||
|
@@ -445,6 +445,12 @@ void cDialog::recalcRect(){
|
||||
|
||||
winRect.right *= get_ui_scale();
|
||||
winRect.bottom *= get_ui_scale();
|
||||
// Uncomment if you need to measure any dialogs.
|
||||
/*
|
||||
LOG_VALUE(fname);
|
||||
LOG_VALUE(winRect.right);
|
||||
LOG_VALUE(winRect.bottom);
|
||||
//*/
|
||||
}
|
||||
|
||||
bool cDialog::initCalled = false;
|
||||
|
@@ -93,16 +93,19 @@ std::vector<fs::path> all_scen_dirs() {
|
||||
// and Itch meta files
|
||||
// (designers might want to ship a README.txt)
|
||||
fs::path itch_apps_path = scenDir/".."/".."/"itch"/"apps";
|
||||
for(fs::directory_iterator app_iter(itch_apps_path); app_iter != fs::directory_iterator(); app_iter++){
|
||||
fs::path app = *app_iter;
|
||||
for(fs::directory_iterator file_iter(app); file_iter != fs::directory_iterator(); file_iter++){
|
||||
fs::path file = *file_iter;
|
||||
if(file.extension() == ".boes"){
|
||||
scen_dirs.push_back(*app_iter);
|
||||
break;
|
||||
}else if(file.extension() == ".itch"){
|
||||
}else if(file.extension() != ".txt"){
|
||||
break;
|
||||
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"){
|
||||
scen_dirs.push_back(*app_iter);
|
||||
break;
|
||||
}else if(file.extension() == ".itch"){
|
||||
}else if(file.extension() != ".txt"){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
||||
@@ -1889,7 +1908,7 @@ class cFilePicker {
|
||||
save_files.resize(save_file_mtimes.size());
|
||||
|
||||
cStack& stk = get_stack();
|
||||
int num_pages = ceil((float)save_file_mtimes.size() / parties_per_page);
|
||||
int num_pages = max(1, ceil((float)save_file_mtimes.size() / parties_per_page));
|
||||
stk.setPageCount(num_pages);
|
||||
// HACK: For some reason which should be fixed, the buttons and labels on subsequent pages
|
||||
// aren't getting text on the static buttons and labels
|
||||
@@ -2098,7 +2117,7 @@ class cFilePicker {
|
||||
if(party_idx < parties_needed)
|
||||
populate_slot(slot_idx, save_file_mtimes[party_idx].first, save_file_mtimes[party_idx].second, save_files[party_idx]);
|
||||
else
|
||||
empty_slot(party_idx - start_idx);
|
||||
empty_slot(slot_idx);
|
||||
}
|
||||
|
||||
++pages_populated;
|
||||
|
@@ -102,6 +102,7 @@ std::string help_text_rsrc = "help";
|
||||
std::map<std::string,std::vector<std::string>> feature_flags = {
|
||||
// Legacy scenario flags
|
||||
{"resurrection-balm", {"required"}}, // This means it CAN be supported, if the scenario has the flag.
|
||||
{"conveyor-belts", {"V2"}}, // Diagonal conveyor belts and big monster physics
|
||||
// Legacy behavior of the T debug action (used by some replays)
|
||||
// does not change the party's outdoors location
|
||||
{"debug-enter-town", {"move-outdoors"}},
|
||||
@@ -1079,6 +1080,7 @@ void init_boe(int argc, char* argv[]) {
|
||||
init_tiling();
|
||||
init_snd_tool();
|
||||
|
||||
// see fallback_scale() in winutil.cpp for where the default UI scale is calculated based on screen size
|
||||
adjust_window_mode();
|
||||
init_ui();
|
||||
// If we don't do this now it'll flash white to start with
|
||||
|
@@ -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;
|
||||
|
@@ -56,14 +56,14 @@ struct terrain_view_t {
|
||||
// access to scenedit-specific global variables (which won't work unless we want to compile the common
|
||||
// sources 3 times), or globals redeclared for no reason in boe.main.cpp and pc.main.cpp
|
||||
struct editor_state_t {
|
||||
bool drawing;
|
||||
bool editing_town;
|
||||
bool drawing = false;
|
||||
bool editing_town = true; // I don't think this starting value of the default editor state matters.
|
||||
|
||||
short last_town_edited;
|
||||
short last_town_edited = 0;
|
||||
// Remember last view and zoom for each town
|
||||
std::map<short, terrain_view_t> town_view_state;
|
||||
|
||||
location last_out_edited;
|
||||
location last_out_edited = {0, 0};
|
||||
// Remember last view and zoom for each outdoor section--
|
||||
// but only for when the designer makes a discontinuous section change.
|
||||
// When simply shifting over by 1 section we won't want to
|
||||
|
@@ -3,8 +3,11 @@
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include "keymods.hpp"
|
||||
|
||||
// Measured on 5/23/25. For now, must be re-measured at 1x UI scale whenever preferences change (unless making the window smaller, maybe).
|
||||
short prefs_height = 529;
|
||||
|
||||
// The default scale should be the largest that the user's screen can fit all three
|
||||
// BoE application windows (because they should probably default to match each other).
|
||||
// BoE application windows and core dialogs of the main game (because they should probably default to match each other).
|
||||
double fallback_scale() {
|
||||
static double scale = 0;
|
||||
// Suppress the float comparison warning.
|
||||
@@ -17,7 +20,7 @@ double fallback_scale() {
|
||||
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
|
||||
|
||||
short max_width = max(boe_width, max(pc_width, scen_width));
|
||||
short max_height = max(boe_height, max(pc_height, scen_height)) + getMenubarHeight();
|
||||
short max_height = max(prefs_height, max(boe_height, max(pc_height, scen_height))) + getMenubarHeight();
|
||||
|
||||
std::vector<double> scale_options = {1.0, 1.5, 2.0, 3.0, 4.0};
|
||||
for(auto it = scale_options.rbegin(); it != scale_options.rend(); ++it){
|
||||
|
Reference in New Issue
Block a user