Thread Tools Display Modes
07/07/17, 04:21 PM   #1
rewt3498
Join Date: Jun 2015
Posts: 7
How to prevent changes to HUD being undone during gameplay

I have an addon that makes some changes to the HUD (Note: I am using gamepad mode). Things that happen during play seem to be counteracting these changes I've made (in some cases outright undoing parts of them, or partially undoing some of them, like slightly decreasing transparency).

I would be grateful if anyone could take a look at the script and see if they know a better approach to solve this problem than the solutions I have attempted (at the bottom of the script).

https://pastebin.com/q4pH14QM

I'll briefly outline the structure of the script for anyone who does take a look to hopefully save you some time: Functions in the beginning all change elements of the HUD they are named after. Last function in the script is what is called during EVENT_ADD_ON_LOADED. Below this function are my attempted solutions.

The changes to the compass are partially undone when transitioning from main menu back to playing. The changes in the alpha of the quest tracker title are undone when changing the focused quest. The solutions I attempted were targeted with this in mind.

However, it now seems there are other circumstances that revert these changes that I can't pin down exactly. I'm therefore hoping there is a more elegant solution that I just don't know about.

As a minor sidenote: I would be grateful if anyone could have a look at my use of zo_callLater and suggest a more proper way to accomplish what I've attempted. I found the script didn't work without it.
  Reply With Quote
07/07/17, 05:14 PM   #2
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
I'd like to invite you to hang out and chat with us on Gitter. There you can ask for help in real time and even request Elder Scrolls
lore friendly jokes to out bot Lexicon: https://gitter.im/esoui/esoui
  Reply With Quote
07/08/17, 10:30 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
The best attempt to find the code that reverts what you did change after your addon loads is to scan the esoui source code (Check the addon named Esoui source code) for the stuff that you did change.

Checking the folder esoui/ingame should be the best place to start.

Like the control names or the start of the control name, as most suffixes will be added in xml, like:
Parent = mycontrol
A label below parent is named ($parent)label which results in mycontrolLabel as the name.

This way you "understand" how the game changes the stuff and where it does it. Then you are able to find the correct place to react on the changes.
Maybe it's not the "ON_ADDON_LOADED" event but some function that the game calls every here and there.

Oh and if you use the gamepad mode be sure to check the shared files/folders as a base and then the gamepad files/folders in the source.

Last edited by Baertram : 07/08/17 at 10:49 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How to prevent changes to HUD being undone during gameplay

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