mirror of
https://github.com/Retropex/dolphin.git
synced 2025-05-12 19:30:44 +02:00
Fixed PrimeHack toggle being reset
This commit is contained in:
parent
aaa54ae2a7
commit
9190dcecf7
@ -137,8 +137,8 @@ bool IsSettingSaveable(const Config::Location& config_location)
|
||||
|
||||
// PrimeHack
|
||||
|
||||
&Config::PRIMEHACK_ENABLE.GetLocation(),
|
||||
&Config::PRIMEHACK_INITIAL_RUN.GetLocation(),
|
||||
&Config::PRIMEHACK_ENABLE.GetLocation(),
|
||||
&Config::PRIMEHACK_PROMPT_TAB.GetLocation(),
|
||||
&Config::PRIMEHACK_NOCLIP.GetLocation(),
|
||||
&Config::PRIMEHACK_INVULNERABILITY.GetLocation(),
|
||||
|
@ -37,11 +37,6 @@ namespace
|
||||
static std::array<std::atomic<WiimoteSource>, MAX_BBMOTES> s_wiimote_sources;
|
||||
static std::optional<size_t> s_config_callback_id = std::nullopt;
|
||||
|
||||
WiimoteSource GetSource(unsigned int index)
|
||||
{
|
||||
return s_wiimote_sources[index];
|
||||
}
|
||||
|
||||
void OnSourceChanged(unsigned int index, WiimoteSource source)
|
||||
{
|
||||
const WiimoteSource previous_source = s_wiimote_sources[index].exchange(source);
|
||||
@ -52,10 +47,6 @@ void OnSourceChanged(unsigned int index, WiimoteSource source)
|
||||
return;
|
||||
}
|
||||
|
||||
if (index == 0) {
|
||||
Config::SetBaseOrCurrent(Config::PRIMEHACK_ENABLE, source == WiimoteSource::Real ? false : true);
|
||||
}
|
||||
|
||||
WiimoteReal::HandleWiimoteSourceChange(index);
|
||||
|
||||
Core::RunAsCPUThread([index] { WiimoteCommon::UpdateSource(index); });
|
||||
@ -84,7 +75,7 @@ HIDWiimote* GetHIDWiimoteSource(unsigned int index)
|
||||
{
|
||||
HIDWiimote* hid_source = nullptr;
|
||||
|
||||
WiimoteSource src = GetSource(index);
|
||||
WiimoteSource src = Wiimote::GetSource(index);
|
||||
switch (src)
|
||||
{
|
||||
case WiimoteSource::Emulated:
|
||||
@ -227,6 +218,11 @@ void Pause()
|
||||
WiimoteReal::Pause();
|
||||
}
|
||||
|
||||
WiimoteSource GetSource(unsigned int index)
|
||||
{
|
||||
return s_wiimote_sources[index];
|
||||
}
|
||||
|
||||
void ChangeUIPrimeHack(int number, bool useMetroidUI)
|
||||
{
|
||||
WiimoteEmu::Wiimote* wiimote = static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number));
|
||||
|
@ -96,6 +96,7 @@ ControllerEmu::ControlGroup* GetDrawsomeTabletGroup(int number,
|
||||
WiimoteEmu::DrawsomeTabletGroup group);
|
||||
ControllerEmu::ControlGroup* GetTaTaConGroup(int number, WiimoteEmu::TaTaConGroup group);
|
||||
|
||||
WiimoteSource GetSource(unsigned int index);
|
||||
void ChangeUIPrimeHack(int number, bool useMetroidUI);
|
||||
|
||||
bool CheckVisor(int visor_count);
|
||||
|
@ -500,4 +500,8 @@ std::string GetMotd() {
|
||||
auto lock = std::lock_guard<std::mutex>(motd_lock);
|
||||
return trilogy_motd;
|
||||
}
|
||||
|
||||
bool UsingRealWiimote() {
|
||||
return Wiimote::GetSource(0) == WiimoteSource::Real;
|
||||
}
|
||||
} // namespace prime
|
||||
|
@ -102,4 +102,6 @@ void ResumeMod();
|
||||
|
||||
void SetMotd(std::string const& motd);
|
||||
std::string GetMotd();
|
||||
|
||||
bool UsingRealWiimote();
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ void HackManager::update_mod_states() {
|
||||
}
|
||||
|
||||
// Disallow any PrimeHack control mods
|
||||
if (!Config::Get(Config::PRIMEHACK_ENABLE))
|
||||
if (!Config::Get(Config::PRIMEHACK_ENABLE) || UsingRealWiimote())
|
||||
{
|
||||
disable_mod("fps_controls");
|
||||
disable_mod("springball_button");
|
||||
|
Loading…
Reference in New Issue
Block a user