Thread Tools Display Modes
03/20/15, 07:30 AM   #1
lightz39
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 21
Change compass state on event help

Hey everyone. I am currently making a combat indicator similar to http://www.esoui.com/downloads/info1...Indicator.html this isn't meant to replace that one just simply my learning process. I am brand new to addon making.

So far I have my compass glow red when in combat and not when out. What I want to do though is change the compass to the area state (the blue glow when in a quest area) and tint that red when in combat. Is this possible? How would I go about this?
  Reply With Quote
03/21/15, 01:21 AM   #2
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I'm not sure exactly what your wanting, but here are a couple of options.
You could:

If you want to just change the outline of the compass you could just set the frame colors.
Lua Code:
  1. ZO_CompassFrameCenter:SetColor(0, 1, 1, 1)
  2. ZO_CompassFrameLeft:SetColor(0, 1, 1, 1)
  3. ZO_CompassFrameRight:SetColor(0, 1, 1, 1)

If you really want it to look exactly like when your in a quest area. I looked, but didn't see any way to use the highlight thats already built in. They are created for the quest pins from a pool & appear to be released when no longer in use. So I think you'de have to make your own, these are the textures for it though. You could just create 3 texture controls (one for the center, left, & right endcaps) and overlay them over the compass:
Lua Code:
  1. "EsoUI/Art/Compass/area2frameAnim_centers.dds"
  2. "EsoUI/Art/Compass/areapin2frame_ends.dds"
  3. "EsoUI/Art/Compass/areapin2frame_ends.dds"

Last edited by circonian : 03/21/15 at 01:24 AM.
  Reply With Quote
03/21/15, 04:55 AM   #3
lightz39
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 21
Thanks for the reply! Sorry I'm pretty new at this. I was able to use this code to make the compass frame red earlier. However like you said I really want to use the area glow, possibly even make a custom one as I prefer a glow to a simple recoloring of the border.
Code:
    ZO_CompassFrameCenter:SetColor(0, 1, 1, 1)
    ZO_CompassFrameLeft:SetColor(0, 1, 1, 1)
    ZO_CompassFrameRight:SetColor(0, 1, 1, 1)
So to use new textures would I set them in my xml file and have then hidden when out of combat/visible when in?
  Reply With Quote
03/21/15, 07:07 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,998
If you just want to replace existing textures with other ones (like exchange the compass border to something own created) havea look at the function ReplaceTexture()
http://www.esoui.com/forums/showthre...eplace+texture

-> The textures must be at least once ingame loaded so replacement will take place. So you could load them to a new created texture (see function WINDOW_MANAGER:CreateControl(name, parent, CT_TEXTURE) and make them :SetHidden(true) so they are not shown, but loaded once this way.
Example for LUA code with textures: http://www.esoui.com/downloads/info33-zTextureTest.html

You don't need to use a XML file if you don't want to.


If you want to add a complete new frame around the compass you will have to create the new textures, anchor it to the compass control and assign your wished textures etc.
I did not do anything like this before so I'm not able to assist you here any further

This source code is not up2date anymore here, but this will maybe help you understand the compass:
http://esodata.uesp.net/current/src/...ss/luadir.html

-> If you wish to see the actual source code go to "Garkin's" dropbox and look for the newest ZIP file with the ESO LUA source codes. Current filename should be https://www.dropbox.com/sh/tedcy6ima...2.0.1.zip?dl=0
  Reply With Quote
03/21/15, 07:22 AM   #5
lightz39
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 21
Thank you very much for the info. I will play around with it and see what I can come up with.

Cheers.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Change compass state on event help


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