fix: cahngement de model avant les changement d'item

This commit is contained in:
gdamms 2022-03-26 19:13:36 +01:00
parent b6728a536e
commit 43a9d4656a
2 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@ NB_WHEELS = 23
NB_HATS = 23 NB_HATS = 23
NB_TEAMS = 2 NB_TEAMS = 2
DELAY = 0.1 DELAY = 0.01
NB_PRIMARY_COLORS = 3 NB_PRIMARY_COLORS = 3
NB_SECONDARY_COLORS = 1 NB_SECONDARY_COLORS = 1
@ -163,25 +163,25 @@ def newCar(model: int, sticker: int, wheel: int, hat: int, team: int, primary_co
time.sleep(DELAY) time.sleep(DELAY)
# select sticker, if necessary # select sticker, if necessary
if sticker != old_sticker: if sticker != old_sticker or model != old_model:
selectItem(STICKER_MENU_BTN, sticker) selectItem(STICKER_MENU_BTN, sticker)
old_sticker = sticker old_sticker = sticker
time.sleep(DELAY) time.sleep(DELAY)
# select wheel, if necessary # select wheel, if necessary
if wheel != old_wheel: if wheel != old_wheel or model != old_model:
selectItem(WHEEL_MENU_BTN, wheel) selectItem(WHEEL_MENU_BTN, wheel)
old_wheel = wheel old_wheel = wheel
time.sleep(DELAY) time.sleep(DELAY)
# select hat, if necessary # select hat, if necessary
if hat != old_hat: if hat != old_hat or model != old_model:
selectItem(HAT_MENU_BTN, hat) selectItem(HAT_MENU_BTN, hat)
old_hat = hat old_hat = hat
time.sleep(DELAY) time.sleep(DELAY)
# select color, if necessary # select color, if necessary
if team != old_team or primary_color != old_primary_color[team] or secondary_color != old_secondary_color[team]: if team != old_team or primary_color != old_primary_color[team] or secondary_color != old_secondary_color[team] or model != old_model:
selectColor(team, primary_color, secondary_color) selectColor(team, primary_color, secondary_color)
old_team = team old_team = team
old_primary_color[old_team] = primary_color old_primary_color[old_team] = primary_color

View file

@ -10,7 +10,7 @@ NB_ETA = 25
NB_ROTATIONS = 10 NB_ROTATIONS = 10
N_START = 0 N_START = 348
N_STOP = 0 N_STOP = 0
DELAY_TRANSITION = 0.3 DELAY_TRANSITION = 0.3