mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
+34
-4
@@ -124,13 +124,13 @@ set(YAML_CPP_INCLUDE_DIRS "${SOURCE_DIR}/include")
|
||||
set(YAML_CPP_LIBRARIES "${BINARY_DIR}/${CMAKE_CFG_INTDIR}/libyaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_windows32_minimal.tar.bz2")
|
||||
set(CEF_URL_HASH "8d0bb1ba2abccebef1e0d45fa2bb9c7ed7ec60de")
|
||||
set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2785.1466.g80e473e_windows32_minimal.tar.bz2")
|
||||
set(CEF_URL_HASH "31086a64fb226cdb4b4ce5a93d5eb32ea0308c17")
|
||||
set(CEF_PRECOMPILED_BINARIES "libcef.dll" "natives_blob.bin" "snapshot_blob.bin" "d3dcompiler_47.dll" "libEGL.dll" "libGLESv2.dll")
|
||||
set(CEF_LIB libcef${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
ELSE ()
|
||||
set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_linux64_minimal.tar.bz2")
|
||||
set(CEF_URL_HASH "9a8f227d08d9c4edb6636041375b900d6b864e12")
|
||||
set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2785.1465.g87ce149_linux64_minimal.tar.bz2")
|
||||
set(CEF_URL_HASH "78352474cc6db47aa517596fd44a99940a408c2e")
|
||||
set(CEF_PRECOMPILED_BINARIES "libcef.so" "natives_blob.bin" "snapshot_blob.bin" "chrome-sandbox")
|
||||
set(CEF_LIB libcef${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
ENDIF()
|
||||
@@ -234,6 +234,36 @@ set (LOOT_GUI_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/editor_message.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/loot_handler.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/loot_app.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/loot_scheme_handler_factory.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/apply_sort_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/cancel_find_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/cancel_sort_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/change_game_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/clear_all_metadata_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/clear_plugin_metadata_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/clipboard_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/close_settings_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/copy_content_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/copy_load_order_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/copy_metadata_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/discard_unapplied_changes_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/editor_opened_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/editor_closed_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_conflicting_plugins_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_game_data_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_game_types_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_init_errors_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_installed_games_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_languages_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_settings_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/get_version_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/metadata_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/open_log_location_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/open_readme_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/redate_plugins_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/save_filter_state_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/sort_plugins_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/update_masterlist_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query_handler.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/resource.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/yaml_simple_message_helpers.h")
|
||||
|
||||
+19
-19
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: LOOT 0.9.2\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n"
|
||||
"POT-Creation-Date: 2016-08-17 18:15+0100\n"
|
||||
"POT-Creation-Date: 2016-09-10 10:52+0100\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"
|
||||
@@ -584,32 +584,32 @@ msgid ""
|
||||
"can be accessed through the main menu."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:111
|
||||
#: src/gui/query_handler.cpp:133
|
||||
msgid "Parsing, merging and evaluating metadata..."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:203 src/gui/query_handler.cpp:206
|
||||
#: src/gui/query_handler.cpp:191 src/gui/query_handler.cpp:194
|
||||
msgid "Failed to change game. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:220 src/gui/query_handler.cpp:223
|
||||
#: src/gui/query_handler.cpp:298 src/gui/query_handler.cpp:301
|
||||
#: src/gui/query_handler.cpp:329 src/gui/query_handler.cpp:332
|
||||
#: src/gui/query_handler.cpp:208 src/gui/query_handler.cpp:211
|
||||
#: src/gui/query_handler.cpp:289 src/gui/query_handler.cpp:292
|
||||
#: src/gui/query_handler.cpp:320 src/gui/query_handler.cpp:323
|
||||
msgid "Failed to copy plugin metadata. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:238 src/gui/query_handler.cpp:248
|
||||
#: src/gui/query_handler.cpp:229 src/gui/query_handler.cpp:239
|
||||
msgid "Failed to apply plugin metadata. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:601
|
||||
#: src/gui/query_handler.cpp:592
|
||||
msgid ""
|
||||
"An error occurred while parsing the masterlist: %1%. This probably happened "
|
||||
"because an update to LOOT changed its metadata syntax support. Try updating "
|
||||
"your masterlist to resolve the error."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:616
|
||||
#: src/gui/query_handler.cpp:607
|
||||
msgid ""
|
||||
"An error occurred while parsing the userlist: %1%. This probably happened "
|
||||
"because an update to LOOT changed its metadata syntax support. Your user "
|
||||
@@ -625,33 +625,33 @@ msgid ""
|
||||
"[LOOT's website](https://loot.github.io/)."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:721 src/gui/query_handler.cpp:724
|
||||
#: src/gui/query_handler.cpp:712 src/gui/query_handler.cpp:715
|
||||
msgid "Failed to get game data. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:806 src/gui/query_handler.cpp:809
|
||||
#: src/gui/query_handler.cpp:797 src/gui/query_handler.cpp:800
|
||||
msgid "Failed to update the masterlist. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:848
|
||||
#: src/gui/query_handler.cpp:839
|
||||
msgid "Loading plugin contents..."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:852
|
||||
#: src/gui/query_handler.cpp:843
|
||||
msgid "Sorting load order..."
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:909
|
||||
#: src/gui/query_handler.cpp:900
|
||||
msgid "Failed to sort plugins. Details: %1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:939
|
||||
#: src/gui/query_handler.cpp:931
|
||||
msgid ""
|
||||
"A global message contains a condition that could not be evaluated. Details: "
|
||||
"%1%"
|
||||
msgstr ""
|
||||
|
||||
#: src/gui/query_handler.cpp:961 src/backend/plugin/plugin_sorter.cpp:217
|
||||
#: src/gui/query_handler.cpp:963 src/backend/plugin/plugin_sorter.cpp:217
|
||||
msgid "\"%1%\" contains a condition that could not be evaluated. Details: %2%"
|
||||
msgstr ""
|
||||
|
||||
@@ -759,12 +759,12 @@ msgstr ""
|
||||
msgid "Failed to open file in its default application."
|
||||
msgstr ""
|
||||
|
||||
#: src/backend/metadata/condition_evaluator.cpp:173
|
||||
#: src/backend/metadata/condition_evaluator.cpp:171
|
||||
msgid "Invalid file path:"
|
||||
msgstr ""
|
||||
|
||||
#: src/backend/metadata/condition_evaluator.cpp:183
|
||||
#: src/backend/metadata/condition_evaluator.cpp:223
|
||||
#: src/backend/metadata/condition_evaluator.cpp:181
|
||||
#: src/backend/metadata/condition_evaluator.cpp:221
|
||||
msgid "Invalid regex string \"%1%\": %2%"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ PluginCleanliness ApiDatabase::GetPluginCleanliness(const std::string& plugin) {
|
||||
// This isn't a very reliable system, because if the lists have been evaluated in some language
|
||||
// other than English, the strings will be in different languages (and the API can't tell what they'd be)
|
||||
// and the strings may be non-standard and begin with something other than "Do not clean." anyway.
|
||||
std::list<Message> messages(game_.GetMasterlist().FindPlugin(PluginMetadata(plugin)).Messages());
|
||||
std::vector<Message> messages(game_.GetMasterlist().FindPlugin(PluginMetadata(plugin)).Messages());
|
||||
|
||||
for (const auto& message : messages) {
|
||||
if (boost::starts_with(message.GetContent(LanguageCode::english).GetText(), "Do not clean")) {
|
||||
|
||||
@@ -32,7 +32,7 @@ along with LOOT. If not, see
|
||||
|
||||
namespace loot {
|
||||
namespace JSON {
|
||||
YAML::Node parse(std::string& json) {
|
||||
YAML::Node parse(const std::string& json) {
|
||||
return YAML::Load(json);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
#include "backend/helpers/helpers.h"
|
||||
|
||||
using std::inserter;
|
||||
using std::list;
|
||||
using std::regex;
|
||||
using std::regex_match;
|
||||
using std::set;
|
||||
using std::vector;
|
||||
|
||||
namespace loot {
|
||||
PluginMetadata::PluginMetadata() : enabled_(true) {}
|
||||
@@ -128,11 +128,11 @@ PluginMetadata PluginMetadata::DiffMetadata(const PluginMetadata& plugin) const
|
||||
inserter(filesDiff, begin(filesDiff)));
|
||||
p.Incs(filesDiff);
|
||||
|
||||
list<Message> msgs1 = plugin.Messages();
|
||||
list<Message> msgs2 = messages_;
|
||||
msgs1.sort();
|
||||
msgs2.sort();
|
||||
list<Message> mDiff;
|
||||
vector<Message> msgs1 = plugin.Messages();
|
||||
vector<Message> msgs2 = messages_;
|
||||
std::sort(begin(msgs1), end(msgs1));
|
||||
std::sort(begin(msgs2), end(msgs2));
|
||||
vector<Message> mDiff;
|
||||
set_symmetric_difference(begin(msgs2),
|
||||
end(msgs2),
|
||||
begin(msgs1),
|
||||
@@ -206,11 +206,11 @@ PluginMetadata PluginMetadata::NewMetadata(const PluginMetadata& plugin) const {
|
||||
inserter(filesDiff, begin(filesDiff)));
|
||||
p.Incs(filesDiff);
|
||||
|
||||
list<Message> msgs1 = plugin.Messages();
|
||||
list<Message> msgs2 = messages_;
|
||||
msgs1.sort();
|
||||
msgs2.sort();
|
||||
list<Message> mDiff;
|
||||
vector<Message> msgs1 = plugin.Messages();
|
||||
vector<Message> msgs2 = messages_;
|
||||
std::sort(begin(msgs1), end(msgs1));
|
||||
std::sort(begin(msgs2), end(msgs2));
|
||||
vector<Message> mDiff;
|
||||
set_difference(begin(msgs2),
|
||||
end(msgs2),
|
||||
begin(msgs1),
|
||||
@@ -281,7 +281,7 @@ std::set<File> PluginMetadata::Incs() const {
|
||||
return incompatibilities_;
|
||||
}
|
||||
|
||||
std::list<Message> PluginMetadata::Messages() const {
|
||||
std::vector<Message> PluginMetadata::Messages() const {
|
||||
return messages_;
|
||||
}
|
||||
|
||||
@@ -301,8 +301,8 @@ std::set<Location> PluginMetadata::Locations() const {
|
||||
return locations_;
|
||||
}
|
||||
|
||||
std::list<SimpleMessage> PluginMetadata::SimpleMessages(const LanguageCode language) const {
|
||||
std::list<SimpleMessage> simpleMessages(messages_.size());
|
||||
std::vector<SimpleMessage> PluginMetadata::SimpleMessages(const LanguageCode language) const {
|
||||
std::vector<SimpleMessage> simpleMessages(messages_.size());
|
||||
std::transform(begin(messages_), end(messages_), begin(simpleMessages), [&](const Message& message) {
|
||||
return message.ToSimpleMessage(language);
|
||||
});
|
||||
@@ -334,7 +334,7 @@ void PluginMetadata::Incs(const std::set<File>& i) {
|
||||
incompatibilities_ = i;
|
||||
}
|
||||
|
||||
void PluginMetadata::Messages(const std::list<Message>& m) {
|
||||
void PluginMetadata::Messages(const std::vector<Message>& m) {
|
||||
messages_ = m;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,13 +71,13 @@ public:
|
||||
std::set<File> LoadAfter() const;
|
||||
std::set<File> Reqs() const;
|
||||
std::set<File> Incs() const;
|
||||
std::list<Message> Messages() const;
|
||||
std::vector<Message> Messages() const;
|
||||
std::set<Tag> Tags() const;
|
||||
std::set<PluginCleaningData> DirtyInfo() const;
|
||||
std::set<PluginCleaningData> CleanInfo() const;
|
||||
std::set<Location> Locations() const;
|
||||
|
||||
std::list<SimpleMessage> SimpleMessages(const LanguageCode language) const;
|
||||
std::vector<SimpleMessage> SimpleMessages(const LanguageCode language) const;
|
||||
|
||||
void Enabled(const bool enabled);
|
||||
void LocalPriority(const Priority& priority);
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
void LoadAfter(const std::set<File>& after);
|
||||
void Reqs(const std::set<File>& reqs);
|
||||
void Incs(const std::set<File>& incs);
|
||||
void Messages(const std::list<Message>& messages);
|
||||
void Messages(const std::vector<Message>& messages);
|
||||
void Tags(const std::set<Tag>& tags);
|
||||
void DirtyInfo(const std::set<PluginCleaningData>& info);
|
||||
void CleanInfo(const std::set<PluginCleaningData>& info);
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
bool operator == (const std::string& rhs) const;
|
||||
bool operator != (const std::string& rhs) const;
|
||||
protected:
|
||||
std::list<Message> messages_;
|
||||
std::vector<Message> messages_;
|
||||
std::set<Tag> tags_;
|
||||
private:
|
||||
std::string name_;
|
||||
@@ -201,7 +201,7 @@ struct convert<loot::PluginMetadata> {
|
||||
if (node["inc"])
|
||||
rhs.Incs(node["inc"].as<std::set<loot::File>>());
|
||||
if (node["msg"])
|
||||
rhs.Messages(node["msg"].as<std::list<loot::Message>>());
|
||||
rhs.Messages(node["msg"].as<std::vector<loot::Message>>());
|
||||
if (node["tag"])
|
||||
rhs.Tags(node["tag"].as<std::set<loot::Tag>>());
|
||||
if (node["dirty"]) {
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
#include "loot/error.h"
|
||||
#include "backend/game/game.h"
|
||||
|
||||
using std::list;
|
||||
|
||||
namespace loot {
|
||||
void MetadataList::Load(const boost::filesystem::path& filepath) {
|
||||
Clear();
|
||||
@@ -58,7 +56,7 @@ void MetadataList::Load(const boost::filesystem::path& filepath) {
|
||||
}
|
||||
}
|
||||
if (metadataList["globals"])
|
||||
messages_ = metadataList["globals"].as<list<Message>>();
|
||||
messages_ = metadataList["globals"].as<std::vector<Message>>();
|
||||
|
||||
if (metadataList["bash_tags"])
|
||||
bashTags_ = metadataList["bash_tags"].as<std::set<std::string>>();
|
||||
@@ -89,14 +87,14 @@ void MetadataList::Clear() {
|
||||
}
|
||||
|
||||
std::list<PluginMetadata> MetadataList::Plugins() const {
|
||||
list<PluginMetadata> pluginList(plugins_.begin(), plugins_.end());
|
||||
std::list<PluginMetadata> pluginList(plugins_.begin(), plugins_.end());
|
||||
|
||||
pluginList.insert(pluginList.end(), regexPlugins_.begin(), regexPlugins_.end());
|
||||
|
||||
return pluginList;
|
||||
}
|
||||
|
||||
std::list<Message> MetadataList::Messages() const {
|
||||
std::vector<Message> MetadataList::Messages() const {
|
||||
return messages_;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void Clear();
|
||||
|
||||
std::list<PluginMetadata> Plugins() const;
|
||||
std::list<Message> Messages() const;
|
||||
std::vector<Message> Messages() const;
|
||||
std::set<std::string> BashTags() const;
|
||||
|
||||
// Merges multiple matching regex entries if any are found.
|
||||
@@ -63,7 +63,7 @@ protected:
|
||||
std::set<std::string> bashTags_;
|
||||
std::unordered_set<PluginMetadata> plugins_;
|
||||
std::list<PluginMetadata> regexPlugins_;
|
||||
std::list<Message> messages_;
|
||||
std::vector<Message> messages_;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
using std::list;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
namespace loot {
|
||||
typedef boost::graph_traits<PluginGraph>::vertex_iterator vertex_it;
|
||||
@@ -99,7 +100,6 @@ private:
|
||||
};
|
||||
|
||||
std::vector<Plugin> PluginSorter::Sort(Game& game, const LanguageCode language) {
|
||||
using std::vector;
|
||||
// Clear existing data.
|
||||
graph_.clear();
|
||||
indexMap_.clear();
|
||||
@@ -213,7 +213,7 @@ void PluginSorter::AddPluginVertices(Game& game, const LanguageCode language) {
|
||||
graph_[v].EvalAllConditions(game);
|
||||
} catch (std::exception& e) {
|
||||
BOOST_LOG_TRIVIAL(error) << "\"" << graph_[v].Name() << "\" contains a condition that could not be evaluated. Details: " << e.what();
|
||||
list<Message> messages(graph_[v].Messages());
|
||||
vector<Message> messages(graph_[v].Messages());
|
||||
messages.push_back(Message(MessageType::error, (boost::format(boost::locale::translate("\"%1%\" contains a condition that could not be evaluated. Details: %2%")) % graph_[v].Name() % e.what()).str()));
|
||||
graph_[v].Messages(messages);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ function onConflictsFilter(evt) {
|
||||
}
|
||||
|
||||
function onChangeGame(evt) {
|
||||
if (evt.detail.item.getAttribute('value') === loot.game.folder) {
|
||||
if (evt.detail.item.getAttribute('value') === loot.game.folder
|
||||
|| loot.game.folder.length === 0) {
|
||||
// Game folder length is zero if LOOT is being initalised.
|
||||
return;
|
||||
}
|
||||
/* Send off a CEF query with the folder name of the new game. */
|
||||
@@ -369,7 +371,7 @@ function onEditorClose(evt) {
|
||||
} else {
|
||||
/* Don't need to record changes, but still need to notify C++ side that
|
||||
the editor has been closed. */
|
||||
promise = loot.query('editorClosed');
|
||||
promise = loot.query('editorClosed', 'null');
|
||||
}
|
||||
promise.catch(loot.handlePromiseError).then(() => {
|
||||
/* Remove body attribute so that sidebar items are styled correctly. */
|
||||
|
||||
@@ -12,15 +12,10 @@
|
||||
if (!requestName) {
|
||||
throw new Error('No request name passed');
|
||||
}
|
||||
let request;
|
||||
if (args.length === 0) {
|
||||
request = requestName;
|
||||
} else {
|
||||
request = JSON.stringify({
|
||||
name: requestName,
|
||||
args,
|
||||
});
|
||||
}
|
||||
const request = JSON.stringify({
|
||||
name: requestName,
|
||||
args,
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
window.cefQuery({
|
||||
request,
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_APPLY_SORT_QUERY
|
||||
#define LOOT_GUI_QUERY_APPLY_SORT_QUERY
|
||||
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
class ApplySortQuery : public Query {
|
||||
public:
|
||||
ApplySortQuery(LootState& state, const std::vector<std::string>& plugins) :
|
||||
state_(state), plugins_(plugins) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
BOOST_LOG_TRIVIAL(trace) << "User has accepted sorted load order, applying it.";
|
||||
state_.decrementUnappliedChangeCounter();
|
||||
state_.getCurrentGame().SetLoadOrder(plugins_);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
LootState& state_;
|
||||
const std::vector<std::string> plugins_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CANCEL_FIND_QUERY
|
||||
#define LOOT_GUI_QUERY_CANCEL_FIND_QUERY
|
||||
|
||||
#include <include/cef_browser.h>
|
||||
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
class CancelFindQuery : public Query {
|
||||
public:
|
||||
CancelFindQuery(CefRefPtr<CefBrowser> browser) : browser_(browser) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
browser_->GetHost()->StopFinding(true);
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
const CefRefPtr<CefBrowser> browser_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CANCEL_SORT_QUERY
|
||||
#define LOOT_GUI_QUERY_CANCEL_SORT_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "backend/helpers/json.h"
|
||||
#include "gui/query/metadata_query.h"
|
||||
|
||||
namespace loot {
|
||||
class CancelSortQuery : public MetadataQuery {
|
||||
public:
|
||||
CancelSortQuery(LootState& state) :
|
||||
MetadataQuery(state),
|
||||
state_(state) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
state_.decrementUnappliedChangeCounter();
|
||||
state_.getCurrentGame().DecrementLoadOrderSortCount();
|
||||
|
||||
return JSON::stringify(YAML::Node(getGeneralMessages()));
|
||||
}
|
||||
|
||||
private:
|
||||
LootState& state_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CHANGE_GAME_QUERY
|
||||
#define LOOT_GUI_QUERY_CHANGE_GAME_QUERY
|
||||
|
||||
#include <boost/locale.hpp>
|
||||
|
||||
#include "backend/helpers/json.h"
|
||||
#include "gui/query/get_game_data_query.h"
|
||||
|
||||
namespace loot {
|
||||
class ChangeGameQuery : public GetGameDataQuery {
|
||||
public:
|
||||
ChangeGameQuery(LootState& state, CefRefPtr<CefFrame> frame, const std::string& gameFolder) :
|
||||
GetGameDataQuery(state, frame),
|
||||
state_(state),
|
||||
gameFolder_(gameFolder) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
state_.changeGame(gameFolder_);
|
||||
|
||||
return GetGameDataQuery::executeLogic();
|
||||
}
|
||||
|
||||
private:
|
||||
LootState& state_;
|
||||
const std::string gameFolder_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CLEAR_ALL_METADATA_QUERY
|
||||
#define LOOT_GUI_QUERY_CLEAR_ALL_METADATA_QUERY
|
||||
|
||||
#include "backend/game/game.h"
|
||||
#include "backend/helpers/json.h"
|
||||
#include "gui/query/metadata_query.h"
|
||||
|
||||
namespace loot {
|
||||
class ClearAllMetadataQuery : public MetadataQuery {
|
||||
public:
|
||||
ClearAllMetadataQuery(LootState& state) :
|
||||
MetadataQuery(state),
|
||||
game_(state.getCurrentGame()) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Clearing all user metadata.";
|
||||
|
||||
// Record which plugins have userlist entries.
|
||||
auto userlistPluginNames = getUserlistPluginNames();
|
||||
|
||||
// Clear the user metadata.
|
||||
game_.GetUserlist().Clear();
|
||||
game_.GetUserlist().Save(game_.UserlistPath());
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Rederiving display metadata for " << userlistPluginNames.size() << " plugins that had user metadata.";
|
||||
|
||||
return getDerivedMetadataJson(userlistPluginNames);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::string> getUserlistPluginNames() const {
|
||||
auto userlistPlugins = game_.GetUserlist().Plugins();
|
||||
std::vector<std::string> userlistPluginNames(userlistPlugins.size());
|
||||
std::transform(begin(userlistPlugins),
|
||||
end(userlistPlugins),
|
||||
begin(userlistPluginNames),
|
||||
[](const PluginMetadata& plugin) {
|
||||
return plugin.Name();
|
||||
});
|
||||
|
||||
return userlistPluginNames;
|
||||
}
|
||||
|
||||
std::string getDerivedMetadataJson(const std::vector<std::string>& userlistPluginNames) {
|
||||
YAML::Node pluginsNode;
|
||||
for (const auto &pluginName : userlistPluginNames) {
|
||||
pluginsNode.push_back(generateDerivedMetadata(pluginName));
|
||||
}
|
||||
|
||||
if (pluginsNode.size() > 0)
|
||||
return JSON::stringify(pluginsNode);
|
||||
else
|
||||
return "[]";
|
||||
}
|
||||
|
||||
Game& game_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CLEAR_PLUGIN_METADATA_QUERY
|
||||
#define LOOT_GUI_QUERY_CLEAR_PLUGIN_METADATA_QUERY
|
||||
|
||||
#include "backend/game/game.h"
|
||||
#include "backend/helpers/json.h"
|
||||
#include "gui/query/metadata_query.h"
|
||||
|
||||
namespace loot {
|
||||
class ClearPluginMetadataQuery : public MetadataQuery {
|
||||
public:
|
||||
ClearPluginMetadataQuery(LootState& state, const std::string& pluginName) :
|
||||
MetadataQuery(state),
|
||||
game_(state.getCurrentGame()),
|
||||
pluginName_(pluginName) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Clearing user metadata for plugin " << pluginName_;
|
||||
|
||||
game_.GetUserlist().ErasePlugin(PluginMetadata(pluginName_));
|
||||
game_.GetUserlist().Save(game_.UserlistPath());
|
||||
|
||||
// Now rederive the displayed metadata from the masterlist.
|
||||
YAML::Node derivedMetadata = generateDerivedMetadata(pluginName_);
|
||||
if (derivedMetadata.size() > 0)
|
||||
return JSON::stringify(derivedMetadata);
|
||||
|
||||
return "null";
|
||||
}
|
||||
|
||||
private:
|
||||
Game& game_;
|
||||
const std::string pluginName_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CLIPBOARD_QUERY
|
||||
#define LOOT_GUI_QUERY_CLIPBOARD_QUERY
|
||||
|
||||
#include "backend/helpers/helpers.h"
|
||||
#include "gui/query/query.h"
|
||||
#include "loot/error.h"
|
||||
|
||||
namespace loot {
|
||||
class ClipboardQuery : public Query {
|
||||
protected:
|
||||
void copyToClipboard(const std::string& text) {
|
||||
#ifdef _WIN32
|
||||
if (!OpenClipboard(NULL)) {
|
||||
throw Error(Error::Code::windows_error, "Failed to open the Windows clipboard.");
|
||||
}
|
||||
|
||||
if (!EmptyClipboard()) {
|
||||
throw Error(Error::Code::windows_error, "Failed to empty the Windows clipboard.");
|
||||
}
|
||||
|
||||
// The clipboard takes a Unicode (ie. UTF-16) string that it then owns and must not
|
||||
// be destroyed by LOOT. Convert the string, then copy it into a new block of
|
||||
// memory for the clipboard.
|
||||
std::wstring wtext = ToWinWide(text);
|
||||
wchar_t * wcstr = new wchar_t[wtext.length() + 1];
|
||||
wcscpy(wcstr, wtext.c_str());
|
||||
|
||||
if (SetClipboardData(CF_UNICODETEXT, wcstr) == NULL) {
|
||||
throw Error(Error::Code::windows_error, "Failed to copy metadata to the Windows clipboard.");
|
||||
}
|
||||
|
||||
if (!CloseClipboard()) {
|
||||
throw Error(Error::Code::windows_error, "Failed to close the Windows clipboard.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_CLOSE_SETTINGS_QUERY
|
||||
#define LOOT_GUI_QUERY_CLOSE_SETTINGS_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/query/get_installed_games_query.h"
|
||||
|
||||
namespace loot {
|
||||
class CloseSettingsQuery : public GetInstalledGamesQuery {
|
||||
public:
|
||||
CloseSettingsQuery(LootState& state, YAML::Node settings) :
|
||||
GetInstalledGamesQuery(state), state_(state), settings_(settings) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Settings dialog closed and changes accepted, updating settings object.";
|
||||
state_.load(settings_);
|
||||
|
||||
return GetInstalledGamesQuery::executeLogic();
|
||||
}
|
||||
|
||||
private:
|
||||
LootState& state_;
|
||||
YAML::Node settings_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
/* LOOT
|
||||
|
||||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
Fallout: New Vegas.
|
||||
|
||||
Copyright (C) 2014-2016 WrinklyNinja
|
||||
|
||||
This file is part of LOOT.
|
||||
|
||||
LOOT is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
LOOT is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LOOT. If not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOOT_GUI_QUERY_COPY_CONTENT_QUERY
|
||||
#define LOOT_GUI_QUERY_COPY_CONTENT_QUERY
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include "gui/query/clipboard_query.h"
|
||||
|
||||
namespace loot {
|
||||
class CopyContentQuery : public ClipboardQuery {
|
||||
public:
|
||||
CopyContentQuery(const YAML::Node& content) : content_(content) {}
|
||||
|
||||
std::string executeLogic() {
|
||||
const std::string text = "[spoiler][code]" + getContentAsText() + "[/code][/spoiler]";
|
||||
|
||||
copyToClipboard(text);
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
std::string getContentAsText() const {
|
||||
YAML::Emitter out;
|
||||
out.SetIndent(2);
|
||||
out << content_;
|
||||
|
||||
std::string text = out.c_str();
|
||||
boost::replace_all(text, "!<!> ", "");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
const YAML::Node content_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user