I think changing mask texture requires a reloaded UI.
|
Quote:
i guess your right, as i have tryed a few things. |
I thought it even requires a logout rather than reload UI. Not sure though.
|
Quote:
Quote:
as i have Quote:
|
I tried this with MidgetMap and did the same thing and thought it wasn't going to work, so I just got rid of my skins, and made it a plain minimap instead so the shape call command ingame would be possible, using your own textures :P
|
Your problem is that each time you change the shape of the minimap you are creating a new texture and slapping it over what was there before. You need to create one texture and reuse it to avoid your problem (and just for good programming).
Also, I can't figure out why you are creating the GetMinimapShape function. You don't use it in your code at all. I have seen a couple different people post something similar and all I can think of it is for compatibility with another addon or everyone is just basing their code off the same bad example. If that function really is needed I would suggest using an internal variable to keep track of the shape (should be saving it anyway) and create the function once and have it just return that setting. To fix your problem quickly based on what you posted: Code:
local t = m:CreateTexture(nil, 'ARTWORK') You could also rename the texture files you are using to simplify it even more: Code:
local t = m:CreateTexture(nil, 'ARTWORK') |
Take a look at the source for my minimap addon, I do what you're wanting to do. Feel free to use any of my code you'd like, I don't mind.
GetMinimapShape() is a global function that other addons can call so they can make sure their minimap icons conform to the shape of your minimap. This was initiated by developers using the ACE libraries, but it isn't limited to that group at all. The function should return a string containing one of the pre-defined shapes; mine returns "CORNER-BOTTOMLEFT", "SQUARE", or "ROUND" depending on the shape that's currently being used. I would suggest that all minimap addons that change the shape of the map should use this function, if it applies to your shapes. |
thanks for the help guys.
and on the note of Code:
function GetMinimapShape() return 'SQUARE' end so I have everything all working by. when you log in you just have to do the command to change the shape and image. that I think is what I might keep it that way. unless there is a way. I can still get the addon to load a default shape/ but to do that. I think I would have to add aload more of junk maybe like Code:
function GetMinimapShape() return 'SQUARE' end if there is a way i can cut this down. I am very greatful for all your time. and Vrul /bow but i have taken heed of what you have said. as till im happy with the in game change shape. im going to update my main addon with some of the info you have said. well a clean up as it was. from Quote:
Quote:
i cant see what to use other then minimapshape. for this. as people who use my addon. they have to change Quote:
Quote:
and with the code you have helped me with. works well. I feel would be too soon. to update my addon with hthat code. till all commands are in with help. but as always im greatful. and i cant wait for other cool ways or edits i can aadd to your code. it might even get to the ppoint where i just use you command style as it is. if i cant work out how to tell the addon to load a defult. im not big into SV as most still is saved in the layout-local |
The first line should be near the top of your file, the rest can be at the end:
Code:
local minimapshape = 'ROUND' |
with this working fine. people keep asking to have the shape they use in game to save. ive been trying a few things.
and maybe i was thinknig usen Code:
t:SetUserPlaced(true) Code:
t:RegisterEvent("ADDON_LOADED") but unsure if that would work due to i think i remember it dont work for frame maken. like Code:
wmshape = "arrow" |
The shape (round or square) will be saved but that doesn't help much since I'm sure the users would care more about the actual texture (custom texture) that goes with it. The only way to keep that value persistent across sessions is to use saved variables. Considering all your other configuration is basically done through editing the top of the lua file, I don't really see the point in one setting being different than all the others.
I'd recommend just keeping the configuration solely through lua edits like it is for the rest, otherwise, you will need to use saved variables and apply the settings once they are loaded. If you are going to do that for one setting then you may as well do it for all of them. Which means needing to expand your slash command or adding a GUI. Also, I think it was you that mentioned wanting the addon to be light weight and that was one reason you were sticking to editing the lua for all configuration (could be mistaken). I'd say just remove the ability to change the "shape" in game and have them manually edit wmshape in the lua like for the other config options. Side note: In that code you just posted, textures don't have OnEvent scripts or a RegisterEvent method. And registering an event without an OnEvent handler won't accomplish anything anyway. I doubt textures have a SetUserPlaced method either (don't feel like checking). |
All times are GMT -6. The time now is 04:51 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI