Controller: Add GetPortDisplayName() that takes pad index
This commit is contained in:
parent
9fc9f4b9e9
commit
4fe3e1147d
|
@ -238,6 +238,12 @@ const char* Controller::GetPortDisplayName(u32 port, u32 slot, bool mtap)
|
||||||
return mtap ? mtap_labels[port][slot] : no_mtap_labels[port];
|
return mtap ? mtap_labels[port][slot] : no_mtap_labels[port];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Controller::GetPortDisplayName(u32 index)
|
||||||
|
{
|
||||||
|
const auto& [port, slot] = ConvertPadToPortAndSlot(index);
|
||||||
|
return GetPortDisplayName(port, slot, g_settings.IsMultitapPortEnabled(port));
|
||||||
|
}
|
||||||
|
|
||||||
std::string Controller::GetSettingsSection(u32 pad)
|
std::string Controller::GetSettingsSection(u32 pad)
|
||||||
{
|
{
|
||||||
return fmt::format("Pad{}", pad + 1u);
|
return fmt::format("Pad{}", pad + 1u);
|
||||||
|
|
|
@ -139,6 +139,7 @@ public:
|
||||||
|
|
||||||
/// Returns a printable label for a given port.
|
/// Returns a printable label for a given port.
|
||||||
static const char* GetPortDisplayName(u32 port, u32 slot, bool mtap);
|
static const char* GetPortDisplayName(u32 port, u32 slot, bool mtap);
|
||||||
|
static const char* GetPortDisplayName(u32 index);
|
||||||
|
|
||||||
/// List of controller indices in the order that they should be displayed.
|
/// List of controller indices in the order that they should be displayed.
|
||||||
static const std::array<u32, NUM_CONTROLLER_AND_CARD_PORTS> PortDisplayOrder;
|
static const std::array<u32, NUM_CONTROLLER_AND_CARD_PORTS> PortDisplayOrder;
|
||||||
|
|
Loading…
Reference in New Issue