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: Selective demolition tool. #7497

Open
wants to merge 1 commit into
base: master
from

Conversation

@stormcone
Copy link
Contributor

commented Apr 10, 2019

Idea from #7394.

Known bug(?):
The demolish button does not stay lowered because the drop-down list window raises back up when it closes. And I do not know how to keep it down. Maybe I need to get a paperweight. :)

@stormcone stormcone force-pushed the stormcone:demolish-tool branch from 6285a0c to 50440f7 Apr 10, 2019
src/landscape.cpp Outdated Show resolved Hide resolved
src/landscape.cpp Outdated Show resolved Hide resolved
src/terraform_gui.cpp Outdated Show resolved Hide resolved
src/terraform_gui.cpp Outdated Show resolved Hide resolved
src/terraform_gui.cpp Outdated Show resolved Hide resolved
@stormcone stormcone force-pushed the stormcone:demolish-tool branch 2 times, most recently from 254980a to ae00181 Apr 11, 2019
@stormcone

This comment has been minimized.

Copy link
Contributor Author

commented Apr 11, 2019

How could be the rising button problem solved? Currently can not abort the demolition if a player clicks on the button again, only with the ESC key.

src/landscape.cpp Outdated Show resolved Hide resolved
src/terraform_gui.cpp Outdated Show resolved Hide resolved
src/terraform_gui.cpp Outdated Show resolved Hide resolved
@stormcone stormcone force-pushed the stormcone:demolish-tool branch 3 times, most recently from 929f359 to 78b09fe Apr 11, 2019
@stormcone

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2019

I have reworked the GUI part: instead of a drop-down list, it is now using a small toolbar window. That way the above mentioned problem is solved.

@stormcone stormcone force-pushed the stormcone:demolish-tool branch from 78b09fe to 9fb7be5 Apr 23, 2019
@PeterN PeterN dismissed their stale review May 1, 2019

Outdated

@stormcone stormcone force-pushed the stormcone:demolish-tool branch from 9fb7be5 to 16c3595 May 7, 2019
@stormcone stormcone force-pushed the stormcone:demolish-tool branch from 16c3595 to 0d42e67 Jun 4, 2019
Copy link
Member

left a comment

Code looks more or less fine, not sure about the concept though


void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {

This comment has been minimized.

Copy link
@LordAro

LordAro Oct 9, 2019

Member

unnecessary switch?

EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DM_ALL), SetMinimalSize(22, 22),
SetFill(0, 1), SetDataTip(SPR_IMG_DYNAMITE, STR_DEMOLISH_EVERYTHING_TOOLTIP),

This comment has been minimized.

Copy link
@LordAro

LordAro Oct 9, 2019

Member

too much indentation here (though I'm not sure what the "expected" amount is, only that 4 tabs is too much)

This comment has been minimized.

Copy link
@stormcone

stormcone Oct 9, 2019

Author Contributor

I am also not sure how much is expected, but I checked that file when I wrote it, and around line 370 there are the same amount of tabs where the widget attributes are in multiple lines, so I wanted to be consistent with them.

Idea from #7394.
@stormcone stormcone force-pushed the stormcone:demolish-tool branch from 0d42e67 to 82c0007 Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.