Allow temporary cursor stack for selection tool
Posted: Wed Apr 16, 2025 7:55 pm
As title says, allow LuaPlayer::cursor_stack_temporary for "selection-tool".
Reason: it behaves like a blueprint / deconstruction planner / upgrade planner in how it selects things and that it is not expected to return to the inventory if it was given to the player via a commond or gui interaction.
Use case: I have players use a command which provides them with a selection tool to select an area, using "on_player_selected_area" I can listen for this action to perform my logic then clear the cursor. But if the player presses Q to clear the cursor then it returns to the inventory, which causes issues if the player's inventory is full. My current solution is to use "character_inventory_slots_bonus" but this has many edge cases such as entering and exiting remote view, the player dieing, needing to set hand location in the inventory, etc. These would not exist if I could set the stack as temporary like is possible with a deconstruction planner.
Reason: it behaves like a blueprint / deconstruction planner / upgrade planner in how it selects things and that it is not expected to return to the inventory if it was given to the player via a commond or gui interaction.
Use case: I have players use a command which provides them with a selection tool to select an area, using "on_player_selected_area" I can listen for this action to perform my logic then clear the cursor. But if the player presses Q to clear the cursor then it returns to the inventory, which causes issues if the player's inventory is full. My current solution is to use "character_inventory_slots_bonus" but this has many edge cases such as entering and exiting remote view, the player dieing, needing to set hand location in the inventory, etc. These would not exist if I could set the stack as temporary like is possible with a deconstruction planner.