mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-28 05:06:42 +00:00
Moved the Mic button of the GCPad to its own group.
This is needed to separate it from the GCPad input configuration dialog as it would be moved to its own dialog.
This commit is contained in:
parent
d1c89db8c8
commit
431929fa1d
2 changed files with 11 additions and 6 deletions
|
@ -24,8 +24,7 @@ static const u16 trigger_bitmasks[] = {
|
||||||
static const u16 dpad_bitmasks[] = {PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT,
|
static const u16 dpad_bitmasks[] = {PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT,
|
||||||
PAD_BUTTON_RIGHT};
|
PAD_BUTTON_RIGHT};
|
||||||
|
|
||||||
static const char* const named_buttons[] = {"A", "B", "X", "Y", "Z", _trans("Start"),
|
static const char* const named_buttons[] = {"A", "B", "X", "Y", "Z", _trans("Start")};
|
||||||
_trans("Mic")};
|
|
||||||
|
|
||||||
static const char* const named_triggers[] = {
|
static const char* const named_triggers[] = {
|
||||||
// i18n: The left trigger button (labeled L on real controllers)
|
// i18n: The left trigger button (labeled L on real controllers)
|
||||||
|
@ -39,11 +38,9 @@ static const char* const named_triggers[] = {
|
||||||
|
|
||||||
GCPad::GCPad(const unsigned int index) : m_index(index)
|
GCPad::GCPad(const unsigned int index) : m_index(index)
|
||||||
{
|
{
|
||||||
int const mic_hax = index > 1;
|
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
groups.emplace_back(m_buttons = new Buttons(_trans("Buttons")));
|
groups.emplace_back(m_buttons = new Buttons(_trans("Buttons")));
|
||||||
for (unsigned int i = 0; i < sizeof(named_buttons) / sizeof(*named_buttons) - mic_hax; ++i)
|
for (unsigned int i = 0; i < sizeof(named_buttons) / sizeof(*named_buttons); ++i)
|
||||||
m_buttons->controls.emplace_back(new ControlGroup::Input(named_buttons[i]));
|
m_buttons->controls.emplace_back(new ControlGroup::Input(named_buttons[i]));
|
||||||
|
|
||||||
// sticks
|
// sticks
|
||||||
|
@ -61,6 +58,10 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
||||||
groups.emplace_back(m_rumble = new ControlGroup(_trans("Rumble")));
|
groups.emplace_back(m_rumble = new ControlGroup(_trans("Rumble")));
|
||||||
m_rumble->controls.emplace_back(new ControlGroup::Output(_trans("Motor")));
|
m_rumble->controls.emplace_back(new ControlGroup::Output(_trans("Motor")));
|
||||||
|
|
||||||
|
// Microphone
|
||||||
|
groups.emplace_back(m_mic = new Buttons(_trans("Microphone")));
|
||||||
|
m_mic->controls.emplace_back(new ControlGroup::Input(_trans("Button")));
|
||||||
|
|
||||||
// dpad
|
// dpad
|
||||||
groups.emplace_back(m_dpad = new Buttons(_trans("D-Pad")));
|
groups.emplace_back(m_dpad = new Buttons(_trans("D-Pad")));
|
||||||
for (auto& named_direction : named_directions)
|
for (auto& named_direction : named_directions)
|
||||||
|
@ -95,6 +96,8 @@ ControllerEmu::ControlGroup* GCPad::GetGroup(PadGroup group)
|
||||||
return m_triggers;
|
return m_triggers;
|
||||||
case PadGroup::Rumble:
|
case PadGroup::Rumble:
|
||||||
return m_rumble;
|
return m_rumble;
|
||||||
|
case PadGroup::Mic:
|
||||||
|
return m_mic;
|
||||||
case PadGroup::Options:
|
case PadGroup::Options:
|
||||||
return m_options;
|
return m_options;
|
||||||
default:
|
default:
|
||||||
|
@ -220,5 +223,5 @@ void GCPad::LoadDefaults(const ControllerInterface& ciface)
|
||||||
bool GCPad::GetMicButton() const
|
bool GCPad::GetMicButton() const
|
||||||
{
|
{
|
||||||
auto lock = ControllerEmu::GetStateLock();
|
auto lock = ControllerEmu::GetStateLock();
|
||||||
return (0.0f != m_buttons->controls.back()->control_ref->State());
|
return (0.0f != m_mic->controls.back()->control_ref->State());
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ enum class PadGroup
|
||||||
DPad,
|
DPad,
|
||||||
Triggers,
|
Triggers,
|
||||||
Rumble,
|
Rumble,
|
||||||
|
Mic,
|
||||||
Options
|
Options
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ private:
|
||||||
Buttons* m_dpad;
|
Buttons* m_dpad;
|
||||||
MixedTriggers* m_triggers;
|
MixedTriggers* m_triggers;
|
||||||
ControlGroup* m_rumble;
|
ControlGroup* m_rumble;
|
||||||
|
Buttons* m_mic;
|
||||||
ControlGroup* m_options;
|
ControlGroup* m_options;
|
||||||
|
|
||||||
const unsigned int m_index;
|
const unsigned int m_index;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue