11-24-13, 07:29 AM | #21 | |
(On a side note, it seems pointless to notify the user that you changed their UI scale, since you just unconditionally do it at every login and there's nothing they can do about it.) A better solution would be to use percents. For example, if you want three equally-sized frames across the bottom of the screen, get the user's effective screen width, divide by 3, and set the width of each frame to the result. If there's some specific situation you think you need to forcibly "normalize" everyone's screen resolution, please describe it so we can offer a less intrusive solution.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. Last edited by Phanx : 11-24-13 at 07:32 AM. |
||
11-25-13, 09:46 AM | #22 |
I was thinking about this again, and I was wondering about UI scaling in general. With the default UI, if you adjust the slider you must click Accept or OK for it to take effect. There is no way to see the effect as you move the slider.
Some unit frame AddOns, along with some full UI replacements do, however, have this feature. Would they be hooking OnUpdate or some animation script? That seems costly on the CPU. |
|
11-25-13, 11:31 AM | #23 | |
as for that you are quite knowledgeable it seems and i have a question directed just for you, everyone else too if they wish. Lua Code:
i want to nest this options panel into the code above, im bout at my wits end Lua Code:
|
||
11-25-13, 08:33 PM | #24 | |
Clicking the "apply" button in the default UI doesn't really require any effort, and all the other system settings require you to click "apply" (or "okay" which is the same as "apply" plus "close") so there's not really any reason Blizzard would make the UI scale apply immediately. Sorry, you're going to have to be more clear about what you want, and/or post more of your code. Based on the snippets you posted, it appears you want to insert a bunch of option widgets into a button, which doesn't make any sense. Presumably there is some other frame that contains the button, and you want to show the other stuff when you click the button, but without seeing the code, that's about all I can come up with.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
11-26-13, 04:55 AM | #25 | |
the button named Options Frame i want as a button that fires a function OnClick as seen here on line 7, the referance to TopFrame is an already existing frame within my artwork.lua. the button places properly, but does not fire. Lua Code:
the code i want it to fire is the options config window i am designing which is this. (these two blocks are the entirety of my code at this moment for this file) Lua Code:
|
||
11-26-13, 05:23 AM | #26 |
i got the button to work, line of code here
Lua Code:
However. when i click the close button, and try to click the options button again, nothing happens. should i be using some sort of event handler here to allow the script to run again, i dont like making things like on a refresh basis because it sounds like it can make an addon very heavy on cpu cycles-- which is exactly what im trying to avoid Last edited by Uitat : 11-26-13 at 05:31 AM. Reason: ARRRRG ifxed but still broken |
|
11-26-13, 08:24 AM | #27 |
Technically it should work, I guess, but you are currently creating the frames all over again each time you press that button. You can't do that. Create all the frames outside of any function and then just do Config_BaseFrame:Show() in OnClick.
A few other fairly important pointers: When you're creating frames and naming them: Code:
CreateFrame("frame", "Config_BaseFrame", UIParent) Code:
local Config_BaseFrame = CreateFrame("frame", nil, UIParent)
__________________
Grab your sword and fight the Horde! |
|
11-26-13, 08:39 AM | #28 |
if you wish i can supply the complete addon for your scrutiny
ok so one last time before i hang it up for the week, im getting frustrated, so ill continue next week if i cant find a way in the next couple hours, Posting 100% of the code, the problem is such i click the options button which resides at the top of my screen in another frame in the script for my artwork, named TopFrame. this button displays properly, after click the Config Frame appears, if i click any tab it does as i instruct and reloads UI as thats what i have the buttons set to just for testing purposes, with the exception of alignment, which throws up a grid on the screen, and that works properly toggles on and off by via entering a Slash Command into the Chatbox, no problem there in the upper right i have a button marked X it is the Generic Close button for wow. see code labeled Close button. when clicked it does just as expected and closes the Frame next... click the Options button again..... Nothing Happens, however if i click the reloadUI on my Addon the UI reloads and the options button will work again, until i hit the close button again then again the options button dies Lua Code:
|
|
11-26-13, 08:43 AM | #29 | |
|
||
11-26-13, 07:04 PM | #30 | |
Your second problem is happening because there's nothing in your code to :Show() your options frame again after you've :Hide()n it by clicking the close button. Actually, your problem is even bigger than that, because your code is actually creating a whole new copy of the options frame every time you click your button. Personally I would just create the options frame right off the bat, :Hide() it, and then all you need to do is :Show() it when you click your button. However, if you're obsessively worried about your addon sitting on an extra 3 KB or whatever of memory that the user *might* not need every game session, you can create it on demand, but then you need to check for it and not create it again if it already exists. For example: Code:
function MyAddon_ShowOptions() -- Does the frame already exist? if not MyAddon_OptionsFrame then -- Nope. Create it now: local options = CreateFrame("Frame", "MyAddon_OptionsFrame", UIParent) -- Set up the frame, add widgets and buttons etc. end -- By this point the frame either already existed, or was just created. MyAddon_OptionsFrame:Show() end
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
11-26-13, 07:46 PM | #31 |
Phanx, great info there, i really appreciate it, you have actually been part of my inspiration in your chat addon, sooner or later i will nest my own chat mod, but for now i like to use yours
im going to try this tomorrow and see how it goes |
|
11-27-13, 06:01 PM | #32 |
backed up my file and started over for simplicity of trying to get your function to work....
Now i am beyond confused (this is the entirety of the code) Lua Code:
|
|
11-27-13, 06:13 PM | #33 |
MyAddon_ShowOptions vs MyAddon_OptionsFrame.
__________________
Grab your sword and fight the Horde! |
|
11-28-13, 03:49 PM | #34 | |
Lua Code:
|
||
11-29-13, 03:56 PM | #35 | |
Lua Code:
|
||
11-29-13, 05:50 PM | #36 | |
|
||
11-29-13, 07:07 PM | #37 |
to all of you that helped
thank you so much for your time and patience, as a budding programmer (or should i say just sprouting into a seedling) you all have made this much easier for me to understand, without you all i would not have accomplished this little bit of my addon, i hope in the future if i need to post i will not look so ignorant or possibly even stupid.
i commend you all on your accomplishments as addon programmers, and one day hope to be as good, if not better but for now, ... i bid ye all farewell thank you again Uitat. |
|
WoWInterface » Developer Discussions » Lua/XML Help » needing some help here |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|