Compare commits

..

No commits in common. "6437f8112db5ba8f7db60f1dcdd81a382ee524a3" and "1cd28eb7074588d17cb7b197a63341b23a3a5473" have entirely different histories.

1598 changed files with 5201 additions and 8227 deletions

View File

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bujyx7ltsi40k" uid="uid://bujyx7ltsi40k"
path="res://.godot/imported/TimelineManager.svg-deb996f134b015aad25457e6b0de530f.ctex" path="res://.godot/imported/TimeLineManager.svg-dd6b4ada11f698cccbfe51b895d69a3b.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://addons/rokojori_action_library/Icons/TimelineManager.svg" source_file="res://addons/rokojori_action_library/Icons/TimeLineManager.svg"
dest_files=["res://.godot/imported/TimelineManager.svg-deb996f134b015aad25457e6b0de530f.ctex"] dest_files=["res://.godot/imported/TimeLineManager.svg-dd6b4ada11f698cccbfe51b895d69a3b.ctex"]
[params] [params]

View File

@ -1,254 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="16"
viewBox="0 0 16 16"
width="16"
version="1.1"
id="svg4"
sodipodi:docname="Timeline.svg"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8"><linearGradient
inkscape:collect="never"
id="linearGradient33765"><stop
style="stop-color:#cccfd5;stop-opacity:1;"
offset="0"
id="stop33761" /><stop
style="stop-color:#a9aeb6;stop-opacity:1;"
offset="0.41559249"
id="stop16949" /><stop
style="stop-color:#b2b3b9;stop-opacity:1;"
offset="0.80959076"
id="stop16951" /><stop
style="stop-color:#8a8a8a;stop-opacity:1;"
offset="1"
id="stop33763" /></linearGradient><linearGradient
id="linearGradient3074"><stop
style="stop-color:#e26708;stop-opacity:1;"
offset="0"
id="stop3070" /><stop
style="stop-color:#bb3c00;stop-opacity:1;"
offset="1"
id="stop3072" /></linearGradient><radialGradient
xlink:href="#linearGradient45008"
id="radialGradient3076"
cx="30.688875"
cy="30.069115"
fx="30.688875"
fy="30.069115"
r="14.05412"
gradientUnits="userSpaceOnUse" /><linearGradient
xlink:href="#linearGradient45008"
id="linearGradient45010"
x1="-31.87768"
y1="22.065159"
x2="-31.87768"
y2="48.78738"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(101.16951,-6.5921995)" /><linearGradient
id="linearGradient45008"><stop
style="stop-color:#e14500;stop-opacity:1;"
offset="0"
id="stop45004" /><stop
style="stop-color:#e17900;stop-opacity:1;"
offset="0.59811592"
id="stop45012" /><stop
style="stop-color:#e19c00;stop-opacity:1;"
offset="1"
id="stop45006" /></linearGradient><linearGradient
xlink:href="#linearGradient45008"
id="linearGradient46715"
x1="31.917692"
y1="47.524929"
x2="31.917692"
y2="22.632998"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(1.7923447e-6)" /><radialGradient
inkscape:collect="never"
xlink:href="#linearGradient33765"
id="radialGradient33767"
cx="28.252495"
cy="28.914215"
fx="28.252495"
fy="28.914215"
r="14.43763"
gradientTransform="matrix(2.0592515,0,0,2.0182304,-29.633594,-30.690448)"
gradientUnits="userSpaceOnUse" /></defs><sodipodi:namedview
id="namedview6"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="11.313709"
inkscape:cx="5.3033009"
inkscape:cy="2.4748737"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g33736" /><g
id="g2210"
transform="matrix(0.54328517,0,0,0.54328517,-9.4489315,-11.300948)"><g
id="g33736"><rect
style="fill:url(#radialGradient33767);fill-opacity:1;stroke:none;stroke-width:1.91428;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="rect18059"
width="28.875259"
height="28.300053"
x="17.679815"
y="21.376339"
ry="14.006492" /><g
id="g17763"
style="opacity:0.2769556;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1"
inkscape:transform-center-x="-1.2719054"
inkscape:transform-center-y="-1.2220245"
transform="matrix(1.1286242,0,0,1.1286242,-4.0892676,-4.3982168)"><g
id="g17761"
transform="matrix(0.69923898,0,0,0.69923898,9.3325793,10.29016)"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1"><rect
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.91428;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="rect17757"
width="3.2538471"
height="14.88635"
x="30.488947"
y="23.89229"
ry="1.6269236" /><rect
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.91428;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="rect17759"
width="3.2766507"
height="10.920136"
x="3.4293973"
y="-58.743446"
ry="1.6269236"
inkscape:transform-center-y="1.5929503"
transform="rotate(133.35838)"
inkscape:transform-center-x="-1.6869533" /></g></g><g
id="g32999"
style="fill:#353a3d;fill-opacity:1"
inkscape:transform-center-x="-1.2719054"
inkscape:transform-center-y="-1.2220245"
transform="matrix(1.1286242,0,0,1.1286242,-4.0892676,-4.3982168)"><g
id="g33729"
transform="matrix(0.69923898,0,0,0.69923898,9.3325793,10.29016)"
style="fill:#353a3d;fill-opacity:1"><rect
style="fill:#353a3d;fill-opacity:1;stroke:none;stroke-width:1.91428;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="rect32993"
width="3.2538471"
height="14.88635"
x="30.488947"
y="23.89229"
ry="1.6269236" /><rect
style="fill:#353a3d;fill-opacity:1;stroke:none;stroke-width:1.91428;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="rect32995"
width="3.2766507"
height="10.920136"
x="3.4293973"
y="-58.743446"
ry="1.6269236"
inkscape:transform-center-y="1.5929503"
transform="rotate(133.35838)"
inkscape:transform-center-x="-1.6869533" /></g></g><g
id="g44470"><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect40748"
width="2.1857765"
height="1.8981743"
x="18.830223"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect40750"
width="2.1857765"
height="1.8981743"
x="42.873764"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect40756"
width="2.1857765"
height="1.8981743"
x="22.447657"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect40758"
width="2.1857765"
height="1.8981743"
x="46.491196"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /></g><g
id="g44490"
transform="rotate(31.072797,31.949858,35.560981)"><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44482"
width="2.1857765"
height="1.8981743"
x="18.830223"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44484"
width="2.1857765"
height="1.8981743"
x="42.873764"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44486"
width="2.1857765"
height="1.8981743"
x="22.447657"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44488"
width="2.1857765"
height="1.8981743"
x="46.491196"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /></g><g
id="g44500"
transform="rotate(59.678732,31.945314,35.562358)"><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44492"
width="2.1857765"
height="1.8981743"
x="18.830223"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44494"
width="2.1857765"
height="1.8981743"
x="42.873764"
y="34.318436"
ry="0.80296504" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44496"
width="2.1857765"
height="1.8981743"
x="22.447657"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /><rect
style="opacity:0.437632;fill:#000000;fill-opacity:1;stroke:none;stroke-width:184.065;stroke-linecap:square;stroke-opacity:1;paint-order:markers stroke fill"
id="rect44498"
width="2.1857765"
height="1.8981743"
x="46.491196"
y="-32.89397"
ry="0.80296504"
transform="rotate(90)" /></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,43 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dghmmuwu5hr8e"
path="res://.godot/imported/Timeline.svg-f58e429fe74f50d9853fd6498e486130.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/rokojori_action_library/Icons/Timeline.svg"
dest_files=["res://.godot/imported/Timeline.svg-f58e429fe74f50d9853fd6498e486130.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@ -5,58 +5,17 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System; using System;
using System.Data; using System.Data;
#if ! ROKOJORI_ACTION_CORE
using Rokojori.Tools; using Rokojori.Tools;
#endif
namespace Rokojori namespace Rokojori
{ {
#if ! TOOLS #if ! TOOLS
[Tool]
public partial class RokojoriPlugin:Node
{
#if ROKOJORI_ACTION_CORE }
[Tool][RokojoriActionCoreExport] #else
public partial class RokojoriPlugin:EditorPlugin
{
#if ROKOJORI_ACTION_CORE_GD
public static readonly string _path = "res://addons/rokojori_action_code_gd";
#else
public static readonly string _path = "res://addons/rokojori_action_code_cs";
#endif
public static string Path( string path )
{
return RokojoriPlugin._path + "/" + path;
}
public static string GlobalizedPath( string path )
{
return ProjectSettings.GlobalizePath( Path( path ) );
}
static readonly string RokojoriRootAutoLoad = "RokojoriRootAutoLoad";
#if ROKOJORI_ACTION_CORE_GD
public static readonly string RokojoriRootAutoLoadPath = Path( "Runtime/Godot/RJ_Root.cs" );
#else
public static readonly string RokojoriRootAutoLoadPath = Path( "Runtime/Godot/Root.cs" );
#endif
public override void _EnablePlugin()
{
AddAutoloadSingleton( RokojoriRootAutoLoad, RokojoriRootAutoLoadPath );
}
public override void _DisablePlugin()
{
RemoveAutoloadSingleton( RokojoriRootAutoLoad );
}
}
#endif
#elif ! ROKOJORI_ACTION_CORE
[Tool] [Tool]
public partial class RokojoriPlugin: EditorPlugin public partial class RokojoriPlugin: EditorPlugin
{ {
@ -150,9 +109,12 @@ namespace Rokojori
} }
static readonly string ProblemsExplorerPath = "res://addons/rokojori_action_library/Tools/Messages/Messages.tscn";
static Control messages;
public override void _EnterTree() public override void _EnterTree()
{ {
// _instance = this;
EnsureHiddenProjectPath( RokojoriProjectInternalPath ); EnsureHiddenProjectPath( RokojoriProjectInternalPath );
EnsureHiddenProjectPath( RokojoriSettingsPath ); EnsureHiddenProjectPath( RokojoriSettingsPath );
@ -164,12 +126,39 @@ namespace Rokojori
inspectorTools.rokojoriPlugin = this; inspectorTools.rokojoriPlugin = this;
inspectorTools.AddPlugins(); inspectorTools.AddPlugins();
// var pePackedScene = GD.Load<PackedScene>( ProblemsExplorerPath );
// if ( pePackedScene != null )
// {
// // this.LogInfo( "Problems Explorer found: ", pePackedScene );
// messages = ((PackedScene)pePackedScene).Instantiate<Control>();
// var ui = messages.Get<UI>();
// ui.BindOwnChildren();
// var shortCut = new Shortcut();
// shortCut.Events = [ new InputEventKey{ CtrlPressed = true, Keycode = Key.U } ];
// AddControlToDock( DockSlot.RightBr, messages, shortCut );
// }
// else
// {
// this.LogInfo( "Problems Explorer not found: ", ProblemsExplorerPath );
// }
} }
public override void _ExitTree() public override void _ExitTree()
{ {
this.LogInfo(); this.LogInfo();
if ( messages != null )
{
RemoveControlFromDocks( messages );
}
RemoveNode3DGizmoPlugin( gizmoDrawerPlugin ); RemoveNode3DGizmoPlugin( gizmoDrawerPlugin );
inspectorTools.rokojoriPlugin = this; inspectorTools.rokojoriPlugin = this;
@ -245,6 +234,10 @@ namespace Rokojori
editingScene.ForEach<IAssemblyReload>( ar => ar.OnAssemblyReloaded() ); editingScene.ForEach<IAssemblyReload>( ar => ar.OnAssemblyReloaded() );
if ( messages != null )
{
messages.ForEach<IAssemblyReload>( ar => ar.OnAssemblyReloaded() );
}
} }
} }

View File

@ -3,19 +3,13 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Action.svg")] [GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Action.svg")]
[RokojoriActionCoreExport] [RokojoriActionCoreExport]
public abstract partial class Action : NetworkNode public partial class Action : NetworkNode
{ {
#if ROKOJORI_ACTION_CORE
protected int networkSeed => 0;
#endif
public enum ActionTriggerMode public enum ActionTriggerMode
{ {
Only_When_Processing_In_Hierarchy, Only_When_Processing_In_Hierarchy,
@ -39,7 +33,7 @@ public abstract partial class Action : NetworkNode
#endif #endif
[ExportToolButton( "Trigger Action in Editor")] [ExportToolButton( "Trigger Action in Editor")]
public Callable triggerActionButton => Callable.From( ()=> Trigger() ); public Callable TriggerActionButton => Callable.From( ()=> Trigger() );
#if !ROKOJORI_ACTION_CORE #if !ROKOJORI_ACTION_CORE
@ -200,7 +194,7 @@ public abstract partial class Action : NetworkNode
return _sendingNetworkSeed; return _sendingNetworkSeed;
} }
_sendingNetworkSeed = GodotRandom.Get().IntegerExclusiveInRange( 0, maxNetworkSeed ); _sendingNetworkSeed = GodotRandom.Get().IntegerExclusive( 0, maxNetworkSeed );
_sendsSeed = true; _sendsSeed = true;
return _sendingNetworkSeed; return _sendingNetworkSeed;

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
/** <summary> /** <summary>

View File

@ -2,34 +2,33 @@
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
[RokojoriActionCoreExport]
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ActionReference.svg")]
public partial class ActionReference : Action
{ {
[Export] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ActionReference.svg")]
public Action referencedAction; public partial class ActionReference : Action
[ExportToolButton( "Set Reference Name" )]
public Callable setReferencedNameButton => Callable.From(
()=>
{
if ( referencedAction == null )
{
this.Name = "* (nothing)";
}
else
{
this.Name = "* " + referencedAction.Name;
}
}
);
protected override void _OnTrigger()
{ {
Action.TriggerSafe( referencedAction ); [Export]
} public Action referencedAction;
}
[ExportToolButton( "Set Reference Name" )]
public Callable setReferencedNameButton => Callable.From(
()=>
{
if ( referencedAction == null )
{
this.Name = "* (nothing)";
}
else
{
this.Name = "* " + referencedAction.Name;
}
}
);
protected override void _OnTrigger()
{
Action.TriggerSafe( referencedAction );
}
}
}

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]
@ -20,11 +19,11 @@ public partial class MusicChannelPlayer:Node
public void TweenVolume( AudioStreamPlayer target, float duration, float toVolume, bool clear, System.Action onReady = null ) public void TweenVolume( AudioStreamPlayer target, float duration, float toVolume, bool clear, System.Action onReady = null )
{ {
var tl = TimelineManager.Ensure( null ); var tl = TimeLineManager.Ensure( null );
var start = tl.position; var start = tl.position;
var fromVolume = target.VolumeLinear; var fromVolume = target.VolumeLinear;
TimelineManager.ScheduleSpanIn( tl, 0, duration, TimeLineManager.ScheduleSpanIn( tl, 0, duration,
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( target ) ) if ( ! GodotObject.IsInstanceValid( target ) )
@ -35,7 +34,7 @@ public partial class MusicChannelPlayer:Node
var lerpedVolume = Mathf.Lerp( fromVolume, toVolume, span.phase ); var lerpedVolume = Mathf.Lerp( fromVolume, toVolume, span.phase );
target.VolumeLinear = lerpedVolume; target.VolumeLinear = lerpedVolume;
if ( type == TimelineSpanUpdateType.End && clear ) if ( type == TimeLineSpanUpdateType.End && clear )
{ {
if ( clear ) if ( clear )
{ {
@ -72,7 +71,7 @@ public partial class MusicChannelPlayer:Node
this.LogInfo( "Playing:", nextMusic ); this.LogInfo( "Playing:", nextMusic );
var name = nextMusic.audio.ResourcePath.ExtractFileName(); var name = FilePath.Absolute( nextMusic.audio.ResourcePath ).fileName;
var nextPlayer = this.CreateChild<AudioStreamPlayer>( "Player " + name ); var nextPlayer = this.CreateChild<AudioStreamPlayer>( "Player " + name );
nextPlayer.VolumeLinear = 0f; nextPlayer.VolumeLinear = 0f;
nextPlayer.Stream = nextMusic.audio; nextPlayer.Stream = nextMusic.audio;

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]
@ -20,8 +19,7 @@ public partial class MusicData: Resource
public override string ToString() public override string ToString()
{ {
var prefix = pitchSemitonesOffset == 0 ? "+/-" : pitchSemitonesOffset > 0 ? "+" : ""; var prefix = pitchSemitonesOffset == 0 ? "+/-" : pitchSemitonesOffset > 0 ? "+" : "";
var volumeString = ( int) ( 100 * volume); return "MusicData: " + (100 * volume)._FF() + "% (" + prefix + pitchSemitonesOffset + " st) " + audio.ResourcePath;
return "MusicData: " + volumeString+ "% (" + prefix + pitchSemitonesOffset + " st) " + audio.ResourcePath;
} }
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass] [Tool][GlobalClass]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -32,7 +31,7 @@ namespace Rokojori
public bool cacheEndPositionOnStart = true; public bool cacheEndPositionOnStart = true;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -42,7 +41,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -58,7 +57,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( target ) ) if ( ! GodotObject.IsInstanceValid( target ) )
@ -81,7 +80,7 @@ namespace Rokojori
target.VolumeDb = lerpedVolume; target.VolumeDb = lerpedVolume;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass] [Tool][GlobalClass]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -36,7 +35,7 @@ namespace Rokojori
{ {
_isCoolingDown = coolDownDuration != null; _isCoolingDown = coolDownDuration != null;
var te = TimelineManager.ScheduleEventIn( var te = TimeLineManager.ScheduleEventIn(
coolDownDuration.timeLine, coolDownDuration.timeLine,
coolDownDuration.GetDurationInSeconds(), coolDownDuration.GetDurationInSeconds(),
ev => ev =>

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori; namespace Rokojori;
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]
@ -22,7 +21,7 @@ namespace Rokojori
return; return;
} }
iterationIndex = MathX.RepeatInt( iterationIndex, num ); iterationIndex = MathX.Repeat( iterationIndex, num );
Action.TriggerSafe( this.GetNthDirectChild<Action>( iterationIndex ) ); Action.TriggerSafe( this.GetNthDirectChild<Action>( iterationIndex ) );

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass] [Tool][GlobalClass]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")]
@ -21,7 +20,7 @@ namespace Rokojori
void SetNodeState() void SetNodeState()
{ {
NodeState.ConfigureWith( target, configuration ); NodeState.Configure( target, configuration );
} }
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")]
@ -61,7 +60,7 @@ namespace Rokojori
var enbled = state == PhysicsState.Physics_Enabled; var enbled = state == PhysicsState.Physics_Enabled;
var trillian = enbled ? Trillean.True : Trillean.False; var trillian = enbled ? Trillean.True : Trillean.False;
NodeState.PartialConfigure( physicsBody, NodeState.Configure( physicsBody,
trillian, trillian, trillian, trillian, trillian, trillian,
trillian, Trillean.Any, false, ProcessModeEnum.Inherit ); trillian, Trillean.Any, false, ProcessModeEnum.Inherit );

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]
@ -37,8 +36,8 @@ namespace Rokojori
var startPosition = target.GlobalPosition; var startPosition = target.GlobalPosition;
_currentSpanAnimationID = TimelineManager.ScheduleSpanIn( duration.timeLine, 0, duration.GetDurationInSeconds(), _currentSpanAnimationID = TimeLineManager.ScheduleSpanIn( duration.timeLine, 0, duration.GetDurationInSeconds(),
( TimelineSpan span, TimelineSpanUpdateType type )=> ( TimeLineSpan span, TimeLineSpanUpdateType type )=>
{ {
if ( span.id != _currentSpanAnimationID ) if ( span.id != _currentSpanAnimationID )
{ {
@ -53,7 +52,7 @@ namespace Rokojori
target.GlobalPosition = startPosition.Lerp( goal.GlobalPosition, span.phase );; target.GlobalPosition = startPosition.Lerp( goal.GlobalPosition, span.phase );;
if ( TimelineSpanUpdateType.End == type ) if ( TimeLineSpanUpdateType.End == type )
{ {
AnimationManager.EndAnimation( this, target, AnimationMember.Position ); AnimationManager.EndAnimation( this, target, AnimationMember.Position );

View File

@ -1,7 +1,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using Godot; using Godot;
using Rokojori; using Rokojori;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -94,7 +93,7 @@ namespace Rokojori
return; return;
} }
var tm = Unique<TimelineManager>.Get(); var tm = Unique<TimeLineManager>.Get();
if ( tm == null ) if ( tm == null )
{ {
@ -130,7 +129,7 @@ namespace Rokojori
return; return;
} }
var tm = Unique<TimelineManager>.Get(); var tm = Unique<TimeLineManager>.Get();
if ( tm == null ) if ( tm == null )
{ {

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/PlayParticles.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/PlayParticles.svg")]
@ -18,7 +17,7 @@ namespace Rokojori
public float godotFinishedReporingBugOffset = 0.2f; public float godotFinishedReporingBugOffset = 0.2f;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
List<GpuParticles3D> _pool = new List<GpuParticles3D>(); List<GpuParticles3D> _pool = new List<GpuParticles3D>();
List<bool> _emitting = new List<bool>(); List<bool> _emitting = new List<bool>();
@ -61,7 +60,7 @@ namespace Rokojori
return; return;
} }
TimelineManager.ScheduleEventIn( TimeLineManager.ScheduleEventIn(
timeLine, timeLine,
godotFinishedReporingBugOffset, godotFinishedReporingBugOffset,
t => _emitting[ index ] = false t => _emitting[ index ] = false

View File

@ -2,10 +2,8 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[RokojoriActionCoreExport]
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/PlaySound.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/PlaySound.svg")]
public partial class PlaySound:Action public partial class PlaySound:Action
{ {
@ -50,7 +48,7 @@ namespace Rokojori
public bool generatePools = true; public bool generatePools = true;
List<AudioStreamPlayer3D> players = []; List<AudioStreamPlayer3D> players = new List<AudioStreamPlayer3D>();
AudioStreamPlayer3D _cached = null; AudioStreamPlayer3D _cached = null;
@ -128,7 +126,7 @@ namespace Rokojori
var length = player.Stream.GetLength(); var length = player.Stream.GetLength();
var numOffsets = Mathf.FloorToInt( length / durationPerSound.GetDurationInSeconds() ); var numOffsets = Mathf.FloorToInt( length / durationPerSound.GetDurationInSeconds() );
var randomIndex = random.IntegerExclusivePositive( numOffsets ); var randomIndex = random.IntegerExclusive( numOffsets );
offset = randomIndex * durationPerSound.GetDurationInSeconds(); offset = randomIndex * durationPerSound.GetDurationInSeconds();
// this.LogInfo( "Offset", numOffsets, randomIndex, offset ); // this.LogInfo( "Offset", numOffsets, randomIndex, offset );
@ -145,12 +143,12 @@ namespace Rokojori
if ( audioManager != null && randomizePlaybackPosition ) if ( audioManager != null && randomizePlaybackPosition )
{ {
var tl = TimelineManager.Ensure( durationPerSound.timeLine ); var tl = TimeLineManager.Ensure( durationPerSound.timeLine );
var start = tl.position; var start = tl.position;
var stopDuration = ( durationPerSound.GetDurationInSeconds() - audioManager.data.bufferCutDuration * cutBufferLengths ) / player.PitchScale; var stopDuration = ( durationPerSound.GetDurationInSeconds() - audioManager.data.bufferCutDuration * cutBufferLengths ) / player.PitchScale;
TimelineManager.ScheduleSpanIn( durationPerSound.timeLine, 0, stopDuration, TimeLineManager.ScheduleSpanIn( durationPerSound.timeLine, 0, stopDuration,
( span, type )=> ( span, type )=>
{ {
var timeNow = tl.position; var timeNow = tl.position;
@ -158,7 +156,7 @@ namespace Rokojori
var phase = span.phase; var phase = span.phase;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
player.Stop(); player.Stop();
player.Playing = false; player.Playing = false;

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass, Tool ] [GlobalClass, Tool ]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -34,7 +33,7 @@ namespace Rokojori
public bool cacheEndVolumeOnStart = true; public bool cacheEndVolumeOnStart = true;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
public void OnAnimatorStart(){} public void OnAnimatorStart(){}
@ -70,7 +69,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -96,7 +95,7 @@ namespace Rokojori
AnimationManager.StartAnimation( this, target, AnimationMember.VolumeDB ); AnimationManager.StartAnimation( this, target, AnimationMember.VolumeDB );
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! AnimationManager.IsAnimating( this, target, AnimationMember.VolumeDB ) ) if ( ! AnimationManager.IsAnimating( this, target, AnimationMember.VolumeDB ) )
@ -120,7 +119,7 @@ namespace Rokojori
// this.LogInfo( "Volume", lerpedVolume ); // this.LogInfo( "Volume", lerpedVolume );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );

View File

@ -2,23 +2,22 @@
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
[RokojoriActionCoreExport]
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
public partial class OnPhysicsProcess : Node
{ {
/** <summary for="field actions">Actions to execute</summary>*/ [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
[Export] public partial class OnPhysicsProcess : Node
public Action[] actions = new Action[ 0 ];
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
public override void _PhysicsProcess( double delta )
{ {
Action.TriggerAllActions( actions, this, triggerDirectChildren ); /** <summary for="field actions">Actions to execute</summary>*/
[Export]
public Action[] actions = new Action[ 0 ];
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
public override void _PhysicsProcess( double delta )
{
Action.TriggerAllActions( actions, this, triggerDirectChildren );
}
} }
} }

View File

@ -2,31 +2,30 @@
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
[RokojoriActionCoreExport]
[GlobalClass, Tool, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
public partial class OnProcess : Node
{ {
/** <summary for="field actions">Actions to execute</summary>*/ [GlobalClass, Tool, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
[Export] public partial class OnProcess : Node
public Action[] actions = new Action[ 0 ];
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
[Export]
public bool executeInEditor = false;
public override void _Process( double delta )
{ {
if ( Engine.IsEditorHint() && ! executeInEditor ) /** <summary for="field actions">Actions to execute</summary>*/
{ [Export]
return; public Action[] actions = new Action[ 0 ];
}
Action.TriggerAllActions( actions, this, triggerDirectChildren ); /** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
[Export]
public bool executeInEditor = false;
public override void _Process( double delta )
{
if ( Engine.IsEditorHint() && ! executeInEditor )
{
return;
}
Action.TriggerAllActions( actions, this, triggerDirectChildren );
}
} }
} }

View File

@ -2,38 +2,30 @@
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
[RokojoriActionCoreExport]
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
public partial class OnReady : Node
{ {
/** <summary for="field actions">Actions to execute</summary>*/ [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
[Export] public partial class OnReady : Node
public Action[] actions = new Action[ 0 ];
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
[Export]
public bool triggerInsideEditor = false;
public Action.ActionTriggerMode additionalMode = Action.ActionTriggerMode.Always;
public Trillean someTrillean = Trillean.False;
public override void _Ready()
{ {
additionalMode = Action.ActionTriggerMode.Only_When_Processing_In_Hierarchy; /** <summary for="field actions">Actions to execute</summary>*/
[Export]
public Action[] actions = new Action[ 0 ];
var nas = Trillean.Any; /** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
[Export]
public bool triggerDirectChildren = true;
if ( Engine.IsEditorHint() && ! triggerInsideEditor ) [Export]
public bool triggerInsideEditor = false;
public override void _Ready()
{ {
return; if ( Engine.IsEditorHint() && ! triggerInsideEditor )
} {
return;
}
Action.TriggerAllActions( actions, this, triggerDirectChildren ); Action.TriggerAllActions( actions, this, triggerDirectChildren );
}
} }
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -67,10 +66,10 @@ namespace Rokojori
if ( _eventID != -1 ) if ( _eventID != -1 )
{ {
TimelineManager.RemoveEvent( timeLine, _eventID ); TimeLineManager.RemoveEvent( timeLine, _eventID );
} }
var tle = TimelineManager.ScheduleLoopEvent( timeLine, duration, offset, tle => Action.TriggerSafe( action ) ); var tle = TimeLineManager.ScheduleLoopEvent( timeLine, duration, offset, tle => Action.TriggerSafe( action ) );
_eventID = tle.id; _eventID = tle.id;
} }
@ -84,7 +83,7 @@ namespace Rokojori
} }
TimelineManager.RemoveEvent( timeLine, _eventID ); TimeLineManager.RemoveEvent( timeLine, _eventID );
_eventID = -1; _eventID = -1;

View File

@ -3,7 +3,6 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Godot.Collections; using Godot.Collections;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[GlobalClass,Tool] [GlobalClass,Tool]

View File

@ -2,16 +2,15 @@
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
[RokojoriActionCoreExport]
[Tool][GlobalClass]
public partial class QuitApp : Action
{ {
protected override void _OnTrigger() [Tool][GlobalClass]
public partial class QuitApp : Action
{ {
this.LogInfo( "Quitting" ); protected override void _OnTrigger()
GetTree().Quit(); {
this.LogInfo( "Quitting" );
GetTree().Quit();
}
} }
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass] [Tool][GlobalClass]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Threading.Tasks; using System.Threading.Tasks;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/RemoveNode.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/RemoveNode.svg")]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Parallel.svg") ] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Parallel.svg") ]
@ -31,36 +30,31 @@ namespace Rokojori
public bool errorsCountAsFinished = false; public bool errorsCountAsFinished = false;
Dictionary<int,int> numFinished = new Dictionary<int, int>();
Dictionary<int,bool> running = new Dictionary<int, bool>();
protected override void _OnTrigger() protected override void _OnTrigger()
{ {
var allActions = new List<Action>( this.actions ); var actions = new List<Action>( this.actions );
if ( triggerDirectChildren ) if ( triggerDirectChildren )
{ {
Nodes.ForEachDirectChild<Action>( this, a => allActions.Add( a ) ); Nodes.ForEachDirectChild<Action>( this, a => actions.Add( a ) );
} }
var sequenceActions = ListExtensions.FilterType<Action,SequenceAction>( allActions); var sequenceActions = Lists.FilterAndMap( actions, ( a, i ) => a is SequenceAction, a => (SequenceAction) a );
var sequenceID = DispatchStart(); var sequenceID = DispatchStart();
if ( ! ignoreNonSequenceActions && sequenceActions.Count != allActions.Count && Mode.First_Finishes_Sequence == mode ) if ( ! ignoreNonSequenceActions && sequenceActions.Count != actions.Count && Mode.First_Finishes_Sequence == mode )
{ {
allActions.ForEach( a => Action.TriggerSafe( a ) ); actions.ForEach( a => Action.TriggerSafe( a ) );
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
return; return;
} }
numFinished[ sequenceID ] = 0;
running[ sequenceID ] = true;
// var numFinished = 0; var numFinished = 0;
// var running = true; var running = true;
sequenceActions.ForEach( sequenceActions.ForEach(
sa => sa =>
@ -70,27 +64,27 @@ namespace Rokojori
{ {
// this.LogInfo( "Sequence Action finished:", HierarchyName.Of( sa ) ); // this.LogInfo( "Sequence Action finished:", HierarchyName.Of( sa ) );
if ( ! running.ContainsKey( sequenceID ) ) if ( ! running )
{ {
return; return;
} }
if ( fe.success || errorsCountAsFinished ) if ( fe.success || errorsCountAsFinished )
{ {
numFinished[ sequenceID ] = numFinished[ sequenceID ] + 1; numFinished ++;
if ( Mode.First_Finishes_Sequence == mode ) if ( Mode.First_Finishes_Sequence == mode )
{ {
running.Remove( sequenceID ); running = false;
// this.LogInfo( "DispatchEnd for First_Finishes_Sequence" ); // this.LogInfo( "DispatchEnd for First_Finishes_Sequence" );
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }
else if ( Mode.Wait_For_All_To_Finish == mode ) else if ( Mode.Wait_For_All_To_Finish == mode )
{ {
if ( numFinished[ sequenceID ] == sequenceActions.Count ) if ( numFinished == sequenceActions.Count )
{ {
running.Remove( sequenceID ); running = false;
// this.LogInfo( "DispatchEnd for Wait_For_All_To_Finish" ); // this.LogInfo( "DispatchEnd for Wait_For_All_To_Finish" );
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }
@ -98,7 +92,7 @@ namespace Rokojori
} }
else else
{ {
running.Remove( sequenceID ); running = false;
// this.LogInfo( "DispatchCancelled for Wait_For_All_To_Finish" ); // this.LogInfo( "DispatchCancelled for Wait_For_All_To_Finish" );
DispatchCancelled( sequenceID ); DispatchCancelled( sequenceID );
} }
@ -107,7 +101,7 @@ namespace Rokojori
} }
); );
allActions.ForEach( a => Action.TriggerSafe( a ) ); actions.ForEach( a => Action.TriggerSafe( a ) );
} }
} }
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
@ -20,7 +19,7 @@ namespace Rokojori
public float maxRepeatDuration = 60; public float maxRepeatDuration = 60;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
bool stopSignal = false; bool stopSignal = false;
@ -44,7 +43,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
if ( maxNumRepeats <= 0 && ( tl == null || maxRepeatDuration <= 0 ) ) if ( maxNumRepeats <= 0 && ( tl == null || maxRepeatDuration <= 0 ) )
{ {
@ -64,7 +63,7 @@ namespace Rokojori
public class RepeatSequenceRunner public class RepeatSequenceRunner
{ {
public RepeatSequence repeatSequence; public RepeatSequence repeatSequence;
public Timeline timeLine; public TimeLine timeLine;
public int sequenceID; public int sequenceID;
public int maxRepeats = 0; public int maxRepeats = 0;
public int started = 0; public int started = 0;
@ -75,7 +74,7 @@ namespace Rokojori
{ {
this.repeatSequence = repeatSequence; this.repeatSequence = repeatSequence;
this.sequenceID = id; this.sequenceID = id;
timeLine = TimelineManager.Ensure( repeatSequence.timeLine ); timeLine = TimeLineManager.Ensure( repeatSequence.timeLine );
startTime = timeLine.position; startTime = timeLine.position;
endTime = startTime + repeatSequence.maxRepeatDuration; endTime = startTime + repeatSequence.maxRepeatDuration;
maxRepeats = repeatSequence.maxNumRepeats; maxRepeats = repeatSequence.maxNumRepeats;

View File

@ -6,7 +6,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
@ -228,7 +227,7 @@ namespace Rokojori
Nodes.ForEachDirectChild<Action>( this, a => run.actions.Add( a ) ); Nodes.ForEachDirectChild<Action>( this, a => run.actions.Add( a ) );
} }
run.sequencables = ListExtensions.FilterType<Action,SequenceAction>( run.actions ); run.sequencables = Lists.FilterType<Action,SequenceAction>( run.actions );

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
@ -12,6 +11,12 @@ namespace Rokojori
[RokojoriActionCoreExport] [RokojoriActionCoreExport]
public abstract partial class SequenceAction : Action public abstract partial class SequenceAction : Action
{ {
public class FinishedEvent
{
public int id;
public bool success;
}
[ExportGroup("Debugging")] [ExportGroup("Debugging")]
[ExportToolButton("Clear Listeners")] [ExportToolButton("Clear Listeners")]
public Callable clearListeners => Callable.From( public Callable clearListeners => Callable.From(
@ -36,13 +41,10 @@ namespace Rokojori
return _dispatchCounter; return _dispatchCounter;
} }
public readonly EventSlot<SequenceActionFinishedEvent> onSequenceDone = new EventSlot<SequenceActionFinishedEvent>(); public readonly EventSlot<SequenceAction.FinishedEvent> onSequenceDone = new EventSlot<SequenceAction.FinishedEvent>();
public int DispatchStart() public int DispatchStart()
{ {
_dispatchCounter ++; _dispatchCounter ++;
if ( showRunningSequences ) if ( showRunningSequences )
@ -59,7 +61,7 @@ namespace Rokojori
{ {
_running.Remove( id ); _running.Remove( id );
var ev = new SequenceActionFinishedEvent{ id = id, success = true }; var ev = new SequenceAction.FinishedEvent{ id = id, success = true };
onSequenceDone.DispatchEvent( ev ); onSequenceDone.DispatchEvent( ev );
if ( showRunningSequences ) if ( showRunningSequences )
@ -74,7 +76,7 @@ namespace Rokojori
{ {
_running.Remove( id ); _running.Remove( id );
var ev = new SequenceActionFinishedEvent{ id = id, success = true }; var ev = new SequenceAction.FinishedEvent{ id = id, success = true };
onSequenceDone.DispatchEvent( ev ); onSequenceDone.DispatchEvent( ev );
if ( showRunningSequences ) if ( showRunningSequences )
@ -87,10 +89,14 @@ namespace Rokojori
public virtual void CancelAllRunning() public virtual void CancelAllRunning()
{ {
foreach ( var r in _running ) var runningList = _running.ToArray();
{
CancelAction( r ); runningList.ForEach(
} ( id )=>
{
CancelAction( id );
}
);
} }
public virtual void CancelAction( int id ) public virtual void CancelAction( int id )

View File

@ -1,13 +0,0 @@
using Godot;
using System.Collections.Generic;
using System.Linq;
using Rokojori.Extensions;
namespace Rokojori;
public class SequenceActionFinishedEvent
{
public int id;
public bool success;
}

View File

@ -1 +0,0 @@
uid://k3685pvc4n6h

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SequenceActionReference.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SequenceActionReference.svg")]
@ -36,7 +35,7 @@ namespace Rokojori
var ownID = DispatchStart(); var ownID = DispatchStart();
var referenceID = -1; var referenceID = -1;
System.Action<SequenceActionFinishedEvent> callback = ( se )=> System.Action<SequenceAction.FinishedEvent> callback = ( se )=>
{ {
if ( se.id != referenceID ) if ( se.id != referenceID )
{ {

View File

@ -6,187 +6,187 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions; namespace Rokojori
namespace Rokojori;
public class SequenceRunner
{ {
public Sequence sequence; public class SequenceRunner
public List<Action> actions;
public List<SequenceAction> sequencables;
public int sequencablesIndex = 0;
bool cancelled = false;
bool cancelledSequence = false;
int _runID = -1;
SequenceAction _runningAction;
int _runningActionID = -1;
public void Cancel()
{ {
if ( cancelled || _runningAction == null ) public Sequence sequence;
public List<Action> actions;
public List<SequenceAction> sequencables;
public int sequencablesIndex = 0;
bool cancelled = false;
bool cancelledSequence = false;
int _runID = -1;
SequenceAction _runningAction;
int _runningActionID = -1;
public void Cancel()
{ {
return; if ( cancelled || _runningAction == null )
}
cancelled = true;
_runningAction.CancelAction( _runningActionID );
}
void CancelRun()
{
if ( cancelledSequence )
{
return;
}
if ( ! cancelled )
{
cancelled = true;
}
cancelledSequence = true;
sequence.DispatchCancelled( _runID );
sequence.ClearRun( this );
}
public void ProcessNext()
{
// RJLog.Log( "@" + sequence.Name, "Index:", sequencablesIndex );
if ( sequencablesIndex == 0 )
{
_runID = sequence.DispatchStart();
if ( sequencables.Count == 0 )
{ {
actions.ForEach( a => Action.TriggerSafe( a ) ); return;
}
cancelled = true;
_runningAction.CancelAction( _runningActionID );
}
void CancelRun()
{
if ( cancelledSequence )
{
return;
}
if ( ! cancelled )
{
cancelled = true;
}
cancelledSequence = true;
sequence.DispatchCancelled( _runID );
sequence.ClearRun( this );
}
public void ProcessNext()
{
// RJLog.Log( "@" + sequence.Name, "Index:", sequencablesIndex );
if ( sequencablesIndex == 0 )
{
_runID = sequence.DispatchStart();
if ( sequencables.Count == 0 )
{
actions.ForEach( a => Action.TriggerSafe( a ) );
sequence.DispatchEnd( _runID );
sequence.ClearRun( this );
return;
}
}
if ( sequencablesIndex >= sequencables.Count )
{
TriggerAllAfter( sequencables[ sequencables.Count -1 ] );
sequence.DispatchEnd( _runID ); sequence.DispatchEnd( _runID );
sequence.ClearRun( this ); sequence.ClearRun( this );
return; return;
} }
}
if ( sequencablesIndex >= sequencables.Count ) if ( cancelled )
{
TriggerAllAfter( sequencables[ sequencables.Count -1 ] );
sequence.DispatchEnd( _runID );
sequence.ClearRun( this );
return;
}
if ( cancelled )
{
CancelRun();
return;
}
var sequenceAction = sequencables[ sequencablesIndex ];
StartAction( sequenceAction );
}
Dictionary<SequenceAction,System.Action<SequenceActionFinishedEvent>> callbacks =
new Dictionary<SequenceAction, System.Action<SequenceActionFinishedEvent>>();
void StartAction( SequenceAction action )
{
var capturedAction = action;
System.Action<SequenceActionFinishedEvent> callback =
( SequenceActionFinishedEvent ev ) =>
{ {
CancelRun();
return;
}
//RJLog.Log( "On Done", id, success ); var sequenceAction = sequencables[ sequencablesIndex ];
StartAction( sequenceAction );
}
if ( ev.id != _runningActionID ) Dictionary<SequenceAction,System.Action<SequenceAction.FinishedEvent>> callbacks =
new Dictionary<SequenceAction, System.Action<SequenceAction.FinishedEvent>>();
void StartAction( SequenceAction action )
{
var capturedAction = action;
System.Action<SequenceAction.FinishedEvent> callback =
( SequenceAction.FinishedEvent ev ) =>
{
//RJLog.Log( "On Done", id, success );
if ( ev.id != _runningActionID )
{
// RJLog.Error( "Invalid ID", id, "!=", _runningActionID );
return;
}
_runningActionID = -1;
if ( ev.success )
{
sequencablesIndex ++;
ProcessNext();
}
else
{
sequence.DispatchCancelled( _runID );
sequence.ClearRun( this );
}
var callbackReference = callbacks[ capturedAction ];
capturedAction.onSequenceDone.RemoveAction( callbackReference );
callbacks.Remove( capturedAction );
};
RunNext( action, callback );
/*
_runningAction = action;
callbacks[ _runningAction ] = callback;
_runningAction.OnSequenceDone += callback;
TriggerAllBefore( _runningAction );
Action.Trigger( _runningAction );
_runningActionID = _runningAction.GetLastSequenceActionID();
*/
}
void RunNext( SequenceAction action, System.Action<SequenceAction.FinishedEvent> callback )
{
_runningAction = action;
callbacks[ _runningAction ] = callback;
_runningAction.onSequenceDone.AddAction( callback );
TriggerAllBefore( _runningAction );
Action.TriggerSafe( _runningAction );
_runningActionID = _runningAction.GetLastSequenceActionID();
}
void TriggerAllBefore( SequenceAction action )
{
var actionIndex = actions.IndexOf( action );
for ( int i = actionIndex - 1; i >= 0; i -- )
{
if ( typeof( SequenceAction ).IsAssignableFrom( actions[ i ].GetType() ) )
{ {
// RJLog.Error( "Invalid ID", id, "!=", _runningActionID );
return; return;
} }
_runningActionID = -1; // RJLog.Log( _runID, "Triggering Actions Before", i, actions[ i ].Name, HierarchyName.Of( action ) );
if ( ev.success ) Action.TriggerSafe( actions[ i ] );
{
sequencablesIndex ++;
ProcessNext();
}
else
{
sequence.DispatchCancelled( _runID );
sequence.ClearRun( this );
}
var callbackReference = callbacks[ capturedAction ];
capturedAction.onSequenceDone.RemoveAction( callbackReference );
callbacks.Remove( capturedAction );
};
RunNext( action, callback );
/*
_runningAction = action;
callbacks[ _runningAction ] = callback;
_runningAction.OnSequenceDone += callback;
TriggerAllBefore( _runningAction );
Action.Trigger( _runningAction );
_runningActionID = _runningAction.GetLastSequenceActionID();
*/
}
void RunNext( SequenceAction action, System.Action<SequenceActionFinishedEvent> callback )
{
_runningAction = action;
callbacks[ _runningAction ] = callback;
_runningAction.onSequenceDone.AddAction( callback );
TriggerAllBefore( _runningAction );
Action.TriggerSafe( _runningAction );
_runningActionID = _runningAction.GetLastSequenceActionID();
}
void TriggerAllBefore( SequenceAction action )
{
var actionIndex = actions.IndexOf( action );
for ( int i = actionIndex - 1; i >= 0; i -- )
{
if ( TypeTools.IsOfType<SequenceAction>( actions[ i ] ) )
{
return;
} }
// RJLog.Log( _runID, "Triggering Actions Before", i, actions[ i ].Name, HierarchyName.Of( action ) );
Action.TriggerSafe( actions[ i ] );
} }
} void TriggerAllAfter( SequenceAction action )
void TriggerAllAfter( SequenceAction action )
{
var actionIndex = actions.IndexOf( action );
for ( int i = actionIndex + 1; i < actions.Count; i ++ )
{ {
if ( TypeTools.IsOfType<SequenceAction>( actions[ i ] ) ) var actionIndex = actions.IndexOf( action );
for ( int i = actionIndex + 1; i < actions.Count; i ++ )
{ {
return; if ( typeof( SequenceAction ).IsAssignableFrom( actions[ i ].GetType() ) )
{
return;
}
// RJLog.Log( "Triggering Action", actions[ i ].Name );
Action.TriggerSafe( actions[ i ] );
} }
// RJLog.Log( "Triggering Action", actions[ i ].Name );
Action.TriggerSafe( actions[ i ] );
} }
}
}
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Parallel.svg") ] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Parallel.svg") ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using System.Linq;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass ] [Tool][GlobalClass ]
@ -39,7 +38,7 @@ namespace Rokojori
} }
var configuration = soloNode == n ? soloConfig : muteConfig; var configuration = soloNode == n ? soloConfig : muteConfig;
NodeState.ConfigureWith( n, configuration ); NodeState.Configure( n, configuration );
} }
); );
} }

