Thread Tools Display Modes
07/02/24, 09:51 AM   #21
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,092
This is no image file https://imgur.com/a/jsF3sQE !
It's an url.

The image at this link is the image on this website's url, in the middle. You need to copy the image's file link (images end on .jpg, jpeg png bmp) and not the url to the wrapper website that shows the image.
-> Right click the image on that website url and chosoe "Copy link/address"
https://i.imgur.com/xhngTBl.png

Link that with the given img tag around it:





About the crash:
I found out that the game crashes are caused by the code
Then call that function butt comment out the code starting from the bottom.
Just do the first block where it creates the conrol from virtual.
If that works, go on and check where it starts to crash.

And then you can find out more about that by inspecting the code where exactly the crash happens.

Last edited by Baertram : 07/02/24 at 09:59 AM.
  Reply With Quote
07/02/24, 12:24 PM   #22
tealke
Join Date: Mar 2023
Posts: 19
thank you for explaining how to insert a picture correctly....I didn't understand that at first

according to your advice, I commented parts of the code and it stopped crashing when the code section was commented
Code:
 local control = CreateControl(panelName .. "_SettingsWindow", GuiRoot, CT_CONTROL)
 if not control then
 d("Error: Unable to create control for " .. panelName)
 return
 end
so the problem is in this function, it displayed an error in the game



which makes sense because the code was not complete
  Reply With Quote
07/02/24, 01:03 PM   #23
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,092
CreateControl(name, parent, controlType)
Maybe I'm wrong but don't you want to create the control with the parent = your TLC you have created before?
-> The TLC's parent is GuiRoot automatically then!

If your TLC name is TMA_Menu_TLC:
local control = CreateControl(panelName .. "_SettingsWindow", TMA_Menu_TLC, CT_CONTROL)

Try if this works without a crash
  Reply With Quote
07/02/24, 01:39 PM   #24
tealke
Join Date: Mar 2023
Posts: 19
the game keeps crashing, I'm wondering if there might be an error in TMA_Settings, otherwise I really don't know
  Reply With Quote
07/02/24, 02:58 PM   #25
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,092
I bet the crash actually does not happen in that function TMA_Menu:CreateSettingsWindow(panelName)
It happens after it!

If you comment the fucntion or parts of it where the CreateControl is used then you get errors afterwards which prevent the crash.
But as the control is created it will exit tis function, go on to next ones and then ctash there.

So try to reenable the function and after the function was called and the
local control = CreateControl(panelName .. "_SettingsWindow", TMA_Menu_TLC, CT_CONTROL)
was run

add some assert( 1 ~= 1, "stopped here") in your code
See how further you can get without a crash then, after the function
function TMA_Menu:CreateSettingsWindow(panelName)
  Reply With Quote
Yesterday, 11:31 AM   #26
tealke
Join Date: Mar 2023
Posts: 19
you're right, it seems to be crashing in the function
TMA_Menu.RegisterSettings()
Code:
-- Register Settings
function TMA_Menu.RegisterSettings()
 --This event is called at EACH realoadui again so do not use that to register datam, use EVENT_ADD_ON_LOADED at best
 --EVENT_MANAGER:RegisterForEvent("TMA_Menu", EVENT_PLAYER_ACTIVATED, function()
 local dark, scene, leftFragment, rightFragment = TMA_Menu.CreateSettingWindows()
 local data = {
 id = "TMAMenu",
 name = TMA.DisplayName,
 longname = TMA.NameS,
 callback = function()
 SCENE_MANAGER:AddFragment(scene)
 SCENE_MANAGER:AddFragment(leftFragment)
 SCENE_MANAGER:AddFragment(rightFragment)
 end
 unselectedCallback = function()
 SCENE_MANAGER:RemoveFragment(scene)
 SCENE_MANAGER:RemoveFragment(leftFragment)
 SCENE_MANAGER:RemoveFragment(rightFragment)
 end
 }

 TMA_Menu:RegisterAddonPanel("TMAMenu", data)
 ZO_GameMenu_AddSettingPanel(data)
 --end)
end
when I used your method, it let me up to here and the game didn't crash, so it's probably this part of the code

Code:
TMA_Menu:RegisterAddonPanel("TMAMenu", data)
 ZO_GameMenu_AddSettingPanel(data)
I just don't know what's wrong with this part
  Reply With Quote
Yesterday, 12:11 PM   #27
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,092
A good advice is to check how ZOs does use those functions and then check what you did differently.

So go to esoui sources at github e.g., search for ZO_GameMenu_AddSettingPanel and find out what you did differently compared to ZOs doing it.

e.g. here
https://github.com/esoui/esoui/blob/...yboard.lua#L88
ZO_GameMenu_AddSettingPanel(panelData)

local panelData =
{
name = panelName,
visible = visible,
callback = callback,
unselectedCallback = unselectedCallback
}

So inspect your "data" with merTorchbug e.g. and see what it looks like.
ZO_GameMenu_AddSettingPanel(data)

To do that you need to make the data globally accessible, e.g. via your table TMA_Menu

TMA_Menu._data = data
--ZO_GameMenu_AddSettingPanel(data) comment this so it does not crash the client!

That way you can inspect /tb TMA_Menu and see the _data entry there
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » I have a problem with displaying the menu in TLC


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