Originally Posted by ZOS_ChipHilseberg
Looking at secure render mode it only impacts which controls draw and which don't, so it doesn't interact with the security violation code. It might be that something else is happening at the same time secure render mode is changing. I know that any scene that uses the stop movement fragment (I'm only seeing crown store and gamepad scenes using it right now) will trigger a violation if the scene is shown from insecure code. Is there some way your code is showing one of those?
|
If you want to have an example try the current version of
Rare Fish Tracker.
It "just" surrounds a TopLevelWindow with a ZO_HUDFadeSceneFragment to handle where and when it is visible.
rft is the TopLevelWindow:
Lua Code:
RARE_FISH_TRACKER_FRAGMENT = ZO_HUDFadeSceneFragment:New(rft, 500, 0)
RARE_FISH_TRACKER_FRAGMENT:SetConditional( function()
if WORLD_MAP_FRAGMENT:IsShowing() then
return RFT.settings.shown_world
else
if IsUnitInCombat("player") then return false end
return RFT.settings.shown or RFT.isFishing
end
end )
WORLD_MAP_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_FRAGMENT_SHOWING or newState == SCENE_FRAGMENT_HIDING then
if RFT.settings.shown_world == RFT.settings.shown then RFT:RestorePosition() end
RARE_FISH_TRACKER_FRAGMENT:Refresh()
elseif newState == SCENE_FRAGMENT_HIDDEN then
RFT.RefreshWindowForZone(GetUnitZone('player'))
end
end )
CALLBACK_MANAGER:RegisterCallback("OnWorldMapChanged", function(navigateIn)
if WORLD_MAP_FRAGMENT:IsShowing() then
if navigateIn and GetMapType() ~= MAPTYPE_ZONE then return end
RFT.RefreshWindowForZone(ZO_WorldMap.zoneName)
else
RFT.RefreshWindowForZone(GetUnitZone('player'))
end
end )
RARE_FISH_TRACKER_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_FRAGMENT_SHOWING then RFT:RestorePosition() end
end )
EVENT_MANAGER:RegisterForEvent("RareFishTracker", EVENT_PLAYER_COMBAT_STATE, function() RARE_FISH_TRACKER_FRAGMENT:Refresh() end)
HUD_SCENE:AddFragment(RARE_FISH_TRACKER_FRAGMENT)
HUD_UI_SCENE:AddFragment(RARE_FISH_TRACKER_FRAGMENT)
LOOT_SCENE:AddFragment(RARE_FISH_TRACKER_FRAGMENT)
WORLD_MAP_SCENE:AddFragment(RARE_FISH_TRACKER_FRAGMENT)
If you change the fade-out duration in line 266 of RareFishWindow.lua (here first line) from 0 to let's say 100 and you make the Rare Fish Tracker window visible, you can't open the store without crash. If you toggle it off first, all is ok.