Can I 'invert' a bool?
You can get rid of your if/else statements by negating the bool's value:
ruleScreenActive = !ruleScreenActive;
I think it is better to write:
ruleScreenActive ^= true;
that way you avoid writing the variable name twice ... which can lead to errors