Apply checkstyle
This commit is contained in:
parent
fe3fa62a97
commit
db4f0cc107
|
@ -2,22 +2,22 @@ package armory.data;
|
|||
|
||||
class Config {
|
||||
|
||||
public static var raw:TConfig = null;
|
||||
public static var raw: TConfig = null;
|
||||
public static var configLoaded = false;
|
||||
|
||||
public static function load(done:Void->Void) {
|
||||
public static function load(done: Void->Void) {
|
||||
try {
|
||||
iron.data.Data.getBlob('config.arm', function(blob:kha.Blob) {
|
||||
iron.data.Data.getBlob("config.arm", function(blob: kha.Blob) {
|
||||
configLoaded = true;
|
||||
raw = haxe.Json.parse(blob.toString());
|
||||
done();
|
||||
});
|
||||
}
|
||||
catch(e:Dynamic) { done(); }
|
||||
catch (e: Dynamic) { done(); }
|
||||
}
|
||||
|
||||
public static function save() {
|
||||
var path = iron.data.Data.dataPath + 'config.arm';
|
||||
var path = iron.data.Data.dataPath + "config.arm";
|
||||
var bytes = haxe.io.Bytes.ofString(haxe.Json.stringify(raw));
|
||||
#if kha_krom
|
||||
Krom.fileSaveBytes(path, bytes.getData());
|
||||
|
@ -30,23 +30,23 @@ class Config {
|
|||
}
|
||||
|
||||
typedef TConfig = {
|
||||
@:optional var debug_console:Null<Bool>;
|
||||
@:optional var window_mode:Null<Int>; // window, fullscreen
|
||||
@:optional var window_w:Null<Int>;
|
||||
@:optional var window_h:Null<Int>;
|
||||
@:optional var window_resizable:Null<Bool>;
|
||||
@:optional var window_maximizable:Null<Bool>;
|
||||
@:optional var window_minimizable:Null<Bool>;
|
||||
@:optional var window_vsync:Null<Bool>;
|
||||
@:optional var window_msaa:Null<Int>;
|
||||
@:optional var window_scale:Null<Float>;
|
||||
@:optional var rp_supersample:Null<Float>;
|
||||
@:optional var rp_shadowmap_cube:Null<Int>; // size
|
||||
@:optional var rp_shadowmap_cascade:Null<Int>; // size for single cascade
|
||||
@:optional var rp_ssgi:Null<Bool>;
|
||||
@:optional var rp_ssr:Null<Bool>;
|
||||
@:optional var rp_bloom:Null<Bool>;
|
||||
@:optional var rp_motionblur:Null<Bool>;
|
||||
@:optional var rp_gi:Null<Bool>; // voxelao
|
||||
@:optional var rp_dynres:Null<Bool>; // dynamic resolution scaling
|
||||
@:optional var debug_console: Null<Bool>;
|
||||
@:optional var window_mode: Null<Int>; // window, fullscreen
|
||||
@:optional var window_w: Null<Int>;
|
||||
@:optional var window_h: Null<Int>;
|
||||
@:optional var window_resizable: Null<Bool>;
|
||||
@:optional var window_maximizable: Null<Bool>;
|
||||
@:optional var window_minimizable: Null<Bool>;
|
||||
@:optional var window_vsync: Null<Bool>;
|
||||
@:optional var window_msaa: Null<Int>;
|
||||
@:optional var window_scale: Null<Float>;
|
||||
@:optional var rp_supersample: Null<Float>;
|
||||
@:optional var rp_shadowmap_cube: Null<Int>; // size
|
||||
@:optional var rp_shadowmap_cascade: Null<Int>; // size for single cascade
|
||||
@:optional var rp_ssgi: Null<Bool>;
|
||||
@:optional var rp_ssr: Null<Bool>;
|
||||
@:optional var rp_bloom: Null<Bool>;
|
||||
@:optional var rp_motionblur: Null<Bool>;
|
||||
@:optional var rp_gi: Null<Bool>; // voxelao
|
||||
@:optional var rp_dynres: Null<Bool>; // dynamic resolution scaling
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package armory.logicnode;
|
|||
|
||||
class ActiveCameraNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic { return iron.Scene.active.camera; }
|
||||
override function get(from: Int): Dynamic { return iron.Scene.active.camera; }
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package armory.logicnode;
|
|||
|
||||
class ActiveSceneNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic { return iron.Scene.active.raw.name; }
|
||||
override function get(from: Int): Dynamic { return iron.Scene.active.raw.name; }
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class AddGroupNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var groupName:String = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var groupName: String = inputs[1].get();
|
||||
var raw = iron.Scene.active.raw;
|
||||
|
||||
|
||||
// Already exists
|
||||
for (g in raw.groups) {
|
||||
if (g.name == groupName) {
|
||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
|||
|
||||
class AddTraitNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var trait:Dynamic = inputs[2].get();
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var trait: Dynamic = inputs[2].get();
|
||||
|
||||
if (object == null || trait == null) return;
|
||||
|
||||
object.addTrait(trait);
|
||||
|
|
|
@ -4,11 +4,11 @@ class AlternateNode extends LogicNode {
|
|||
|
||||
var b = true;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
b ? runOutput(0) : runOutput(1);
|
||||
b = !b;
|
||||
}
|
||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
|||
|
||||
class AnimActionNode extends LogicNode {
|
||||
|
||||
public var value:String;
|
||||
public var value: String;
|
||||
|
||||
public function new(tree:LogicTree, value = "") {
|
||||
public function new(tree: LogicTree, value = "") {
|
||||
super(tree);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (inputs.length > 0) return inputs[0].get();
|
||||
return value;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
if (inputs.length > 0) inputs[0].set(value);
|
||||
else this.value = value;
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class AnimationStateNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
var animation = object.animation;
|
||||
|
|
|
@ -8,13 +8,13 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class AppendTransformNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var matrix:Mat4 = inputs[2].get();
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var matrix: Mat4 = inputs[2].get();
|
||||
|
||||
if (object == null || matrix == null) return;
|
||||
|
||||
|
|
|
@ -6,20 +6,20 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyForceAtLocationNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var force:Vec4 = inputs[2].get();
|
||||
var location:Vec4 = inputs[3].get();
|
||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var force: Vec4 = inputs[2].get();
|
||||
var location: Vec4 = inputs[3].get();
|
||||
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
if (object == null || force == null || location == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
if (!local) {
|
||||
rb.applyForce(force, location);
|
||||
}
|
||||
|
|
|
@ -6,19 +6,19 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyForceNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var force:Vec4 = inputs[2].get();
|
||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var force: Vec4 = inputs[2].get();
|
||||
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
if (object == null || force == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
if (!local) {
|
||||
rb.applyForce(force);
|
||||
}
|
||||
|
|
|
@ -6,20 +6,20 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyImpulseAtLocationNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var impulse:Vec4 = inputs[2].get();
|
||||
var location:Vec4 = inputs[3].get();
|
||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var impulse: Vec4 = inputs[2].get();
|
||||
var location: Vec4 = inputs[3].get();
|
||||
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
if (object == null || impulse == null || location == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
if (!local) {
|
||||
rb.applyImpulse(impulse, location); }
|
||||
else {
|
||||
|
|
|
@ -6,19 +6,19 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyImpulseNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var impulse:Vec4 = inputs[2].get();
|
||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var impulse: Vec4 = inputs[2].get();
|
||||
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||
|
||||
if (object == null || impulse == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
if (!local) {
|
||||
rb.applyImpulse(impulse);
|
||||
}
|
||||
|
|
|
@ -6,18 +6,18 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyTorqueImpulseNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var torque:Vec4 = inputs[2].get();
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var torque: Vec4 = inputs[2].get();
|
||||
|
||||
if (object == null || torque == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
rb.applyTorqueImpulse(torque);
|
||||
#end
|
||||
|
||||
|
|
|
@ -6,18 +6,18 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class ApplyTorqueNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var torque:Vec4 = inputs[2].get();
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var torque: Vec4 = inputs[2].get();
|
||||
|
||||
if (object == null || torque == null) return;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
rb.applyTorque(torque);
|
||||
#end
|
||||
|
||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
|||
|
||||
class ArrayAddNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
if (inputs.length > 2) {
|
||||
for (i in 2...inputs.length) {
|
||||
var value:Dynamic = inputs[i].get();
|
||||
var value: Dynamic = inputs[i].get();
|
||||
ar.push(value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
|||
|
||||
class ArrayAddUniqueNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
|
||||
if (inputs.length > 2) {
|
||||
for (i in 2...inputs.length) {
|
||||
var value:Dynamic = inputs[i].get();
|
||||
var value: Dynamic = inputs[i].get();
|
||||
if (ar.indexOf(value) == -1) ar.push(value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class ArrayBooleanNode extends LogicNode {
|
||||
|
||||
public var value:Array<Bool> = [];
|
||||
public var value: Array<Bool> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Bool = inp.get();
|
||||
var val: Bool = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayBooleanNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,18 @@ import iron.math.Vec4;
|
|||
|
||||
class ArrayColorNode extends LogicNode {
|
||||
|
||||
public var value:Array<Vec4> = [];
|
||||
public var value: Array<Vec4> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Vec4 = inp.get();
|
||||
var val: Vec4 = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class ArrayColorNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class ArrayFloatNode extends LogicNode {
|
||||
|
||||
public var value:Array<Float> = [];
|
||||
public var value: Array<Float> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Float = inp.get();
|
||||
var val: Float = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayFloatNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
|||
|
||||
class ArrayGetNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var ar:Array<Dynamic> = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var ar: Array<Dynamic> = inputs[0].get();
|
||||
if (ar == null) return null;
|
||||
|
||||
var i:Int = inputs[1].get();
|
||||
|
||||
var i: Int = inputs[1].get();
|
||||
if (i < 0) i = ar.length + i;
|
||||
if (i < 0 || i > ar.length - 1) {
|
||||
var className = Type.getClassName(Type.getClass(tree));
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class ArrayInArrayNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var array:Array<Dynamic> = inputs[0].get();
|
||||
var value:Dynamic = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var array: Array<Dynamic> = inputs[0].get();
|
||||
var value: Dynamic = inputs[1].get();
|
||||
|
||||
return ! (array.indexOf(value) == -1);
|
||||
return array.indexOf(value) != -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class ArrayIntegerNode extends LogicNode {
|
||||
|
||||
public var value:Array<Int> = [];
|
||||
public var value: Array<Int> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Int = inp.get();
|
||||
var val: Int = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayIntegerNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class ArrayLengthNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var ar:Array<Dynamic> = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var ar: Array<Dynamic> = inputs[0].get();
|
||||
return ar != null ? ar.length : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class ArrayLoopNode extends LogicNode {
|
||||
|
||||
var value:Dynamic;
|
||||
var value: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
for (val in ar) {
|
||||
|
@ -24,7 +24,7 @@ class ArrayLoopNode extends LogicNode {
|
|||
runOutput(2);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class ArrayNode extends LogicNode {
|
||||
|
||||
public var value:Array<Dynamic> = [];
|
||||
public var value: Array<Dynamic> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Dynamic = inp.get();
|
||||
var val: Dynamic = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,18 @@ import iron.object.Object;
|
|||
|
||||
class ArrayObjectNode extends LogicNode {
|
||||
|
||||
public var value:Array<Object> = [];
|
||||
public var value: Array<Object> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Object = inp.get();
|
||||
var val: Object = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class ArrayObjectNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class ArrayPopNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var ar:Array<Dynamic> = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var ar: Array<Dynamic> = inputs[0].get();
|
||||
if (ar == null) return null;
|
||||
|
||||
|
||||
return ar.pop();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
|||
|
||||
class ArrayRemoveNode extends LogicNode {
|
||||
|
||||
var removedValue:Dynamic = null;
|
||||
var removedValue: Dynamic = null;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
var i:Int = inputs[2].get();
|
||||
var i: Int = inputs[2].get();
|
||||
if (i < 0) i = ar.length + i;
|
||||
|
||||
removedValue = ar[i];
|
||||
|
@ -21,7 +21,7 @@ class ArrayRemoveNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return removedValue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
|||
|
||||
class ArrayRemoveValueNode extends LogicNode {
|
||||
|
||||
var removedValue:Dynamic = null;
|
||||
var removedValue: Dynamic = null;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
var val:Dynamic = inputs[2].get();
|
||||
var val: Dynamic = inputs[2].get();
|
||||
|
||||
removedValue = val;
|
||||
ar.remove(val);
|
||||
|
@ -20,7 +20,7 @@ class ArrayRemoveValueNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return removedValue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
|||
|
||||
class ArraySetNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
var i:Int = inputs[2].get();
|
||||
var value:Dynamic = inputs[3].get();
|
||||
var i: Int = inputs[2].get();
|
||||
var value: Dynamic = inputs[3].get();
|
||||
|
||||
if (i < 0) ar[ar.length + i] = value;
|
||||
else ar[i] = value;
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class ArrayShiftNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var ar:Array<Dynamic> = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var ar: Array<Dynamic> = inputs[0].get();
|
||||
if (ar == null) return null;
|
||||
|
||||
return ar.shift();
|
||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
|||
|
||||
class ArraySliceNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var ar:Array<Dynamic> = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var ar: Array<Dynamic> = inputs[0].get();
|
||||
if (ar == null) return null;
|
||||
|
||||
var i:Int = inputs[1].get();
|
||||
var end:Int = inputs[2].get();
|
||||
|
||||
var i: Int = inputs[1].get();
|
||||
var end: Int = inputs[2].get();
|
||||
|
||||
if (i < 0) i = ar.length + i;
|
||||
if (i < 0 || i > ar.length - 1) {
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class ArraySpliceNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var ar:Array<Dynamic> = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var ar: Array<Dynamic> = inputs[1].get();
|
||||
if (ar == null) return;
|
||||
|
||||
var i = inputs[2].get();
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class ArrayStringNode extends LogicNode {
|
||||
|
||||
public var value:Array<String> = [];
|
||||
public var value: Array<String> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:String = inp.get();
|
||||
var val: String = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayStringNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,18 @@ import iron.math.Vec4;
|
|||
|
||||
class ArrayVectorNode extends LogicNode {
|
||||
|
||||
public var value:Array<Vec4> = [];
|
||||
public var value: Array<Vec4> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val:Vec4 = inp.get();
|
||||
var val: Vec4 = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class ArrayVectorNode extends LogicNode {
|
|||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,16 @@ import iron.object.Object;
|
|||
|
||||
class BlendActionNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var action1:String = inputs[2].get();
|
||||
var action2:String = inputs[3].get();
|
||||
var blendFactor:Float = inputs[4].get();
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var action1: String = inputs[2].get();
|
||||
var action2: String = inputs[3].get();
|
||||
var blendFactor: Float = inputs[4].get();
|
||||
|
||||
if (object == null) return;
|
||||
var animation = object.animation;
|
||||
if (animation == null) animation = object.getParentArmature(object.name);
|
||||
|
|
|
@ -7,21 +7,21 @@ import iron.math.Mat4;
|
|||
class BoneFKNode extends LogicNode {
|
||||
|
||||
var notified = false;
|
||||
var m:Mat4 = null;
|
||||
var w:Mat4 = null;
|
||||
var m: Mat4 = null;
|
||||
var w: Mat4 = null;
|
||||
var iw = Mat4.identity();
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
#if arm_skin
|
||||
|
||||
var object:Object = inputs[1].get();
|
||||
var boneName:String = inputs[2].get();
|
||||
var transform:Mat4 = inputs[3].get();
|
||||
|
||||
var object: Object = inputs[1].get();
|
||||
var boneName: String = inputs[2].get();
|
||||
var transform: Mat4 = inputs[3].get();
|
||||
|
||||
if (object == null) return;
|
||||
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
||||
if (anim == null) anim = object.getParentArmature(object.name);
|
||||
|
@ -30,7 +30,7 @@ class BoneFKNode extends LogicNode {
|
|||
var bone = anim.getBone(boneName);
|
||||
m = anim.getBoneMat(bone);
|
||||
w = anim.getAbsMat(bone);
|
||||
|
||||
|
||||
function moveBone() {
|
||||
m.setFrom(w);
|
||||
m.multmat(transform);
|
||||
|
|
|
@ -6,26 +6,26 @@ import iron.math.Vec4;
|
|||
|
||||
class BoneIKNode extends LogicNode {
|
||||
|
||||
var goal:Vec4;
|
||||
var goal: Vec4;
|
||||
var notified = false;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
#if arm_skin
|
||||
|
||||
var object:Object = inputs[1].get();
|
||||
var boneName:String = inputs[2].get();
|
||||
var object: Object = inputs[1].get();
|
||||
var boneName: String = inputs[2].get();
|
||||
goal = inputs[3].get();
|
||||
|
||||
|
||||
if (object == null || goal == null) return;
|
||||
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
||||
if (anim == null) anim = object.getParentArmature(object.name);
|
||||
|
||||
var bone = anim.getBone(boneName);
|
||||
|
||||
|
||||
function solveBone() {
|
||||
anim.solveIK(bone, goal);
|
||||
|
||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
|||
|
||||
class BooleanNode extends LogicNode {
|
||||
|
||||
public var value:Bool;
|
||||
public var value: Bool;
|
||||
|
||||
public function new(tree:LogicTree, value = false) {
|
||||
public function new(tree: LogicTree, value = false) {
|
||||
super(tree);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (inputs.length > 0) return inputs[0].get();
|
||||
return value;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
if (inputs.length > 0) inputs[0].set(value);
|
||||
else this.value = value;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class BranchNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var b:Bool = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var b: Bool = inputs[1].get();
|
||||
b ? runOutput(0) : runOutput(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,31 +4,32 @@ import iron.object.Object;
|
|||
|
||||
class CallFunctionNode extends LogicNode {
|
||||
|
||||
var result:Dynamic;
|
||||
var result: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
if (object == null) return;
|
||||
|
||||
var funName:String = inputs[2].get();
|
||||
var args:Array<Dynamic> = [];
|
||||
|
||||
var funName: String = inputs[2].get();
|
||||
var args: Array<Dynamic> = [];
|
||||
|
||||
for (i in 3...inputs.length) {
|
||||
args.push(inputs[i].get());
|
||||
}
|
||||
|
||||
|
||||
var func = Reflect.field(object, funName);
|
||||
if (func != null)
|
||||
if (func != null) {
|
||||
result = Reflect.callMethod(object, func, args);
|
||||
}
|
||||
|
||||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
|||
|
||||
class CallGroupNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
var callTree:LogicTree = null;
|
||||
public var property0: String;
|
||||
var callTree: LogicTree = null;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@:access(iron.Trait)
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
|
||||
if (callTree == null) {
|
||||
var classType = Type.resolveClass(property0);
|
||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
|||
|
||||
class CallHaxeStaticNode extends LogicNode {
|
||||
|
||||
var result:Dynamic;
|
||||
var result: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
|
||||
var path:String = inputs[1].get();
|
||||
if (path != '') {
|
||||
override function run(from: Int) {
|
||||
|
||||
var path: String = inputs[1].get();
|
||||
if (path != "") {
|
||||
var dotIndex = path.lastIndexOf(".");
|
||||
var classPath = path.substr(0, dotIndex);
|
||||
var classType = Type.resolveClass(classPath);
|
||||
|
@ -22,7 +22,7 @@ class CallHaxeStaticNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetCheckboxNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var canvas: CanvasScript;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
#if arm_ui
|
||||
override function get(from:Int) {
|
||||
override function get(from: Int) {
|
||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
if (canvas == null || !canvas.ready) return null;
|
||||
|
||||
|
||||
// This Try/Catch hacks around an issue where the handles are
|
||||
// not created yet, even though canvas.ready is true.
|
||||
try {
|
||||
return canvas.getHandle(inputs[0].get()).selected;
|
||||
} catch (e:Dynamic) {return null;}
|
||||
}
|
||||
catch (e: Dynamic) { return null; }
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetInputTextNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var canvas: CanvasScript;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
#if arm_ui
|
||||
override function get(from:Int) {
|
||||
override function get(from: Int) {
|
||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
if (canvas == null || !canvas.ready) return null;
|
||||
|
||||
|
||||
// This Try/Catch hacks around an issue where the handles are
|
||||
// not created yet, even though canvas.ready is true.
|
||||
try {
|
||||
return canvas.getHandle(inputs[0].get()).text;
|
||||
} catch (e:Dynamic) {return null;}
|
||||
}
|
||||
catch (e: Dynamic) { return null; }
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetLocationNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var x:Float;
|
||||
var y:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var x: Float;
|
||||
var y: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class CanvasGetLocationNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
|
@ -33,7 +33,7 @@ class CanvasGetLocationNode extends LogicNode {
|
|||
tree.notifyOnUpdate(update);
|
||||
update();
|
||||
}
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (from == 1) return x;
|
||||
else if (from == 2) return y;
|
||||
else return 0;
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetPBNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var at:Int;
|
||||
var max:Int;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var at: Int;
|
||||
var max: Int;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class CanvasGetPBNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
|
@ -33,7 +33,7 @@ class CanvasGetPBNode extends LogicNode {
|
|||
tree.notifyOnUpdate(update);
|
||||
update();
|
||||
}
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (from == 1) return at;
|
||||
else if (from == 2) return max;
|
||||
else return 0;
|
||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetPositionNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var canvas: CanvasScript;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
#if arm_ui
|
||||
override function get(from:Int) {
|
||||
override function get(from: Int) {
|
||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
if (canvas == null || !canvas.ready) return null;
|
||||
|
||||
|
||||
// This Try/Catch hacks around an issue where the handles are
|
||||
// not created yet, even though canvas.ready is true.
|
||||
try {
|
||||
return canvas.getHandle(inputs[0].get()).position;
|
||||
} catch (e:Dynamic) {return null;}
|
||||
}
|
||||
catch (e: Dynamic) { return null; }
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetRotationNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var rad:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var rad: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class CanvasGetRotationNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
|
@ -32,7 +32,7 @@ class CanvasGetRotationNode extends LogicNode {
|
|||
tree.notifyOnUpdate(update);
|
||||
update();
|
||||
}
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (from == 1) return rad;
|
||||
else return 0;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetScaleNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var width:Int;
|
||||
var height:Int;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var width: Int;
|
||||
var height: Int;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class CanvasGetScaleNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
|
@ -33,7 +33,7 @@ class CanvasGetScaleNode extends LogicNode {
|
|||
tree.notifyOnUpdate(update);
|
||||
update();
|
||||
}
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (from == 1) return height;
|
||||
else if (from == 2) return width;
|
||||
else return 0;
|
||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasGetSliderNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var canvas: CanvasScript;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
#if arm_ui
|
||||
override function get(from:Int) {
|
||||
override function get(from: Int) {
|
||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||
if (canvas == null || !canvas.ready) return null;
|
||||
|
||||
|
||||
// This Try/Catch hacks around an issue where the handles are
|
||||
// not created yet, even though canvas.ready is true.
|
||||
try {
|
||||
return canvas.getHandle(inputs[0].get()).value;
|
||||
} catch (e:Dynamic) {return null;}
|
||||
}
|
||||
catch (e: Dynamic) { return null; }
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetAssetNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var asset:String;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var asset: String;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CanvasSetAssetNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
asset = Std.string(inputs[2].get());
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetLocationNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var newX:Float;
|
||||
var newY:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var newX: Float;
|
||||
var newY: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class CanvasSetLocationNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
newX = inputs[2].get();
|
||||
newY = inputs[3].get();
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetPBNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var newAt:Int;
|
||||
var newMax:Int;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var newAt: Int;
|
||||
var newMax: Int;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ class CanvasSetPBNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
newAt = inputs[2].get();
|
||||
newMax = inputs[3].get();
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetRotationNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var rad:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var rad: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CanvasSetRotationNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
rad = inputs[2].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetScaleNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var height:Int;
|
||||
var width:Int;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var height: Int;
|
||||
var width: Int;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class CanvasSetScaleNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
height = inputs[2].get();
|
||||
width = inputs[3].get();
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetSliderNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var value:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var value: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,12 +22,13 @@ class CanvasSetSliderNode extends LogicNode {
|
|||
try {
|
||||
canvas.getHandle(element).value = value;
|
||||
tree.removeUpdate(update);
|
||||
} catch (e:Dynamic) {}
|
||||
}
|
||||
catch (e: Dynamic) {}
|
||||
|
||||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
value = inputs[2].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
|
|
|
@ -6,14 +6,14 @@ import kha.Color;
|
|||
|
||||
class CanvasSetTextColorNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var r:Float;
|
||||
var g:Float;
|
||||
var b:Float;
|
||||
var a:Float;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var r: Float;
|
||||
var g: Float;
|
||||
var b: Float;
|
||||
var a: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,11 +22,11 @@ class CanvasSetTextColorNode extends LogicNode {
|
|||
if (!canvas.ready) return;
|
||||
tree.removeUpdate(update);
|
||||
|
||||
canvas.getElement(element).color_text = Color.fromFloats(r,g,b,a);
|
||||
canvas.getElement(element).color_text = Color.fromFloats(r, g, b, a);
|
||||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
r = inputs[2].get();
|
||||
g = inputs[3].get();
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetTextNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var text:String;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var text: String;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CanvasSetTextNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
text = Std.string(inputs[2].get());
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
|||
|
||||
class CanvasSetVisibleNode extends LogicNode {
|
||||
|
||||
var canvas:CanvasScript;
|
||||
var element:String;
|
||||
var visible:Bool;
|
||||
var canvas: CanvasScript;
|
||||
var element: String;
|
||||
var visible: Bool;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CanvasSetVisibleNode extends LogicNode {
|
|||
else canvas.getElement(element).visible = false;
|
||||
runOutput(0);
|
||||
}
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
element = inputs[1].get();
|
||||
visible = inputs[2].get();
|
||||
canvas = Scene.active.getTrait(CanvasScript);
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class CaseStringNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
public var property0: String;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var s:String = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var s: String = inputs[0].get();
|
||||
if (s == null) return null;
|
||||
|
||||
switch (property0) {
|
||||
|
|
|
@ -6,14 +6,14 @@ class CastPhysicsRayNode extends LogicNode {
|
|||
|
||||
var v = new Vec4();
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var vfrom:Vec4 = inputs[0].get();
|
||||
var vto:Vec4 = inputs[1].get();
|
||||
var mask:Int = inputs[2].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var vfrom: Vec4 = inputs[0].get();
|
||||
var vto: Vec4 = inputs[1].get();
|
||||
var mask: Int = inputs[2].get();
|
||||
|
||||
if (vfrom == null || vto == null) return null;
|
||||
|
||||
|
@ -26,13 +26,14 @@ class CastPhysicsRayNode extends LogicNode {
|
|||
if (rb != null) return rb.object;
|
||||
}
|
||||
else if (from == 1) { // Hit
|
||||
var hitPointWorld:Vec4 = rb != null ? physics.hitPointWorld : null;
|
||||
var hitPointWorld: Vec4 = rb != null ? physics.hitPointWorld : null;
|
||||
if (hitPointWorld != null) {
|
||||
v.set(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z, 1);
|
||||
return v;
|
||||
}
|
||||
} else { // Normal
|
||||
var hitNormalWorld:Vec4 = rb != null ? physics.hitNormalWorld : null;
|
||||
}
|
||||
else { // Normal
|
||||
var hitNormalWorld: Vec4 = rb != null ? physics.hitNormalWorld : null;
|
||||
if (hitNormalWorld != null) {
|
||||
v.set(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z, 0);
|
||||
return v;
|
||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
|||
|
||||
class ClearParentNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
var object:Object = inputs[1].get();
|
||||
var keepTransform:Bool = inputs[2].get();
|
||||
|
||||
override function run(from: Int) {
|
||||
var object: Object = inputs[1].get();
|
||||
var keepTransform: Bool = inputs[2].get();
|
||||
|
||||
if (object == null || object.parent == null) return;
|
||||
|
||||
object.parent.removeChild(object, keepTransform);
|
||||
|
|
|
@ -6,18 +6,18 @@ class ColorNode extends LogicNode {
|
|||
|
||||
var value = new Vec4();
|
||||
|
||||
public function new(tree:LogicTree, r = 0.8, g = 0.8, b = 0.8, a = 1.0) {
|
||||
public function new(tree: LogicTree, r = 0.8, g = 0.8, b = 0.8, a = 1.0) {
|
||||
super(tree);
|
||||
|
||||
value.set(r, g, b, a);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (inputs.length > 0) return inputs[0].get();
|
||||
return value;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
if (inputs.length > 0) inputs[0].set(value);
|
||||
else this.value = value;
|
||||
}
|
||||
|
|
|
@ -4,17 +4,17 @@ import iron.math.Vec4;
|
|||
|
||||
class CompareNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
public var property1:Float;
|
||||
public var property0: String;
|
||||
public var property1: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Bool {
|
||||
override function get(from: Int): Bool {
|
||||
|
||||
var v1:Dynamic = inputs[0].get();
|
||||
var v2:Dynamic = inputs[1].get();
|
||||
var v1: Dynamic = inputs[0].get();
|
||||
var v2: Dynamic = inputs[1].get();
|
||||
var cond = false;
|
||||
|
||||
switch (property0) {
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class ConcatenateStringNode extends LogicNode {
|
||||
|
||||
public var value:String;
|
||||
public var value: String;
|
||||
|
||||
public function new(tree:LogicTree, value = "") {
|
||||
public function new(tree: LogicTree, value = "") {
|
||||
super(tree);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
value = "";
|
||||
for (inp in inputs) value += inp.get();
|
||||
return value;
|
||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
|||
|
||||
class ContainsStringNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
public var property0: String;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var s1:String = inputs[0].get();
|
||||
var s2:String = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var s1: String = inputs[0].get();
|
||||
var s2: String = inputs[1].get();
|
||||
if (s1 == null || s2 == null) return null;
|
||||
|
||||
switch (property0) {
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class DegToRadNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var deg:Float = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var deg: Float = inputs[0].get();
|
||||
return deg * 0.0174532924;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ class DisplayInfoNode extends LogicNode {
|
|||
|
||||
static inline var displayIndex = 0;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (from == 0) return kha.Display.all[displayIndex].width;
|
||||
else return kha.Display.all[displayIndex].height;
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
|||
|
||||
class DynamicNode extends LogicNode {
|
||||
|
||||
public var value:Dynamic;
|
||||
public var value: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree, value:Dynamic = null) {
|
||||
public function new(tree: LogicTree, value: Dynamic = null) {
|
||||
super(tree);
|
||||
this.value = value == null ? {} : value;
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return value;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
|||
|
||||
class ExpressionNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
var result:Dynamic;
|
||||
public var property0: String;
|
||||
var result: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
|
||||
#if hscript
|
||||
var expr = property0;
|
||||
|
@ -22,7 +22,7 @@ class ExpressionNode extends LogicNode {
|
|||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
|||
|
||||
class FloatNode extends LogicNode {
|
||||
|
||||
public var value:Float;
|
||||
public var value: Float;
|
||||
|
||||
public function new(tree:LogicTree, value = 0.0) {
|
||||
public function new(tree: LogicTree, value = 0.0) {
|
||||
super(tree);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
if (inputs.length > 0) return inputs[0].get();
|
||||
return value;
|
||||
}
|
||||
|
||||
override function set(value:Dynamic) {
|
||||
override function set(value: Dynamic) {
|
||||
if (inputs.length > 0) inputs[0].set(value);
|
||||
else this.value = value;
|
||||
}
|
||||
|
|
|
@ -3,20 +3,20 @@ package armory.logicnode;
|
|||
class FunctionNode extends LogicNode {
|
||||
|
||||
@:allow(armory.logicnode.LogicTree)
|
||||
var args:Array<Dynamic> = [];
|
||||
var args: Array<Dynamic> = [];
|
||||
@:allow(armory.logicnode.LogicTree)
|
||||
var result:Dynamic;
|
||||
var result: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@:allow(armory.logicnode.LogicTree)
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
runOutput(0);
|
||||
}
|
||||
|
||||
override function get(from:Int) {
|
||||
override function get(from: Int): Dynamic {
|
||||
return this.args[from - 1];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@ package armory.logicnode;
|
|||
class FunctionOutputNode extends LogicNode {
|
||||
|
||||
@:allow(armory.logicnode.LogicTree)
|
||||
var result:Dynamic;
|
||||
var result: Dynamic;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
override function run(from: Int) {
|
||||
this.result = inputs[1].get();
|
||||
runOutput(0);
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@ class GamepadCoordsNode extends LogicNode {
|
|||
|
||||
var coords = new Vec4();
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var num:Int = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var num: Int = inputs[0].get();
|
||||
var gamepad = iron.system.Input.getGamepad(num);
|
||||
if (from == 0) {
|
||||
coords.x = gamepad.leftStick.x;
|
||||
|
@ -32,9 +32,11 @@ class GamepadCoordsNode extends LogicNode {
|
|||
coords.x = gamepad.rightStick.movementX;
|
||||
coords.y = gamepad.rightStick.movementY;
|
||||
return coords;
|
||||
} else if(from == 4) {
|
||||
}
|
||||
else if (from == 4) {
|
||||
return gamepad.down("l2");
|
||||
} else if(from == 5) {
|
||||
}
|
||||
else if (from == 5) {
|
||||
return gamepad.down("r2");
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -4,17 +4,16 @@ import iron.math.Vec4;
|
|||
|
||||
class GateNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
public var property1:Float;
|
||||
public var property0: String;
|
||||
public var property1: Float;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from:Int) {
|
||||
|
||||
var v1:Dynamic = inputs[1].get();
|
||||
var v2:Dynamic = inputs[2].get();
|
||||
override function run(from: Int) {
|
||||
var v1: Dynamic = inputs[1].get();
|
||||
var v2: Dynamic = inputs[2].get();
|
||||
var cond = false;
|
||||
|
||||
switch (property0) {
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.CameraObject;
|
|||
|
||||
class GetCameraFovNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var camera:CameraObject = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var camera: CameraObject = inputs[0].get();
|
||||
|
||||
if (camera == null) return 0.0;
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ import iron.object.Object;
|
|||
|
||||
class GetChildNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
public var property0: String;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
var childName:String = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
var childName: String = inputs[1].get();
|
||||
|
||||
if (object == null || childName == null) return null;
|
||||
|
||||
|
@ -30,7 +30,7 @@ class GetChildNode extends LogicNode {
|
|||
return null;
|
||||
}
|
||||
|
||||
function contains(o:Object, name:String):Object {
|
||||
function contains(o: Object, name: String): Object {
|
||||
if (o.name.indexOf(name) >= 0) return o;
|
||||
else {
|
||||
for (c in o.children) {
|
||||
|
@ -41,7 +41,7 @@ class GetChildNode extends LogicNode {
|
|||
return null;
|
||||
}
|
||||
|
||||
function startsWith(o:Object, name:String):Object {
|
||||
function startsWith(o: Object, name: String): Object {
|
||||
if (StringTools.startsWith(o.name, name)) return o;
|
||||
else {
|
||||
for (c in o.children) {
|
||||
|
@ -52,7 +52,7 @@ class GetChildNode extends LogicNode {
|
|||
return null;
|
||||
}
|
||||
|
||||
function endsWith(o:Object, name:String):Object {
|
||||
function endsWith(o: Object, name: String): Object {
|
||||
if (StringTools.endsWith(o.name, name)) return o;
|
||||
else {
|
||||
for (c in o.children) {
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetChildrenNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class GetContactsNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
if (object == null) return null;
|
||||
|
||||
#if arm_physics
|
||||
|
|
|
@ -4,13 +4,13 @@ import iron.object.Object;
|
|||
|
||||
class GetDistanceNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object1:Object = inputs[0].get();
|
||||
var object2:Object = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object1: Object = inputs[0].get();
|
||||
var object2: Object = inputs[1].get();
|
||||
|
||||
if (object1 == null || object2 == null) return 0;
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class GetFirstContactNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
if (object == null) return null;
|
||||
|
||||
#if arm_physics
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
package armory.logicnode;
|
||||
|
||||
import iron.object.Object;
|
||||
import iron.math.Vec4;
|
||||
import armory.trait.physics.RigidBody;
|
||||
|
||||
class GetGravityNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
|
||||
override function get(from: Int): Dynamic {
|
||||
|
||||
#if arm_physics
|
||||
var physics = armory.trait.physics.PhysicsWorld.active;
|
||||
return physics.world.getGravity();
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class GetGroupNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var groupName:String = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var groupName: String = inputs[0].get();
|
||||
return iron.Scene.active.getGroup(groupName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ package armory.logicnode;
|
|||
|
||||
class GetHaxePropertyNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Dynamic = inputs[0].get();
|
||||
var property:String = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Dynamic = inputs[0].get();
|
||||
var property: String = inputs[1].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetLocationNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.MeshObject;
|
|||
|
||||
class GetMaterialNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:MeshObject = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: MeshObject = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.MeshObject;
|
|||
|
||||
class GetMeshNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:MeshObject = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: MeshObject = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
|||
|
||||
class GetNameNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return '';
|
||||
if (object == null) return "";
|
||||
|
||||
return object.name;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
|||
|
||||
class GetObjectNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var objectName:String = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var objectName: String = inputs[0].get();
|
||||
|
||||
return iron.Scene.active.getChild(objectName);
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetParentNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ import iron.object.Object;
|
|||
|
||||
class GetPropertyNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
var property:String = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
var property: String = inputs[1].get();
|
||||
|
||||
if (from == 0) {
|
||||
if (object == null || object.properties == null) return null;
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
package armory.logicnode;
|
||||
|
||||
import iron.object.Object;
|
||||
import iron.math.Quat;
|
||||
import iron.math.Vec3;
|
||||
|
||||
class GetRotationNode extends LogicNode {
|
||||
public function new(tree:LogicTree) {
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
if (object == null)
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
if (object == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var rot = object.transform.rot;
|
||||
switch (from) {
|
||||
case 0:
|
||||
|
@ -21,8 +23,9 @@ class GetRotationNode extends LogicNode {
|
|||
case 1:
|
||||
// vector
|
||||
var sqrtW = Math.sqrt(1 - (rot.w * rot.w));
|
||||
if (sqrtW == 0)
|
||||
if (sqrtW == 0) {
|
||||
return new Vec3(0, 0, 1);
|
||||
}
|
||||
return new Vec3(rot.x / sqrtW, rot.y / sqrtW, rot.z / sqrtW);
|
||||
case 2:
|
||||
// angle radians
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetScaleNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ import iron.object.Object;
|
|||
|
||||
class GetTraitNode extends LogicNode {
|
||||
|
||||
var cname:Class<iron.Trait> = null;
|
||||
var cname: Class<iron.Trait> = null;
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
var name:String = inputs[1].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
var name: String = inputs[1].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetTransformNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) return null;
|
||||
|
||||
|
|
|
@ -5,16 +5,16 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class GetVelocityNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
if (object == null) return null;
|
||||
|
||||
#if arm_physics
|
||||
var rb:RigidBody = object.getTrait(RigidBody);
|
||||
var rb: RigidBody = object.getTrait(RigidBody);
|
||||
|
||||
if (rb != null) {
|
||||
if (from == 0) return rb.getLinearVelocity();
|
||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
|||
|
||||
class GetVisibleNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
var object:Object = inputs[0].get();
|
||||
override function get(from: Int): Dynamic {
|
||||
var object: Object = inputs[0].get();
|
||||
|
||||
if (object == null) false;
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package armory.logicnode;
|
|||
|
||||
class GlobalObjectNode extends LogicNode {
|
||||
|
||||
public function new(tree:LogicTree) {
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from:Int):Dynamic {
|
||||
override function get(from: Int): Dynamic {
|
||||
return iron.Scene.global;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue