mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Bugfix : message des commandes constant
This commit is contained in:
parent
d8efdad277
commit
a30cd1d029
BIN
ropy-07.blend
BIN
ropy-07.blend
Binary file not shown.
27
rp.py
27
rp.py
@ -160,7 +160,6 @@ def terrain_run ():
|
||||
|
||||
# Pause
|
||||
# FIXME : HL alors que c'est avec les touches
|
||||
# FIXME : Stopper Ropy
|
||||
if scene.objects['Terrain']['run'] == True:
|
||||
scene.objects['Terrain']['run']=False
|
||||
scene.objects['Pause'].setVisible(False,False)
|
||||
@ -168,9 +167,6 @@ def terrain_run ():
|
||||
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||
scene.objects['Run']. restorePhysics()
|
||||
scene.objects['Run-Hl'].setVisible(True,False)
|
||||
scene.objects['Cmd-text']['Text']= "Exécuter (F5)"
|
||||
# scene.objects['Cmd-text']['Text']= "Run (F5)"
|
||||
scene.objects['Cmd-text'].setVisible(True,False) # FIXME : suppresion de du message
|
||||
|
||||
# Run
|
||||
# FIXME : HL alors que c'est avec les touches
|
||||
@ -181,8 +177,6 @@ def terrain_run ():
|
||||
scene.objects['Run-Hl'].setVisible(False,False)
|
||||
scene.objects['Pause']. restorePhysics()
|
||||
scene.objects['Pause-Hl'].setVisible(True,False)
|
||||
scene.objects['Cmd-text']['Text']= "Pause (F5)"
|
||||
scene.objects['Cmd-text'].setVisible(True,False)
|
||||
|
||||
# Démarrage de la map
|
||||
if scene.objects['Terrain']['thread_run']==False:
|
||||
@ -303,7 +297,7 @@ def sound_set ():
|
||||
scene.objects['Commands']['sound']=True
|
||||
# scene.objects['Cmd-text']['Text']= "Mute"
|
||||
scene.objects['Cmd-text']['Text']= "Muet"
|
||||
scene.objects['Cmd-text'].setVisible(True,False)
|
||||
# scene.objects['Cmd-text'].setVisible(True,False)
|
||||
|
||||
# Maj du fichier de config (sound : data/config/sound -> [0][1].text)
|
||||
rp_config_tree[0][1].text=str(scene.objects['Commands']['sound'])
|
||||
@ -320,7 +314,7 @@ def sound_unset ():
|
||||
scene.objects['Commands']['sound']=False
|
||||
# scene.objects['Cmd-text']['Text']= "Unmute"
|
||||
scene.objects['Cmd-text']['Text']= "Rétablir le son"
|
||||
scene.objects['Cmd-text'].setVisible(True,False)
|
||||
# scene.objects['Cmd-text'].setVisible(True,False)
|
||||
|
||||
# Maj du fichier de config (sound : data/config/sound -> [0][1].text)
|
||||
rp_config_tree[0][1].text=str(scene.objects['Commands']['sound'])
|
||||
@ -363,12 +357,13 @@ def cmd_init():
|
||||
# audiodev.unlock()
|
||||
|
||||
# UI : Text, ...
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
scene.objects['Cmd-text']['Text']=""
|
||||
scene.objects['Cmd-text'].setVisible(True,False)
|
||||
scene.objects['Points-Map-text']['Text']=""
|
||||
scene.objects['Grid-u'].setVisible(False,True)
|
||||
scene.objects['Grid-v'].setVisible(False,True)
|
||||
scene.objects['Points-Map-text'].setVisible(True,False)
|
||||
scene.objects['Points-Map-text']['Text']=""
|
||||
# scene.objects['Points-Map-text'].setVisible(False,False)
|
||||
scene.objects['Points-Map-text'].setVisible(True,False)
|
||||
# scene.objects['Info-1-text'].setVisible(False,False)
|
||||
# scene.objects['Info-2-text'].setVisible(False,False)
|
||||
|
||||
@ -463,38 +458,34 @@ def cmd_hl(cont):
|
||||
|
||||
# Désactivation
|
||||
if cont.sensors['MO'].status == JUST_RELEASED and (scene.objects['Terrain']['manip_mode']==0 or scene.objects['Terrain']['manip_mode']==9):
|
||||
scene.objects['Cmd-text']['Text']= ""
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop" and obj.name!="Sound-cmd" and obj.name!="NoSound-cmd" :
|
||||
scene.objects[obj.name+'-Hl'].setVisible(False,True)
|
||||
obj.setVisible(True,True)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
|
||||
# Run et pause
|
||||
if obj.name=="Pause" or obj.name=="Run":
|
||||
if scene.objects['Terrain']['run'] == True:
|
||||
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||
scene.objects['Pause'].setVisible(True,False)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
else:
|
||||
scene.objects['Run-Hl'].setVisible(False,False)
|
||||
scene.objects['Run'].setVisible(True,False)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
|
||||
# Stop
|
||||
if obj.name=="Stop":
|
||||
if scene.objects['Terrain']['thread_run']==True:
|
||||
scene.objects['Stop-Hl'].setVisible(False,False)
|
||||
scene.objects['Stop'].setVisible(True,False)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
|
||||
# Sound
|
||||
if obj.name=="NoSound-cmd" and scene.objects['Commands']['sound']==False:
|
||||
scene.objects['NoSound-cmd-Hl'].setVisible(False,False)
|
||||
scene.objects['NoSound-cmd'].setVisible(True,False)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
if obj.name=="Sound-cmd" and scene.objects['Commands']['sound']==True:
|
||||
scene.objects['Sound-cmd-Hl'].setVisible(False,False)
|
||||
scene.objects['Sound-cmd'].setVisible(True,False)
|
||||
scene.objects['Cmd-text'].setVisible(False,False)
|
||||
|
||||
##
|
||||
# Click sur les commandes
|
||||
@ -507,9 +498,11 @@ def cmd_click (cont):
|
||||
if obj.name=="Pause" or obj.name=="Run":
|
||||
sound_play (snd_click)
|
||||
terrain_run ()
|
||||
|
||||
if obj.name=="Stop":
|
||||
sound_play (snd_click)
|
||||
terrain_stop ()
|
||||
|
||||
if obj.name=="Objective":
|
||||
sound_play (snd_grid)
|
||||
terrain_grid ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user