ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   New Developer Here, Couple Questions (https://www.esoui.com/forums/showthread.php?t=6935)

Irregulator 04/02/17 12:51 PM

New Developer Here, Couple Questions
 
Hi all,

I'm new to addon authoring but not to coding. I had a couple ideas in mind and was hoping to get some feedback/somewhere to start with them.
  1. I want to be able to re-color the standard discovered map pins on the world map. I understand each pin has a texture .dds file associated with it - can I change that file or somehow change what file is used for world map pins?
  2. A toggle sprint keybind (not toggle run). I have some issues with my hands and would like to not have to hold a button in order to sprint. Ideally I could press this toggle sprint key and my character would sprint until he ran out of stamina or until I pressed the move forward or backward keys. It'd work similarly on a horse.

Where should I start with these ideas? I know that the function that actually makes your character sprint is private - does this mean my toggle sprint idea isn't possible?
Since all the .dds files are rolled into .dat files in the game's code - does that mean changing the game's map pin colors won't be possible?

Thanks for your time.

Rhyono 04/02/17 12:57 PM

The default sprinting button was a pain to get used to since it is an awkward angle, but I didn't have a better choice in mind. Due to sprinting being private, it does kill the most logical way of handling it. I'm not sure if it might be possible to keep a normal keybind from toggling it back off on release though.

As for changing the map pins, Harven's addon allows creating new custom map pins and perhaps it could allow reskinning existing ones? http://www.esoui.com/downloads/info3...nsMarkers.html

Baertram 04/02/17 02:57 PM

You can colorize the map pin textures instead of exchanging them with new ones.
You just need to find their global name (using addon ZGOO and moving the mouse above the pin on the map and thenn type "/zgoo mouse" into the chat na dpress return), get the control for the name by

Lua Code:
  1. local mapPinTextureCtrl = WINDOW_MANAGER:GetControlByName("ZO_MapPin36", "Background").
->Background contains the texture for the pin itsself, Highlight the blue glowing surrounding. Bozth are children of type CT_TEXTURE of that pin ZO_MapPin36.
-> The pins should all be in ZO_WorldMapContainer as children, starting with "ZO_MapPin" and then a number.

After this you can use somehting like this to colorize it
Lua Code:
  1. mapPinTextureCtrl:SetColor(r, g, b, a)

Where r = red, g= green, b=blue and a = alpha value (0 to 1, in 0.1 steps I think)

To exchange the texture instead use:
Lua Code:
  1. mapPinTextureCtrl:SetTexture("/esoui/art/path/to/ingame/texturefile.dds")

Irregulator 04/02/17 09:37 PM

Quote:

Originally Posted by Baertram (Post 30432)
To exchange the texture instead use:
Lua Code:
  1. mapPinTextureCtrl:SetTexture("/esoui/art/path/to/ingame/texturefile.dds")

I didn't realize I could do this! So I can simply place a file in that location in my addon folder? Or does it go somewhere else? Thanks for your help.

Dolgubon 04/02/17 10:01 PM

Yes, you can use custom textures placed in the addon's files. For example,[[DolgubonsLazySetCrafter/images/patterns/templateTexture.dds]]

Irregulator 04/04/17 07:11 PM

/zgoo mouse is incredibly helpful, thank you Baertram. I'm starting to realize why an addon doesn't exist to re-color existing map pins already though (maybe lol) - it appears that every pin has its own control, even when they're the same icon. However, map pins (in the m_Pin table) have a sub-table called m_PinTags, and in this sub-table the path to the pin texture file is the second value.

Would it be possible to pull all pins into my code and re-color/re-texture them if they use a certain texture file? Or maybe there's some other identifying value that is the same across all pins of the same icon I can use? Getting the control for each pin individually would be incredibly time consuming...

retired_adventurer 04/05/17 10:26 AM

For your ergonomic issues you could try moving sprint to your mouse or some other key, like spacebar.

Irregulator 04/06/17 07:02 PM

Quote:

Originally Posted by retired_adventurer (Post 30475)
For your ergonomic issues you could try moving sprint to your mouse or some other key, like spacebar.

That's a good idea, but my god I've been sprinting with shift and jumping with the spacebar since the second grade! lol

Letho 04/07/17 08:17 AM

I put sprint to "CTRL" and sneak to "<" for that reason.

retired_adventurer 04/07/17 01:31 PM

Quote:

Originally Posted by Irregulator (Post 30487)
That's a good idea, but my god I've been sprinting with shift and jumping with the spacebar since the second grade! lol

Don't worry, a few hundred hours of ESO will easily rewire your brain into trying to sprint with space in every other game too.


All times are GMT -6. The time now is 01:52 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI