hocclk: improve kip saving mechanism
This commit is contained in:
@@ -71,6 +71,10 @@ MiscGui::MiscGui()
|
|||||||
|
|
||||||
MiscGui::~MiscGui()
|
MiscGui::~MiscGui()
|
||||||
{
|
{
|
||||||
|
if (shouldSaveKip) {
|
||||||
|
sendKipData();
|
||||||
|
shouldSaveKip = false;
|
||||||
|
}
|
||||||
if (s_kipThreadPending) {
|
if (s_kipThreadPending) {
|
||||||
threadWaitForExit(&s_kipThread);
|
threadWaitForExit(&s_kipThread);
|
||||||
threadClose(&s_kipThread);
|
threadClose(&s_kipThread);
|
||||||
@@ -94,7 +98,7 @@ void MiscGui::addConfigToggle(HocClkConfigValue configVal, const char* altName,
|
|||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
||||||
} else if (kip) {
|
} else if (kip) {
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
}
|
}
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
});
|
});
|
||||||
@@ -121,7 +125,7 @@ void MiscGui::addConfigTrackbar(HocClkConfigValue configVal, const char* altName
|
|||||||
this->configList->values[configVal] = v;
|
this->configList->values[configVal] = v;
|
||||||
Result rc = hocclkIpcSetConfigValues(this->configList);
|
Result rc = hocclkIpcSetConfigValues(this->configList);
|
||||||
if (R_FAILED(rc)) FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
if (R_FAILED(rc)) FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
||||||
if (kip) sendKipData();
|
if (kip) shouldSaveKip = true;
|
||||||
});
|
});
|
||||||
this->listElement->addItem(bar);
|
this->listElement->addItem(bar);
|
||||||
}
|
}
|
||||||
@@ -142,7 +146,7 @@ void MiscGui::addMappedConfigTrackbar(HocClkConfigValue configVal, const char* a
|
|||||||
this->configList->values[configVal] = vals[idx];
|
this->configList->values[configVal] = vals[idx];
|
||||||
Result rc = hocclkIpcSetConfigValues(this->configList);
|
Result rc = hocclkIpcSetConfigValues(this->configList);
|
||||||
if (R_FAILED(rc)) FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
if (R_FAILED(rc)) FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
||||||
if (kip) sendKipData();
|
if (kip) shouldSaveKip = true;
|
||||||
});
|
});
|
||||||
this->listElement->addItem(bar);
|
this->listElement->addItem(bar);
|
||||||
}
|
}
|
||||||
@@ -218,7 +222,7 @@ void MiscGui::addConfigButton(HocClkConfigValue configVal,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (kip) {
|
if (kip) {
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
}
|
}
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
@@ -243,7 +247,7 @@ void MiscGui::addConfigButton(HocClkConfigValue configVal,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (kip) {
|
if (kip) {
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
}
|
}
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
@@ -336,7 +340,7 @@ void MiscGui::addConfigButtonS(HocClkConfigValue configVal,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (kip) {
|
if (kip) {
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
}
|
}
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
@@ -361,7 +365,7 @@ void MiscGui::addConfigButtonS(HocClkConfigValue configVal,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (kip) {
|
if (kip) {
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
}
|
}
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
@@ -1305,7 +1309,7 @@ protected:
|
|||||||
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -1365,7 +1369,7 @@ protected:
|
|||||||
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
FatalGui::openWithResultCode("hocclkIpcSetConfigValues", rc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sendKipData();
|
shouldSaveKip = true;
|
||||||
this->lastContextUpdate = armGetSystemTick();
|
this->lastContextUpdate = armGetSystemTick();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -77,4 +77,5 @@ protected:
|
|||||||
|
|
||||||
tsl::elm::ToggleListItem* enabledToggle;
|
tsl::elm::ToggleListItem* enabledToggle;
|
||||||
u8 frameCounter = 60;
|
u8 frameCounter = 60;
|
||||||
|
bool shouldSaveKip = false;
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user