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 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
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 April 12, 2020 11:21
@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 michicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@nielsmh nielsmh deleted the sb-buttons branch May 22, 2020 20:23
JGRennison added a commit to JGRennison/Upstream-OpenTTD 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 pushed 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 pushed 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
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants