Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: "Remove all industries" button in scenario editor #8550

Open
wants to merge 1 commit into
base: master
from

Conversation

@Kuhnovic
Copy link
Contributor

@Kuhnovic Kuhnovic commented Jan 9, 2021

Motivation / Problem

Many scenarios found in on the online content server come with industries. This is unfortunate when you want to play that particular map with for instance the FIRS industry set, or if you want to start with a clean slate for a different reason. The current solution is to go over the entire map and remove each industry, which is tedious.

Description

This feature is only available in the scenario editor. It removes all industries. It also turns removes residual farmland and replaces it with grass.

wAc0puysLU

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
Copy link
Contributor

@glx22 glx22 left a comment

I like this idea. I just quickly checked the code. And made some suggestions.

src/industry_gui.cpp Outdated Show resolved Hide resolved
src/industry_gui.cpp Outdated Show resolved Hide resolved
src/industry_gui.cpp Outdated Show resolved Hide resolved
src/industry_gui.cpp Outdated Show resolved Hide resolved
@TrueBrain TrueBrain changed the title Feature: Remove all industries button in scenario editor Feature: "Remove all industries" button in scenario editor Jan 9, 2021
@Kuhnovic Kuhnovic force-pushed the Kuhnovic:remove_all_industries branch from 5e45870 to 770351b Jan 10, 2021
@Kuhnovic
Copy link
Contributor Author

@Kuhnovic Kuhnovic commented Jan 10, 2021

Thanks for the review Glx22, I addressed your points.

I was also thinking, maybe this is a good opportunity to add a dedicated button for Many Random Industries. I've always found it a bit strange that it was just in the industry list as if it was just another type. Let me know what you guys think.

EDIT: this is what I mean, notice the Many Random Industries entry in the list is also gone.
image

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 11, 2021

Yeah it may be a good opportunity to remove the many random industries "hack" and use a proper button.
But I think other people might have a different opinion about that.

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jan 11, 2021

I agree, but I properly wouldn't put them on top of each other. Maybe next to each other is better suited? The word "industries" is a bit redundant here even, so, so "Build many random" and "Remove all" might be sufficient. Dunno, just thinking out loud :D

@LC-Zorg
Copy link

@LC-Zorg LC-Zorg commented Jan 11, 2021

Both changes would be very, very useful. They are sorely lacking.

I agree, but I properly wouldn't put them on top of each other. Maybe next to each other is better suited? The word "industries" is a bit redundant here even, so, so "Build many random" and "Remove all" might be sufficient. Dunno, just thinking out loud :D

It doesn't really matter much, but I think the buttons next to each other would look a bit worse due to the asymmetry of the buttons below. Also, full sentences, due to the importance of functions and their effects, seem justified here.

Importantly, what is sorely lacking, and I would very much like to ask, is a confirmation request for both multi-enterprise construction and removal. There is nothing worse than pressing "many random" or "remove all" by accident after a long time creating a scenario ... It will be all the more important that after changing the "Remove all" button will be adjacent to the "Build".

@Kuhnovic Kuhnovic force-pushed the Kuhnovic:remove_all_industries branch from 770351b to 1e3b92f Jan 11, 2021
@Kuhnovic
Copy link
Contributor Author

@Kuhnovic Kuhnovic commented Jan 11, 2021

Importantly, what is sorely lacking, and I would very much like to ask, is a confirmation request for both multi-enterprise construction and removal.

Couldn't agree more. I pushed some additional changes. There's now a Create Random Industries button, I felt that caption was appropriate than "many random industries". Both the Remove and Create buttons ask for user confirmation.

I kept the stacked buttons since I also think it will look strange if the bottom row contains a resize button.

CJ6kITVlqn

@LordAro
Copy link
Member

@LordAro LordAro commented Jan 13, 2021

Looks very good. Removing the "hacky" Create Random Industries "industry" option is always good

I do think the buttons would look better side-by-side though, rather than one above another

@Kuhnovic
Copy link
Contributor Author

@Kuhnovic Kuhnovic commented Jan 13, 2021

I've been trying out some layouts:

image
Stacked, not aligned. Doesn't look right IMO.

image
Resize button on separate line. This can work, but it feels a bit cluttered.

I'm working on a layout that has the resize button next to the build button, but it's difficult to line things up properly and having it look good, while also being able to switch off the scenario-editor-only buttons. This GUI system can be a bit of a pain :P

@LordAro
Copy link
Member

@LordAro LordAro commented Jan 13, 2021

How about with create/remove buttons at the top of the window?

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jan 13, 2021

Honestly, while checking the preview (click the deployment button :D), I think on top of each other like you had it originally is totally fine (I know, I said otherwise earlier .. I changed my mind :P). Your fonts etc are making it look worse for me than it really is:

image

This looks perfectly fine to me :)

(well, maybe all buttons should be on top of each other, but meh, don't think that is for this PR to fix :D)

@Kuhnovic
Copy link
Contributor Author

@Kuhnovic Kuhnovic commented Jan 13, 2021

How about with create/remove buttons at the top of the window?

image
That wouldlook like this. In a way I like the separation, because now the top buttons apply to all industries, where the bottom buttons apply to the selected industry.

(and it's a heck of a lot easier to set up)

This looks perfectly fine to me :)

I'm also fine with keeping the first option of course ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.