Feedback > New Features

Upgrading The Interface Format

(1/2) > >>

DocClox:
Here's an idea. Make the Interface files use XML, and have WYSIWYG editor for them. Sound like a lot of work? Well, yes, but...

Suppose the XML format we adopt is XHTML? Then we could use any old web page editor to design screens, so long as it outputs valid XHTML, and then just ignore anything we don't like (like hyperlinks).

The problem, of course, is that the really cool stuff for screen design would be CSS, and that's not XML based

XML might be the way to go, anyway however. Currently you've got (it seems) a set of fields that are order dependant, which is a bit fragile, and makes it a real bugger to do things like allowing modders to add floating images. We could do that with XML and have  a bit more flexibility.

Need to write our own editor, in which case, though.

Other options might be to use Webkit or Xulrunner, although that really turns the game into a webapp, and opens up some security issues we'd probably sooner stayed closed.

Anyway, that's my tuppence ha'penny's worth on the subject. Anyone else?

trex:
Well something I would like is the addition to resize the screen. Fullscreen would be nice, but an option to manually size the window would be just as good.

Anything that lets modderrs improve the games sounds great, the UI is an area modding would make a great difference. I guess it just comes down to the priority of recoding something that works ok as is, over adding/ bug killing.

Dagoth:
Really, he could just have any lines past the main known ones to be considered as an image. The line format could be the same, with the addition of a filename field on the end. Like so:
8 48 584 480 brothelback2.jpg

You could then add as many images as desired like that, each on their own line. If necessary, they could be prefixed with a number indicating how many such images to process (like is done for processing traits and such in the other files).
The images would preferably be added in the background behind everything else (placed before everything else if that's needed to get the order correct) in the order that they're given in the file. That way, they could be used as background images for text and other controls.

I doubt I'd actually use that much myself, but it would still be quite handy.

EDIT: a more detailed example, using BrothelScreen.txt as an example:

--- Code: ---16 20 768 576 1 WINDOW - XPos, YPos, WIDTH, HEIGHT, BORDERSIZE
600 258 160 32 Girl Management BUTTON - XPos, YPos, WIDTH, HEIGHT
600 298 160 32 Staff Management BUTTON - XPos, YPos, WIDTH, HEIGHT
600 338 160 32 Upgrades BUTTON - XPos, YPos, WIDTH, HEIGHT
600 398 160 32 Dungeon BUTTON - XPos, YPos, WIDTH, HEIGHT
600 458 160 32 Visit town BUTTON - XPos, YPos, WIDTH, HEIGHT
184 536 160 32 Save BUTTON - XPos, YPos, WIDTH, HEIGHT
600 536 160 32 Next Day BUTTON - XPos, YPos, WIDTH, HEIGHT
432 536 160 32 Turn summary BUTTON - XPos, YPos, WIDTH, HEIGHT
8 536 160 32 Quit BUTTON - XPos, YPos, WIDTH, HEIGHT
600 208 72 32 Prev BUTTON - XPos, YPos, WIDTH, HEIGHT
688 208 72 32 Next BUTTON - XPos, YPos, WIDTH, HEIGHT
8 48 584 480 Image - x,y,width,height
600 48 160 152 10 Brothel Details text - xpos, ypos, width, height, fontsize
16 8 900 64 20 Brothel Name text - xpos, ypos, width, height, fontsize
3
8 48 584 480 brothelback2.jpg
8 248 584 480 brothelback3.jpg
8 448 584 480 brothelback4.jpg

--- End code ---

Another interface request:
Give us the ability to change the height of listbox entries, or alternately necno could simply change the size himself; they're currently too tall really, wasting space which could used to display more entries.

necno:
Resolution change will be implemented once i finish finalizing the interfaces (as i finalize i create the txt document for editing).

I can implement images as Dagoth (Elder Scrolls ref?) stated its not difficult to do.

As for a separate editor for interfaces and XML format. Well i just don't see it as needed especially vs the time to code, i just use Photoshop to design interfaces (although i always do a rush job). Only takes a little longer to copy the x/y stuff into the text file.

DocClox:

--- Quote from: necno on October 19, 2009, 07:20:50 PM ---I can implement images as Dagoth (Elder Scrolls ref?) stated its not difficult to do.

--- End quote ---

It's a workaround, certainly.  It's still fragile, though and I just think the current approach is going to scale  well. Sooner or later, I think you'll need something a bit more sophisticated.

[edit]

If we do it that way, we'll need some way to handle Z-Ordering. As it stands, items at the bottom are going to be painted on top of everything else. That means we can't use them as sight-screens for text, or to group UI elements.

You can change that so end-of-file images are always on the bottom of course, but then you can't do things like create image frames that partially cover the picture area.


--- Quote from: necno on October 19, 2009, 07:20:50 PM ---As for a separate editor for interfaces and XML format. Well i just don't see it as needed especially vs the time to code, i just use Photoshop to design interfaces (although i always do a rush job). Only takes a little longer to copy the x/y stuff into the text file.

--- End quote ---

I agree about pasting in the numbers; I was just thinking that XHTML would give us a free editor, in effect. Certainly a home made wysiwyg editor is way too much work for the benefit derived.

As for the XML format itself, if the work involved is the only objection, I'd be happy to take a crack at it for you. I'd use TinyXML to do the hard work of parsing the files. After that, it's just a case of packing the UI information into the structures you use currently.

Navigation

[0] Message Index

[#] Next page

Go to full version