Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
01deb71bee | |||
6559cb95fd | |||
093d6efcc7 | |||
0b9400ec4b |
@@ -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,18 @@ 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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1889,7 +1889,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 +2098,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;
|
||||
|
@@ -1079,6 +1079,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
|
||||
|
@@ -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