WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Reloacating raid frames via slash (https://www.wowinterface.com/forums/showthread.php?t=23540)

Manube 05-12-09 04:49 PM

Reloacating raid frames via slash
 
I have been trying to put together a slash command to change my frame position biased on my roll in a raid.

This is how I've attempted to go about doing this, and I also have the Ideal.config saved in the saved variables folder via the TOC. However I cannot seem to make it save the new Ideal.config values when the reloadUI action occurs. Any help would be greatly appreciated.

Code:

if (Ideal == nil) then
Ideal = {config = {
    plx = -175,
    ply = -150,
    rax = -200,
    ray = -260,
    }}
end

Code:

SlashCmdList['IDEAL'] = function(id)
        if(id and (id=='tank' or id=='dps'))then
                Ideal.config.plx = -175
                Ideal.config.ply = -150
                Ideal.config.rax = -200
                Ideal.config.ray = -260
                ReloadUI()
        elseif(id and id=='heal10') then
                Ideal.config.plx = -175
                Ideal.config.ply = -150
                Ideal.config.rax = -20
                Ideal.config.ray = -120
                ReloadUI()
        elseif(id and id == 'heal25') then
                Ideal.config.plx = -175
                Ideal.config.ply = -150
                Ideal.config.rax = -200
                Ideal.config.ray = -260
                ReloadUI()
        else
                print("Input /ideal followed by your raid assignment: tank, dps, heal10, heal25")
        end
end
SLASH_IDEAL1='/ideal'

Do I have to do something special to pull or insert values into the saved variables folder?

Waverian 05-13-09 05:12 PM

http://www.wowwiki.com/Saving_variab..._game_sessions

Short version is write the values when the PLAYER_LOGOUT event is fired.

v6o 05-13-09 07:00 PM

Quote:

Originally Posted by Waverian (Post 135787)
Short version is write the values when the PLAYER_LOGOUT event is fired.

Untrue. That's just if you need to make some last changes before you log out / variables are saved.


@Manube

I didn't make anything permanent so I just move my frames with SetPoint and not reloading (reloading loads in default positions)

If you want to save location / mode for next login then you could use SavedVariables.

Manube 05-15-09 01:42 PM

come again
 
sorry for my ignorance, but how do you "not anchor" the frames when you use setpoint. i've played around for quite some time with your last sugestions yourstruly and i really like the idea but can't seem to implement it properly. any pointers would be much appreciated.

Thanks for your help thus far.

Manube

v6o 05-16-09 03:48 PM

I don't use user placed / movable by dragging or anything like that so my unit frame locations are not saved but instead is set by my layout. Basically it contains raid1:SetPoint() and all my other raid groups are anchored to raid1. This makes the move just temporary until a ui reload or login but as I'm mostly in the default, it doesn't matter.

All I do to move my raid frames then is.

Code:

local UnitFrameMode = 0
SLASH_UNITFRAMEMODE1 = '/mode'
SlashCmdList['UNITFRAMEMODE'] = function()
        if (InCombatLockdown()) then return end
        if UnitFrameMode==0 then
                UnitFrameMode=1
                raid[1]:SetPoint("TOPLEFT", UIParent, "CENTER", -210, -240)
        else
                UnitFrameMode=0
                raid[1]:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 10, -10)
        end
end


Manube 05-17-09 04:44 PM

Thanks a lot this worked perfectly, I would have never thought of doing this.

:D:D:D:D:D:D:D:D:D:D

-Manube


All times are GMT -6. The time now is 02:42 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI