use ruleset instead of rule for naming, make rules editable by rebuilding the rulesets, make rule button have simple and advanced rule options, fix key input, fix mouse motion input

This commit is contained in:
csd4ni3l
2025-11-23 23:41:14 +01:00
parent d5de17f8e0
commit 6a318ebe67
3 changed files with 99 additions and 21 deletions

View File

@@ -8,10 +8,10 @@ DO_KEYS = tuple(DO_RULES.keys())
BAD_WHEN = {tuple(sorted(pair)) for pair in NON_COMPATIBLE_WHEN}
BAD_DO_WHEN = {tuple(pair) for pair in NON_COMPATIBLE_DO_WHEN}
def generate_rule():
def generate_ruleset(ruleset_type):
when_a = random.choice(IF_KEYS)
if random.random() < 0.5:
if ruleset_type == "advanced":
valid_b = [
b for b in IF_KEYS
if b != when_a and tuple(sorted((when_a, b))) not in BAD_WHEN