mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
ee3fa58bfa
## Description of change Adds `-mainmonitor` option which changes the monitor layout before launching the game. This is much more reliable than the old `-monitor` option which operated at DX9 level. This works for TDJ/UFC subscreens, for example. Rename `-monitor` option to `-dx9mainadapter` to discourage use. `-monitor` will continue to work, of course. Changing of primary monitor happens first before any orientation changes / refresh rate changes, which means those options will result in the logically correct configuration. Create a new option category for `Monitor` (rotate, refresh rate, etc). Add a monitor selection widget for `-mainmonitor` option in the configurator. Improve how we log names of monitors in the log during boot - should be less of "Generic PnP Monitor" after this.
88 lines
2.2 KiB
C++
88 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
enum class OptionType {
|
|
Bool,
|
|
Text,
|
|
Integer,
|
|
Enum,
|
|
Hex,
|
|
};
|
|
|
|
enum class OptionPickerType {
|
|
None,
|
|
AsioDriver,
|
|
EACard,
|
|
CpuAffinity,
|
|
FilePath,
|
|
DirectoryPath,
|
|
Monitor,
|
|
};
|
|
|
|
struct OptionDefinition {
|
|
std::string title;
|
|
// unique identifier used for flag matching but also stored in config files
|
|
// (should not be changed once published for compat)
|
|
std::string name;
|
|
// what's displayed in the UI/logs as the flag name
|
|
std::string display_name = "";
|
|
// slash-delimited list of strings that also work as flag
|
|
std::string aliases = "";
|
|
// what's displayed in the UI/logs as the tooltip
|
|
std::string desc;
|
|
OptionType type;
|
|
bool hidden = false;
|
|
std::string setting_name = "";
|
|
std::string game_name = "";
|
|
std::string category = "Development";
|
|
bool sensitive = false;
|
|
std::vector<std::pair<std::string, std::string>> elements = {};
|
|
bool disabled = false;
|
|
OptionPickerType picker = OptionPickerType::None;
|
|
|
|
// for OptionPickerType::FilePath
|
|
std::string file_extension = "";
|
|
};
|
|
|
|
class Option {
|
|
private:
|
|
OptionDefinition definition;
|
|
std::string search_string;
|
|
|
|
public:
|
|
std::string value;
|
|
std::vector<Option> alternatives;
|
|
bool disabled = false;
|
|
bool conflicting = false;
|
|
|
|
explicit Option(OptionDefinition definition, std::string value = "") :
|
|
definition(std::move(definition)), value(std::move(value)) {
|
|
};
|
|
|
|
inline const OptionDefinition &get_definition() const {
|
|
return this->definition;
|
|
}
|
|
inline void set_definition(OptionDefinition definition) {
|
|
this->definition = std::move(definition);
|
|
}
|
|
|
|
inline bool is_active() const {
|
|
return !this->value.empty();
|
|
}
|
|
|
|
void value_add(std::string new_value);
|
|
|
|
bool has_alternatives() const;
|
|
bool value_bool() const;
|
|
const std::string &value_text() const;
|
|
std::vector<std::string> values() const;
|
|
std::vector<std::string> values_text() const;
|
|
uint32_t value_uint32() const;
|
|
uint64_t value_hex64() const;
|
|
bool search_match(const std::string &query_in_lower_case);
|
|
};
|