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: Town name filtering #7621

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@telk5093
Copy link

commented Jun 12, 2019

This is a re-PR of #6983, which implements the filtering feature for town name list like below:
(I reopen a PR since I have no idea how to change branch of previous PR)
image

Now it does not blink and seems stable unlike #6983 as @LordAro said.
Nevertheless, please let me know if there any problem with my commit and also please aware that I'm very new to both C/C++ and OpenTTD's codes.

Show resolved Hide resolved src/town_gui.cpp Outdated

@telk5093 telk5093 force-pushed the telk5093:town_name_filtering branch 2 times, most recently from ff43701 to e75f752 Jun 13, 2019

@nielsmh

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Remember to run the generate_widget and squirrel_export scripts after adding a new widget ID, and commit the updated script API files.

static char buf_cache[64];
char buf[64];
static char buf_cache[MAX_LENGTH_TOWN_NAME_CHARS];
char buf[MAX_LENGTH_TOWN_NAME_CHARS];

This comment has been minimized.

Copy link
@LordAro

LordAro Jun 13, 2019

Member

i feel like these should be MAX_LENGTH_TOWN_NAME_CHARS * MAX_CHAR_LENGTH, same as the QueryString - a townname could conceivably be constructed out of 64 4-byte characters, and of course "char" is just a byte

Ideally the 64 -> constant changes should be in a separate commit (there may be other instances of this being incorrect as well)

This comment has been minimized.

Copy link
@telk5093

telk5093 Jun 13, 2019

Author

I changed them and seperated commit as you said, thanks a lot.

@telk5093 telk5093 force-pushed the telk5093:town_name_filtering branch from 10b26e7 to 892c67c Jun 13, 2019

@telk5093

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

@nielsmh I had no idea I should run squirrel_export additionally. Thanks for noticing me and has done.

@telk5093 telk5093 force-pushed the telk5093:town_name_filtering branch from 892c67c to cd84304 Jun 13, 2019

@telk5093 telk5093 force-pushed the telk5093:town_name_filtering branch from cd84304 to 3054c49 Jun 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.