trying to make an XP bar the way i want it
ok i am having issues herethe functions all work fine and all
but what i am trying to do here is make the XP bar Primary inside of a frame named XPFrame now i have a mathmatic formula that sizes that frame so i include it here, yay the formula works, however my darn xp bar dont switch to a Rep bar at max level also i want a little mouse interaction of on shift right click it switches to Rep bar, also i want to have it auto switch at max level here is my code, please for god sake some one help me im bout to loose my mind, basically i have a working XP bar and a working Rep Bar sorry for bombarding you all... maybe i need a more experienced coder to work with me on my project, yes no? Code:
|
You can save yourself a lot of work by using StatusBar objects instead of manually calculating and setting the width of plain Frame objects. Your code was really messy and I didn't feel like going over it line by line, so I just adapted the code from my already-working XP/rep bar to behave the way you described (auto switch to rep at max level or on shift-right-click) and use the same flat texture as your code.
Code:
local XP_COLOR = { r = 0.6, g = 0, b = 0.5 } |
Quote:
Quote:
Phannx, your a God i only had to tweek that just a little bit... i.e. Code:
local f = CreateFrame("Frame", "derXPBar", XPFrame) i was wondering though, how could i add in a texture like all those cool bars out there, i dont really like the flat to much.. i like the aluminum texture a lot and when i use my other addon UI-tat, thats my primary texture Librarys convolute things a lot because i dont understand their workings |
I just use a backdrop myself, my XP bar overall is probably my favorite part of my UI of all things too. Likely because it's one of the first parts I made.
|
error
im getting a consistant error right now, i see where its happening but cant understand why,
in the code you altered for me here is the error as provided by bug sack/grabber Code:
7x Deranjata-0.0.2.1a\Modules\XPbar.lua:198: Usage: <unnamed>:SetValue(value) |
Can you post your current XPbar.lua? preferrably on a site like pastebin using the lua syntax highlighting.
|
Quote:
Quote:
http://pastebin.com/mR712PP6 there is a link to it with Lua Highlighting for some reason i cant use the code wrap or link wraps or any of the nifty forum tools so youll hae to copy past to browser without all my little notes at the top and just putting in just like i pastebinned, the error now reads 1x Deranjata-0.0.2.1a\Modules\XPbar.lua:51: Usage: <unnamed>:SetValue(value) <in C code> Deranjata-0.0.2.1a\Modules\XPbar.lua:51: in function "Update" Deranjata-0.0.2.1a\Modules\XPbar.lua:102: in function <Deranjata\Modules\XPbar.lua:98> Locals: self = derXPBar { 0 = <userdata> Update = <function> defined @Interface\AddOns\Deranjata\Modules\XPbar.lua:39 } event = nil arg1 = nil level = 6 name = "Thunder Bluff" standing = 4 min = 0 max = 300 |
Code:
bar:SetValue(cur) Code:
bar:SetValue(rep) |
Please stop encasing every line of your post in a color tag... makes reading through code and quoting really annoying. :(
Quote:
Code:
restBar:SetStatusBarTexture("Interface\\BUTTONS\\WHITE8X8") Code:
restBar:SetStatusBarTexture("Interface\\AddOns\\MyXPAddon\\MyTextureFile") Quote:
|
Quote:
other then the quotes and code tags i dont use anything, hmmm maybe my browser is out of date |
Ah I was thinking there was more to it because of the "XPbar.lua:198" showing an error at line 198, anyways what lombra says should fix it, I don't get any errors with it.
|
Quote:
also thanks for the texture tip, worked like a dream, next up i think i will do buff bars, little face smashing there but i think my keyboard can take the abuse, it has up until now then i think ill be ready to update my addon to 0.0.3.0a hehe |
Quote:
|
yeah im going to probly go for more of the status bar style like the old elkanos buff bars if anyone remembers that
|
to Leej and Sphanx and Lombra
i would like to thank you in t the credits of my addon, i know many are finicky of what addons their names are associated with, could i include my thanks to you all, it seems your names keep coming up on theRoster of most help to me
|
Quote:
|
Quote:
local big = small x small |
All times are GMT -6. The time now is 10:24 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI