mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Add mixed comments to input code, make some tooltip clearer
This commit is contained in:
parent
e9e41b925b
commit
f4fec42165
@ -93,10 +93,15 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
|||||||
|
|
||||||
// options
|
// options
|
||||||
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
|
||||||
m_options->AddSetting(&m_always_connected_setting,
|
m_options->AddSetting(
|
||||||
// i18n: Treat a controller as always being connected regardless of what
|
&m_always_connected_setting,
|
||||||
// devices the user actually has plugged in
|
// i18n: Treat a controller as always being connected regardless of what
|
||||||
_trans("Always Connected"), false);
|
// devices the user actually has plugged in
|
||||||
|
{_trans("Always Connected"), _trans(""),
|
||||||
|
_trans("Always connected if checked.\n"
|
||||||
|
"If unchecked, it will link the emulated controller connection state\n"
|
||||||
|
"to the real default device connection state (if there is one).")},
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GCPad::GetName() const
|
std::string GCPad::GetName() const
|
||||||
|
@ -23,7 +23,6 @@ void ExtensionPort::AttachExtension(Extension* ext)
|
|||||||
|
|
||||||
m_extension = ext;
|
m_extension = ext;
|
||||||
m_i2c_bus.AddSlave(m_extension);
|
m_i2c_bus.AddSlave(m_extension);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace WiimoteEmu
|
} // namespace WiimoteEmu
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "DolphinQt/Config/Graphics/BalloonTip.h"
|
#include "DolphinQt/Config/Graphics/BalloonTip.h"
|
||||||
|
|
||||||
|
constexpr int TOOLTIP_DELAY = 300;
|
||||||
|
|
||||||
template <class Derived>
|
template <class Derived>
|
||||||
class ToolTipWidget : public Derived
|
class ToolTipWidget : public Derived
|
||||||
{
|
{
|
||||||
@ -25,7 +27,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (m_timer_id)
|
if (m_timer_id)
|
||||||
return;
|
return;
|
||||||
m_timer_id = this->startTimer(300);
|
m_timer_id = this->startTimer(TOOLTIP_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void leaveEvent(QEvent* event) override
|
void leaveEvent(QEvent* event) override
|
||||||
|
@ -371,6 +371,7 @@ public:
|
|||||||
}
|
}
|
||||||
case TOK_ASSIGN:
|
case TOK_ASSIGN:
|
||||||
{
|
{
|
||||||
|
// Use this carefully as it's extremely powerful and can end up in unforeseen situations
|
||||||
lhs->SetValue(rhs->GetValue());
|
lhs->SetValue(rhs->GetValue());
|
||||||
return lhs->GetValue();
|
return lhs->GetValue();
|
||||||
}
|
}
|
||||||
@ -565,6 +566,9 @@ private:
|
|||||||
|
|
||||||
// This class proxies all methods to its either left-hand child if it has bound controls, or its
|
// This class proxies all methods to its either left-hand child if it has bound controls, or its
|
||||||
// right-hand child. Its intended use is for supporting old-style barewords expressions.
|
// right-hand child. Its intended use is for supporting old-style barewords expressions.
|
||||||
|
// Note that if you have a keyboard device as default device and the expression is a single digit
|
||||||
|
// number, this will usually resolve in a numerical key instead of a numerical value.
|
||||||
|
// Though if this expression belongs to NumericSetting, it will likely be simplifed back to a value.
|
||||||
class CoalesceExpression : public Expression
|
class CoalesceExpression : public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -945,6 +949,7 @@ static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& st
|
|||||||
qualifier.control_name = str;
|
qualifier.control_name = str;
|
||||||
qualifier.has_device = false;
|
qualifier.has_device = false;
|
||||||
|
|
||||||
|
// This control expression will only work (find the specified control) with the default device.
|
||||||
return std::make_unique<ControlExpression>(qualifier);
|
return std::make_unique<ControlExpression>(qualifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,9 @@ public:
|
|||||||
enum class ParseStatus
|
enum class ParseStatus
|
||||||
{
|
{
|
||||||
Successful,
|
Successful,
|
||||||
|
// Note that the expression could still work in this case (be valid and return a value)
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
|
// Will return the default value
|
||||||
EmptyExpression,
|
EmptyExpression,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -107,6 +109,7 @@ class ControlQualifier
|
|||||||
public:
|
public:
|
||||||
bool has_device;
|
bool has_device;
|
||||||
Core::DeviceQualifier device_qualifier;
|
Core::DeviceQualifier device_qualifier;
|
||||||
|
// Makes no distinction between input and output
|
||||||
std::string control_name;
|
std::string control_name;
|
||||||
|
|
||||||
ControlQualifier() : has_device(false) {}
|
ControlQualifier() : has_device(false) {}
|
||||||
|
@ -44,7 +44,7 @@ void ControlGroup::AddDeadzoneSetting(SettingValue<double>* value, double maximu
|
|||||||
// i18n: The percent symbol.
|
// i18n: The percent symbol.
|
||||||
_trans("%"),
|
_trans("%"),
|
||||||
// i18n: Refers to the dead-zone setting of gamepad inputs.
|
// i18n: Refers to the dead-zone setting of gamepad inputs.
|
||||||
_trans("Input strength to ignore.")},
|
_trans("Input strength to ignore and remap.")},
|
||||||
0, 0, maximum_deadzone);
|
0, 0, maximum_deadzone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ IMUGyroscope::IMUGyroscope(std::string name_, std::string ui_name_)
|
|||||||
// i18n: "°/s" is the symbol for degrees (angular measurement) divided by seconds.
|
// i18n: "°/s" is the symbol for degrees (angular measurement) divided by seconds.
|
||||||
_trans("°/s"),
|
_trans("°/s"),
|
||||||
// i18n: Refers to the dead-zone setting of gyroscope input.
|
// i18n: Refers to the dead-zone setting of gyroscope input.
|
||||||
_trans("Angular velocity to ignore.")},
|
_trans("Angular velocity to ignore and remap.")},
|
||||||
2, 0, 180);
|
2, 0, 180);
|
||||||
|
|
||||||
AddSetting(&m_calibration_period_setting,
|
AddSetting(&m_calibration_period_setting,
|
||||||
|
@ -128,6 +128,7 @@ std::optional<u32> SquareStickGate::GetIdealCalibrationSampleCount() const
|
|||||||
ReshapableInput::ReshapableInput(std::string name_, std::string ui_name_, GroupType type_)
|
ReshapableInput::ReshapableInput(std::string name_, std::string ui_name_, GroupType type_)
|
||||||
: ControlGroup(std::move(name_), std::move(ui_name_), type_)
|
: ControlGroup(std::move(name_), std::move(ui_name_), type_)
|
||||||
{
|
{
|
||||||
|
// 50 is not always enough but users can set it to more with an expression
|
||||||
AddDeadzoneSetting(&m_deadzone_setting, 50);
|
AddDeadzoneSetting(&m_deadzone_setting, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,6 +286,10 @@ ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlSta
|
|||||||
x -= m_center.x;
|
x -= m_center.x;
|
||||||
y -= m_center.y;
|
y -= m_center.y;
|
||||||
|
|
||||||
|
// We run this even if both x and y will be zero.
|
||||||
|
// In that case, std::atan2(0, 0) returns a valid non-NaN value, but the exact value
|
||||||
|
// (which depends on the signs of x and y) does not matter here as dist is zero
|
||||||
|
|
||||||
// TODO: make the AtAngle functions work with negative angles:
|
// TODO: make the AtAngle functions work with negative angles:
|
||||||
ControlState angle = std::atan2(y, x) + MathUtil::TAU;
|
ControlState angle = std::atan2(y, x) + MathUtil::TAU;
|
||||||
|
|
||||||
|
@ -133,7 +133,6 @@ bool InputConfig::LoadConfig(bool isGC)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
controller->LoadConfig(&config);
|
controller->LoadConfig(&config);
|
||||||
// Update refs
|
|
||||||
controller->UpdateReferences(g_controller_interface);
|
controller->UpdateReferences(g_controller_interface);
|
||||||
controller_names.push_back(controller->GetName());
|
controller_names.push_back(controller->GetName());
|
||||||
|
|
||||||
|
@ -770,6 +770,7 @@ void Renderer::UpdateDrawRectangle()
|
|||||||
const float win_width = static_cast<float>(m_backbuffer_width);
|
const float win_width = static_cast<float>(m_backbuffer_width);
|
||||||
const float win_height = static_cast<float>(m_backbuffer_height);
|
const float win_height = static_cast<float>(m_backbuffer_height);
|
||||||
|
|
||||||
|
// FIXME: this breaks at very low widget sizes
|
||||||
// Make ControllerInterface aware of the render window region actually being used
|
// Make ControllerInterface aware of the render window region actually being used
|
||||||
// to adjust mouse cursor inputs.
|
// to adjust mouse cursor inputs.
|
||||||
g_controller_interface.SetAspectRatioAdjustment(draw_aspect_ratio / (win_width / win_height));
|
g_controller_interface.SetAspectRatioAdjustment(draw_aspect_ratio / (win_width / win_height));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user