Forums for the FreeOrion project
It is currently Mon Jun 25, 2018 1:52 pm

All times are UTC

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri May 26, 2017 7:56 pm 

Joined: Mon Feb 29, 2016 8:37 pm
Posts: 219
I've posted a PR #1587
with improvements to the ship design handling of the design window.

It allows saved designs to be manipulated, saved, deleted, drag dropped, added
to the finished designs individually or as a group at any time or automatically
at game start.

It allows the finished designs to be made obsolete or restored over the course
of the game. Obsolete designs don't appear in the production window, but still
appear in the design window.

I'll provide details of the changes and then an image at the bottom of the post.

In detail the changes to the saved designs are:

- saving of the designs automatically chooses filenames in the shipdesigns
directory without requesting a file name for each ship and breaking immersion.

- saved designs can be dragged and dropped to reorder them. The order will
persist in new games

- saved designs can be deleted

- saved designs can be edited by dragging them to the bench or doubling clicking

- new saved designs can be added directly when editing an existing saved design

- ctrl-clicking a saved design adds it to the empire's finished designs

- there is an option, "Add All Saved Ship Designs at Game Start" to add all
saved designs to the empire at game start. (This is a bug fix and it now
works even if the design window is not opened.) This option can be changed in
the options window or in the right click context menu for any saved design.

In detail the changes to the finished designs are:

- finished designs can now be available, unavailable or obsolete. Obsolete
designs have been removed from the empire everywhere except the design window.
They will not appear in the production window.

- obsolete and unavailable designs appear desaturated with a popup indicating
if they are obsolete or unavailable

- designs can be made obsolete/unobsolete from the right click context menu or
by ctrl-clicking.

- designs can be deleted from the right-click context menu. Deleted designs
can't be restored.

- there is an option "Add All Default Ship Designs at Game Start" to add/not add
the default designs to the empire at game start. This option can be changed
in the options window or from the right-click context menu of any finished

Because of the added state, obsolete, an additional toggle button Obsolete is
added to the Availabilities filer. The button shows/hides obsolete designs.

p.s. Scripter bonus #1 It you copy the default/scripting/ship_designs into your
saved designs directory then you can edit the default designs and their
ordering. Copying it back to its original location will use the new
designs and ordering as the default ship designs.

p.p.s. Scripter bonus #2: It works with monsters too. Monsters dragged to the
bench from the saved designs will be editable.

File comment: The design window showing some obsolete and some current ship designs.
design_wnd_library.png [ 258.39 KiB | Viewed 290 times ]

PostPosted: Sat May 27, 2017 3:54 pm 
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3310
Initial reaction is thank you, I'll compile it in and start testing for my next game: this sort of thing is increasingly useful when working through rebalancing parts/hulls, several of my saved designs are basically obsolete/invalid with the PRs I'm currently testing and it's really annoying.

An aside that's never been written up but would fit in perfectly here: I'd like the ability to add all my saved designs for a specific hull to my current game, I don't want to add every single design I've got saved if I'm only researching, say, Robotic Line, or Organic Line, but I do want to be able to easily add all my Flux designs (normally scouts) or all my BioAdaptive Hull designs. It's less of a major thing now I've deleted most of my robotic hull saved designs, until I redo that tech tree you have to research that tech to get damage control so they'd just clutter up the production list.

Will it be OK to basically take the two main PRs required and compile from them?

Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

PostPosted: Sat May 27, 2017 6:07 pm 

Joined: Mon Feb 29, 2016 8:37 pm
Posts: 219
MatGb, in order to test you only need PR 1587, provided you backup your saved design directory.
Otherwise, when you go back to any other branch it will not be able to read the modified saved designs.
The game is still playable, you just have to un-modify by hand your saved designs.

I provided PR 1586 as an easier to review and merge PR to avoid that problem.
It allows the current code to ignore the modifications to the saved ship designs and operate normally with the modified designs.

Once PR 1588 is merged it won't matter, since master will be able to parse the new file type.

I like your idea of adding just saved designs for specific hulls.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group