(fdc038d5d) Keymapping and UX test: - Map use to "E" and Select to "Left Mouse". - Introduce a dedicated key for deselecting ("Right Mouse"). - Introduce a dedicated key for shooting ("Left Mouse"). - Define certain objects as shootables, which simply means that they use the "Shoot" key instead of using the "Use" key. This required the least amount of refactoring the existing code. - TODO: don't register the "Select" input when aiming or when an interface is open -> should prevent interacting through UI elements. - TODO: sync the new input types with the server.
This commit is contained in:
@@ -348,14 +348,14 @@ namespace Barotrauma.Items.Components
|
||||
#endif
|
||||
}
|
||||
|
||||
//called when the item is equipped and left mouse button is pressed
|
||||
//called when the item is equipped and the "use" key is pressed
|
||||
//returns true if the item was used succesfully (not out of ammo, reloading, etc)
|
||||
public virtual bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
return characterUsable || character == null;
|
||||
}
|
||||
|
||||
//called when the item is equipped and right mouse button is pressed
|
||||
//called when the item is equipped and the "aim" key is pressed
|
||||
public virtual bool SecondaryUse(float deltaTime, Character character = null)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user