Thread Tools Display Modes
04-25-09, 11:05 AM   #1
kellewic
Premium Member
 
kellewic's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 2
Help understanding RDX

I am trying to do something simple (or so I thought ) to get a feel for RDX. What I am attempting is to simply show some text when I have aggro.

I did see in the Threats.lua a function that I thought would work, but it looks to only give threat %s (scaled and raw) with no way to get the isTanking or state variables.

So I decided to go the custom script route, but it doesn't seem to update very much in combat. I added some print statements in and I might see 3 of them per fight and all vars from UnitDetailedThreatSituation() remain nil.

It took me a few hours to even get the window and unit frame part to show with no errors and I'm still not sure if it's correct since I am not familiar with the concepts within RDX and how everything works together.

For instance, in the custom script I figured I could use the RDX.Unit functions, but I couldn't figure out what unit they were applying to at a given point in time. They always seemed to apply to my target. I thought this might be because the unit frame's "context" was "target", but if I changed it to "player", it doesn't work at all.

I have included the package information here hoping someone can point the way so to speak. I may be doing it completely wrong, but I played with so many settings, this was the only way I could get it work even partially work.

Code:
	["Kell_UI"] = {
		["infoVersion"] = "1.0.0",
		["infoAuthor"] = "Gaktar",
		["player_has_aggro_script"] = {
			["ty"] = "Script",
			["version"] = 1,
			["data"] = {
				["script"] = "text = \"AGGRA\"\n\nif UnitExists(\"target\") then\n    local _, status = UnitDetailedThreatSituation(\"player\", \"target\")\n\n    if not status and not UnitIsUnit(\"player\", \"player\") then\n        if UnitIsUnit(\"player\", \"targettarget\") then\n            status = 3\n        end\n    end\n\n    GatherSage2:Print(\"Status: \", status)\n\n    if status == 3 then\n        text = \"AGGRO\"\n    end\nend",
			},
		},
		["player_has_aggro_win"] = {
			["ty"] = "Window",
			["version"] = 1,
			["data"] = {
				{
					["bkdColor"] = {
						["a"] = 0.5,
						["r"] = 0,
						["g"] = 0,
						["b"] = 0,
					},
					["titleColor"] = {
						["a"] = 1,
						["r"] = 0,
						["g"] = 0,
						["b"] = 0,
					},
					["title"] = "",
					["feature"] = "Frame: LW Lock/Unlock",
				}, -- [1]
				{
					["feature"] = "UnitFrame",
					["design"] = "Kell_UI:player_has_aggro_if",
				}, -- [2]
				{
					["feature"] = "layout_single_unitframe",
					["unitWatch"] = 1,
					["version"] = 1,
					["interval"] = 0.1,
					["unit"] = "target",
				}, -- [3]
			},
		},
		["infoAuthorRealm"] = "Ghostlands",
		["player_has_aggro_if"] = {
			["ty"] = "UnitFrameType",
			["version"] = 1,
			["data"] = {
				{
					["feature"] = "Description",
					["description"] = "Shows if the player has aggro\n",
				}, -- [1]
				{
					["feature"] = "base_default",
					["h"] = 20,
					["version"] = 1,
					["w"] = 95,
					["alpha"] = 1,
				}, -- [2]
				{
					["feature"] = "ColorVariable: Static Color",
					["name"] = "staticRed",
					["color"] = {
						["a"] = 1,
						["r"] = 1,
						["g"] = 0,
						["b"] = 0,
					},
				}, -- [3]
				{
					["script"] = "Kell_UI:player_has_aggro_script",
					["color"] = "staticRed",
					["owner"] = "Base",
					["w"] = 75,
					["feature"] = "txt_custom",
					["h"] = 20,
					["version"] = 1,
					["anchor"] = {
						["dx"] = 0,
						["dy"] = 0,
						["lp"] = "CENTER",
						["rp"] = "CENTER",
						["af"] = "Base",
					},
					["name"] = "customText",
					["font"] = {
						["flags"] = "THICKOUTLINE",
						["title"] = "Default",
						["name"] = "Default",
						["justifyH"] = "CENTER",
						["face"] = "Interface\\Addons\\RDX_mediapack\\sharedmedia\\fonts\\DIOGENES.ttf",
						["justifyV"] = "CENTER",
						["size"] = 20,
					},
				}, -- [4]
			},
		},
		["infoComment"] = "",
	},
  Reply With Quote
05-03-09, 02:40 AM   #2
sigg
Featured Artist
 
sigg's Avatar
Featured
Join Date: Aug 2008
Posts: 1,251
Get aggro is already implemented in RDX.

Use Variable: Unit in set
Select class "has aggro"
This will provide a flag aggro for you.

You also have "ColorVariable: Threat Color" by Cripsii
The color change depend on the situation where you are :
No Threat color
Gain aggro color
Loss Aggro color
Tanking color
  Reply With Quote

WoWInterface » Featured Projects » OpenRDX » OpenRDX Community » OpenRDX: Community Chat » Help understanding RDX


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