Thread Tools Display Modes
05-12-09, 04:49 PM   #1
Manube
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 4
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?
  Reply With Quote
05-13-09, 05:12 PM   #2
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
http://www.wowwiki.com/Saving_variab..._game_sessions

Short version is write the values when the PLAYER_LOGOUT event is fired.
  Reply With Quote
05-13-09, 07:00 PM   #3
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by Waverian View Post
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.
  Reply With Quote
05-15-09, 01:42 PM   #4
Manube
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 4
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
  Reply With Quote
05-16-09, 03:48 PM   #5
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
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
  Reply With Quote
05-17-09, 04:44 PM   #6
Manube
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 4
Thanks a lot this worked perfectly, I would have never thought of doing this.



-Manube
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Reloacating raid frames via slash


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off