View Single Post
10/25/16, 03:53 AM   #24
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
I know this thread is old but my problem is quite related to the scene manager. It's acting very funny right know.

What I am doing:

Code:
-- self.aura[auraName] is a top level control

self.aura[auraName].sceneFragment = ZO_SimpleSceneFragment:New(self.aura[auraName]);
HUD_SCENE:AddFragment(AuraMastery.aura[auraName].sceneFragment);
Create the fragment and assign it to the HUD_SCENE.



I am using a registered update handler to listen for desired (de-)buffs. This handler simply looks at a specified frequency if the effect is present and sets the boolean variable 'display' to true or false depending on wether the effect is present or not

Code:
HUD_SCENE:RemoveFragment(AuraMastery.aura[auraName].sceneFragment);		
if (display) then
    HUD_SCENE:AddFragment(AuraMastery.aura[auraName].sceneFragment);

    (...)
Remove set fragment if the buff/debuff is not present, then check if it is present (display = true). IF it is present, add the fragment to the scene again.

In clearer words, I:

1. create a top level control (TLC)
2. make it a shard
3. assign this shard to HUD_SCENE

4. updating handler (updating every 5frames):
check if aura is present
=>
if (not present): remove the shard from HUD_SCENE
else add the shard from HUD_SCENE






My problem: The control is visible if I start the game. To make it work I have to /reloadui, then everything runs flawlessly. Any ideas?

Last edited by Letho : 10/25/16 at 04:34 AM.
  Reply With Quote