Quantcast
Questions about advanced aspects of the default UI. - WoWInterface
Thread Tools Display Modes
08-04-11, 03:24 AM   #1
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Questions about advanced aspects of the default UI.

What an awful topic title. I couldn't think of anything better.

Anyhow, there have been a couple of things in the default UI that have been haunting me for some time. Things that are there but nobody really seems to know how to change. For example:

- We can scan the WorldFrame for chat bubbles/nameplates, but do we have any access to the functions that spawn them? Are they documented anywhere?
- Following that, would it be possible to apply custom class colours to enemy player name plates without overwriting RAID_CLASS_COLORS or using a CPU-intensive OnUpdate script?
- Following that, is there any way to change the class colours on (mini)map party/raid icons without the use of similar code?
- Is there any way to access spell button/item icons that are attached to the game cursor when you drag them around? I'd like to change their appearance, but I can't find the source code behind them. I've looked through cursor functions, but I've no idea where the actual functions are that set the icon texture on the cursor.

If you happen to know anything about this (or similar obscure parts of the UI), then by all means, post.
  Reply With Quote
08-04-11, 05:40 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,924
Originally Posted by Haleth View Post
- We can scan the WorldFrame for chat bubbles/nameplates, but do we have any access to the functions that spawn them? Are they documented anywhere?
To my knowledge, these are created and managed by the game code itself from the WorldFrame and have no API associated with them.


Originally Posted by Haleth View Post
- Following that, is there any way to change the class colours on (mini)map party/raid icons without the use of similar code?
These are actually the same blip textures used for the WorldMapFrame. I haven't taken a look at the Minimap API for a while, but last I checked, there was a function to load in a modified blip texture.
Edit: Might want to check out Minimap:SetClassBlipTexture().


Originally Posted by Haleth View Post
- Is there any way to access spell button/item icons that are attached to the game cursor when you drag them around? I'd like to change their appearance, but I can't find the source code behind them. I've looked through cursor functions, but I've no idea where the actual functions are that set the icon texture on the cursor.
Cursor rendering is handled by the game code itself and its changes are applied through use of the cursor mode and pickup* API calls. It is possible to store what was picked up, clear the cursor, render your own texture for your own icon at the cursor position, and reapply it when pickup* is called again. If you try this route, expect your texture to lag back behind the cursor a few frames if you're running the cursor in hardware mode.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-04-11 at 05:51 PM.
  Reply With Quote
08-05-11, 04:15 AM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Thanks for the reply. The map icons function seems interesting, I'll see if I can find where it's called.

The easiest solution would simply be to replace the original texture file for the icons, but I prefer to keep everything within the addons itself.
  Reply With Quote
08-06-11, 03:05 AM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Well, that 'worked', as in, I was able to change the texture, but because of the lack of proper .blp/tga converters I just ended up with green squares on my minimap.

Trying something now to change the class colours on the unit nameplates.

Edit: That was easy, just hooking OnShow and checking the health bar colour did the trick.

Last edited by Haleth : 08-06-11 at 07:04 AM.
  Reply With Quote
08-06-11, 11:41 AM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,732
Originally Posted by Haleth View Post
because of the lack of proper .blp/tga converters I just ended up with green squares on my minimap.
What were you using? I like BLP2PNG.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-06-11, 04:25 PM   #6
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Well, I use mac so that's not an option for me. The only thing I've found is blp tools, which is broken and buggy.

I tried using a .tga format image either with almost everything exactly the same as the original, but it wouldn't work either. I've probably made an oversight somewhere.

Last edited by Haleth : 08-06-11 at 04:44 PM. Reason: Nobody cares about this part!
  Reply With Quote
08-06-11, 11:54 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,732
Okay, then have you tried taking the textures from here to edit?
http://wowprogramming.com/utils/artbrowser

They're already .png files, and then you just have to save them as .tga in your editing software.

/edit: remember that you need an alpha channel
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-07-11, 06:38 AM   #8
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
I tried that and I got it working, but the quality of the icons appears to be considerably lower than the original. The borders seem fuzzy in-game, though when viewed with any imaging program it appears just fine.

  Reply With Quote
08-07-11, 10:26 AM   #9
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by Haleth View Post
Edit: That was easy, just hooking OnShow and checking the health bar colour did the trick.
yeah, the trick is discovering that a nameplate exists in the first place.

are you polling WorldFrame for new children, and digging into the texture regions to identify which are nameplates (this is the only approach i know of)?
__________________
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!"
  Reply With Quote
08-07-11, 11:41 AM   #10
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Originally Posted by acapela View Post
yeah, the trick is discovering that a nameplate exists in the first place.

are you polling WorldFrame for new children, and digging into the texture regions to identify which are nameplates (this is the only approach i know of)?
Yes, but there's now a more efficient method than looking through the textures because nameplates are actually named now. They're called NamePlate1, NamePlate2, ... etc.

Code:
local function IsValidFrame(frame)
	local name = frame:GetName()
	return name and name:find("NamePlate")
end
Code:
local numKids = 0
local last = 0
local OnUpdate = function(self, elapsed)
	last = last + elapsed

	if last > freq then
		last = 0

		if WorldFrame:GetNumChildren() ~= numKids then
			numKids = WorldFrame:GetNumChildren()
			for i = 1, select("#", WorldFrame:GetChildren()) do
				frame = select(i, WorldFrame:GetChildren())

				if IsValidFrame(frame) then
					CreateFrame(frame)
				end
			end
		end
	end
end
(modified caelNamePlates)

Chat bubbles aren't named yet unfortunately.
  Reply With Quote
08-07-11, 05:32 PM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,924
For named frames, you should be able to refer to their name as if it were a global. For example, a frame named "NamePlate1" should be assigned to a global variable called "NamePlate1". This is the behavior of the frame creation routine for both CreateFrame() and the XML parser. Note that if a global variable of the same name already exists, it won't be set, but the frame is still created.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-07-11 at 05:39 PM.
  Reply With Quote
08-08-11, 08:50 AM   #12
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Originally Posted by SDPhantom View Post
For named frames, you should be able to refer to their name as if it were a global. For example, a frame named "NamePlate1" should be assigned to a global variable called "NamePlate1". This is the behavior of the frame creation routine for both CreateFrame() and the XML parser. Note that if a global variable of the same name already exists, it won't be set, but the frame is still created.
How exactly would that apply here if I can ask? I'm not sure I understand.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Questions about advanced aspects of the default UI.

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