def populateGump(g): bufflist = world.getPlayer().buffs g.addBackground((0, 0, len(bufflist) * 30 + 8, 36), 3000) x = 4 # bufflist is a list of tuples # (icon id, title, desc, seconds to expire) for cur in bufflist: if cur[0] in BUFF_ICONS: g.addImage((x, 4), Texture(TextureSource.GUMPART, BUFF_ICONS[cur[0]])) x += 30 else: print "Unknown buff icon", cur[0], cur[1]
def create(args): g = GumpMenu("paperdoll", args.get("x", 50), args.get("y", 50)) g.mobile = args["mobile"] g.onWarmodeChanged = onWarmodeChanged g.addImage((0, 0), Texture(TextureSource.GUMPART, 2000)) g.addPaperdollView((3, 9, 240, 300), g.mobile) g.addPythonButton((20, 195), Texture(TextureSource.GUMPART, 2002), openProfile) if g.mobile == world.getPlayer(): btnHelp = g.addPythonButton((185, 44), Texture(TextureSource.GUMPART, 2031), sendHelpRequest) btnHelp.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2033) btnHelp.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2032) btnDisconnect = g.addPythonButton((185, 98), Texture(TextureSource.GUMPART, 2009), disconnect) btnDisconnect.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2011) btnDisconnect.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2010) btnSkills = g.addPythonButton((185, 154), Texture(TextureSource.GUMPART, 2015), openSkills) btnSkills.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2017) btnSkills.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2016) if g.mobile.warmode: btnWarmode = g.addPythonButton((185, 205), Texture(TextureSource.GUMPART, 2024), toggleWarmode) btnWarmode.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2026) btnWarmode.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2025) else: btnWarmode = g.addPythonButton((185, 205), Texture(TextureSource.GUMPART, 2021), toggleWarmode) btnWarmode.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2023) btnWarmode.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2022) btnWarmode.name = "btnWarmode" btStatus = g.addPythonButton((185, 233), Texture(TextureSource.GUMPART, 2027), openStatus) btStatus.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2029) btStatus.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2028) g.addPropertyLabel((20, 270, 180, 20), "paperdoll-name") return g
def create(args): g = GumpMenu("paperdoll", args.get("x", 50), args.get("y", 50)) g.mobile = args["mobile"] g.onWarmodeChanged = onWarmodeChanged g.addImage((0, 0), Texture(TextureSource.GUMPART, 2000)) g.addPaperdollView((3, 9, 240, 300), g.mobile) g.addPythonButton((20, 195), Texture(TextureSource.GUMPART, 2002), openProfile) if g.mobile == world.getPlayer(): btnHelp = g.addPythonButton((185, 44), Texture(TextureSource.GUMPART, 2031), sendHelpRequest) btnHelp.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2033) btnHelp.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2032) btnDisconnect = g.addPythonButton((185, 98), Texture(TextureSource.GUMPART, 2009), disconnect) btnDisconnect.state("mouseOver").texture = Texture( TextureSource.GUMPART, 2011) btnDisconnect.state("mouseDown").texture = Texture( TextureSource.GUMPART, 2010) btnSkills = g.addPythonButton((185, 154), Texture(TextureSource.GUMPART, 2015), openSkills) btnSkills.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2017) btnSkills.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2016) if g.mobile.warmode: btnWarmode = g.addPythonButton((185, 205), Texture(TextureSource.GUMPART, 2024), toggleWarmode) btnWarmode.state("mouseOver").texture = Texture( TextureSource.GUMPART, 2026) btnWarmode.state("mouseDown").texture = Texture( TextureSource.GUMPART, 2025) else: btnWarmode = g.addPythonButton((185, 205), Texture(TextureSource.GUMPART, 2021), toggleWarmode) btnWarmode.state("mouseOver").texture = Texture( TextureSource.GUMPART, 2023) btnWarmode.state("mouseDown").texture = Texture( TextureSource.GUMPART, 2022) btnWarmode.name = "btnWarmode" btStatus = g.addPythonButton((185, 233), Texture(TextureSource.GUMPART, 2027), openStatus) btStatus.state("mouseOver").texture = Texture(TextureSource.GUMPART, 2029) btStatus.state("mouseDown").texture = Texture(TextureSource.GUMPART, 2028) g.addPropertyLabel((20, 270, 180, 20), "paperdoll-name") return g
def create(args): g = GumpMenu("status", args.get("x", 100), args.get("y", 100)) g.mobile = args["mobile"] if g.mobile == world.getPlayer(): g.addImage((0, 0), Texture(TextureSource.GUMPART, 10860)) l = g.addPropertyLabel((83, 45, 295, 20), "name") l.halign = HAlign.CENTER l = g.addPropertyLabel((83, 73, 35, 25), "strength") l.halign = HAlign.CENTER l = g.addPropertyLabel((83, 102, 35, 25), "dexterity") l.halign = HAlign.CENTER l = g.addPropertyLabel((83, 129, 35, 25), "intelligence") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 69, 35, 20), "hitpoints") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 81, 35, 20), "hitpoints-max") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 94, 35, 20), "stamina") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 107, 35, 20), "stamina-max") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 122, 35, 20), "mana") l.halign = HAlign.CENTER l = g.addPropertyLabel((145, 135, 35, 20), "mana-max") l.halign = HAlign.CENTER l = g.addPropertyLabel((219, 74, 35, 20), "statcap") l.halign = HAlign.CENTER l = g.addPropertyLabel((219, 102, 35, 20), "luck") l.halign = HAlign.CENTER l = g.addPropertyLabel((219, 130, 35, 20), "weight") l.halign = HAlign.CENTER l = g.addPropertyLabel((281, 74, 35, 20), "damage-min") l.halign = HAlign.CENTER # TODO: damage max l = g.addPropertyLabel((281, 102, 35, 20), "gold") l.halign = HAlign.CENTER l = g.addPropertyLabel((281, 130, 35, 20), "followers") l.halign = HAlign.CENTER # TODO: followers max l = g.addPropertyLabel((352, 69, 35, 20), "resist-physical") l.halign = HAlign.CENTER l = g.addPropertyLabel((352, 85, 35, 20), "resist-fire") l.halign = HAlign.CENTER l = g.addPropertyLabel((352, 100, 35, 20), "resist-cold") l.halign = HAlign.CENTER l = g.addPropertyLabel((352, 116, 35, 20), "resist-poison") l.halign = HAlign.CENTER l = g.addPropertyLabel((352, 132, 35, 20), "resist-energy") l.halign = HAlign.CENTER l.rgba = rgba("#444444") # TODO: SE/SA Addons (Buttons for StatsUp/Down, BuffList-Button) else: # TODO: proper uo gump g.addBackground((0, 0, 250, 52), 3000) g.addPropertyLabel((5, 5, 250, 20), "name") g.addPropertyLabel((5, 22, 250, 20), "hitpoints") return g