View File

@ -2,10 +2,8 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[RokojoriActionCoreExport]
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Delay.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Delay.svg")]
public partial class Delay : SequenceAction public partial class Delay : SequenceAction
{ {
@ -13,7 +11,7 @@ namespace Rokojori
public float duration; public float duration;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -24,13 +22,13 @@ namespace Rokojori
if ( Engine.IsEditorHint() ) if ( Engine.IsEditorHint() )
{ {
TimelineManager.ScheduleSpanIn(timeLine, 0, duration, TimeLineManager.ScheduleSpanIn( timeLine, 0, duration ,
( span, type )=> ( span, type )=>
{ {
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
this.LogInfo( "time:", Godot.Time.GetTicksMsec() / 1000f ); this.LogInfo( "time:", Time.GetTicksMsec() / 1000f );
} }
}, },
this this
@ -38,7 +36,7 @@ namespace Rokojori
} }
else else
{ {
var eventID = TimelineManager.ScheduleEventIn( timeLine, duration, var eventID = TimeLineManager.ScheduleEventIn( timeLine, duration,
( tle ) => ( tle ) =>
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using System.Threading.Tasks; using System.Threading.Tasks;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Delay.svg")] [Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Delay.svg")]
@ -19,15 +18,15 @@ namespace Rokojori
if ( Engine.IsEditorHint() ) if ( Engine.IsEditorHint() )
{ {
var timeLine = TimelineManager.Ensure( null ); var timeLine = TimeLineManager.Ensure( null );
TimelineManager.ScheduleSpanIn( timeLine, 0, numFrames * 1f/60f , TimeLineManager.ScheduleSpanIn( timeLine, 0, numFrames * 1f/60f ,
( span, type )=> ( span, type )=>
{ {
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
this.LogInfo( "time:", Godot.Time.GetTicksMsec() / 1000f ); this.LogInfo( "time:", Time.GetTicksMsec() / 1000f );
} }
}, },
this this

View File

@ -3,7 +3,6 @@ using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -17,7 +16,7 @@ namespace Rokojori
public float growDuration = 0.0f; public float growDuration = 0.0f;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
[Export] [Export]
public Action[] actions = new Action[ 0 ]; public Action[] actions = new Action[ 0 ];
@ -42,7 +41,7 @@ namespace Rokojori
for ( int i = 0; i < list.Count; i++ ) for ( int i = 0; i < list.Count; i++ )
{ {
TimelineManager.ScheduleEventIn( timeLine, offset, TimeLineManager.ScheduleEventIn( timeLine, offset,
id => id =>
{ {
Action.TriggerSafe( list[ i ] ); Action.TriggerSafe( list[ i ] );

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -17,7 +16,7 @@ namespace Rokojori
public int numRepeats; public int numRepeats;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
[Export] [Export]
public Action action; public Action action;
@ -33,7 +32,7 @@ namespace Rokojori
{ {
for ( int i = 0; i < numRepeats; i++ ) for ( int i = 0; i < numRepeats; i++ )
{ {
TimelineManager.ScheduleEventIn( timeLine, i * duration, TimeLineManager.ScheduleEventIn( timeLine, i * duration,
id => id =>
{ {
if ( i == 0 ) if ( i == 0 )

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -11,7 +10,7 @@ namespace Rokojori
public partial class TweenTimeLineSpeed:SequenceAction public partial class TweenTimeLineSpeed:SequenceAction
{ {
[Export] [Export]
public Timeline targetTimeLine; public TimeLine targetTimeLine;
[Export] [Export]
public float timeLineSpeed; public float timeLineSpeed;
@ -23,7 +22,7 @@ namespace Rokojori
public bool cacheSpeedOnStart = true; public bool cacheSpeedOnStart = true;
[Export] [Export]
public Timeline tweenTimeLine; public TimeLine tweenTimeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
{ {
@ -32,7 +31,7 @@ namespace Rokojori
return; return;
} }
var tl = tweenTimeLine == null ? TimelineManager.Get().realtimeTimeline : tweenTimeLine; var tl = tweenTimeLine == null ? TimeLineManager.Get().realtimeTimeline : tweenTimeLine;
var start = targetTimeLine.position; var start = targetTimeLine.position;
@ -49,7 +48,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
var timeNow = tl.position; var timeNow = tl.position;
@ -66,7 +65,7 @@ namespace Rokojori
targetTimeLine.runner.speed = lerpedSpeed; targetTimeLine.runner.speed = lerpedSpeed;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -41,7 +40,7 @@ namespace Rokojori
_actionID = _id; _actionID = _id;
_animationID = TimelineManager.ScheduleSpanWith( duration, _animationID = TimeLineManager.ScheduleSpanWith( duration,
( s, t ) => ( s, t ) =>
{ {
if ( _animationID != s.id ) if ( _animationID != s.id )
@ -54,7 +53,7 @@ namespace Rokojori
target.Set( intNumber + "" ); target.Set( intNumber + "" );
if ( TimelineSpanUpdateType.End == t ) if ( TimeLineSpanUpdateType.End == t )
{ {
target.Set( endValue + "" ); target.Set( endValue + "" );
DispatchEnd( _id ); DispatchEnd( _id );

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -2,7 +2,6 @@
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -84,7 +83,7 @@ namespace Rokojori
this.LogInfo( "Start Value Float Tween", HierarchyName.OfAny( target ), target.GetType().Name, targetMemberPath, ">>", startValue ); this.LogInfo( "Start Value Float Tween", HierarchyName.OfAny( target ), target.GetType().Name, targetMemberPath, ">>", startValue );
_timeID = TimelineManager.ScheduleSpanWith( duration, _timeID = TimeLineManager.ScheduleSpanWith( duration,
( span, type )=> ( span, type )=>
{ {
@ -114,7 +113,7 @@ namespace Rokojori
// target._Set( targetMember, value ); // target._Set( targetMember, value );
SetTargetValue( target, targetMemberPath, value ); SetTargetValue( target, targetMemberPath, value );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
// this.LogInfo( "End Float Tween", endValue ); // this.LogInfo( "End Float Tween", endValue );

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -68,7 +67,7 @@ namespace Rokojori
AnimationManager.StartAnimation( this, compositorVFX, "driverValue" ); AnimationManager.StartAnimation( this, compositorVFX, "driverValue" );
_timeID = TimelineManager.ScheduleSpanWith( duration, _timeID = TimeLineManager.ScheduleSpanWith( duration,
( span, type )=> ( span, type )=>
{ {
@ -94,7 +93,7 @@ namespace Rokojori
compositorVFX.driverValue = value; compositorVFX.driverValue = value;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
compositorVFX.driverValue = value; compositorVFX.driverValue = value;
AnimationManager.EndAnimation( this, compositorVFX, "driverValue" ); AnimationManager.EndAnimation( this, compositorVFX, "driverValue" );

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -121,7 +120,7 @@ namespace Rokojori
this.LogInfo( "Start Value Float Tween", HierarchyName.OfAny( target ), target.GetType().Name, targetMemberPath, ">>", startValue ); this.LogInfo( "Start Value Float Tween", HierarchyName.OfAny( target ), target.GetType().Name, targetMemberPath, ">>", startValue );
_timeID = TimelineManager.ScheduleSpanWith( duration, _timeID = TimeLineManager.ScheduleSpanWith( duration,
( span, type )=> ( span, type )=>
{ {
@ -151,7 +150,7 @@ namespace Rokojori
// target._Set( targetMember, value ); // target._Set( targetMember, value );
SetTargetValue( target, targetMemberPath, value ); SetTargetValue( target, targetMemberPath, value );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
// this.LogInfo( "End Float Tween", endValue ); // this.LogInfo( "End Float Tween", endValue );

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -110,7 +109,7 @@ namespace Rokojori
// this.LogInfo( "Get Float Tween", startValue ); // this.LogInfo( "Get Float Tween", startValue );
_timeID = TimelineManager.ScheduleSpanWith( duration, _timeID = TimeLineManager.ScheduleSpanWith( duration,
( span, type )=> ( span, type )=>
{ {
@ -139,7 +138,7 @@ namespace Rokojori
propertyName.Set( material, value ); propertyName.Set( material, value );
// ReflectionHelper.SetValue( material, propertyName , value ); // ReflectionHelper.SetValue( material, propertyName , value );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
// this.LogInfo( "End Float Tween", endValue ); // this.LogInfo( "End Float Tween", endValue );

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -20,7 +19,7 @@ namespace Rokojori
public TweenType tweenType = new TweenTimeCurve(); public TweenType tweenType = new TweenTimeCurve();
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -35,7 +34,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -52,7 +51,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( light3D ) ) if ( ! GodotObject.IsInstanceValid( light3D ) )
@ -70,7 +69,7 @@ namespace Rokojori
lerpData.CopyTo( light3D ); lerpData.CopyTo( light3D );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -24,7 +23,7 @@ namespace Rokojori
public TweenType tweenType = new TweenTimeCurve(); public TweenType tweenType = new TweenTimeCurve();
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
ColorProperty[] colors = []; ColorProperty[] colors = [];
@ -91,7 +90,7 @@ namespace Rokojori
SetAssignedMaterial( fromMaterial ); SetAssignedMaterial( fromMaterial );
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -137,7 +136,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
var timeNow = tl.position; var timeNow = tl.position;
@ -168,7 +167,7 @@ namespace Rokojori
elementIndex ++; elementIndex ++;
} }
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
foreach ( var c in colors ) foreach ( var c in colors )
{ {

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -20,7 +19,7 @@ namespace Rokojori
public TweenType tweenType = new TweenTimeCurve(); public TweenType tweenType = new TweenTimeCurve();
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -35,7 +34,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -52,7 +51,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( particles3D ) ) if ( ! GodotObject.IsInstanceValid( particles3D ) )
@ -70,7 +69,7 @@ namespace Rokojori
lerpData.CopyTo( particles3D ); lerpData.CopyTo( particles3D );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -2,7 +2,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -40,7 +39,7 @@ namespace Rokojori
public bool cacheEndPositionOnStart = true; public bool cacheEndPositionOnStart = true;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
Vector3 GetToPosition() Vector3 GetToPosition()
@ -64,7 +63,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -80,7 +79,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( target ) ) if ( ! GodotObject.IsInstanceValid( target ) )
@ -110,7 +109,7 @@ namespace Rokojori
target.Position = lerpedPosition; target.Position = lerpedPosition;
} }
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -23,7 +22,7 @@ namespace Rokojori
public bool cacheEndPositionOnStart = true; public bool cacheEndPositionOnStart = true;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -33,7 +32,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -49,7 +48,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( activeVolume ) ) if ( ! GodotObject.IsInstanceValid( activeVolume ) )
@ -72,7 +71,7 @@ namespace Rokojori
activeVolume.weight = lerpedWeight; activeVolume.weight = lerpedWeight;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -3,7 +3,6 @@ using System;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -26,7 +25,7 @@ namespace Rokojori
public bool cacheEndPositionOnStart = true; public bool cacheEndPositionOnStart = true;
[Export] [Export]
public Timeline timeLine; public TimeLine timeLine;
protected override void _OnTrigger() protected override void _OnTrigger()
@ -36,7 +35,7 @@ namespace Rokojori
return; return;
} }
var tl = TimelineManager.Ensure( timeLine ); var tl = TimeLineManager.Ensure( timeLine );
var start = tl.position; var start = tl.position;
@ -52,7 +51,7 @@ namespace Rokojori
tweenType = TweenTimeCurve.defaultCurve; tweenType = TweenTimeCurve.defaultCurve;
} }
TimelineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(), TimeLineManager.ScheduleSpanIn( tl, 0, tweenType.GetTweenDuration(),
( span, type )=> ( span, type )=>
{ {
if ( ! GodotObject.IsInstanceValid( target ) ) if ( ! GodotObject.IsInstanceValid( target ) )
@ -75,7 +74,7 @@ namespace Rokojori
target.Scale = lerpedScale; target.Scale = lerpedScale;
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
DispatchEnd( sequenceID ); DispatchEnd( sequenceID );
} }

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -58,9 +57,9 @@ namespace Rokojori
random = random == null ? GodotRandom.Get() : random; random = random == null ? GodotRandom.Get() : random;
return new Vector3( return new Vector3(
random.Polar1() * durationRandomRange, random.Polar() * durationRandomRange,
random.Polar1() * delayRandomRange, random.Polar() * delayRandomRange,
random.Polar1() * scaleRandomRange random.Polar() * scaleRandomRange
); );
} }
@ -73,7 +72,7 @@ namespace Rokojori
return curve.Sample( phase ) * ( scaleY + scaleOffset ); return curve.Sample( phase ) * ( scaleY + scaleOffset );
} }
public float SampleRandomized( float time, Vector3 randomization ) public float Sample( float time, Vector3 randomization )
{ {
return Sample( time, randomization.X, randomization.Y, randomization.Z ); return Sample( time, randomization.X, randomization.Y, randomization.Z );
} }

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -65,9 +64,9 @@ namespace Rokojori
random = random == null ? GodotRandom.Get() : random; random = random == null ? GodotRandom.Get() : random;
return new Vector3( return new Vector3(
random.Polar1() * durationRandomRange, random.Polar() * durationRandomRange,
random.Polar1() * delayRandomRange, random.Polar() * delayRandomRange,
random.Polar1() * scaleAllRandomRange random.Polar() * scaleAllRandomRange
); );
} }

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
public interface Animator public interface Animator

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
public interface IFloatDriver public interface IFloatDriver

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
using System.Text; using System.Text;
using Godot; using Godot;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]

View File

@ -5,7 +5,6 @@ using System.Text;
using Godot; using Godot;
using System.Linq; using System.Linq;
using Rokojori.Extensions;
namespace Rokojori namespace Rokojori
{ {
[Tool] [Tool]
@ -128,7 +127,7 @@ namespace Rokojori
allTargets.AddRange( targets ); allTargets.AddRange( targets );
} }
allTargets = ListExtensions.Filter( ListExtensions.From( allTargets ), t => t as GeometryInstance3D != null ); allTargets = Lists.Filter( Lists.From( allTargets ), t => t as GeometryInstance3D != null );
return allTargets; return allTargets;
} }
@ -165,7 +164,7 @@ namespace Rokojori
var flashCurve = flashEffect.flashCurve; var flashCurve = flashEffect.flashCurve;
var color = flashEffect.color.GetHDRColor(); var color = flashEffect.color.GetHDRColor();
var timeline = TimelineManager.Ensure( flashEffect.timeline ); var timeline = TimeLineManager.Ensure( flashEffect.timeline );
runner.randomization = flashCurve.Randomize( random ); runner.randomization = flashCurve.Randomize( random );
var duration = flashCurve.GetRandomizedDuration( runner.randomization ); var duration = flashCurve.GetRandomizedDuration( runner.randomization );
@ -258,8 +257,8 @@ namespace Rokojori
runner.animationID = TimelineManager.ScheduleSpanIn( timeline, 0, duration, runner.animationID = TimeLineManager.ScheduleSpanIn( timeline, 0, duration,
( TimelineSpan span, TimelineSpanUpdateType type )=> ( TimeLineSpan span, TimeLineSpanUpdateType type )=>
{ {
// debugProcessIndicator.Position = debugProcessIndicatorFull * span.phase; // debugProcessIndicator.Position = debugProcessIndicatorFull * span.phase;
@ -326,7 +325,7 @@ namespace Rokojori
); );
if ( type == TimelineSpanUpdateType.End ) if ( type == TimeLineSpanUpdateType.End )
{ {
if ( runner.light != null ) if ( runner.light != null )
{ {

Some files were not shown because too many files have changed in this diff Show More