March 29, 2024, 05:05:10 am
Username:

Password:

Topic: GUI Theme Maker  (Read 11075 times)

Wizard

  • Posts: 67
    • View Profile
GUI Theme Maker
« on: July 17, 2015, 08:25:41 pm »
I'm writing an application to automatically write faction.ini/default.ini in intrface\ folder by dragging PNGs and FRMs visually in a desktop window. Basically got an ini reader/writer and the basic dragging of pixmaps on the screen. Only thing remaining is interpretting the parameters within the ini files. A couple things i've noticed,

The first word, the one that begins with a capital letter, denotes which interface category a parameter belongs to, ie, IntMain, IntAim both belong to the main game interface because they are prefixed with *Int*.

  * .*Pic     = filename to PNG or FRM
  * .*PicDn = filename to PNG or FRM while *button* is activated
  * .*X        = X coordinate
  * .*Y        = Y coordinate
  * .*StepX = X pixels, draw image denoted by another variable at a space of N pixels towards the X direction, ie, horizontally
  * .*StepY = same as StepX, except Y direction, ie, vertically
  * .*

What is, OffsX and OffsY? Are there any tips as to how to interpret the parameters within the ini files?
Or should I manually map them all to mean things?

How do you, the FOnline developers extend the game interface? Is that possible through Angel Script? If that's true then I would assume that you are responsible for the naming conventions of these parameters within the ini files. Can you elaborate to me or give me a lookup table for their meanings?

drot

  • Posts: 169
  • I like NCR
    • View Profile
    • Rawhide
Re: GUI Theme Maker
« Reply #1 on: July 18, 2015, 07:45:14 am »
You should ask these kinds of questions on fodev.net (not trying to be rude but you will get more help there).
#rawhide on ForestNet

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #2 on: July 18, 2015, 08:29:17 am »
TNX. That's not rude to me.

BeheGrzmotPL

  • Posts: 31
    • View Profile
Re: GUI Theme Maker
« Reply #3 on: July 18, 2015, 08:22:52 pm »
Hello,
a month ago I also started a similar project, but recently I had no time to finish it.
When I'm done - I share in the forum.
http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331

What language are you going to write your program? I write in JavaScript.

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #4 on: July 19, 2015, 08:57:40 am »
Hello,
a month ago I also started a similar project, but recently I had no time to finish it.
When I'm done - I share in the forum.
http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331

What language are you going to write your program? I write in JavaScript.

Really? Coincidence :)
Unfortunately I don't understand Russian, so I cannot read that post you linked.
I am writing in C, desktop App. I am having trouble interpretting the INI, without a reference to the meanings of the individual variables within it, I cannot for certain make a stable application without very time consuming trial and error first.

I would propose that we merge our code into a repository, but I don't think JavaScript and C would be very compatible.

BeheGrzmotPL

  • Posts: 31
    • View Profile
Re: GUI Theme Maker
« Reply #5 on: July 19, 2015, 02:15:29 pm »
Hehe, this is the Polish language - easy to distinguish, because it is not written in the Cyrillic alphabet ;) 
I recommend using Google Translate, and the best of Google Chrome browser, which automatically translates the whole page. I know English on an average level, so as I write a longer story, I am using the translator and possibly introduce its own amendments.



As for the program:

INI file is a plain text file with a different extension. Just save all the data as a text file - permanent element names and values ​​of the variables, you can add the #comments.

Names of elements easily decipher. File name, the coordinates of the upper left and lower right corner of the element, the same text, I'm just not sure what it is OffsX and OffsY but also some coordinates, so come out later what is it.

Now I concentrated on the technical part of the program - I mean the general appearance and the ability to move objects with the mouse. All files FRM I converted to PNG and FOFRM (animation of the sequence of PNG files).

Unfortunately, over the last month I did not do anything because I was busy with another project.



It seems to me that the only thing that might be useful to you from my program, and even - may be exactly identical allowing any time to edit the data in my or your program - is a database.

I write database using JSON language that is compatible with many other programming languages and can transfer data between them.

My tutorial: http://www.w3schools.com/json/json_files.asp

Your tutorial: https://code.google.com/p/rapidjson/wiki/UserGuide
or http://www.codeproject.com/Tips/805182/A-fast-JSON-parser-loader-for-your-Cplusplus-proje
or another.



I suggest JSON file structure:

Code: (INI file) [Select]
;===============Register Button

LogRegPicDn=MENUDOWN.PNG
LogReg=671 324 760 354
LogRegText=0 0 0 0


Code: (JSON file) [Select]
database([
{

"name":";",
"value":"===============Register Button"
},
{
"name":"LogRegPicDn",
"value":"MENUDOWN.PNG"
},
{
"name":"LogReg",
"value":"671 324 760 354"
},
{
"name":"LogRegText",
"value":"0 0 0 0"
}
]);
Theoretically, I can use simple variables here instead of an array, but the array allows you to upgrade and does not require manual numbering variables.


Coordinates best to save in this way. Before saving you should convert numeric values to string and combine in one word.
Characters = better to add when writing to the INI file.


JSON data file is a text file and can be saved with any extension, for example: .TXT, .JS, .PHP, .JSON, .H, .FONLINE, anything at all ;)


Note: The JSON file could not be any comments.


Note2: I do not know how in C / C++, but in PHP special characters must be written as a string in PHP - that is, the \ should be written as \\, " as \" etc.


Note to the administrator: There is a bug in the WYSIWIG creator, because some spacing between the lines to intercede twice, when I intercede only once.

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #6 on: July 19, 2015, 07:09:24 pm »
AHH, It's Polish :facepalm

