mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-12 17:13:07 +00:00
Address feedback
This commit is contained in:
parent
e97542a487
commit
79a1f1c3d2
3 changed files with 34 additions and 28 deletions
|
|
@ -482,11 +482,11 @@ namespace MWGui
|
|||
|
||||
void SettingsWindow::onResolutionAccept()
|
||||
{
|
||||
auto resultion = mResolutionList->getItemDataAt<std::pair<int, int>>(mResolutionList->getIndexSelected());
|
||||
if (resultion)
|
||||
auto resolution = mResolutionList->getItemDataAt<std::pair<int, int>>(mResolutionList->getIndexSelected());
|
||||
if (resolution)
|
||||
{
|
||||
Settings::video().mResolutionX.set(resultion->first);
|
||||
Settings::video().mResolutionY.set(resultion->second);
|
||||
Settings::video().mResolutionX.set(resolution->first);
|
||||
Settings::video().mResolutionY.set(resolution->second);
|
||||
|
||||
apply();
|
||||
}
|
||||
|
|
@ -506,8 +506,8 @@ namespace MWGui
|
|||
|
||||
for (size_t i = 0; i < mResolutionList->getItemCount(); ++i)
|
||||
{
|
||||
auto resultion = mResolutionList->getItemDataAt<std::pair<int, int>>(i);
|
||||
if (resultion && resultion->first == currentX && resultion->second == currentY)
|
||||
auto resolution = mResolutionList->getItemDataAt<std::pair<int, int>>(i);
|
||||
if (resolution && resolution->first == currentX && resolution->second == currentY)
|
||||
{
|
||||
mResolutionList->setIndexSelected(i);
|
||||
break;
|
||||
|
|
@ -873,12 +873,12 @@ namespace MWGui
|
|||
// check if this resolution is supported in fullscreen
|
||||
if (mResolutionList->getIndexSelected() != MyGUI::ITEM_NONE)
|
||||
{
|
||||
auto resultion
|
||||
auto resolution
|
||||
= mResolutionList->getItemDataAt<std::pair<int, int>>(mResolutionList->getIndexSelected());
|
||||
if (resultion)
|
||||
if (resolution)
|
||||
{
|
||||
Settings::video().mResolutionX.set(resultion->first);
|
||||
Settings::video().mResolutionY.set(resultion->second);
|
||||
Settings::video().mResolutionX.set(resolution->first);
|
||||
Settings::video().mResolutionY.set(resolution->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -886,18 +886,18 @@ namespace MWGui
|
|||
int fallbackX = 0, fallbackY = 0;
|
||||
for (size_t i = 0; i < mResolutionList->getItemCount(); ++i)
|
||||
{
|
||||
auto resultion = mResolutionList->getItemDataAt<std::pair<int, int>>(i);
|
||||
if (!resultion)
|
||||
auto resolution = mResolutionList->getItemDataAt<std::pair<int, int>>(i);
|
||||
if (!resolution)
|
||||
continue;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
fallbackX = resultion->first;
|
||||
fallbackY = resultion->second;
|
||||
fallbackX = resolution->first;
|
||||
fallbackY = resolution->second;
|
||||
}
|
||||
|
||||
if (resultion->first == Settings::video().mResolutionX
|
||||
&& resultion->second == Settings::video().mResolutionY)
|
||||
if (resolution->first == Settings::video().mResolutionX
|
||||
&& resolution->second == Settings::video().mResolutionY)
|
||||
supported = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "inputactions.hpp"
|
||||
|
||||
#include <format>
|
||||
#include <queue>
|
||||
#include <set>
|
||||
|
||||
|
|
@ -116,14 +115,14 @@ namespace LuaUtil
|
|||
void Registry::insert(const Info& info)
|
||||
{
|
||||
if (mIds.find(info.mKey) != mIds.end())
|
||||
throw std::domain_error(std::format("Action key \"{}\" is already in use", info.mKey));
|
||||
throw std::domain_error("Action key \"" + info.mKey + "\" is already in use");
|
||||
if (info.mKey.empty())
|
||||
throw std::domain_error("Action key can't be an empty string");
|
||||
if (info.mL10n.empty())
|
||||
throw std::domain_error("Localization context can't be empty");
|
||||
if (!validateActionValue(info.mDefaultValue, info.mType))
|
||||
throw std::logic_error(std::format(
|
||||
"Invalid value: \"{}\" for action \"{}\"", LuaUtil::toString(info.mDefaultValue), info.mKey));
|
||||
throw std::logic_error("Invalid value: \"" + LuaUtil::toString(info.mDefaultValue) + "\" for action \""
|
||||
+ info.mKey + "\"");
|
||||
Id id = mBindingTree.insert();
|
||||
mKeys.push_back(info.mKey);
|
||||
mIds[std::string(info.mKey)] = id;
|
||||
|
|
@ -156,7 +155,7 @@ namespace LuaUtil
|
|||
{
|
||||
auto iter = mIds.find(key);
|
||||
if (iter == mIds.end())
|
||||
throw std::logic_error(std::format("Unknown action key: \"{}\"", key));
|
||||
throw std::logic_error("Unknown action key: \"" + std::string(key) + "\"");
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
|
|
@ -182,9 +181,16 @@ namespace LuaUtil
|
|||
Id id = safeIdByKey(key);
|
||||
Info info = mInfo[id];
|
||||
if (info.mType != type)
|
||||
throw std::logic_error(
|
||||
std::format("Attempt to get value of type \"{}\" from action \"{}\" with type \"{}\"",
|
||||
typeName(type), key, typeName(info.mType)));
|
||||
{
|
||||
std::string message("Attempt to get value of type \"");
|
||||
message += typeName(type);
|
||||
message += "\" from action \"";
|
||||
message += key;
|
||||
message += "\" with type \"";
|
||||
message += typeName(info.mType);
|
||||
message += "\"";
|
||||
throw std::logic_error(message);
|
||||
}
|
||||
return mValues[id];
|
||||
}
|
||||
|
||||
|
|
@ -269,14 +275,14 @@ namespace LuaUtil
|
|||
{
|
||||
auto it = mIds.find(key);
|
||||
if (it == mIds.end())
|
||||
throw std::domain_error(std::format("Unknown trigger key \"{}\"", key));
|
||||
throw std::domain_error("Unknown trigger key \"" + std::string(key) + "\"");
|
||||
return it->second;
|
||||
}
|
||||
|
||||
void Registry::insert(const Info& info)
|
||||
{
|
||||
if (mIds.find(info.mKey) != mIds.end())
|
||||
throw std::domain_error(std::format("Trigger key \"{}\" is already in use", info.mKey));
|
||||
throw std::domain_error("Trigger key \"" + info.mKey + "\" is already in use");
|
||||
if (info.mKey.empty())
|
||||
throw std::domain_error("Trigger key can't be an empty string");
|
||||
if (info.mL10n.empty())
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "animblendrules.hpp"
|
||||
|
||||
#include <format>
|
||||
#include <iterator>
|
||||
#include <utility>
|
||||
|
||||
|
|
@ -103,7 +102,8 @@ namespace SceneUtil
|
|||
}
|
||||
else
|
||||
{
|
||||
throw std::domain_error(std::format("'blending_rules' object not found in '{}' file!", configPath.value()));
|
||||
throw std::domain_error(
|
||||
"'blending_rules' object not found in '" + std::string(configPath.value()) + "' file!");
|
||||
}
|
||||
|
||||
// If no rules then dont allocate any instance
|
||||
|
|
|
|||
Loading…
Reference in a new issue