View Single Post
11-02-10, 07:04 PM   #40
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Blah okay so as for ace config i have no idea how to make this work.. ultimately i need a text entry field and then to list the contents of the GMoveableFrames saved variable... does anyone know much about the AceConfig and AceGUI? this is what it looks like so far you can see where i started the move frames tab. Is there no help file anywhere about AceGUI? other then this one http://www.wowace.com/addons/ace3/pa...ustom-controls ?

heres my code right now for the ace settings
Code:
local addonName, addon = ...
addonName = addonName:match("^(.+)_Config$")
addon = _G[addonName]
if not addon then return end

local AceGUI = LibStub("AceGUI-3.0")

local path = [[Interface\AddOns\]] .. addonName .. [[\Skins\]]
local skins = {
	[path .. "Alliance"] = "Alliance",
	[path .. "Horde"] = "Horde",
	[path .. "BlackMetal"] = "Black Metal",
	[path .. "Elf"] = "Elf",
}

local styles = {
	"Vertical",
	"Horizontal"
}

function addon:MoveFrameList()
	local i, v
	for i,v in ipairs(GMoveableFrames) do print(i..":"..v) end
end


--[[-----------------------------------------------------------------------------
Common for all options
-------------------------------------------------------------------------------]]
local function Get(info)
	return addon.settings[info[#info]]
end

local function Set(info, value)
	addon.settings[info[#info]] = value or false
end


--[[-----------------------------------------------------------------------------
Options
-------------------------------------------------------------------------------]]
local options = {
	type = 'group',
	childGroups = "tab",
	get = Get,
	set = Set,
	args = {
		option1 = {
			name = "General",
			desc = "General Options.",
			type = "group",
			order = 1,
			
			args = {
				lockFrames = {
					type = 'toggle',
					order = 1,
					name = "Lock Frames",
					desc = "Prevent frames from being moved by the mouse."
				},
				
				tooltipIconSize = {
					type = 'range',
					order = 3,
					name = "Tooltip Icon Size",
					desc = "Set the size of icons added to tooltips.",
					min = 8, max = 32, step = 1
				},
				showWatchFrame = {
							type = 'toggle',
							order = 2,
							name = "Show Objectives",
							desc = "Show Objectives/Watch Frame.",
							set = function(info, value)
								Set(info, value)
									addon:SafeCall("InitWatchFrame")
							end
				},
				showExpBar = {
							type = 'toggle',
							order = 4,
							name = "Show XP Bar",
							desc = "Show GrimUI Experiance Bar.",
							set = function(info, value)
								Set(info, value)
									addon:SafeCall("ConfigureExpBar")
							end
				},
				showRepBar = {
							type = 'toggle',
							order = 5,
							name = "Show Rep Bar",
							desc = "Show GrimUI Reputatiom/Faction Bar.",
							set = function(info, value)
								Set(info, value)
									addon:SafeCall("ConfigureRepBar")
							end
				},
				useViewPort = {
							type = 'toggle',
							order = 5,
							name = "Use ViewPort",
							desc = "Moves world frame up - currently causes water problems turn water detail down in order to us without glitch.",
							set = function(info, value)
								Set(info, value)
									addon:SafeCall("SetupViewPort")
							end
				},
				uiSkin = {
					type = 'select',
					order = 6,
					name = "Art Skin",
					desc = "Choose which skin to use.",
					values = skins,
					set = function(info, value)
						Set(info, value)
						addon:SafeCall("ConfigureSkin")
					end
				},
				artSetPoint = {
							type = 'range',
							order = 7,
							name = "Art Skin Width",
							desc = "Set the width of the main art skin.",
							min = -1920, 
							max = 1920, 
							step = 2,
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ArtSetPoint")
							end
						},
				artSetAlpha = {
							type = 'range',
							order = 8,
							name = "Art Skin Alpha",
							desc = "Set the Alpha of the main art skin.",
							min = 0, 
							max = 1, 
							step = 0.01,
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ArtSetAlpha")
							end
						},
				ResetFrames = {
					type = 'execute',
					order = 11,
					name = "Reset Frames",
					desc = "Wipe all frame position data.",
					func = function(info)
					local movedFrames = addon.settings.movedFrames
					for name in pairs(movedFrames) do
						addon:UnlockFrame(name)
						movedFrames[name] = nil
					end
					addon:LockFrame(WatchFrame)
					addon:SafeCall("ResetPlayerFrame")
					addon:SafeCall("ResetPartyFrames")
					addon:SafeCall("ResetExpRepBar")
					addon:SafeCall("PlayerFrameRESetScale")
					addon:SafeCall("ResetDevBar")
					addon:SafeCall("ArtSetPointReset")
					addon:SafeCall("LFGEyeFix")
					addon:SafeCall("MiniMapPVPFix")
				end
				},
				ResetWTF = {
					type = 'execute',
					order = 11,
					name = "Reset WTF File",
					desc = "Wipe all WTF file settings. !!**WARNING**!! This will reset everything! Including Macaroon!",
					func = function(info)
					addon:SafeCall("ResetWTF")
					ReloadUI()
				end
				},
			},
		},
		option2 = {
			name = "PlayerFrame",
			desc = "PlayerFrame Options.",
			type = "group",
			order = 2,
			args = {
				PlayerFrame = {
					type = 'group', inline = true,
					order = -4,
					name = "Player Frame",
					args = {
						playerFrameScale = {
							type = 'range',
							order = 3,
							name = "Scale",
							desc = "Set the Scale of PlayerFrame.",
							min = 0.4, 
							max = 2.4, 
							step = 0.1,
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigurePlayerFrame")
							end
						},
						
						showPlayerFrame = {
							type = 'toggle',
							order = 1,
							name = "Enable",
							desc = "Show " .. addonName .. "'s player frame.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigurePlayerFrame")
							end
						},
						hideBlizPlayerFrame = {
							type = 'toggle',
							order = 2,
							name = "Hide Blizzard",
							desc = "Disable Blizzard's default player frame.",
							set = function(info, value)
								Set(info, value)
									addon:SafeCall("ConfigureBlizPlayerFrame")
							end
						}
					}
				},
			},
		},
		option3 = {
			name = "PartyFrames",
			desc = "PartyFrames Options.",
			type = "group",
			order = 3,
			args = {
				PartyFrames = {
					type = 'group', inline = true,
					order = -3,
					name = "Party Frames",
					args = {
						showPartyFrames = {
							type = 'toggle',
							order = 1,
							name = "Enable",
							desc = "Show " .. addonName .. "'s party frames.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigurePartyFrames")
							end
						},
						hideGrimPartyInRaid = {
							type = 'toggle',
							order = 2,
							name = "Hide Party in Raid",
							desc = "Hide GrimUI Party Frames in Raid.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigurePartyFrames")
							end
						},
						hideBlizPartyFrames = {
							type = 'toggle',
							order = 3,
							name = "Hide Blizzard",
							desc = "Disable Blizzard's default party frames.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigureBlizPartyFrames")
							end
						},
						stylePartyFrames = {
							type = 'select',
							order = 4,
							name = "Party Frames Style",
							desc = "Choose which style to use for party frames.",
							values = styles,
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("StylePartyFrames")
							end
						}
					}
				},
			},
		},

		option4 = {
			name = "TargetFrame",
			desc = "TargetFrame Options.",
			type = "group",
			order = 4,
			args = {
				TargetFrame = {
					type = 'group', inline = true,
					order = -3,
					name = "Target Frame",
					args = {
						hideBlizTargetFrame = {
							type = 'toggle',
							order = 1,
							name = "Hide Blizzard",
							desc = "Hide Blizzard Target Frame.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("ConfigureBlizTargetFrame")
							end
						},
					}
				},
			},
		},
		
		option5 = {
			name = "Chat",
			desc = "Chat Options.",
			type = "group",
			order = 5,
			args = {
				showCombatLog = {
					type = 'toggle',
					order = 2,
					name = "Show Combat Log",
					desc = "Enable the combat log window.",
					set = function(info, value)
						Set(info, value)
						addon:SafeCall("ConfigureCombatLog")
					end
				},
				showChatTabs = {
					type = 'toggle',
					order = 3,
					name = "Show Chat Tabs",
					desc = "Show Chat Frame 2 and 6's Chat Tabs.",
					set = function(info, value)
						Set(info, value)
						addon:SafeCall("ConfigureChatTabs")
					end
				},
				ResetChat = {
					type = 'execute',
					order = -4,
					name = "Reset Chat",
					desc = "Reset the chat windows to " .. addonName .. "'s defaults.",
					func = function(info)
						addon:SafeCall("ResetChatFrames")
					end
				},
			},
		},
	option6 = {
			name = "Hud",
			desc = "Heads Up Display Options.",
			type = "group",
			order = 6,
			args = {
				Hud = {
					type = 'group', inline = true,
					order = -3,
					name = "Hud",
					args = {
						
					}
				},
			},
		},
	option7 = {
			name = "DashBoard",
			desc = "DasrhBoard Options.",
			type = "group",
			order = 6,
			args = {
				DashBoard = {
					type = 'group', inline = true,
					order = -3,
					name = "DasrhBoard",
					args = {
						latencyShow = {
							type = 'toggle',
							order = 1,
							name = "FPS/Latency",
							desc = "Show DashBoard FPS and Latency frames.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("DashLayout")
							end
						},
						speedShow = {
							type = 'toggle',
							order = 1,
							name = "Speed",
							desc = "Show DashBoard Speed frame.",
							set = function(info, value)
								Set(info, value)
								addon:SafeCall("DashLayout")
							end
						},
					}
				},
			},
		},
	option8 = {
		name = "Frame Mover",
		desc = "Make Frames Move-Able.",
		type = "group",
		order = 7,
		args = {
			listFrame = {
				type = 'group', inline = true,
				order = 1,
				name = "Moveable Frames List",
				args = {

				}
			},
			addFrame = {
				type = 'input',
				order = 11,
				name = "Add Frame",
				desc = "Add Frame to Moveable Frames List",
			}
		},
	},
	option20 = {
			name = "Dev Tools",
			desc = "Development Tools.",
			type = "group",
			order = 8,
			args = {
				showDevBar = {
					type = 'toggle',
					order = 1,
					name = "GrimUI DevBar",
					desc = "GrimUI Development Bar, easy /framestack /reload button.",
					set = function(info, value)
						Set(info, value)
						addon:SafeCall("ShowDevBar")
					end
				},
				toggleTaintLog = {
					type = 'toggle',
					order = 2,
					name = "Taint Logging",
					desc = "Enable Taint Logging - MAY REQUIRE RELOAD.",
					set = function(info, value)
						Set(info, value)
						addon:SafeCall("ToggleTaintLog")
					end
				},
				BlizBuildInfo = {
					type = 'execute',
					order = 3,
					name = "Blizzard Build Info",
					desc = "Retrive current Blizzard build infomration.",
					func = function(info)
						addon:SafeCall("BlizBuildInfo")
					end
				},
			},
		},
	},
}

--[[-----------------------------------------------------------------------------
Initialize
-------------------------------------------------------------------------------]]
LibStub('AceConfigRegistry-3.0'):RegisterOptionsTable(addonName, options)

addon.configPanel:AssignOptions(addonName)
--addon.configPanel:SetDesc("These options allow you to change the appearance and behavior of " .. addonName .. ".")
addon.configPanel:SetInfo("Version: " .. GetAddOnMetadata(addonName, 'Version'))
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote