change behavior of autowrite: only write re-write on rising edge

This commit is contained in:
mrbesen 2023-02-05 13:47:09 +01:00
parent aa982d3798
commit 0aca8969f9
Signed by untrusted user: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 4 additions and 1 deletions

View File

@ -110,8 +110,11 @@ void LolAutoAccept::setOnRuneChangeFunc(onruneschange_func on) {
}
void LolAutoAccept::setAutoWriteText(bool enabled, const std::string& text) {
if ( enabled && !autoWriteTextEnabled ) {
// only re-write on rising edge
autoWriteTextDone = false;
}
autoWriteTextEnabled = enabled;
autoWriteTextDone = false;
autoWriteText = text;
}