Log in

View Full Version : [TEC]linking Pages files


divingbluefrog
06-17-13, 03:02 PM
I need some help from the UI's gurus...
I don't figure, neither find any hint in the various threads about menu_1024_768, how a clickable zone, or button, in a given page xxx.ini file can load another page.
It's done everywhere, but no clue about the "how". And I don't believe in magic...:D

SkyBaron
06-17-13, 04:12 PM
I implemented my Enigma simulator based on these two threads:

http://www.subsim.com/radioroom/showthread.php?t=163118

http://www.subsim.com/radioroom/showthread.php?t=165968

...and of course some previous programming knowledge.

Hope this helps!

divingbluefrog
06-18-13, 02:07 AM
Thanks SkyBaron, unfortunately I've already read those and many others without finding the answer.
Perhaps should I have been more precise in my question.
Take this as an example :
http://www.subsim.com/radioroom/picture.php?albumid=787&pictureid=6749

This is a view of the Page Crew.ini displayed in game.
When you click on the text "torpedo", which is in fact a button, the game loads the Page Guns.ini where this tab is discribed.
But, in Page Crew.ini, the only reference to this button is :

[G61 I6]
Name=TorpedoBtn
Type=1032;Button
ItemID=0x61040008
ParentID=0x61040000
Pos=613,-28,296,34
Zone= 663 693 296 34 2 1 0x6104000C 0.5 -0.5 0x61040008 -0.5 0.5 0 0
StyleSheetNames=GrayTabButton
Materials=4
Display=0;No stretch
Font=30
Text=6411
TextFlags=0x5
StatesColors=0xEDBF72FF, 0x747474FF, 0xE0E0E0FF, 0xEDBF72FF

And that's all! Where is the link? How the game knows to load the Page Guns.ini and not the UZO page? It doesn't come from the associated .py files as they are empty.
ParentID=0x61040000 is nothing more than the menu group that describes the page layout.

EDIT :I think it could only be related to menu.txt, the capital letters entries must be harcoded somewhere. Must practice some tests to validate....

Trevally.
06-18-13, 07:45 AM
Are you using the menu editor to check:06:

http://img5.imageshack.us/img5/5743/c5mh.jpg

divingbluefrog
06-18-13, 08:25 AM
Yes I do. And I'm almost sure now that it's done via the text entry :
when a clickable zone, or a button is referenced with a text=x line in the Page file,
and it's displayed as string : [x]UPPERCASE in the Item Text zone (last one) of
the menu Editor, it's in fact a call to the Page xyz.ini file.
I think that the link between UPPERCASE name and xyz name is harcoded somewhere, cause I can't find a file giving it.

But there is another feature that bothers me now (I know, the more you learn, the more you discover the extent of your ignorance).
Let me prepare a clear explanation and I will post it soon.

divingbluefrog
06-18-13, 08:50 AM
http://www.subsim.com/radioroom/picture.php?albumid=787&pictureid=6750

In various items description you find a line text=1, which is reported as String : [0001]GO TO GAME in the Item text display.
And of course, when the game is running, it displays the proper name.
And the question is the same as the previous one : How?

TheDarkWraith
06-23-13, 11:58 AM
I need some help from the UI's gurus...
I don't figure, neither find any hint in the various threads about menu_1024_768, how a clickable zone, or button, in a given page xxx.ini file can load another page.
It's done everywhere, but no clue about the "how". And I don't believe in magic...:D

Take a big picture look at the problem you are having and you will realize the error in your thinking. A page is never loaded by a button click. Almost all the pages are loaded at game start. To load a page that isn't integral to the game you have to tell the game to load it (using ScriptManagerManaged.MakeSureIsLoaded). What else can make a page hide/show (think big picture - hint: inherited ScriptManager method)?

Yes I do. And I'm almost sure now that it's done via the text entry :
when a clickable zone, or a button is referenced with a text=x line in the Page file,
and it's displayed as string : [x]UPPERCASE in the Item Text zone (last one) of
the menu Editor, it's in fact a call to the Page xyz.ini file.
I think that the link between UPPERCASE name and xyz name is harcoded somewhere, cause I can't find a file giving it.

But there is another feature that bothers me now (I know, the more you learn, the more you discover the extent of your ignorance).
Let me prepare a clear explanation and I will post it soon.

Almost all the pages that have no .py files for them are hard coded in the game. The game code updates all the menu item's text properties, bitmap state, checked state, etc. The problem you are having is you fail to understand how the menu items work (and the inherited methods they have). Examine the .ini files and the inherited ScriptManager methods for the menu items using the ScriptManager edit in game. Your answer lies in the entries for each menu entry and how the inherited ScriptManager methods works with those.

In various items description you find a line text=1, which is reported as String : [0001]GO TO GAME in the Item text display.
And of course, when the game is running, it displays the proper name.
And the question is the same as the previous one : How?

I do this same thing with my UIs mod. Once again see above :D