mirror of
https://github.com/csd4ni3l/chaos-protocol.git
synced 2026-01-01 04:23:43 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user