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: Push-buttons on storybook pages #7896

Merged
merged 14 commits into from May 22, 2020
Merged

Conversation

@nielsmh
Copy link
Contributor

nielsmh commented Jan 3, 2020

This adds three kinds of new elements to storybook pages: A plain instant-action button, a "select a tile" tool button, and a "select a vehicle" tool button.
When a player clicks a button, and selects a tile or vehicle if required, an event is posted to the game script.

This allows for more types of player-initiated interaction with GS.

Ideas not yet implemented, which I'd like feedback on:

  • A fourth button type requiring the player to submit a text string.
  • Filter bits for the tile and vehicle select buttons, to limit which types of tiles and vehicles will be accepted and allow the command to submit.
  • Different colours for buttons.
  • Icons (sprites) on buttons - not sure how the sprite to use would best be indicated.
  • Selectable mouse cursor for the tile and vehicle selection modes.

image

@nielsmh nielsmh force-pushed the nielsmh:sb-buttons branch from 1cb5b0b to 2303c97 Apr 11, 2020
@nielsmh
Copy link
Contributor Author

nielsmh commented Apr 12, 2020

Here's an updated screenshot showing off the addtional features :)
image

I think this is basically ready now. Colourful buttons, selectable cursor, and filter for vehicle types happened. I don't think text submit buttons, tile type filter, or button icons will happen.

@nielsmh nielsmh marked this pull request as ready for review Apr 12, 2020
@ldpl
Copy link
Contributor

ldpl commented May 12, 2020

Just got an idea that it would be quite useful to have buttons that can connect players to other servers. Mostly for commuties that have more than one server.

Copy link
Member

michicc left a comment

I didn't write a GS to test this, but the code diff itself looks fine to me.

@nielsmh nielsmh merged commit 800ade7 into OpenTTD:master May 22, 2020
8 checks passed
8 checks passed
Commit checker
Details
OpenTTD CI Build #20200411.3 succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.9) Linux linux-amd64-clang-3.9 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@nielsmh nielsmh deleted the nielsmh:sb-buttons branch May 22, 2020
JGRennison added a commit to JGRennison/Upstream-OpenTTD that referenced this pull request May 27, 2020
nielsmh added a commit that referenced this pull request May 27, 2020
rasputino pushed a commit to rasputino/OpenTTD that referenced this pull request Jun 1, 2020
Allow more direct player-initiated interaction for Game Scripts, by letting the GS put push-buttons on storybook pages. These buttons can either trigger an immediate event, or require the player to first select a tile on the map, or a vehicle.

Additionally this reworks how the storybook pages are layouted and rendered, to allow for slightly more complex layouts, and maybe speeding drawing up a bit.
rasputino pushed a commit to rasputino/OpenTTD that referenced this pull request Jun 1, 2020
freprec added a commit to freprec/OpenTTD that referenced this pull request Jun 19, 2020
Allow more direct player-initiated interaction for Game Scripts, by letting the GS put push-buttons on storybook pages. These buttons can either trigger an immediate event, or require the player to first select a tile on the map, or a vehicle.

Additionally this reworks how the storybook pages are layouted and rendered, to allow for slightly more complex layouts, and maybe speeding drawing up a bit.
freprec added a commit to freprec/OpenTTD that referenced this pull request Jun 19, 2020
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

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