mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 07:13:57 +02:00
new default LOD settings, and support for reset settings without crashing
This commit is contained in:
parent
0f8842f582
commit
93f8cfc80a
5 changed files with 32 additions and 15 deletions
|
@ -28,16 +28,23 @@
|
|||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||
|
||||
bool CrashHandler::checkForAndHandleCrash() {
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings settings;
|
||||
settings.beginGroup("Developer");
|
||||
QVariant displayCrashOptions = settings.value(MenuOption::DisplayCrashOptions);
|
||||
QVariant askToResetSettingsOption = settings.value(MenuOption::AskToResetSettings);
|
||||
settings.endGroup();
|
||||
bool askToResetSettings = askToResetSettingsOption.isValid() && askToResetSettingsOption.toBool();
|
||||
|
||||
// If option does not exist in Interface.ini so assume default behavior.
|
||||
bool displaySettingsResetOnCrash = !displayCrashOptions.isValid() || displayCrashOptions.toBool();
|
||||
|
||||
QFile runningMarkerFile(runningMarkerFilePath());
|
||||
if (runningMarkerFile.exists()) {
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings settings;
|
||||
settings.beginGroup("Developer");
|
||||
QVariant displayCrashOptions = settings.value(MenuOption::DisplayCrashOptions);
|
||||
settings.endGroup();
|
||||
if (!displayCrashOptions.isValid() // Option does not exist in Interface.ini so assume default behavior.
|
||||
|| displayCrashOptions.toBool()) {
|
||||
Action action = promptUserForAction();
|
||||
bool wasLikelyCrash = runningMarkerFile.exists();
|
||||
|
||||
if (wasLikelyCrash || askToResetSettings) {
|
||||
if (displaySettingsResetOnCrash || askToResetSettings) {
|
||||
Action action = promptUserForAction(wasLikelyCrash);
|
||||
if (action != DO_NOTHING) {
|
||||
handleCrash(action);
|
||||
}
|
||||
|
@ -47,13 +54,19 @@ bool CrashHandler::checkForAndHandleCrash() {
|
|||
return false;
|
||||
}
|
||||
|
||||
CrashHandler::Action CrashHandler::promptUserForAction() {
|
||||
CrashHandler::Action CrashHandler::promptUserForAction(bool showCrashMessage) {
|
||||
QDialog crashDialog;
|
||||
crashDialog.setWindowTitle("Interface Crashed Last Run");
|
||||
QLabel* label;
|
||||
if (showCrashMessage) {
|
||||
crashDialog.setWindowTitle("Interface Crashed Last Run");
|
||||
label = new QLabel("If you are having trouble starting would you like to reset your settings?");
|
||||
} else {
|
||||
crashDialog.setWindowTitle("Reset Settings");
|
||||
label = new QLabel("Would you like to reset your settings?");
|
||||
}
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
|
||||
QLabel* label = new QLabel("If you are having trouble starting would you like to reset your settings?");
|
||||
layout->addWidget(label);
|
||||
|
||||
QRadioButton* option1 = new QRadioButton("Reset all my settings");
|
||||
|
|
|
@ -29,7 +29,7 @@ private:
|
|||
DO_NOTHING
|
||||
};
|
||||
|
||||
static Action promptUserForAction();
|
||||
static Action promptUserForAction(bool showCrashMessage);
|
||||
static void handleCrash(Action action);
|
||||
|
||||
static const QString runningMarkerFilePath();
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#include <PIDController.h>
|
||||
#include <SimpleMovingAverage.h>
|
||||
|
||||
const float DEFAULT_DESKTOP_LOD_DOWN_FPS = 30.0;
|
||||
const float DEFAULT_HMD_LOD_DOWN_FPS = 45.0;
|
||||
const float DEFAULT_DESKTOP_LOD_DOWN_FPS = 20.0;
|
||||
const float DEFAULT_HMD_LOD_DOWN_FPS = 20.0;
|
||||
const float MAX_LIKELY_DESKTOP_FPS = 59.0; // this is essentially, V-synch - 1 fps
|
||||
const float MAX_LIKELY_HMD_FPS = 74.0; // this is essentially, V-synch - 1 fps
|
||||
const float INCREASE_LOD_GAP = 15.0f;
|
||||
|
|
|
@ -582,6 +582,9 @@ Menu::Menu() {
|
|||
}
|
||||
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls);
|
||||
|
||||
// Developer > Ask to Reset Settings
|
||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AskToResetSettings, 0, false);
|
||||
|
||||
// Developer > Display Crash Options
|
||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true);
|
||||
// Developer > Crash Application
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace MenuOption {
|
|||
const QString AnimDebugDrawAnimPose = "Debug Draw Animation";
|
||||
const QString AnimDebugDrawDefaultPose = "Debug Draw Default Pose";
|
||||
const QString AnimDebugDrawPosition= "Debug Draw Position";
|
||||
const QString AskToResetSettings = "Ask To Reset Settings";
|
||||
const QString AssetMigration = "ATP Asset Migration";
|
||||
const QString AssetServer = "Asset Browser";
|
||||
const QString Attachments = "Attachments...";
|
||||
|
|
Loading…
Reference in a new issue