EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
Editing UI Elements
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 18:31    Post subject: Editing UI Elements Reply with quote Print

I'm wanting to edit some UI elements (menu headers). I have no idea where to start or what to really even look for. Any help would be greatly appreciated.

Trying to edit Mayhem's new 'job' ui so that jobs only have 1 header instead of each individually.

https://www.dropbox.com/s/l24d8f7v64n3qag/Mayhem%20Sanctuary%20Manager%20UI.png?dl=0

Would very much appreciate some guidance. Next step is to hopefully edit the new DA's to quit being stupid Wink

Back to top
View user's profile Send private message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 01:59    Post subject: Reply with quote Print

Pretty sure I've managed to find the correct 'line'. But I'm unsure of which element is dictating which one determines how the data is listed. Namely why each job is listed with a separate header... No idea what I'm doing here.

Managed to find the file and what I think is the correct 'string?' Forfeit! Evil or Very Mad again tomorrow... Guess I'll actually go play for now!

Back to top
View user's profile Send private message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 02:03    Post subject: Reply with quote Print

<line linenr="031" indent=" ">
<var>$jobs</var>
<text> </text>
<text>=</text>
<text> </text>
<text>table</text>
<text> </text>
<text>get</text>
<text> </text>
<var>$logistics</var>
<text> </text>
<text>(</text>
<text> </text>
<text>'jobs'</text>
<text> </text>
<text>)</text>
</line>
<line linenr="032" indent="  ">
<comment>* Collect data to sort the array.</comment>
</line>

--

Not sure the appropriate format for linking this but I'm pretty sure this is what determines how it's sorted? Any insight would be appreciated.

Back to top
View user's profile Send private message
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 20781 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 10:39    Post subject: Reply with quote Print

First of all, you cannot edit X3 scripts in an ordinary text or xml editor. The somewhat readable part at the top of the script file (everything between the <sourcetext></sourcetext> tags) is only responsible for displaying the script in your browser. Doubleclicking an xml script file within the "scripts" folder, or any other folder where the x2script.xsl is present, will open a readable view of that script in your browser. If you want to reference or ask about about specific code snippets, copy the relevant part of this view into bbcode code-tags in your post. The actual script code, however, is listed between the <codearray></codearray> tags.
To edit a script you either need to use the ingame Script Editor or a specialised external Script Editor like X-Studio by mr.bear. (If you haven't worked with MSCI scripts/the Script Editor before, you may want to read the MSCI manual.)

As for your headline issue, you need to find the script which is creating the menu in question. The line you're looking for is "add custom menu heading to array <Value>: text=<Var/String>" which adds a heading text defined in "text=<Var/String>" to the menu specified in "<Value>". See also this tutorial on creating custom menus in X3TC/AP.


_________________
Besteht Interesse an einem Nopileos-Hörbuch?

Farnhams Legende und Nopileos als E-Books!

"People who think they know everything are a great annoyance to those of us who do." - Isaac Asimov

"If it's not impossible, there must be a way to do it." - Sir Nicholas Winton
Back to top
View user's profile Send private message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 16:26    Post subject: Reply with quote Print

Thanks Illuminatus, Helps alot! Wasn't sure where to go from there.

Never messed with anything like this other than HTML was trying to edit it like I would HTML.

Back to top
View user's profile Send private message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 18:07    Post subject: Reply with quote Print

So slightly more progress, Seems I've possibly found the lines (probably not).

https://www.dropbox.com/s/cc8bymizseeggfn/Mayhem%20Job.png?dl=0

I'm fairly positive this is the dynamic menu. But from what I could understand it should be labeled with dynamic in it? Not sure. Maybe there's a reference to make it dynamic that I'm not seeing.

https://www.dropbox.com/s/ai8ki58rg1y1enm/Mayhem%20Directory.png?dl=0

Seeing *collect data to sort array* makes me think this is the dynamic line? If I'm understanding how this works correctly.

I also haven't been able to find $logistics or $jobs. Seems like that's something else other than a script? Is it just a internal reference?


TL;DR : Pretty sure I've found the line but don't see whats making it create individual headers.

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 3509 on topic
Location: France
Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 18:23    Post subject: Reply with quote Print

...

Menu.DWM.Get.Logistics.Jobs, line 98

Code:
add custom menu heading to array $menu: title=$t


replace by:

Code:
add non selectable menu item: $menu, text=$t



_________________
Mayhem - Satellites Monitoring - ADS (Joubarbian Edition) - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
Argustone





Joined: 05 Jun 2017
Posts: 57 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 19:26    Post subject: Reply with quote Print

So your suggestion wasn't quite what I was trying to do. But after some more 'figuring' it's this simple. DELETE line 108.

https://www.dropbox.com/s/8g2fdfjf81tyhz0/Now%20thats%20nice%21.png?dl=0

It's so clean! Thanks for all the help! Lock thread?

Edit. I'm guessing this means that all lines below 108 to the 'end' are now junk (for my game) probably should delete them as well?

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 3509 on topic
Location: France
Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 19:33    Post subject: Reply with quote Print

Illuminati, Illumanitoum, Illuminatus! May this thread be locked!


_________________
Mayhem - Satellites Monitoring - ADS (Joubarbian Edition) - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sun, 23. Sep 18, 22:31

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.09803 seconds, sql queries = 23