I made some bars to display the HP, SP and XP of the character, but when the bar should be empty, it's not.
As can be seen here. I cropped the picture a little and marked the problem areas. The third bar is the XP-bar.
Here is the code for the bars.
Code: Select all
def Charstats():
if char_stats: # XP Leiste erstellen
ui.image("Leiste Grund.png", xpos=5, ypos=5, xanchor='left', yanchor='top')
ui.bar(HP_bar_max, HP_bar, xmaximum = 264, xpos=8, ypos=8, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gruen.png", right_bar=None)
ui.image("Leiste Grund.png", xpos=5, ypos=36, xanchor='left', yanchor='top')
ui.image("Leiste Grund.png", xpos=5, ypos=67, xanchor='left', yanchor='top')
if magic_learned:
ui.bar(MP_bar_max, MP_bar, xmaximum = 264, xpos=8, ypos=39, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Blau.png", right_bar=None)
ui.bar(SP_bar_max, SP_bar, xmaximum = 264, xpos=8, ypos=70, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
ui.image("Leiste Grund.png", xpos=5, ypos=98, xanchor='left', yanchor='top')
ui.bar(LVLUP, XP, xmaximum = 264, xpos=8, ypos=101, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
else:
ui.bar(SP_bar_max, SP_bar, xmaximum = 264, xpos=8, ypos=39, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
ui.bar(LVLUP, XP, xmaximum = 264, xpos=8, ypos=70, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
config.overlay_functions.append(Charstats)
Code: Select all
def Datenanzeige():
if data_show and not kampf:
ui.image(DATA_BG, xpos=280, ypos=0, xanchor='left', yanchor='top')
if character_data_show: # Fertig
ui.vbox(xpos=300, ypos=20, xanchor='left', yanchor='top', spacing=5) # Haupt VBOX
ui.hbox(spacing=5) # HBOX NAME/LVL
ui.textbutton("Name: [spielername]", xminimum=400, yminimum=35, clicked=empty, hovered=tt_name, unhovered=tt_off)
ui.textbutton("Level: [level]", xminimum=200, yminimum=35, clicked=empty, hovered=tt_level, unhovered=tt_off)
ui.textbutton("Experience: [XP] / [LVLUP]", xminimum=350, yminimum=35, clicked=empty, hovered=tt_experience, unhovered=tt_off)
ui.close() # HBOX NAME/LVL
... # I removed some lines here, because they are not relevant to the bars.
ui.close() # Haupt VBOX
... # Same here.
config.overlay_functions.append(Datenanzeige)