It looks interesting. I'm not sure what you're doing with that JSON file, is it to serve as a database for the meanings of the INI variables?

I have a similar thing, I call it descriptions.ini (uses same format as faction.ini/default.ini), but it does nothing but pop up a tooltip to the user.

Currently I am implementing FRM viewer, but I am unsure where I can find the palette file (color.pal) used by FOnline. Do you know?

Did you convert FRM to PNG? Is that done during runtime or prehand using external tools?

BeheGrzmotPL

  • Posts: 31
    • View Profile
Re: GUI Theme Maker
« Reply #7 on: July 19, 2015, 08:27:01 pm »
I'm not sure how well I'm doing this because I'm quite a novice programmer :P I do this in the form of a website, because first - that I know how to do, and second - easier to reach a large group of people and do not need to install anything. I can also very easily customize the look with CSS and JS.

There probably is no dedicated service INI files, so I treat it like any other text file. Reading a file line by line every time would be rather inefficient, especially that manually modified file could vary significantly.
That's why I'm going to use JSON for data storage for the program - will be assigned to all the scripts. To the program in spite of everything I would have to use a lot of variables that store data from an INI file. Instead of creating variables that are encoded in the program, I write data to an external file via JSON and I operate directly on them. If so, I have a working data stored in auxiliary file, and by the way it is possible to easily export them to other programs.
INI file will be generated from scratch after each change. My program is intended to serve creation. At the moment I considered not ready file import options of finished INI files, but it also can be done in the future.
With JSON I will be able to connect this wizard with PHP and create a service similar to www.nitue.net

I used to convert this program: http://www.atomicgamer.com/files/95422/titanium-frm-browser-1-3
It has a file default.pal - this can be helpful.
« Last Edit: July 19, 2015, 08:40:49 pm by BeheGrzmotPL »

drot

  • Posts: 169
  • I like NCR
    • View Profile
    • Rawhide
Re: GUI Theme Maker
« Reply #8 on: July 20, 2015, 11:58:21 am »
Currently I am implementing FRM viewer, but I am unsure where I can find the palette file (color.pal) used by FOnline. Do you know?

It uses the one from master.dat.
#rawhide on ForestNet

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #9 on: July 21, 2015, 10:43:52 am »
TNX. Got the color.pal.

In the JSON file, it seems that you do not plan on reading exisitng INI files? Because what would be the point of a JSON file if that's true? Is this true? Do you plan on only making the application able to write INI files? You can load entire INI files into memory, then process them, that's not inefficient and they are usually not very big. Well, I don't know anything about JavaScript except how it looks like.

BeheGrzmotPL

  • Posts: 31
    • View Profile
Re: GUI Theme Maker
« Reply #10 on: July 21, 2015, 11:04:46 pm »
I see it, that in order to load into memory INI, I have to assign data from the INI to variables or arrays, so I can upload them directly to JSON. This allows performing operations on elements - moving, resizing, change image - doing them directly on the plate in JSON, instead of on the virtual array in JS that could be accidentally erased when you refresh the page (F5). In addition, using JSON can transfer data from JS to PHP and vice versa, if needed.

Actually, I could not even use the JSON. Load data into memory, perform operations on them, save to INI, and that's all. However, it seems to me I might come in handy later. If now I do and I do not useful, it's not lose, and how not to do and I will need later on, I'll have to do half of the program from scratch.

I suggested you use it to our programs use the same data, but... actually, I don't know why :P


Changing the subject:

I wonder how to download data from INI intended for other resolution because some of the parameters there do not exist (they are the same as for the primary resolution).


And above all - where to get the missing files FRM. The INI files are entered in many files FRM are not exist in the folder Interface. I unpacked file data/faction.zip and it also did not exist. I downloaded the SDK and there are exactly the same files.
« Last Edit: July 21, 2015, 11:30:45 pm by BeheGrzmotPL »

drot

  • Posts: 169
  • I like NCR
    • View Profile
    • Rawhide
Re: GUI Theme Maker
« Reply #11 on: July 22, 2015, 08:22:56 am »
And above all - where to get the missing files FRM. The INI files are entered in many files FRM are not exist in the folder Interface. I unpacked file data/faction.zip and it also did not exist. I downloaded the SDK and there are exactly the same files.

Sometimes they are assigned dummy values like None.FRM, since if I remember it right you can't leave a value unassigned.
#rawhide on ForestNet

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #12 on: July 22, 2015, 08:34:00 pm »
I got rough FRM viewer. It's because documentation is scarce, and the one I've been reading is thankfully less faulty than correct. Either that or FRMs do not particularly follow their specification (I guess it's reverse engineered, what to expect?). For single frame FRMs, the file header fields report 100% correctly. Though the animations, they tend to have incorrect header fields. However, Width and Height fields have so far always been correct.

Appreciate if anyone got documentation on the FRM file format, otherwise, I'll satisfy with this rough implementation based on: http://falloutmods.wikia.com/wiki/FRM_File_Format

I can display both static and animated FRMs currently.

Now I move on to .fofrm support, which should be no problem.

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #13 on: July 22, 2015, 08:35:57 pm »
I'll also release source code when I've got atleast a basic working GUI Interface Maker.

Wizard

  • Posts: 67
    • View Profile
Re: GUI Theme Maker
« Reply #14 on: July 22, 2015, 09:16:49 pm »
I made a C specific programming mistake in converting 32bit numbers to little endian. That was the reason for FRMs reporting faulty fields. I guess FRM support no longer qualifies as rough :)

Should have said, "either that, or the other thing, or I did a mistake".
« Last Edit: July 22, 2015, 09:19:55 pm by Wizard »