• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

rob771532

Recruit
Jun 8, 2019
5
0
All I want to do is display some values on screen. I've been trying to wrap my head around XDialog for a little while now, and it seems vastly over-complicated for what I'm trying to do. I've been reading a lot of LUA code for XDialog, and I still can't wrap my head around it.

I have a couple of global variables called globRadiation and globSolarWind

All I really want to do is have a little box permanently open on the right hand side of the screen which looks more or less like the attached image, and updates every few seconds. (apologies for the potato pbrush edit).

Do I really need what feels like thirty pages of XDialog to do this? Or am I really missing something obvious?
Is XDialog the best/only thing to do the job?

This feels like one of the last pieces of the puzzle I've been working on, since ChoGGI helped with the global variable issues I was having... so any assistance would be welcome.

Rob
 

Attachments

  • infomockup.jpg
    infomockup.jpg
    9,3 KB · Views: 16
Yes, XDialogs are annoying (at least they're not XTemplates). I can put towards some mods I did if you want to browse them? If you have more direct questions there's the discord (so you're not just asking me).

30 pages no, you'll need an xwindow, some elements inside it.
 
Hi ChoGGi. If you've got something relatively simple that I can have a look at, then yes, please point me that way.
I think what might be confusing me most is that everything I've tried to learn from is so cluttered with pop-ups and extra functionality that I'm having trouble trying to unwrap what bit does what.
 
This is a fairly simple (comparatively) dialog example
https://github.com/ChoGGi/SurvivingMars_CheatMods/blob/master/Expanded Cheat Menu/Code/Dialogs/DTMSlots.lua
(I've done a few dialogs, so I've merged most of the stuff in my classes_ui.lua file

Code:
-- this will fire whenever a save is loaded (I think)
function OnMsg.InGameInterfaceCreated(igi)
    -- you'll probably need to attach it to something in igi, not just igi, but I'm lazy (I can show you how to use ECM to examine dialogs).
 
    -- using the dialog class obj from the above link
  local dlg = ChoGGi_DlgDTMSlots:new({}, igi, {
        -- you probably won't need to, but if you want to send some context stuff (see the context in the Init func)
        -- access it from Init as context.somestring
        somestring = "string",
    })
    -- if you want to do something to the dialog from here use "dlg"
    -- like create a thread and fiddle with it afterwards
 
end