Add Remove Input Map Key node
This commit is contained in:
parent
43a574eb15
commit
daee309ad8
23
Sources/armory/logicnode/RemoveInputMapKeyNode.hx
Normal file
23
Sources/armory/logicnode/RemoveInputMapKeyNode.hx
Normal file
|
@ -0,0 +1,23 @@
|
|||
package armory.logicnode;
|
||||
|
||||
import armory.system.InputMap;
|
||||
|
||||
class RemoveInputMapKeyNode extends LogicNode {
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from: Int) {
|
||||
var inputMap = inputs[1].get();
|
||||
var key = inputs[2].get();
|
||||
|
||||
var k = InputMap.getInputMapKey(inputMap, key);
|
||||
|
||||
if (k != null) {
|
||||
if (InputMap.getInputMap(inputMap).removeInput(k)) {
|
||||
runOutput(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
15
blender/arm/logicnode/input/LN_remove_input_map_key.py
Normal file
15
blender/arm/logicnode/input/LN_remove_input_map_key.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from arm.logicnode.arm_nodes import *
|
||||
|
||||
class RemoveInputMapKeyNode(ArmLogicTreeNode):
|
||||
"""Remove input map key."""
|
||||
bl_idname = 'LNRemoveInputMapKeyNode'
|
||||
bl_label = 'Remove Input Map Key'
|
||||
arm_version = 1
|
||||
|
||||
def init(self, context):
|
||||
super(RemoveInputMapKeyNode, self).init(context)
|
||||
self.add_input('ArmNodeSocketAction', 'In')
|
||||
self.add_input('NodeSocketString', 'Input Map')
|
||||
self.add_input('NodeSocketString', 'Key')
|
||||
|
||||
self.add_output('ArmNodeSocketAction', 'Out')
|
Loading…
Reference in a new issue