Bugfix : overlay de la page Crédits

This commit is contained in:
Philippe Roy 2023-02-06 15:11:34 +01:00
parent b42038b61a
commit 8c011aa529
3 changed files with 68 additions and 13 deletions

Binary file not shown.

11
rp.py
View File

@ -1050,7 +1050,6 @@ def tablet_close ():
# Maj du fichier de config (mission actuelle : data/mission/current -> [1][0].text) # Maj du fichier de config (mission actuelle : data/mission/current -> [1][0].text)
rp_config_tree[1][0].text=str(scene.objects['Points']['mission']) rp_config_tree[1][0].text=str(scene.objects['Points']['mission'])
print ("tablet close")
config_save() config_save()
# Overlay # Overlay
@ -1228,9 +1227,6 @@ def task_close_click(cont):
def upgrade_maj(): def upgrade_maj():
print ("upgrade_maj")
print ("speed : ", scene.objects['Points']['upgrade_speed'])
# Batterie # Batterie
if scene.objects['Points']['upgrade_battery'] : if scene.objects['Points']['upgrade_battery'] :
scene.objects['St-Panels-3'].setVisible(True,True) scene.objects['St-Panels-3'].setVisible(True,True)
@ -1288,7 +1284,6 @@ def store_close():
rp_config_tree[2][i].text="True" rp_config_tree[2][i].text="True"
else: else:
rp_config_tree[2][i].text="False" rp_config_tree[2][i].text="False"
print ("store close")
config_save() config_save()
# Overlay # Overlay
@ -1395,14 +1390,9 @@ def config_save():
## ##
def config_load(): def config_load():
print ("config load")
fichier_xml=os.path.join(os.path.split((scene.objects['Commands']['script']))[0], "rp_config.xml") fichier_xml=os.path.join(os.path.split((scene.objects['Commands']['script']))[0], "rp_config.xml")
rp_config2 = ET.parse(fichier_xml) rp_config2 = ET.parse(fichier_xml)
rp_config_tree2 = rp_config2.getroot() rp_config_tree2 = rp_config2.getroot()
print (rp_config_tree2[2][0].text)
print (rp_config_tree2[2][1].text)
print (rp_config_tree2[2][2].text)
print (rp_config_tree2[2][3].text)
# Configuration de l'écran # Configuration de l'écran
bge.render.setWindowSize(int(rp_config_tree2[0][3][0].text),int(rp_config_tree2[0][3][1].text)) bge.render.setWindowSize(int(rp_config_tree2[0][3][0].text),int(rp_config_tree2[0][3][1].text))
@ -1504,7 +1494,6 @@ def about_close():
scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx'] scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx']
scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly'] scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz'] scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
print ("about close")
config_save() config_save()
## ##

View File

