SetScale
Hello there! I am here to bug you all again! Mwahahhahahah! Welll.. I wouldn't make a new thread if I didn't need help and I need help if it is available at all.
I have this script below: Code:
SLASH_MYSCRIPT1 = "/scale"; Code:
Minimap:SetResizable(true) Code:
Minimap:SetUserPlaced(true) Any help is appreciated and thank you for your time! :) |
Minimap:SetResizable(true) isn't doing anything if its inside that slash cmd when the ui is loading.
|
yeah I took it out :P But it still ain't saving.. I am still playing with it :P My brain hurts >.>
here is everything if anyone is curious. http://pastie.org/979464 Maybe I messed up somewhere.. I wish I could see it :P |
When you say it isn't saving are you checking the WTF file to see if it is physically saving and not using what was saved or is it actually not saving to the file ?
|
Quote:
Do I have to used saved variables for that? >.> I'm thinking I do, but if I really do have to use saved variables, is there a reference anywhere that could possibly help me out adding saved variables? I've been looking at past threads, but some are very old and I don't know if that is a good reference or not. |
I'm not sure if blizzard saves scaling settings in its auto save files.
I know it stores the position and sizing although not always the position and size you were planning on rofl. The blizzard cvars and saved variables are loaded with VARIABLES_LOADED or rather that event is triggered once they have finished their stuff rofl. You could use that to see if frame:GetScale() returns what you initially used frame:SetScale() with. That would the first step to see if it ignores the scaling you did or if it deals with it but does something different rofl. As to using your own SavedVariables. wowwiki is a good resource for that. This page may help you figure that stuff out if it works out that you need to use it : http://www.wowwiki.com/Saving_variab..._game_sessions Also, on a side note, from what I found out while playing with the watch frame positioning and sizing etc there is a file called layout-local.txt in your characters wtf folder that seems to be where they store the individual layout of some but not all frames. Ah, here it is. The frame layouts stored there seem to be done if you use the function http://www.wowwiki.com/API_Frame_SetUserPlaced and there are a few key conditions that you might want to see if that could be why it doesn't work for you. However, like I said, I doubt that it stores the scaling. Here is an example of one of the frames for one of my characters: Frame: MinimapCluster FrameLevel: 6 Anchor: BOTTOM X: -6 Y: 30 W: 192 H: 192 A quick search for scale and a scan for anything that could mean scale found nothing in the file. So worst case scenario you will need to store and restore the scaling. |
Alrighty, i will try to work it out and see what I come up with, thank you :)
Referring to this: Quote:
|
I just meant that if, as I suspect and you are starting to suspect, it isn't self saving the scale that you may have delve into the nitty gritty details of saving them in savedvariables file.
|
Ah okay. Well, I have that slash command so people can change the scale, so I was thinking, how would I get that to save in the future, if I did add scale manually, and have it save in the future? Or me adding it in the saved variables, it would just save in the future? :P
edit - I don't know if that made any sense lol |
Rofl. You will not believe how easy it will be to save your variables. If you have ever used tables you're half way there. Take a quick gander at that page I linked when you're head is more level rofl and you will see what I mean.
Basically your code as it is will work fine. You just need to store the value in your saved variable table and restore it when your addon starts :D 2 or 3 extra lines and you'll be set :D |
Hmmmmmm I changed the scale in the saved variables but it was set to nil. So what I did was, set the scale to 3 ingame, then reloaded, and then it was set back to nil... Hmm hmmhmm lol Sorry :( I'm still learning, but at least its saving now.
I see what you wrote above :P I will continue to work on it. |
Well... I think I will try tomorrow :)
I did add the whole table, saved variables, the whole thing, still not saving. Even manually added the scale in the saved variables, still not saving scale... I will have to wait till tomorrow. For now, bed time >.> |
Quote:
Edit: Also, did you add SavedVariables to your .toc? |
Simple.
Add this to the .toc file: Code:
##SavedVariables: FerousMinimapScale Code:
local addon = ... |
Quote:
Quote:
edit - i want to say thank you to everyone who has helped thus far, I am still new to coding, but I'm finally getting the hang of it with no lua experience lol so thanks again everyone :) |
Quote:
|
I dunno if the same concept applies, but when I was creating my pet bar exp addon, or any addon that I had to set scale of the bar this was how I did it.
Code:
MyOptions = { |
Okay, I put in what you wrote Nightcracker and it's saving now. I'm extremely close.. But, its just saving as MidgetMapDB = 0.5 or what ever scale I set it to ingame, its not saving it as 'scale = #'
|
Just change MidgetMapDB to whatever name you want to save it with .. just change it to the same in the TOC as well as your LUA file :D
|
Quote:
Code:
local defaults = { it's saving in the saved variables as... (Yes, it is saving when I change scale ingame, but to this) Quote:
I'm getting there, I'm getting there. edit - I also figure, with all my noobish mistakes, this might help someone in the future, so I figured I'd keep going :P lol |
All times are GMT -6. The time now is 07:36 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI