[1.1.27] Event/property for playing a sound on selection-tool start selection

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
ceresward
Inserter
Inserter
Posts: 21
Joined: Mon Dec 18, 2017 8:45 pm
Contact:

[1.1.27] Event/property for playing a sound on selection-tool start selection

Post by ceresward »

Hi, the built-in selection tools (upgrade planner, blueprint, etc.) will play a sound both when the player begins making a selection, and when the player finishes their selection. I would like to be able to match that functionality when implementing a generic selection-tool. I can play a sound when area selection ends using `on_player_selected_area`, however there is no event or prototype property that will let me play a sound when area selection starts. Can we get a way to do this please?

I propose adding one or both of the following:
  • New event `on_player_begins_selecting_area`
  • New SelectionTool prototype properties `selection_start_sound` and `selection_end_sound` (both optional)

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.27] Event/property for playing a sound on selection-tool start selection

Post by eradicator »

ceresward wrote:
Fri Mar 19, 2021 4:57 am
however there is no event or prototype property that will let me play a sound when area selection starts.
Technically a linked-control custom-input can raise that event. But that adds overhead to every click, has to be filtered for cursor_stack and possibly doesn't work with all modifier key combinations.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding interface requests”