@ -87,7 +87,7 @@ def open():
scene.objects['About']['timer'] = 0 scene.objects['About']['timer'] = 0
scene.objects['About']['anim'] = True scene.objects['About']['anim'] = True
# Taille de l'écran : Boutons < et > ("640x360", "960x540", "1280x720", "1920x1080") # Taille de l'écran : Boutons < et > ("640x360", "960x540", "1280x720", "1920x1080")
if bge.render.getWindowWidth() <=640: if bge.render.getWindowWidth() <=640:
scene.objects['About_screen-down'].setVisible(False,True) scene.objects['About_screen-down'].setVisible(False,True)
scene.objects['About_screen-down-colbox'].suspendPhysics (True) scene.objects['About_screen-down-colbox'].suspendPhysics (True)
@ -197,7 +197,15 @@ def credits(cont):
scene.objects["Credits"]['init_ly']=scene.objects["Credits"].worldPosition.y scene.objects["Credits"]['init_ly']=scene.objects["Credits"].worldPosition.y
scene.objects["Credits"]['init_lz']=scene.objects["Credits"].worldPosition.z scene.objects["Credits"]['init_lz']=scene.objects["Credits"].worldPosition.z
# Afficher la page Crédits # Overlay
scene.removeOverlayCollection(bpy.data.collections['Hud'])
scene.objects['Points'].setVisible(False,True)
scene.objects['Commands'].setVisible(False,True)
scene.active_camera = scene.objects["Camera-Hud"]
scene.objects['Camera'].setVisible(False,True)
scene.objects['Doc-cmd-colbox'].suspendPhysics (True)
# Afficher la page Créditsp
scene.objects["Credits"].worldPosition.x = scene.objects["About"]['init_lx'] scene.objects["Credits"].worldPosition.x = scene.objects["About"]['init_lx']
scene.objects["Credits"].worldPosition.y = scene.objects["About"]['init_ly'] scene.objects["Credits"].worldPosition.y = scene.objects["About"]['init_ly']
scene.objects["Credits"].worldPosition.z = scene.objects["About"]['init_lz'] scene.objects["Credits"].worldPosition.z = scene.objects["About"]['init_lz']
@ -229,6 +237,64 @@ def credits_close(cont):
scene.objects['Credits'].setVisible(False,True) scene.objects['Credits'].setVisible(False,True)
scene.objects['About'].setVisible(True,True) scene.objects['About'].setVisible(True,True)
# Overlay
scene.objects['Points'].setVisible(True,True)
if scene.objects['Commands']['twins']:
scene.objects['Points-Twins'].setVisible(True,True)
scene.objects['Points-Twins-text'].setVisible(True,False)
else:
scene.objects['Points-Twins'].setVisible(False,True)
scene.objects['Points-Twins-text'].setVisible(False,False)
scene.objects['Commands'].setVisible(True,True)
scene.objects['Camera'].setVisible(True,True)
scene.active_camera = scene.objects["Camera"]
scene.addOverlayCollection(scene.cameras['Camera-Hud'], bpy.data.collections['Hud'])
# UI : Commands
scene.objects['Run-Hl'].setVisible(False,False)
scene.objects['Pause'].setVisible(False,False)
scene.objects['Pause'].suspendPhysics()
scene.objects['Pause-Hl'].setVisible(False,False)
# scene.objects['Stop'].setVisible(False,False)
# scene.objects['Stop'].suspendPhysics()
scene.objects['Stop-Hl'].setVisible(False,False)
scene.objects['Aim-cmd-Hl'].setVisible(False,False)
scene.objects['Doc-cmd-Hl'].setVisible(False,False)
scene.objects['Doc-cmd-colbox'].restorePhysics()
scene.objects['ResetView-Hl'].setVisible(False,False)
scene.objects['About-cmd-Hl'].setVisible(False,False)
scene.objects['Speed_up-Hl'].setVisible(False,False)
scene.objects['Speed_down-Hl'].setVisible(False,False)
scene.objects['Cmd-text'].setVisible(False,False)
# Task panel
if scene.objects['Commands']['task']:
scene.objects['Task-cmd'].setVisible(False,True)
scene.objects['Task-cmd'].suspendPhysics()
scene.objects['Task-cmd-Hl'].setVisible(False,True)
scene.objects['Task_close-cmd'].setVisible(True,True)
scene.objects['Task_close-cmd'].restorePhysics()
scene.objects['Task_close-cmd-Hl'].setVisible(False,True)
else:
scene.objects['Task_close-cmd'].setVisible(False,True)
scene.objects['Task_close-cmd'].suspendPhysics()
scene.objects['Task_close-cmd-Hl'].setVisible(False,True)
scene.objects['Task-cmd'].setVisible(True,True)
scene.objects['Task-cmd'].restorePhysics()
scene.objects['Task-cmd-Hl'].setVisible(False,True)
# Vitesse
if scene.objects['Points']['upgrade_speed'] ==False:
scene.objects['Text_speed'].setVisible(False,True)
scene.objects['Text_speed_label-fr'].setVisible(False,True)
scene.objects['Speed_down'].setVisible(False,True)
scene.objects['Speed_up'].setVisible(False,True)
# Camera
scene.objects['Camera'].worldPosition.x = scene.objects['Camera']['current_lx']
scene.objects['Camera'].worldPosition.y = scene.objects['Camera']['current_ly']
scene.objects['Camera'].worldPosition.z = scene.objects['Camera']['current_lz']
def credits_link(cont): def credits_link(cont):
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive : if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
obj = cont.owner obj = cont.owner