Thread Tools Display Modes
02-17-11, 01:58 AM   #1
Mirdamor
A Murloc Raider
Join Date: Feb 2011
Posts: 6
[REQUEST] Yellow click for spell thing.

Hello World Of Warcraft Addon makers.

The image below pretty much explain everything. It would be a complement to the basic Blizzard UI and not very light.

How to use it: Simple right-click and the bar will pop up above the mob you clicked and select the spell you want to cast(Hello cpn. obvious).


Last edited by Mirdamor : 02-19-11 at 05:14 AM.
  Reply With Quote
02-17-11, 04:23 AM   #2
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
I'm not really sure if this is possible. You can however do this with mouseover macro's, such as:
Code:
#showtooltip
/cast [@focus, mod:ctrl][@player, mod:shift][@mouseover,help][@mouseovertarget,help][help][@targettarget,help][] Hand of Protection
  Reply With Quote
02-17-11, 06:00 AM   #3
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Maybe it can be done with rightclick and GetMouseFocus() ?

Do a check if it's a player and then move and show a hidden created buffbar to the mouse which is rehidden when a/all buffs is cast?
__________________

  Reply With Quote
02-17-11, 09:38 AM   #4
Mirdamor
A Murloc Raider
Join Date: Feb 2011
Posts: 6
Well, if you say it's impossible that's a let down. : (
  Reply With Quote
02-17-11, 09:43 AM   #5
FynexFox
A Murloc Raider
Join Date: Feb 2008
Posts: 8
It wouldn't be possible in combat, is that correct? You can not update frames with clickable buttons during combat. That really would take any of the practicality away from this.
  Reply With Quote
02-17-11, 09:47 AM   #6
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
this might be possible but it would be far from lightweight. In order to make those buttons work they would have to be written in secure code so that they still worked in combat. Also a huge library would have to be written to handle that bar knowing what spells to put on the buttons based on what you are targeting and what class you are, what level you are and what spec and everything else.

Also the tricky part would be making the bar follow moving targets, i would look at the nameplate system and maybe think about tying this into the nameplate system or at least attempt to use the methods found there for keeping the bar over the initial target.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-17-11, 09:51 AM   #7
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by FynexFox View Post
It wouldn't be possible in combat, is that correct? You can not update frames with clickable buttons during combat. That really would take any of the practicality away from this.
You would not be able to update the buttons in combat. You dont really need to though. If the buttons are predetermined based on type of target then all you need to have done in combat is a show/hideing of the bar which is possible in combat. different bars would have to be made for different types of targets. As for it being able to determine things and update the bar on the fly no, not possible at least not in combat. Which is why when the game loads it would h ave to determine what class you are what spec you are and build the bars then based on a big library of all the spells for every class/spec. Like i said... i think its doable but far from lightweight or easy lol.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-17-11, 10:02 AM   #8
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
You can't show or hide secure buttons in combat either, so I don't really see how this idea - however useful - could ever be implemented.
__________________
Oh, the simulated horror!
  Reply With Quote
02-17-11, 10:04 AM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Ailae View Post
You can't show or hide secure buttons in combat either, so I don't really see how this idea - however useful - could ever be implemented.
How do you figure? i do it all the time...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-17-11, 10:13 AM   #10
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
The following code builds a grid of buttons granted they do not start off full you have to drag spells to them but you could like i said have the game load spells to the bars when you first log in no problem. Then there is a secure hotspot button that you can click on to open and close the grid of buttons anytime including in combat. This code is an adaptation of Giest which actually brought the grid up on the cursor although i dont think it worked in combat but my secure toggle code does work in combat. It would not be that hard to get this grid to come up on the mouse cursor when right clicking a target. The hard part will be getting the frame to follow the target if it moves or you shift your view, but like i said attach the frame to the nameplates... or use the nameplate system to move the frame when you shift your view or the target moves. The tedious part will be writing a library to handle filling the buttons when you log in, also make it update the buttons when you gain levels and change specs. Put an incombat handler so that it never trys to update the buttons while in combat which would cause secure restriction issues. Its easy to show/hide a secure button frame in combat... check out this code. Note- if you cant figure out what some of these things are doing because they make calls to functions in my core file let me know and ill post that to.

Code:
local addonName, addon = ...

addon:RegisterDefaultSetting("showContextMenu", false)

--[[-----------------------------------------------------------------------------
This is used to set the default button ids . These buttons do not conflict with
known stance/form/stealth bars.  These settings are not ideal, but are the best
compromise I could come up with short of writing virtual action buttons.

Default Blizzard IDs:
1-12		Main Bar (Unused by Warriors)
13-24		Second Bar
25-36		Side Bar 1
37-48		Side Bar 2
49-60		Bottom Right Bar
61-72		Bottom Left Bar
73-84		Warrior Battle, Druid Cat, Rogue Stealth, Priest Shadowform
85-96		Warrior Defensive, Druid Tree
97-108	Warrior Berserker, Druid Bear
109-120	Druid Moonkin
121-132	Possess Bar (Unusable)
-------------------------------------------------------------------------------]]
local actionID, class = UnitClass('player')

if class == 'DRUID' then
	actionID = {
		48, --01
		49, --02
		50, --03
		51, --04
		52, --05
		53, --06
		54, --07
		55, --08
		56, --09
		57, --10
		58, --11
		59, --12
		60, --13
		61, --14
		62, --15
		63, --16
		64, --17
		65, --18
		66, --19
		67, --20
		68, --21
		69, --22
		70, --23
		71, --24
		72  --25
	}
elseif class == 'WARRIOR' then
	actionID = {
		1, --01
		2, --02
		3, --03
		4, --04
		5, --05
		6, --06
		7, --07
		8, --08
		9, --09
		10, --10
		11, --11
		12, --12
		72, --13, Pesky warriors.
		109, --14
		110, --15
		111, --16
		112, --17
		113, --18
		114, --19
		115, --20
		116, --21
		117, --22
		118, --23
		119, --24
		120  --25
	}
else
	actionID = {
		96, --01
		97, --02
		98, --03
		99, --04
		100, --05
		101, --06
		102, --07
		103, --08
		104, --09
		105, --10
		106, --11
		107, --12
		108, --13
		109, --14
		110, --15
		111, --16
		112, --17
		113, --18
		114, --19
		115, --20
		116, --21
		117, --22
		118, --23
		119, --24
		120  --25
	}
end

local contextMenu = CreateFrame('Frame', nil, UIParent, 'SecureFrameTemplate')
contextMenu:SetPoint('RIGHT', UIParent, 'RIGHT', -280, -120)

local buttons = { }
for index = 1, #actionID do
	local button = CreateFrame('CheckButton', addonName .. "ContextMenuButton" .. index, contextMenu, 'ActionBarButtonTemplate')
	buttons[index] = button
	if (index - 1) % 5 ~= 0 then
		button:SetPoint('LEFT', buttons[index - 1], 'RIGHT', 2, 0)
	elseif index ~= 1 then
		button:SetPoint('TOPLEFT', buttons[index - 5], 'BOTTOMLEFT', 0, -2)
	else
		button:SetPoint('TOPLEFT')
	end
	button:SetAttribute('type', 'action')
	button:SetAttribute('action', actionID[index])
end

contextMenu:SetHeight(buttons[1]:GetHeight() * 5 + 8)
contextMenu:SetWidth(buttons[1]:GetWidth() * 5 + 8)
contextMenu:SetScale(0.8)

local texture = contextMenu:CreateTexture(nil, 'ARTWORK')
texture:SetTexture([[Interface\DialogFrame\UI-DialogBox-Background]])
texture:SetVertexColor(1, 1, 1, 0.5)
texture:SetPoint('CENTER')
texture:SetWidth(36)
texture:SetHeight(36)

local title = contextMenu:CreateFontString(nil, 'OVERLAY')
title:SetFont([[Fonts\FRIZQT__.TTF]], 12, 'OVERLAY')
title:SetTextColor(1, 1, 0, 0.8)
title:SetPoint('TOP', texture, 'TOP', 0, -1)
title:SetText('GCM')

--[[-----------------------------------------------------------------------------
Context "hot spot" button
-------------------------------------------------------------------------------]]
local hotSpot = CreateFrame('Button', nil, UIParent, 'SecureHandlerClickTemplate')
hotSpot:SetPoint('BOTTOMRIGHT', -370, 220)
hotSpot:SetHeight(15)
hotSpot:SetWidth(15)

hotSpot:SetFrameRef("contextMenu", contextMenu)
hotSpot:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
hotSpot:SetAttribute('_onclick', [[
	local frame = self:GetFrameRef("contextMenu")
	if button == 'LeftButton' then
		if frame:IsVisible() then
			frame:Hide(true)
		else
			frame:Show(true)
		end
	elseif button == 'RightButton' then
		control:CallMethod("ToggleCombatLog")
	end
]])

 hotSpot:SetScript('OnEnter', function(self)
	GameTooltip:SetOwner(self, 'ANCHOR_TOP', 0, 1)
	GameTooltip:AddLine("|cffeda55fLeft Click|r for ContextMenu", 0.2, 1, 0.2)
	GameTooltip:AddLine("|cffeda55fRight Click|r toggle CombatLog", 0.2, 1, 0.2)
	GameTooltip:Show()
end)

hotSpot:SetScript('OnLeave', addon.HideTooltip)

function hotSpot:ToggleCombatLog()
	addon.settings.showCombatLog = not addon.settings.showCombatLog
	addon:ConfigureCombatLog()
end

--[[-----------------------------------------------------------------------------
Initialize
-------------------------------------------------------------------------------]]
addon.RegisterEvent("ContextMenu-Initialize", 'PLAYER_ENTERING_WORLD', function(self, event)
	addon.UnregisterEvent(self, event)

	if not addon.settings.showContextMenu then
		contextMenu:Hide()
	end
end)

--[[-----------------------------------------------------------------------------
Save setting on logout
-------------------------------------------------------------------------------]]
addon.RegisterEvent("ContextMenu-SaveState", 'PLAYER_LOGOUT', function()
	addon.settings.showContextMenu = contextMenu:IsShown() or false
end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 02-17-11 at 10:20 AM.
  Reply With Quote
02-17-11, 07:34 PM   #11
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Well, you use a secure toggle to hide and show the button which isn't what I meant really. For this to work the buttons would have to be able to hide/show automatically (without user interaction) when a targets nameplate shows up/goes away, likely resulting in the action being blocked if done when in combat.
__________________
Oh, the simulated horror!
  Reply With Quote
02-17-11, 09:12 PM   #12
Akkorian
A Flamescale Wyrmkin
 
Akkorian's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 111
Have you guys looked at OPie? I’m not sure there’s a way to have WoW show a different bar or different buttons from the same action (like right-clicking a certain spot) depending on what kind of target you have. If you have to use different actions to open different bars (like right-click for spells you want to use on enemy mobs, or alt-click for spells you want to use on friendly players) then you could probably just use OPie, if you’re okay with the buttons being arranged in circles. It has an option to pop up the buttons at your cursor, so you could just alt-click over a friendly player to have it pop up a ring of buttons.
__________________
“Be humble, for you are made of earth. Be noble, for you are made of stars.”
  Reply With Quote
02-18-11, 08:35 AM   #13
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Ailae View Post
Well, you use a secure toggle to hide and show the button which isn't what I meant really. For this to work the buttons would have to be able to hide/show automatically (without user interaction) when a targets nameplate shows up/goes away, likely resulting in the action being blocked if done when in combat.
Actually from what it sounds like he wants it would not be "automatically" but rather when the user clicked on a target. So it should in theory be no problem.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-18-11, 08:36 AM   #14
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Akkorian View Post
Have you guys looked at OPie? I’m not sure there’s a way to have WoW show a different bar or different buttons from the same action (like right-clicking a certain spot) depending on what kind of target you have. If you have to use different actions to open different bars (like right-click for spells you want to use on enemy mobs, or alt-click for spells you want to use on friendly players) then you could probably just use OPie, if you’re okay with the buttons being arranged in circles. It has an option to pop up the buttons at your cursor, so you could just alt-click over a friendly player to have it pop up a ring of buttons.
Clique allows for some of this same stuff.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-18-11, 09:06 AM   #15
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Which is why I posted the mouseover macro in the first place :P
  Reply With Quote
02-18-11, 09:34 AM   #16
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Originally Posted by Grimsin View Post
Actually from what it sounds like he wants it would not be "automatically" but rather when the user clicked on a target. So it should in theory be no problem.
How would you attach your secure handler to "a target" then? Attaching it to a nameplate would mean to move it accordingly, which you can't do in combat. And there really is no other way to attach it in the 3D world.

Simple right-click and the bar will pop up above the mob you clicked and select the spell you want to cast.
To me this sounds like he wants to be able to right-click on a unit in the 3D-world and show a set of bars above or in proximity of it. With the limitations of secure buttons, I really don't see how it's possible - even when using a secure handler - since the position of the bar wouldn't be static. At least not as far as I know, although I have limited experience with using secure templates. Is it even possible to intercept a right-click on a 3D unit, without breaking all kinds of stuff?
__________________
Oh, the simulated horror!
  Reply With Quote
02-18-11, 11:43 AM   #17
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
I know i can move my modified vehicle bar in combat granted it does cause taint but nothing you notice. As for the click on the unit, i think it would be simple as watch for target changed and then have it get the info of the unit check the type of unit show/hide a bar according to type of unit and then anchor to unit's name plate.

Like i said im pretty sure it is doable but its really a lot of work.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-19-11, 06:08 AM   #18
Mirdamor
A Murloc Raider
Join Date: Feb 2011
Posts: 6
Originally Posted by Ailae View Post
How would you attach your secure handler to "a target" then? Attaching it to a nameplate would mean to move it accordingly, which you can't do in combat. And there really is no other way to attach it in the 3D world.



To me this sounds like he wants to be able to right-click on a unit in the 3D-world and show a set of bars above or in proximity of it. With the limitations of secure buttons, I really don't see how it's possible - even when using a secure handler - since the position of the bar wouldn't be static. At least not as far as I know, although I have limited experience with using secure templates. Is it even possible to intercept a right-click on a 3D unit, without breaking all kinds of stuff?
That's correct. C :
  Reply With Quote
02-19-11, 06:32 AM   #19
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I'd also think this is very hard to do, if not, impossible

Anyway, welcome to WoWInterface,
since I referred you from your original thread
  Reply With Quote
02-19-11, 05:43 PM   #20
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by Ailae View Post
How would you attach your secure handler to "a target" then? Attaching it to a nameplate would mean to move it accordingly, which you can't do in combat. And there really is no other way to attach it in the 3D world.
ultimately, i think it would have to be attached to the nameplate. detecting when there is a mouseover target, and identifying the associated nameplate (if enabled, within nameplate range, visible on the screen, and not the current target... see below) would be possible, via inspection of all visible nameplates for an "active" highlight region. i don't think having a control like this serve as an interlocutor for spellcasting would require secure frames (would it? especially if you built macros for the mouseover unit dynamically, up front... the author of an action-bar addon would likely be able to say for certain; for instance, can Macaroon activate an action bar when the "mouseover" unitid becomes active, and hide it when the unitid becomes inactive?). creating/initializing extra graphical objects, associating them with the base nameplate frame assembly, and generically detecting mouse activity on them is all possible in combat.

but in addition to nameplates being enabled (i.e. via "keybinding"), nameplate range (currently at 40 yards, hardcoded into the WoW Client), and simple world-frame visibility/clipping...

the fact (and the exception to all of the above) is that the current target nameplate is "dead" to the mouse (hardcoded into the WoW Client; Blizzard added this "feature" sometime around WoW 3.3, if memory serves). mouseover events on the current target nameplate would not be flagged (the highlight region doesn't activate, and you would have to mouse over the current target 3D model even just to have a unitid), and while i have not ever tried an active control of any kind, it would be my expectation that you would not be able to get anything associated with the current target nameplate frame assembly to answer to mouse-clicks. i.e. even if you could pop up your nameplate-attached toolbar on mouseover, nothing on it would respond to mouse-clicks.

that would tend to limit the value of something like this.

now that i think of it, this is probably all a Blizzard plot... they have been making it progressively harder for "targeting aid" addons of all kinds (and a per-unit action bar that popped up on mouseover would definitely qualify as a "targeting aid", i think). disclaimer: have a PvE-centric perspective on this.

my $0.02.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"

Last edited by acapela : 02-19-11 at 05:49 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » [REQUEST] Yellow click for spell thing.

Thread Tools
Display Modes

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