General Tso
Panzer General
I'm in the process of increasing the options available in the Advance Setup screen. I've change the screen so that it works something like the Diplomatic screen. There are three sub panels that are connected to AdvancedSetup using LuaContext. They are located in three seperate files called CivSetup, MapSetUp, and GameSetup. I have another file called DataManager that loads UserData into an object - it contains a Lua object (ie table) with functions attached to it using ":". This object loads the UserData when the game starts or a new mod is initialized, then manages the data while the screen is open, then saves the changed data back to UserData when the screen is closed. The problem I have is that when I use the include statement to include DataManager in CivSetup, MapSetup, and GameSetup I end up with 3 different objects. I don't want that - I want a single object that allows the three panels to share data. Can anybody please help me?
I've tried making the data object a global. I've also tried making it a local variable and passing that variable back to the other files but nothing works - I always end up with three separate objects. What am I doing wrong?
I simplified the code down to a empty table with two simple function for testing purposes and it still doesn't work. I can post it if necessary.
I've tried making the data object a global. I've also tried making it a local variable and passing that variable back to the other files but nothing works - I always end up with three separate objects. What am I doing wrong?
I simplified the code down to a empty table with two simple function for testing purposes and it still doesn't work. I can post it if necessary.