mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: LOOT 0.10.3\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n"
|
||||
"POT-Creation-Date: 2017-02-02 20:25+0000\n"
|
||||
"POT-Creation-Date: 2017-02-05 13:37+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -674,7 +674,7 @@ msgid ""
|
||||
"Fallout 3, Fallout: New Vegas and Fallout 4."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query/get_game_data_query.h:43
|
||||
#: src/gui/query/get_game_data_query.h:45
|
||||
msgid "Parsing, merging and evaluating metadata..."
|
||||
msgstr ""
|
||||
|
||||
@@ -728,10 +728,12 @@ msgstr ""
|
||||
|
||||
#: src/gui/state/game.cpp:369
|
||||
msgid ""
|
||||
"An error occurred while parsing the metadata list(s): %1%. Try updating your "
|
||||
"masterlist to resolve the error. If the error is with your user metadata, "
|
||||
"this probably happened because an update to LOOT changed its metadata syntax "
|
||||
"support. Your user metadata will have to be updated manually.\n"
|
||||
"An error occurred while parsing the metadata list(s): %1%.\n"
|
||||
"\n"
|
||||
"Try updating your masterlist to resolve the error. If the error is with your "
|
||||
"user metadata, this probably happened because an update to LOOT changed its "
|
||||
"metadata syntax support. Your user metadata will have to be updated "
|
||||
"manually.\n"
|
||||
"\n"
|
||||
"To do so, use the 'Open Debug Log Location' in LOOT's main menu to open its "
|
||||
"data folder, then open your 'userlist.yaml' file in the relevant game "
|
||||
|
||||
+27
-19
@@ -88,17 +88,22 @@ void LootHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||
// Set window size & position.
|
||||
if (lootState_.isWindowPositionStored()) {
|
||||
#ifdef _WIN32
|
||||
RECT rc;
|
||||
rc.left = lootState_.getWindowPosition().left;
|
||||
rc.top = lootState_.getWindowPosition().top;
|
||||
rc.right = lootState_.getWindowPosition().right;
|
||||
rc.bottom = lootState_.getWindowPosition().bottom;
|
||||
WINDOWPLACEMENT windowPlacement;
|
||||
windowPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||
windowPlacement.rcNormalPosition.left = lootState_.getWindowPosition().left;
|
||||
windowPlacement.rcNormalPosition.top = lootState_.getWindowPosition().top;
|
||||
windowPlacement.rcNormalPosition.right = lootState_.getWindowPosition().right;
|
||||
windowPlacement.rcNormalPosition.bottom = lootState_.getWindowPosition().bottom;
|
||||
|
||||
if (lootState_.getWindowPosition().maximised) {
|
||||
windowPlacement.showCmd = SW_SHOWMAXIMIZED;
|
||||
}
|
||||
|
||||
// Fit the saved window size/position to the current monitor setup.
|
||||
|
||||
// Get the nearest monitor to the saved size/pos.
|
||||
HMONITOR hMonitor;
|
||||
hMonitor = MonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST);
|
||||
hMonitor = MonitorFromRect(&windowPlacement.rcNormalPosition, MONITOR_DEFAULTTONEAREST);
|
||||
|
||||
// Get the rect for the monitor's working area.
|
||||
MONITORINFO mi;
|
||||
@@ -106,14 +111,14 @@ void LootHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||
GetMonitorInfo(hMonitor, &mi);
|
||||
|
||||
// Clip the saved rect to fit inside the monitor rect.
|
||||
int width = rc.right - rc.left;
|
||||
int height = rc.bottom - rc.top;
|
||||
rc.left = max(mi.rcWork.left, min(mi.rcWork.right - width, rc.left));
|
||||
rc.top = max(mi.rcWork.top, min(mi.rcWork.bottom - height, rc.top));
|
||||
rc.right = rc.left + width;
|
||||
rc.bottom = rc.top + height;
|
||||
int width = windowPlacement.rcNormalPosition.right - windowPlacement.rcNormalPosition.left;
|
||||
int height = windowPlacement.rcNormalPosition.bottom - windowPlacement.rcNormalPosition.top;
|
||||
windowPlacement.rcNormalPosition.left = max(mi.rcWork.left, min(mi.rcWork.right - width, windowPlacement.rcNormalPosition.left));
|
||||
windowPlacement.rcNormalPosition.top = max(mi.rcWork.top, min(mi.rcWork.bottom - height, windowPlacement.rcNormalPosition.top));
|
||||
windowPlacement.rcNormalPosition.right = windowPlacement.rcNormalPosition.left + width;
|
||||
windowPlacement.rcNormalPosition.bottom = windowPlacement.rcNormalPosition.top + height;
|
||||
|
||||
SetWindowPos(hWnd, HWND_TOP, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW);
|
||||
SetWindowPlacement(hWnd, &windowPlacement);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef _WIN32
|
||||
@@ -154,14 +159,17 @@ void LootHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
||||
assert(CefCurrentlyOn(TID_UI));
|
||||
|
||||
#ifdef _WIN32
|
||||
RECT rc;
|
||||
GetWindowRect(browser->GetHost()->GetWindowHandle(), &rc);
|
||||
WINDOWPLACEMENT windowPlacement;
|
||||
windowPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||
|
||||
GetWindowPlacement(browser->GetHost()->GetWindowHandle(), &windowPlacement);
|
||||
|
||||
LootSettings::WindowPosition position;
|
||||
position.top = rc.top;
|
||||
position.bottom = rc.bottom;
|
||||
position.left = rc.left;
|
||||
position.right = rc.right;
|
||||
position.top = windowPlacement.rcNormalPosition.top;
|
||||
position.bottom = windowPlacement.rcNormalPosition.bottom;
|
||||
position.left = windowPlacement.rcNormalPosition.left;
|
||||
position.right = windowPlacement.rcNormalPosition.right;
|
||||
position.maximised = windowPlacement.showCmd == SW_SHOWMAXIMIZED;
|
||||
lootState_.storeWindowPosition(position);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ using std::recursive_mutex;
|
||||
using std::string;
|
||||
|
||||
namespace loot {
|
||||
LootSettings::WindowPosition::WindowPosition() : top(0), bottom(0), left(0), right(0) {}
|
||||
LootSettings::WindowPosition::WindowPosition() : top(0), bottom(0), left(0), right(0), maximised(false) {}
|
||||
|
||||
LootSettings::LootSettings() :
|
||||
gameSettings_({
|
||||
@@ -77,11 +77,13 @@ void LootSettings::load(YAML::Node& settings) {
|
||||
|
||||
if (settings["window"]
|
||||
&& settings["window"]["top"] && settings["window"]["bottom"]
|
||||
&& settings["window"]["left"] && settings["window"]["right"]) {
|
||||
&& settings["window"]["left"] && settings["window"]["right"]
|
||||
&& settings["window"]["maximised"]) {
|
||||
windowPosition_.top = settings["window"]["top"].as<long>();
|
||||
windowPosition_.bottom = settings["window"]["bottom"].as<long>();
|
||||
windowPosition_.left = settings["window"]["left"].as<long>();
|
||||
windowPosition_.right = settings["window"]["right"].as<long>();
|
||||
windowPosition_.maximised = settings["window"]["maximised"].as<bool>();
|
||||
}
|
||||
|
||||
if (settings["games"]) {
|
||||
@@ -223,6 +225,7 @@ YAML::Node LootSettings::toYaml() const {
|
||||
node["window"]["bottom"] = windowPosition_.bottom;
|
||||
node["window"]["left"] = windowPosition_.left;
|
||||
node["window"]["right"] = windowPosition_.right;
|
||||
node["window"]["maximised"] = windowPosition_.maximised;
|
||||
}
|
||||
|
||||
node["games"] = gameSettings_;
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
long bottom;
|
||||
long left;
|
||||
long right;
|
||||
bool maximised;
|
||||
};
|
||||
|
||||
LootSettings();
|
||||
|
||||
@@ -152,6 +152,7 @@ TEST_F(LootSettingsTest, loadingFromYamlShouldStoreLoadedValues) {
|
||||
inputYaml["lastGame"] = lastGame;
|
||||
inputYaml["lastVersion"] = lastVersion;
|
||||
inputYaml["window"] = window;
|
||||
inputYaml["window"]["maximised"] = true;
|
||||
inputYaml["games"] = games;
|
||||
inputYaml["filters"] = filters;
|
||||
|
||||
@@ -166,6 +167,7 @@ TEST_F(LootSettingsTest, loadingFromYamlShouldStoreLoadedValues) {
|
||||
EXPECT_EQ(2, settings_.getWindowPosition().bottom);
|
||||
EXPECT_EQ(3, settings_.getWindowPosition().left);
|
||||
EXPECT_EQ(4, settings_.getWindowPosition().right);
|
||||
EXPECT_TRUE(settings_.getWindowPosition().maximised);
|
||||
|
||||
const YAML::Node outputYaml = settings_.toYaml();
|
||||
EXPECT_EQ(updateMasterlist, outputYaml["updateMasterlist"].as<bool>());
|
||||
@@ -452,6 +454,7 @@ TEST_F(LootSettingsTest, toYamlShouldOutputStoredSettings) {
|
||||
inputYaml["lastGame"] = lastGame;
|
||||
inputYaml["lastVersion"] = lastVersion;
|
||||
inputYaml["window"] = window;
|
||||
inputYaml["window"]["maximised"] = true;
|
||||
inputYaml["games"] = games;
|
||||
inputYaml["filters"] = filters;
|
||||
|
||||
@@ -469,6 +472,7 @@ TEST_F(LootSettingsTest, toYamlShouldOutputStoredSettings) {
|
||||
for (const auto& position : window) {
|
||||
EXPECT_EQ(position.second, outputYaml["window"][position.first].as<long>());
|
||||
}
|
||||
EXPECT_TRUE(outputYaml["window"]["maximised"].as<bool>());
|
||||
|
||||
for (const auto& filter : filters) {
|
||||
EXPECT_EQ(filter.second, outputYaml["filters"][filter.first].as<bool>());
|
||||
|
||||
Reference in New Issue
Block a user