SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 12-25-13, 04:35 PM   #1
vanjast
Sea Lord
 
Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,797
Downloads: 1214
Uploads: 4
Default HEADS UP - Menu-Ini editor (WIP)

After many years decided to attack this
A week into this so far.. and making good progress.

Any ideas from you lot ?
I have ideas what I want to do.. but added input is always welcome!

I have an idea where this will go eventually..
- provide a graphical interface/editor for SH3/4.. maybe SH5
- replace S3D in it's entirety
- replace code modules (far into the future, if at all!! - will assess this)

Naturally this all depends on my free time... but anyway.. I'll be back in the new year with progress..
vanjast is offline   Reply With Quote
Old 12-25-13, 09:13 PM   #2
areo16
Sonar Guy
 
Join Date: Oct 2013
Posts: 382
Downloads: 64
Uploads: 0
Default

Quote:
Originally Posted by vanjast View Post
After many years decided to attack this
A week into this so far.. and making good progress.

Any ideas from you lot ?
I have ideas what I want to do.. but added input is always welcome!

I have an idea where this will go eventually..
- provide a graphical interface/editor for SH3/4.. maybe SH5
- replace S3D in it's entirety
- replace code modules (far into the future, if at all!! - will assess this)

Naturally this all depends on my free time... but anyway.. I'll be back in the new year with progress..
I say go for it. The first one. The second one I'm not so sure is necessary unless you can add a feature to deal with GR2 files to import into S3D.
areo16 is offline   Reply With Quote
Old 12-26-13, 04:34 AM   #3
radcapricorn
Helmsman
 
Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
Default

I uh... Well... Damn it. That just goes to show one has to announce one's work! vanjast, I've been recently working on menu editor myself. Made a good progress too, main loading/presentation facilities are laid out, no material loader just yet but it's coming along.



This is how it looks right now. Not much to look at, but it's a basis.

So... Maybe we could collaborate on this? What do you say?

EDIT: I was going to announce this too, eventually, especially since I knew I'd need insight from people experienced with editing menu.ini. Hardcoded IDs, item behavior under various settings, parameters that I don't fully understand, that sort of thing. I also wanted to include things like dials.cfg, commands.cfg and menu_{en,de}.txt editing, to be more or less feature complete.

Last edited by radcapricorn; 12-26-13 at 04:58 AM.
radcapricorn is offline   Reply With Quote
Old 12-26-13, 02:10 PM   #4
vanjast
Sea Lord
 
Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,797
Downloads: 1214
Uploads: 4
Default

We can do...

I'm only a week into this so it still looks like a skeleton.
These are my ideas so far.

- The left Treeview (TV) extracts the menu file as it is.. character-for-character, and when saved written back to the ini file as is. A track of backup files is generated.

- Selecting an item in the left TV, places that item and all it's details into the right TV... depending what it contains, is displayed in the image section to the right.

- The right TV can display Parent/Child relationships, and the whole selected menu page structure. an image file interface (as seen in game) appears on the right. Here you can graphically select, resize and move.. all updates are automatic to the right TV parameters.

- Other features will be ID checking, renumbering, insertion, links to other files (images and otherwise).. auto udating, backups... whatever come to mind
Generally the idea is to make the INI file stable

So in a sense we would have an interface editor for the mods to play with.


vanjast is offline   Reply With Quote
Old 12-26-13, 02:20 PM   #5
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Very cool work Guys.


What are you programming in? C#?
If I can assist with any questions feel free to PM me.
I kind of know my way around the files.
  Reply With Quote
Old 12-26-13, 03:11 PM   #6
vanjast
Sea Lord
 
Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,797
Downloads: 1214
Uploads: 4
Default

Thanks privateer..
I'll pm a few questions later with regard to some of the parameters...

oh.. The dev kit is Masm32.
vanjast is offline   Reply With Quote
Old 12-26-13, 03:45 PM   #7
radcapricorn
Helmsman
 
Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
Default

Quote:
Originally Posted by vanjast View Post
We can do...
Fantastic!

Quote:
I'm only a week into this so it still looks like a skeleton.
These are my ideas so far.

- The left Treeview (TV) extracts the menu file as it is.. character-for-character, and when saved written back to the ini file as is.
Is that prudent? I mean, AFAICT the ini structure itself with those [Gxx Iyyy] identifiers just represents the actual UI tree (or forest, actually), but flattened backwards. These bracketed numbers don't present any meaningful info for editing, do they? Plus if you store them, you'd have to recalculate them for the whole subtree every time you add or remove UI elements, instead of just once when saving the file.

IDs (ItemID, ParentID), on the other hand, are a different matter, since they are pretty much responsible for the actual UI structure.

Quote:
A track of backup files is generated.
Backups are certainly a must. But what do you mean by "track"?

Quote:
- Selecting an item in the left TV, places that item and all it's details into the right TV... depending what it contains, is displayed in the image section to the right.

- The right TV can display Parent/Child relationships, and the whole selected menu page structure. an image file interface (as seen in game) appears on the right. Here you can graphically select, resize and move.. all updates are automatic to the right TV parameters.
I'm currently achieving this using one treeview for the whole UI structure, and another one (table-like) for displaying info on currently selected item (see my screenshot). Using the main tree, I can add, remove or change type of the items (via right-click menu), control item visibility (the "eye" icon like in Photoshop/GIMP and many other applications).

For adding new items, I've hacked together a rather naive ID generator which sort of works, although it's not completely in line with what I think it was intended for IDs, but again we have to consider that the program may be working with files edited by hand, which also don't strictly follow the developers intent.

From what I can tell, IDs were intended to be in the form XX000000 for pages and XXYY0000 for groups (no matter how deep in the tree those groups are), with only the lowest two bytes being used by all other item types, and in a way that a child items would respect that numbering in their own IDs. In practice, however, we could potentially encounter files that don't follow this convention, esp. the last part.

Quote:
- Other features will be ID checking, renumbering, insertion, links to other files (images and otherwise).. auto udating, backups... whatever come to mind
Generally the idea is to make the INI file stable
Renumbering can be fully automagic if you reconstruct the tree after reading the file and then forget those [Gxx Iyyy] numbers: flattening the tree out again will give proper numbers. So in a sense renumbering would be as easy as open -> save (with a warning that numbers are wrong, of course).

Regarding ID checking, yeah. While I was drafting the parser, I quickly found out that I can't really read the file if I consider it an error if there are duplicate or incorrect IDs: MaGUI, for example, has several duplicates and one ID that wouldn't fit into 32 bits (not to belittle the work, it's a huge file, and it has been manually edited, after all). So it is indeed required to read the files in relaxed mode (allowing for some mistakes in files edited by hand) with some later warnings of some kind. Right now, for example, I highlight elements with duplicate IDs in red and unnamed elements in dark yellow (since that's not really an error).

Quote:
Originally Posted by privateer View Post
Very cool work Guys.


Quote:
What are you programming in? C#?
I personally use C++ and Qt. The beauty of Qt is that it allows to create a very flexible interaction between data and its representation (the model/view paradigm). Plus it has a very nifty facility for rendering 2D scenes: all I had to do was construct some rectangles whenever the actual data said it has changed. Finalizing it would require additional work, sure, but most of the boilerplate is already taken care of by the framework.

Quote:
If I can assist with any questions feel free to PM me.
I kind of know my way around the files.
Will certainly do

Quote:
oh.. The dev kit is Masm32.


vanjast, can I PM you as well for further discussion? Or should we keep it here so as much as possible would be public?
radcapricorn is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.