auto load saved designs
Moderator: Committer
auto load saved designs
I got tired of having to manually add my saved designs; the attached patch causes them to be automatically added to the empire's designs. It is somewhat inefficient in that the completed designs listbox is repopulated entirely as each saved design is added. This didn't seem to cause a noticeable slowdown and it had taken me long enough to find a reasonable spot to do this at all so I wasn't in the mood to sort through disconnecting and reconnecting the involved signals.
Geoff, this may not be what you had in mind long term (I wonder if it perhaps could cause designs to be added to empires when in moderator mode although I don't think that should cause a significant problem), but do you view it as at least a reasonable interim step?
Geoff, this may not be what you had in mind long term (I wonder if it perhaps could cause designs to be added to empires when in moderator mode although I don't think that should cause a significant problem), but do you view it as at least a reasonable interim step?
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: auto load saved designs
hmm, just realized this is is causing the designs to get added back after they've been deleted, so that's a nuisance. When I had previously tried other locations for this code I kept running into trouble that the added design would trigger a sequence of signals that wasn't fully connected yet, causing the game to hang. I think I'll put in a turn check so that it only loads the saved designs on turn 1. Other suggestions are welcome.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: auto load saved designs
Options that spring to mind:
* A button
* A Context menu entry
Or another way to manually say you wish to load all saved. Either would be a smaller nuisance than adding each and give a clear time to do it, while having lesser cost for those who don't want to use it.
* A button
* A Context menu entry
Or another way to manually say you wish to load all saved. Either would be a smaller nuisance than adding each and give a clear time to do it, while having lesser cost for those who don't want to use it.
Any code by me in this post is released under GPL 2.0 or later.
Re: auto load saved designs
Turn check probably best.
And now we've got saved designs, which is a really nice feature, I'm thinking readdress the way we've done predefined ship designs, make them much more 'example' basic designs without any follow ups for improved tech, but that's not urgent nor particularly on topic.
Turn 1 makes most sense I think.
And now we've got saved designs, which is a really nice feature, I'm thinking readdress the way we've done predefined ship designs, make them much more 'example' basic designs without any follow ups for improved tech, but that's not urgent nor particularly on topic.
Turn 1 makes most sense I think.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: auto load saved designs
Yeah, that is the first option that had come to mind, but that space is already rather crowded and I didn't like the prospects of trying to squeeze in a button.Mitten.O wrote:Options that spring to mind: * A button
Ah! Yes, that's a great suggestion, a context menu could offer to add the current design (if not already known to the player's empire) and/or add all the saved designs. Fairly simple to code up & doesn't add any clutter, I like it.* A Context menu entry
That was the best I could come up with, but I think it's good to give some control to the user. An options window option could be used but I hate to add more things there -- overall I think Mitten's context menu suggestion works out best (so long as it includes an option to add all saved designs not just the single one selected).MatGB wrote:Turn check probably best.
I strongly agree for the most part, but I think that keeping at least a couple improved tech follow ups would be best (like a radar scout and one or more upgrades to the Cruiser, and one or two exemplars with the Organic Hull).And now we've got saved designs, which is a really nice feature, I'm thinking readdress the way we've done predefined ship designs, make them much more 'example' basic designs without any follow ups for improved tech...
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: auto load saved designs
I was thinking mass driver 1, laser 1 and plasma one for the 'main' hulls and then a couple exemplars with roughly equivalent weapon, laser1 or plasma1, with scouts and similar.
Keep the workhorse "everyone uses these at least once" hulls but dump the refinements &c.
Keep the workhorse "everyone uses these at least once" hulls but dump the refinements &c.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: auto load saved designs
Don't think so... which empire would it add to? And I don't think there are many / any moderator actions for issuing orders for empires; that's not what moderating is about (playing the game for players vs. modifying the universe they play in).Dilvish wrote:...I wonder if it perhaps could cause designs to be added to empires when in moderator mode...
I don't have strong preferences about how saved designs are used / added. I assumed it wouldn't be good to assume players would always want all saved designs added by default.
Re: auto load saved designs
Well, it's really quite handy, and much easier to delete an unneeded design than to manually create a needed one, and even manually adding individual saved designs can get to be a nuisance after a few designs, so I think it's pretty likely anyone using this would want to load all saved designs and then just pare them down as desired or as the game progresses and they become stale (same as with any design).Geoff the Medio wrote:I assumed it wouldn't be good to assume players would always want all saved designs added by default.
For me, having simply added the if (CurrentTurn()==1) check to the above patch is perfect because I always want them loaded. I can understand the desire to leave it as a choice for the user, in which case the right-click context menu is the desired feature. I started to implement that (with both an option to load the current individual design or all saved designs) but got sidetracked; I'll try to wrap it up in time for the next weekly builds.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: auto load saved designs
If you're worried about moderators, or even if you're not, just add a check that the client's empire id isn't ALL_EMPIRES.
Re: auto load saved designs
ok here is a revised patch which adds a context menu to the saved designs list, to allow adding to the player empire designs either just the current design or all saved designs. The patch makes it look like a lot of lines have changed when really most of them were just indented one level. I did leave in one little piece in DesignWnd::MainPanel::Sanitize() that's currently unnecessary: -- on my machine I'll have that uncommented so as to always autoload, I thought it would be convenient for any other devs that wanted to autoload saved designs, but I can understand that it could be considered unneeded bloat; just let me know if you want it out or if you have any other comments.
Code: Select all
if (CurrentTurn() == 1) {
//GetSavedDesignsManager().LoadAllSavedDesigns();
}
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: auto load saved designs
ok well I went ahead and committed it, with just a bit more commentary; it can always be adjusted.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: auto load saved designs
adrian_broher might dislike it. Might be better to comment out the whole thing, instead of just the bit inside the if block.Dilvish wrote:I did leave in one little piece... but I can understand that it could be considered unneeded bloat
Re: auto load saved designs
Okay.
Code: Select all
r7727 | dilvish-fo | 2014-09-22 11:20:00 -0700 (Mon, 22 Sep 2014) | 1 line
follow-up on r7726, commenting out some additional currently unnecessary lines and adding explanation
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: auto load saved designs
What about an option in the setup screen to (dis-)allow autoloading, so that everyone can have the behaviour that suits him, and not only developers...Dilvish wrote:Okay.Code: Select all
r7727 | dilvish-fo | 2014-09-22 11:20:00 -0700 (Mon, 22 Sep 2014) | 1 line follow-up on r7726, commenting out some additional currently unnecessary lines and adding explanation
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: auto load saved designs
Our UI/Graphics Lead Eleazar (largely absent as of late due to upsurge in RL demands) had urged us to minimize the addition of new options, but I agree that this seems like a pretty suitable situation for one.vincele wrote:What about an option in the setup screen to (dis-)allow autoloading, so that everyone can have the behaviour that suits him, and not only developers...
Geoff, Vezzra, thoughts on that?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0