Update 2 files

- /rp_about.py
- /rp.py
This commit is contained in:
Philippe Roy 2023-02-07 05:39:45 +00:00
parent a675dbbe88
commit 76b042390a
2 changed files with 11 additions and 2 deletions

9
rp.py
View File

@ -400,7 +400,7 @@ def cmd_init(cont):
# Configuration de l'écran
bge.render.setWindowSize(int(rp_config_tree[0][3][0].text),int(rp_config_tree[0][3][1].text))
scene.objects['About']['quality'] = int(rp_config_tree[0][3][2].text)
rp_about.quality_apply(scene.objects['About']['quality'])
rp_about.quality_apply(scene.objects['About']['quality'], True)
# UI : Commands
scene.objects['Run-Hl'].setVisible(False,False)
@ -1494,6 +1494,13 @@ def about_close():
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']
# Maj du fichier de config (écran : data/config/screen/width, height, quality-> [0][3][0].text, [0][3][1].text, [0][3][2].text)
screen_width = bge.render.getWindowWidth()
screen_height = bge.render.getWindowHeight()
rp_config_tree[0][3][0].text=str(screen_width)
rp_config_tree[0][3][1].text=str(screen_height)
rp_config_tree[0][3][2].text=str(scene.objects['About']['quality'])
config_save()
##

View File

@ -412,12 +412,14 @@ def quality_down(cont):
# Qualité du rendu EEVEE de 0 à 4
##
def quality_apply(quality):
def quality_apply(quality, start_flag=False):
# Texte du About
quality_txt=("Inconvenant", "Basse", "Moyenne", "Haute", "Épique")
# quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA')
scene.objects['About_quality']['Text']= "Qualité : "+quality_txt[quality]
if start_flag== False and sys.platform!="linux": # Plantage sur Windows -> redémarrage après changement
return
# Inconvenant
if quality== 0: