From dab72b46d970b30d20b336aeb74d0ff9017cadeb Mon Sep 17 00:00:00 2001 From: Josef Date: Thu, 19 Jun 2025 19:22:25 +0200 Subject: [PATCH] UI Update --- Icons/PostProcess.svg | 158 +++ Icons/PostProcess.svg.import | 37 + RokojoriPlugin.cs | 187 +++ Runtime/Actions/Action.cs | 3 + Runtime/Actions/Node3D/TweenAudio.cs | 2 +- Runtime/Actions/SequenceAction.cs | 2 + Runtime/Actions/Visual/TweenLight.cs | 5 + Runtime/Actions/Visual/TweenParticles.cs | 5 + Runtime/Actions/Visual/TweenPosition.cs | 66 +- Runtime/Animation/Flash/Flash.cs | 21 + .../Shake/Presets/Mini Poke - Shake.tres | 2 +- Runtime/Animation/Shake/Shake.cs | 22 + Runtime/Events/EventSlot.cs | 6 + Runtime/Files/FilesSync.cs | 13 +- Runtime/Godot/CustomDisposer.cs | 15 + Runtime/Godot/CustomDisposer.cs.uid | 1 + Runtime/Godot/IAssemblyReload.cs | 12 + Runtime/Godot/IAssemblyReload.cs.uid | 1 + Runtime/Godot/Nodes.cs | 16 +- Runtime/Godot/Root.cs | 51 + Runtime/Graphs/Trees/TreeWalker.cs | 32 +- Runtime/Interactions/Grabbable.cs | 44 +- Runtime/Localization/LocaleManager.cs | 2 +- Runtime/Math/Math3D.cs | 10 + Runtime/Networking/NetworkManager.cs | 2 +- Runtime/Random/IDGenerator.cs | 60 + Runtime/Random/IDGenerator.cs.uid | 1 + Runtime/Selectors/SelectorFlag.cs | 5 +- .../Materials/CustomMaterialProperty.cs | 2 + Runtime/Structures/MapList.cs | 10 + Runtime/Testing/CheckAttribute.cs | 0 Runtime/Testing/CheckAttribute.cs.uid | 1 + Runtime/Testing/CheckTransforms.cs | 81 ++ Runtime/Testing/CheckTransforms.cs.uid | 1 + Runtime/Testing/CheckWarnings.cs | 55 + Runtime/Testing/CheckWarnings.cs.uid | 1 + Runtime/Testing/DebugAction.cs | 102 ++ Runtime/Testing/DebugAction.cs.uid | 1 + Runtime/Testing/DebugMessage.cs | 62 + Runtime/Testing/DebugMessage.cs.uid | 1 + Runtime/Time/DateTime/DateMath.cs | 26 + Runtime/Time/DateTime/DateMath.cs.uid | 1 + Runtime/Time/TImeLineManager_Scheduling.cs | 5 + Runtime/Time/TimeLineManager.cs | 2 +- Runtime/Time/TimeLines/UITime.tres | 11 + Runtime/Tools/Arrays.cs | 14 +- Runtime/Tools/Boxed/BoxedFloatValue.cs | 40 + Runtime/Tools/Boxed/BoxedFloatValue.cs.uid | 1 + Runtime/Tools/Boxed/ColorValue.cs | 13 + .../Tools/Boxed/FloatRanges/BoolFloatValue.cs | 60 + .../Boxed/FloatRanges/BoolFloatValue.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Float16Value.cs | 60 + .../Boxed/FloatRanges/Float16Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Float256Value.cs | 60 + .../Boxed/FloatRanges/Float256Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Float2Value.cs | 60 + .../Boxed/FloatRanges/Float2Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Float4Value.cs | 60 + .../Boxed/FloatRanges/Float4Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Float8Value.cs | 60 + .../Boxed/FloatRanges/Float8Value.cs.uid | 1 + .../Boxed/FloatRanges/FloatDOFDistance.cs | 60 + .../Boxed/FloatRanges/FloatDOFDistance.cs.uid | 1 + .../FloatRanges/FloatDOFTransitionValue.cs | 60 + .../FloatDOFTransitionValue.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Polar1024Value.cs | 60 + .../Boxed/FloatRanges/Polar1024Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Polar16Value.cs | 60 + .../Boxed/FloatRanges/Polar16Value.cs.uid | 1 + .../Tools/Boxed/FloatRanges/Polar2Value.cs | 60 + .../Boxed/FloatRanges/Polar2Value.cs.uid | 1 + Runtime/Tools/Boxed/FloatRanges/PolarValue.cs | 60 + .../Tools/Boxed/FloatRanges/PolarValue.cs.uid | 1 + Runtime/Tools/Boxed/FloatValue.cs | 23 +- Runtime/Tools/Boxed/NormalizedValue.cs | 62 + Runtime/Tools/Boxed/NormalizedValue.cs.uid | 1 + Runtime/Tools/Boxed/PowerValue.cs | 66 + Runtime/Tools/Boxed/PowerValue.cs.uid | 1 + Runtime/Tools/Lists.cs | 21 +- Runtime/UI/Components/UIDragging.cs | 418 ++++++ Runtime/UI/Components/UIDragging.cs.uid | 1 + Runtime/UI/Components/UISlider.cs | 354 +++++ Runtime/UI/Components/UISlider.cs.uid | 1 + Runtime/UI/Layouts/UIFlowLayout.cs | 6 +- Runtime/UI/Layouts/UILayouting.cs | 64 +- Runtime/UI/Nodes/UIHolder.cs | 21 + Runtime/UI/Nodes/UIHolder.cs.uid | 1 + Runtime/UI/Nodes/UIHoverable.cs | 12 + Runtime/UI/Nodes/UIHoverable.cs.uid | 1 + Runtime/UI/Nodes/UIImage.cs | 218 ++- .../RoundedRectangleUIImageType.cs | 94 +- Runtime/UI/Nodes/UIImageTypes/UIImageType.cs | 44 +- Runtime/UI/Nodes/UIInputInfo.cs | 12 +- Runtime/UI/Nodes/UIRegion.cs | 176 ++- Runtime/UI/Nodes/UIText.cs | 209 ++- Runtime/UI/Nodes/UIWrapper.cs | 26 + Runtime/UI/Nodes/UIWrapper.cs.uid | 1 + Runtime/UI/Optimization/RedrawCue.cs | 15 + Runtime/UI/Optimization/RedrawCue.cs.uid | 1 + Runtime/UI/ShaderProperties/ShaderUIColor.cs | 5 + Runtime/UI/ShaderProperties/ShaderUINumber.cs | 28 +- .../UI/ShaderProperties/UIShaderProperties.cs | 50 + .../RoundedRectangle.gdshader | 4 +- Runtime/UI/Styling/UIColor.cs | 101 +- Runtime/UI/Styling/UINumber.cs | 225 +++- Runtime/UI/Styling/UISelector.cs | 144 ++ Runtime/UI/Styling/UISelector.cs.uid | 1 + Runtime/UI/Styling/UISelectorFlag.cs | 40 + Runtime/UI/Styling/UISelectorFlag.cs.uid | 1 + Runtime/UI/Styling/UISelectorFlagEntry.cs | 19 + Runtime/UI/Styling/UISelectorFlagEntry.cs.uid | 1 + Runtime/UI/Styling/UISelectorStyle.cs | 19 + Runtime/UI/Styling/UISelectorStyle.cs.uid | 1 + Runtime/UI/Styling/UIStyle.cs | 249 +++- Runtime/UI/Styling/UIStyleProperty.cs | 89 +- .../UI/Styling/UIStylePropertyContainer.cs | 21 +- .../UI/Transitions/ActiveStyleTransition.cs | 160 ++- Runtime/UI/Transitions/UIColorTransition.cs | 20 + Runtime/UI/Transitions/UINumberTransition.cs | 3 + .../UI-Selectors/UI Active Selector Flag.tres | 7 + .../UI Dragging Selector Flag.tres | 7 + .../UI-Selectors/UI Focus Selector Flag.tres | 7 + .../UI-Selectors/UI Hover Selector Flag.tres | 7 + .../UI Scrolling Selector Flag.tres | 7 + Runtime/UI/UI-Settings-Default.tres | 26 +- Runtime/UI/UI.cs | 218 ++- Runtime/UI/UISettings.cs | 14 + .../CameraSlotSelectors/SetActiveCamera.cs | 2 +- .../CenterAndRangeDepthOfFieldEffect.cs | 71 + .../CenterAndRangeDepthOfFieldEffect.cs.uid | 1 + .../PostProcess/FixedDepthOfFieldEffect.cs | 66 + .../FixedDepthOfFieldEffect.cs.uid | 1 + .../VirtualCameras/PostProcess/FogEffect.cs | 148 +++ .../PostProcess/FogEffect.cs.uid | 1 + .../PostProcess/FollowDepthOfFieldEffect.cs | 77 ++ .../FollowDepthOfFieldEffect.cs.uid | 1 + .../VirtualCameras/PostProcess/GlowEffect.cs | 138 ++ .../PostProcess/GlowEffect.cs.uid | 1 + .../PostProcess/GlowEffectLevels.cs | 83 ++ .../PostProcess/GlowEffectLevels.cs.uid | 1 + .../PostProcess/PostProcessEffectProcessor.cs | 46 + .../PostProcessEffectProcessor.cs.uid | 1 + .../PostProcess/PostProcessVolume.cs | 75 ++ .../PostProcess/PostProcessVolume.cs.uid | 1 + .../PostProcess/PostProcessVolumeEffect.cs | 236 ++++ .../PostProcessVolumeEffect.cs.uid | 1 + .../PostProcess/_XX_DepthOfFieldEffect.cs | 90 ++ .../PostProcess/_XX_DepthOfFieldEffect.cs.uid | 1 + .../VirtualCameras/VirtualCamera3DManager.cs | 256 +++- Tools/Messages/Active Font Style.tres | 25 + Tools/Messages/Idle Font Style.tres | 29 + Tools/Messages/Message Background.tres | 59 + Tools/Messages/Message Content.tres | 37 + Tools/Messages/Message Icon.tres | 46 + Tools/Messages/Message Link.tres | 55 + Tools/Messages/Message Node Link.tres | 73 + Tools/Messages/Message Resource Link.tres | 73 + Tools/Messages/Message Time Stamp.tres | 39 + Tools/Messages/Message Type Title Error.tres | 28 + Tools/Messages/Message Type Title Info.tres | 28 + .../Messages/Message Type Title Warning.tres | 28 + Tools/Messages/Message Type Title.tres | 26 + Tools/Messages/Message Web Link.tres | 73 + Tools/Messages/Message.cs | 29 + Tools/Messages/Message.cs.uid | 1 + Tools/Messages/Message.tscn | 1175 +++++++++++++++++ Tools/Messages/MessageStyle.tres | 36 + Tools/Messages/Messages.tscn | 450 +++++++ Tools/Messages/Vertical-Slider.tres | 299 +++++ 169 files changed, 8755 insertions(+), 418 deletions(-) create mode 100644 Icons/PostProcess.svg create mode 100644 Icons/PostProcess.svg.import create mode 100644 Runtime/Godot/CustomDisposer.cs create mode 100644 Runtime/Godot/CustomDisposer.cs.uid create mode 100644 Runtime/Godot/IAssemblyReload.cs create mode 100644 Runtime/Godot/IAssemblyReload.cs.uid create mode 100644 Runtime/Random/IDGenerator.cs create mode 100644 Runtime/Random/IDGenerator.cs.uid create mode 100644 Runtime/Testing/CheckAttribute.cs create mode 100644 Runtime/Testing/CheckAttribute.cs.uid create mode 100644 Runtime/Testing/CheckTransforms.cs create mode 100644 Runtime/Testing/CheckTransforms.cs.uid create mode 100644 Runtime/Testing/CheckWarnings.cs create mode 100644 Runtime/Testing/CheckWarnings.cs.uid create mode 100644 Runtime/Testing/DebugAction.cs create mode 100644 Runtime/Testing/DebugAction.cs.uid create mode 100644 Runtime/Testing/DebugMessage.cs create mode 100644 Runtime/Testing/DebugMessage.cs.uid create mode 100644 Runtime/Time/DateTime/DateMath.cs create mode 100644 Runtime/Time/DateTime/DateMath.cs.uid create mode 100644 Runtime/Time/TimeLines/UITime.tres create mode 100644 Runtime/Tools/Boxed/BoxedFloatValue.cs create mode 100644 Runtime/Tools/Boxed/BoxedFloatValue.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float16Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float16Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float256Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float256Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float2Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float2Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float4Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float4Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float8Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Float8Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs.uid create mode 100644 Runtime/Tools/Boxed/FloatRanges/PolarValue.cs create mode 100644 Runtime/Tools/Boxed/FloatRanges/PolarValue.cs.uid create mode 100644 Runtime/Tools/Boxed/NormalizedValue.cs create mode 100644 Runtime/Tools/Boxed/NormalizedValue.cs.uid create mode 100644 Runtime/Tools/Boxed/PowerValue.cs create mode 100644 Runtime/Tools/Boxed/PowerValue.cs.uid create mode 100644 Runtime/UI/Components/UIDragging.cs create mode 100644 Runtime/UI/Components/UIDragging.cs.uid create mode 100644 Runtime/UI/Components/UISlider.cs create mode 100644 Runtime/UI/Components/UISlider.cs.uid create mode 100644 Runtime/UI/Nodes/UIHolder.cs create mode 100644 Runtime/UI/Nodes/UIHolder.cs.uid create mode 100644 Runtime/UI/Nodes/UIHoverable.cs create mode 100644 Runtime/UI/Nodes/UIHoverable.cs.uid create mode 100644 Runtime/UI/Nodes/UIWrapper.cs create mode 100644 Runtime/UI/Nodes/UIWrapper.cs.uid create mode 100644 Runtime/UI/Optimization/RedrawCue.cs create mode 100644 Runtime/UI/Optimization/RedrawCue.cs.uid create mode 100644 Runtime/UI/Styling/UISelector.cs create mode 100644 Runtime/UI/Styling/UISelector.cs.uid create mode 100644 Runtime/UI/Styling/UISelectorFlag.cs create mode 100644 Runtime/UI/Styling/UISelectorFlag.cs.uid create mode 100644 Runtime/UI/Styling/UISelectorFlagEntry.cs create mode 100644 Runtime/UI/Styling/UISelectorFlagEntry.cs.uid create mode 100644 Runtime/UI/Styling/UISelectorStyle.cs create mode 100644 Runtime/UI/Styling/UISelectorStyle.cs.uid create mode 100644 Runtime/UI/UI-Selectors/UI Active Selector Flag.tres create mode 100644 Runtime/UI/UI-Selectors/UI Dragging Selector Flag.tres create mode 100644 Runtime/UI/UI-Selectors/UI Focus Selector Flag.tres create mode 100644 Runtime/UI/UI-Selectors/UI Hover Selector Flag.tres create mode 100644 Runtime/UI/UI-Selectors/UI Scrolling Selector Flag.tres create mode 100644 Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/FogEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/FogEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/GlowEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/GlowEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs create mode 100644 Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs.uid create mode 100644 Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs create mode 100644 Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs.uid create mode 100644 Tools/Messages/Active Font Style.tres create mode 100644 Tools/Messages/Idle Font Style.tres create mode 100644 Tools/Messages/Message Background.tres create mode 100644 Tools/Messages/Message Content.tres create mode 100644 Tools/Messages/Message Icon.tres create mode 100644 Tools/Messages/Message Link.tres create mode 100644 Tools/Messages/Message Node Link.tres create mode 100644 Tools/Messages/Message Resource Link.tres create mode 100644 Tools/Messages/Message Time Stamp.tres create mode 100644 Tools/Messages/Message Type Title Error.tres create mode 100644 Tools/Messages/Message Type Title Info.tres create mode 100644 Tools/Messages/Message Type Title Warning.tres create mode 100644 Tools/Messages/Message Type Title.tres create mode 100644 Tools/Messages/Message Web Link.tres create mode 100644 Tools/Messages/Message.cs create mode 100644 Tools/Messages/Message.cs.uid create mode 100644 Tools/Messages/Message.tscn create mode 100644 Tools/Messages/MessageStyle.tres create mode 100644 Tools/Messages/Messages.tscn create mode 100644 Tools/Messages/Vertical-Slider.tres diff --git a/Icons/PostProcess.svg b/Icons/PostProcess.svg new file mode 100644 index 0000000..2e13df0 --- /dev/null +++ b/Icons/PostProcess.svg @@ -0,0 +1,158 @@ + + diff --git a/Icons/PostProcess.svg.import b/Icons/PostProcess.svg.import new file mode 100644 index 0000000..bed225d --- /dev/null +++ b/Icons/PostProcess.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dfoere3ebvqcd" +path="res://.godot/imported/PostProcess.svg-9bd595bde45601bf2c44bb02a5f521fa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/rokojori_action_library/Icons/PostProcess.svg" +dest_files=["res://.godot/imported/PostProcess.svg-9bd595bde45601bf2c44bb02a5f521fa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/RokojoriPlugin.cs b/RokojoriPlugin.cs index 1effc78..7ef107e 100644 --- a/RokojoriPlugin.cs +++ b/RokojoriPlugin.cs @@ -2,6 +2,9 @@ using Godot; using Rokojori; using System.Collections.Generic; +using System.Globalization; +using System; +using System.Data; namespace Rokojori { @@ -11,6 +14,7 @@ namespace Rokojori GizmoDrawerPlugin gizmoDrawerPlugin = new GizmoDrawerPlugin(); public static readonly string path = "res://addons/rokojori_action_library"; + public static string Path( string path ) { return RokojoriPlugin.path + "/" + path; @@ -18,25 +22,208 @@ namespace Rokojori static readonly string RokojoriRootAutoLoad = "RokojoriRootAutoLoad"; static readonly string RokojoriRootAutoLoadPath = Path( "Runtime/Godot/Root.cs" ); + static readonly string RokojoriProjectInternalPath = "res://.rokojori"; + static readonly string RokojoriSettingsPath = "res://.rokojori/settings"; + static readonly string RokojoriCachePath = "res://.rokojori/cache"; public override void _EnablePlugin() { + this.LogInfo(); AddAutoloadSingleton( RokojoriRootAutoLoad, RokojoriRootAutoLoadPath ); + + + EnsureHiddenProjectPath( RokojoriProjectInternalPath ); + EnsureHiddenProjectPath( RokojoriSettingsPath ); + EnsureHiddenProjectPath( RokojoriCachePath ); + } + void EnsureHiddenProjectPath( string resPath ) + { + var gdIgnorePath = resPath + "/.gdignore" ; + FilesSync.EnsureDirectoryExists( ProjectSettings.GlobalizePath( resPath ) ); + + if ( ! FilesSync.FileExists( ProjectSettings.GlobalizePath( gdIgnorePath ) ) ) + { + FilesSync.SaveUTF8( ProjectSettings.GlobalizePath( gdIgnorePath ), "" ); + } + } + + public override void _DisablePlugin() { + this.LogInfo(); RemoveAutoloadSingleton( RokojoriRootAutoLoad ); } + + static readonly string ProblemsExplorerPath = "res://addons/rokojori_action_library/Tools/Messages/Messages.tscn"; + static Control messages; + public override void _EnterTree() { + EnsureHiddenProjectPath( RokojoriProjectInternalPath ); + EnsureHiddenProjectPath( RokojoriSettingsPath ); + EnsureHiddenProjectPath( RokojoriCachePath ); + + this.LogInfo(); + AddNode3DGizmoPlugin( gizmoDrawerPlugin ); + + var pePackedScene = GD.Load( ProblemsExplorerPath ); + + if ( pePackedScene != null ) + { + // this.LogInfo( "Problems Explorer found: ", pePackedScene ); + + messages = ((PackedScene)pePackedScene).Instantiate(); + + var ui = messages.Get(); + 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() { + this.LogInfo(); + + if ( messages != null ) + { + RemoveControlFromDocks( messages ); + } + RemoveNode3DGizmoPlugin( gizmoDrawerPlugin ); } + + bool wasDisposed = true; + + public RokojoriPlugin() + { + wasDisposed = true; + } + + public class MarkerData + { + public DateTime time; + } + + static readonly string markerPath = "reload-marker.json"; + + + + protected override void Dispose( bool disposing ) + { + + var markerData = new MarkerData(); + markerData.time = DateTime.Now; + + SaveCache( markerPath, markerData ); + } + + float reloadDuration = 2; + DateTime lastUpdateTime = DateTime.Now; + DateTime lastDisposalTime = DateTime.Now; + + public void SaveCache( string relativeCachePath, object data ) + { + var path = RokojoriCachePath + "/" + relativeCachePath; + + FilesSync.SaveJSON( ProjectSettings.GlobalizePath( path ), data ); + } + + public T LoadCache( string relativeCachePath ) where T:new() + { + var path = RokojoriCachePath + "/" + relativeCachePath; + + return FilesSync.LoadJSON( ProjectSettings.GlobalizePath( path )); + } + + public T LoadSettings( string relativeSettingsPath ) where T:new() + { + var path = RokojoriSettingsPath + "/" + relativeSettingsPath; + + return FilesSync.LoadJSON( ProjectSettings.GlobalizePath( path )); + } + + UI editingSceneUI = null; + UIRegion editingSceneRegion = null; + + public override void _Process( double delta ) + { + var editingScene = EditorInterface.Singleton.GetEditedSceneRoot(); + + if ( lastUpdateTime.HasExpired( reloadDuration ) ) + { + lastUpdateTime = DateTime.Now; + + var markerData = LoadCache( markerPath ); + + if ( markerData != null && markerData.time != lastDisposalTime ) + { + lastDisposalTime = markerData.time; + + editingScene.ForEach( ar => ar.OnAssemblyReloaded() ); + + if ( messages != null ) + { + messages.ForEach( ar => ar.OnAssemblyReloaded() ); + } + } + } + + if ( editingScene is UIRegion region && ! ( editingScene is UI ) ) + { + if ( editingSceneRegion != region ) + { + if ( editingSceneUI != null ) + { + editingSceneUI.RemoveSelf(); + editingSceneUI = null; + } + + editingSceneRegion = region; + editingSceneUI = this.CreateChild(); + editingSceneUI.settings = region.uiSettings; + + editingSceneUI.BindChildrenOf( region ); + } + + editingSceneUI.updateMode = UI.UpdateMode.Only_Manual_Updates; + + if ( region.reassignUI ) + { + editingSceneUI.settings = region.uiSettings; + region.SetUI( editingSceneUI ); + editingSceneUI.BindChildrenOf( region ); + region.reassignUI = false; + } + + if ( region.updateInEditor ) + { + region.SetUI( editingSceneUI ); + editingSceneUI.BindChildrenOf( region ); + editingSceneUI.fontZoom = region.fontZoom; + + editingSceneUI.UpdateExternal( (float)delta ); + region.Layout(); + region.computedFontSize = editingSceneUI.X_computedFontSizePixels; + } + + + } + + + } } } \ No newline at end of file diff --git a/Runtime/Actions/Action.cs b/Runtime/Actions/Action.cs index 1f301e4..55acd15 100644 --- a/Runtime/Actions/Action.cs +++ b/Runtime/Actions/Action.cs @@ -9,6 +9,9 @@ namespace Rokojori [GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Action.svg")] public partial class Action : NetworkNode { + [ExportToolButton( "Trigger Action in Editor")] + public Callable TriggerActionButton => Callable.From( ()=> Trigger() ); + NetworkNodeSlot _seedSlot = new NetworkNodeSlot(); NetworkNodeSlot _dataSlot = new NetworkNodeSlot(); NetworkNodeSlot _seedAndDataSlot = new NetworkNodeSlot(); diff --git a/Runtime/Actions/Node3D/TweenAudio.cs b/Runtime/Actions/Node3D/TweenAudio.cs index 3b04277..9db5cb6 100644 --- a/Runtime/Actions/Node3D/TweenAudio.cs +++ b/Runtime/Actions/Node3D/TweenAudio.cs @@ -23,7 +23,7 @@ namespace Rokojori public bool changePlayState = true; [Export] - public float changingPlayStateTresholdDB = -40f; + public float changingPlayStateTresholdDB = -80f; [Export] public TweenType tweenType = new TweenTimeCurve(); diff --git a/Runtime/Actions/SequenceAction.cs b/Runtime/Actions/SequenceAction.cs index 9b63f6f..7003b32 100644 --- a/Runtime/Actions/SequenceAction.cs +++ b/Runtime/Actions/SequenceAction.cs @@ -14,6 +14,8 @@ namespace Rokojori [GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SequenceAction.svg")] public partial class SequenceAction : Action { + + int _dispatchCounter = 0; public int GetLastSequenceActionID() diff --git a/Runtime/Actions/Visual/TweenLight.cs b/Runtime/Actions/Visual/TweenLight.cs index 709314d..de2856b 100644 --- a/Runtime/Actions/Visual/TweenLight.cs +++ b/Runtime/Actions/Visual/TweenLight.cs @@ -24,6 +24,11 @@ namespace Rokojori protected override void _OnTrigger() { + if ( Engine.IsEditorHint() ) + { + return; + } + if ( light3D == null || tweenLightData == null ) { return; diff --git a/Runtime/Actions/Visual/TweenParticles.cs b/Runtime/Actions/Visual/TweenParticles.cs index 7e08917..185b404 100644 --- a/Runtime/Actions/Visual/TweenParticles.cs +++ b/Runtime/Actions/Visual/TweenParticles.cs @@ -24,6 +24,11 @@ namespace Rokojori protected override void _OnTrigger() { + if ( Engine.IsEditorHint() ) + { + return; + } + if ( particles3D == null ) { return; diff --git a/Runtime/Actions/Visual/TweenPosition.cs b/Runtime/Actions/Visual/TweenPosition.cs index 7926e85..a151642 100644 --- a/Runtime/Actions/Visual/TweenPosition.cs +++ b/Runtime/Actions/Visual/TweenPosition.cs @@ -12,16 +12,29 @@ namespace Rokojori [Export] public Node3D target; + [Export] + public Mode positionSpace = Mode.Global; + [Export] public Node3D endPosition; + public enum Mode + { + Global, + Local + } + [Export] public Vector3 endOffset; + + [Export] public TweenType tweenType = new TweenTimeCurve(); + + [Export] public bool cacheEndPositionOnStart = true; @@ -29,6 +42,32 @@ namespace Rokojori public TimeLine timeLine; + Vector3 GetToPosition() + { + var toPosition = endOffset; + + if ( Mode.Global == positionSpace ) + { + if ( endPosition != null ) + { + toPosition += endPosition.GlobalPosition; + } + } + else + { + + if ( endPosition != null ) + { + toPosition += endPosition.Position; + } + + } + + return toPosition; + + + } + protected override void _OnTrigger() { if ( target == null ) @@ -40,14 +79,9 @@ namespace Rokojori var start = tl.position; - var fromPosition = target.GlobalPosition; - var toPosition = endOffset; + var fromPosition = target.GetPosition( Mode.Global == positionSpace ); + var toPosition = GetToPosition(); - if ( endPosition != null ) - { - toPosition += endPosition.GlobalPosition; - } - var sequenceID = DispatchStart(); var tweenType = this.tweenType; @@ -67,18 +101,20 @@ namespace Rokojori if ( ! cacheEndPositionOnStart ) { - toPosition = endOffset; - - if ( endPosition != null ) - { - toPosition += endPosition.GlobalPosition; - } + toPosition = GetToPosition(); } var lerpedPosition = fromPosition.Lerp( toPosition, state ); - target.GlobalPosition = lerpedPosition; - + if ( Mode.Global == positionSpace ) + { + target.GlobalPosition = lerpedPosition; + } + else if ( Mode.Local == positionSpace ) + { + target.Position = lerpedPosition; + } + if ( type == TimeLineSpanUpdateType.End ) { DispatchEnd( sequenceID ); diff --git a/Runtime/Animation/Flash/Flash.cs b/Runtime/Animation/Flash/Flash.cs index b1b1baa..85bc1b1 100644 --- a/Runtime/Animation/Flash/Flash.cs +++ b/Runtime/Animation/Flash/Flash.cs @@ -64,6 +64,27 @@ namespace Rokojori OmniLight3D light = null; + public override string[] _GetConfigurationWarnings() + { + var warnigns = new List(); + + if ( flashEffect == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" + "No flash effect assigned"); + } + + for ( int i = 0; i < targets.Length; i++ ) + { + if ( targets[ i ] == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" +"A null target is assigned in the targets array at index " + i ); + } + + } + + return warnigns.ToArray(); + } + Color ComputeLightColor( Color color, float phase ) { if ( phase < 5/100f ) diff --git a/Runtime/Animation/Shake/Presets/Mini Poke - Shake.tres b/Runtime/Animation/Shake/Presets/Mini Poke - Shake.tres index 367d09a..8e35a29 100644 --- a/Runtime/Animation/Shake/Presets/Mini Poke - Shake.tres +++ b/Runtime/Animation/Shake/Presets/Mini Poke - Shake.tres @@ -41,7 +41,7 @@ timeline = ExtResource("3_pgufg") smooth = true smoothingStrength = 0.477 positionShake = Vector3(0.075, 0, 0.075) -globalPosition = true +globalPosition = false repeatAndFlipFirstPosition = true rotationShake = Vector3(0.5, 0.5, 10) globalRotation = false diff --git a/Runtime/Animation/Shake/Shake.cs b/Runtime/Animation/Shake/Shake.cs index 1e9bb72..fa98094 100644 --- a/Runtime/Animation/Shake/Shake.cs +++ b/Runtime/Animation/Shake/Shake.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; using Godot; +using System.Linq; namespace Rokojori { @@ -25,6 +26,27 @@ namespace Rokojori public void OnAnimatorEnd(){} public void OnAnimatorCancel(){} + public override string[] _GetConfigurationWarnings() + { + var warnigns = new List(); + + if ( shakeEffect == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" + "No shake effect assigned"); + } + + for ( int i = 0; i < targets.Length; i++ ) + { + if ( targets[ i ] == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" +"A null target is assigned in the targets array at index " + i ); + } + + } + + return warnigns.ToArray(); + } + protected override void _OnTrigger() { if ( _actionID != -1 ) diff --git a/Runtime/Events/EventSlot.cs b/Runtime/Events/EventSlot.cs index 19fe377..d9eed63 100644 --- a/Runtime/Events/EventSlot.cs +++ b/Runtime/Events/EventSlot.cs @@ -22,12 +22,18 @@ namespace Rokojori public void AddAction( Action action ) { + if ( _actions.IndexOf( action ) != - 1 || _additions.IndexOf( action ) != -1 ) + { + return; + } + if ( _canModify ) { _actions.Add( action ); } else { + _additions.Add( action ); } } diff --git a/Runtime/Files/FilesSync.cs b/Runtime/Files/FilesSync.cs index f588c2d..5f09121 100644 --- a/Runtime/Files/FilesSync.cs +++ b/Runtime/Files/FilesSync.cs @@ -100,7 +100,7 @@ namespace Rokojori public static bool SaveJSON( string path, object obj ) { return SaveUTF8( path, JSON.StringifyObject( obj ) ); - } + } public static string LoadUTF8( string path ) { @@ -119,6 +119,17 @@ namespace Rokojori return null; } + public static T LoadJSON( string path ) where T:new() + { + if ( ! FilesSync.FileExists( path ) ) + { + return default(T); + } + + var jsonString = LoadUTF8( path ); + return JSON.ParseObject( jsonString ); + } + public static bool SaveBytes( string fileName, byte[] byteArray ) { try diff --git a/Runtime/Godot/CustomDisposer.cs b/Runtime/Godot/CustomDisposer.cs new file mode 100644 index 0000000..711ef75 --- /dev/null +++ b/Runtime/Godot/CustomDisposer.cs @@ -0,0 +1,15 @@ +using Godot; +using System.Text; +using System.Collections.Generic; + +namespace Rokojori +{ + public interface ICustomDisposer + { + public void Dispose(); + + public string GetUID(); + + public string GetInfo(); + } +} \ No newline at end of file diff --git a/Runtime/Godot/CustomDisposer.cs.uid b/Runtime/Godot/CustomDisposer.cs.uid new file mode 100644 index 0000000..41a10bf --- /dev/null +++ b/Runtime/Godot/CustomDisposer.cs.uid @@ -0,0 +1 @@ +uid://bgyrh3cmiuric diff --git a/Runtime/Godot/IAssemblyReload.cs b/Runtime/Godot/IAssemblyReload.cs new file mode 100644 index 0000000..8251003 --- /dev/null +++ b/Runtime/Godot/IAssemblyReload.cs @@ -0,0 +1,12 @@ +using Godot; +using System.Text; +using System.Collections.Generic; +using System.Linq; + +namespace Rokojori +{ + public interface IAssemblyReload + { + public void OnAssemblyReloaded(); + } +} \ No newline at end of file diff --git a/Runtime/Godot/IAssemblyReload.cs.uid b/Runtime/Godot/IAssemblyReload.cs.uid new file mode 100644 index 0000000..f86e013 --- /dev/null +++ b/Runtime/Godot/IAssemblyReload.cs.uid @@ -0,0 +1 @@ +uid://culnn75r8fbu4 diff --git a/Runtime/Godot/Nodes.cs b/Runtime/Godot/Nodes.cs index 67ba546..d53a525 100644 --- a/Runtime/Godot/Nodes.cs +++ b/Runtime/Godot/Nodes.cs @@ -183,7 +183,7 @@ namespace Rokojori return list; } - public static void ForEach( Node root, Action callback ) where T:class + public static void ForEach( this Node root, Action callback ) where T:class { var walker = nodesWalker; @@ -421,6 +421,18 @@ namespace Rokojori nodes.ForEach( n => RemoveAndDelete( n ) ); } + public static void RemoveSelf( this Node node ) + { + var parent = node.GetParent(); + + if ( parent != null ) + { + parent.RemoveChild( node ); + } + + node.QueueFree(); + } + public static void RemoveAndDeleteChildrenOfType( Node parent, bool includeInternal = false ) where T:Node { if ( parent == null ) @@ -469,6 +481,8 @@ namespace Rokojori } } + + public static T GetDirectChild( Node parent ) where T:Node { diff --git a/Runtime/Godot/Root.cs b/Runtime/Godot/Root.cs index 09041e1..ff7e121 100644 --- a/Runtime/Godot/Root.cs +++ b/Runtime/Godot/Root.cs @@ -1,3 +1,4 @@ +using System; using Godot; @@ -41,5 +42,55 @@ namespace Rokojori return _singleton; } + + + #if TOOLS + + public override void _Process( double delta ) + { + if ( ! Engine.IsEditorHint() ) + { + return; + } + + CheckWarnings(); + + } + + int step = 0; + + void CheckWarnings() + { + var walker = NodesWalker.Get(); + + for ( int i = 0; i < numNodeTests; i++ ) + { + if ( _iterationNode == null || ! IsInstanceValid( _iterationNode ) ) + { + _iterationNode = EditorInterface.Singleton.GetEditedSceneRoot(); + } + else + { + _iterationNode = walker.NextNode( _iterationNode ); + } + + UpdateWarning( _iterationNode ); + } + } + + Node _iterationNode = null; + int numNodeTests = 100; + + void UpdateWarning( Node n ) + { + if ( n == null ) + { + return; + } + + n.UpdateConfigurationWarnings(); + } + + #endif } } \ No newline at end of file diff --git a/Runtime/Graphs/Trees/TreeWalker.cs b/Runtime/Graphs/Trees/TreeWalker.cs index 8a127e2..3d214cf 100644 --- a/Runtime/Graphs/Trees/TreeWalker.cs +++ b/Runtime/Graphs/Trees/TreeWalker.cs @@ -262,6 +262,17 @@ namespace Rokojori return null; } + public N NextAfterChildren( N node ) + { + var lastGrandChild = LastGrandChild( node ); + + if ( lastGrandChild != null ) + { + return NextNode( lastGrandChild ); + } + + return NextNode( node ); + } public bool IsChildOf( N child, N parent ) { @@ -488,7 +499,26 @@ namespace Rokojori Iterate( node, addToList, childrenOnly ); } - + + + public void PruneChildTraversal( N root, Func callback ) + { + var it = NextNode( root ); + + while ( it != null && IsChildOf( it, root ) ) + { + var continueWithChildren = callback( it ); + + if ( continueWithChildren ) + { + it = NextNode( it ); + } + else + { + it = NextAfterChildren( it ); + } + } + } } diff --git a/Runtime/Interactions/Grabbable.cs b/Runtime/Interactions/Grabbable.cs index 85f1346..0db9de8 100644 --- a/Runtime/Interactions/Grabbable.cs +++ b/Runtime/Interactions/Grabbable.cs @@ -28,11 +28,25 @@ namespace Rokojori [Export] public RigidBody3D rigidBody3D; - - [Export] Pointable pointable; - + [Export] - public bool disablePointableDuringGrab = true; + public Pointable pointable; + + + bool _disablePointableDuringGrab; + [Export] + public bool disablePointableDuringGrab + { + get => _disablePointableDuringGrab; + set + { + _disablePointableDuringGrab = value; + + #if TOOLS + UpdateConfigurationWarnings(); + #endif + } + } [ExportGroup("Read Only")] [Export] @@ -40,6 +54,28 @@ namespace Rokojori protected bool enablePointableOnRelease = false; + public override string[] _GetConfigurationWarnings() + { + var warnigns = new List(); + + if ( grabTarget == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" + "No grabTarget assigned."); + } + + if ( rigidBody3D == null ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" + "No rigidBody3D assigned."); + } + + if ( pointable == null && _disablePointableDuringGrab ) + { + warnigns.Add( HierarchyName.Of( this ) + ":" + "No pointable assigned, although 'disablePointableDuringGrab' is active."); + } + + return warnigns.ToArray(); + } + public void SetGrabber( Grabber grabber ) { this.grabber = grabber; diff --git a/Runtime/Localization/LocaleManager.cs b/Runtime/Localization/LocaleManager.cs index 8ddb4d3..3ea3838 100644 --- a/Runtime/Localization/LocaleManager.cs +++ b/Runtime/Localization/LocaleManager.cs @@ -50,7 +50,7 @@ namespace Rokojori lc = lm.languageLocale; } - RJLog.Log( "currentLanguage", lc ); + // RJLog.Log( "currentLanguage", lc ); return lc; } diff --git a/Runtime/Math/Math3D.cs b/Runtime/Math/Math3D.cs index 90648b4..226343a 100644 --- a/Runtime/Math/Math3D.cs +++ b/Runtime/Math/Math3D.cs @@ -709,6 +709,11 @@ namespace Rokojori return q.X == 0 && q.Y == 0 && q.Z == 0 && q.W == 0; } + public static bool IsZero( this Vector3 v ) + { + return v.X == 0 && v.Y == 0 && v.Z == 0; + } + public static bool IsValid( this Quaternion q ) { return ! ( q.IsFinite() || q.IsZero() ); @@ -776,6 +781,11 @@ namespace Rokojori return node.GlobalTransform.Basis.Scale; } + public static Vector3 GetPosition( this Node3D node, bool global = false ) + { + return global ? node.GlobalPosition : node.Position; + } + public static float GetGlobalUniScale( Node3D node ) { var scale3 = GetGlobalScale( node ); diff --git a/Runtime/Networking/NetworkManager.cs b/Runtime/Networking/NetworkManager.cs index df070d8..bfd63bf 100644 --- a/Runtime/Networking/NetworkManager.cs +++ b/Runtime/Networking/NetworkManager.cs @@ -72,7 +72,7 @@ namespace Rokojori public override void _Process( double delta ) { - if ( ! IsInSession ) + if ( sessionManager == null || ! sessionManager.isInSession ) { return; } diff --git a/Runtime/Random/IDGenerator.cs b/Runtime/Random/IDGenerator.cs new file mode 100644 index 0000000..568a5ab --- /dev/null +++ b/Runtime/Random/IDGenerator.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using Godot; +using System; +using System.Text; + + + +namespace Rokojori +{ + public class IDGenerator + { + static readonly string DefaultID_CharacterSet = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + + static readonly int DefaultID_NumCharacters = 16; + + protected string characterSet = IDGenerator.DefaultID_CharacterSet; + protected int numCharacters = DefaultID_NumCharacters; + + + + public IDGenerator set( string characterSet, int numCharacters ) + { + this.characterSet = characterSet; + this.numCharacters = numCharacters; + + return this; + } + + public static string GenerateID( RandomEngine randomEngine = null ) + { + var id = ""; + randomEngine = RandomEngine.CreateIfNull( randomEngine ); + + for ( var i = 0; i < DefaultID_NumCharacters; i++ ) + { + var randomCharacter = randomEngine.From( DefaultID_CharacterSet ); + id += randomCharacter; + } + + return id; + } + + public string generate( RandomEngine randomEngine = null ) + { + var id = new StringBuilder(); + randomEngine = RandomEngine.CreateIfNull( randomEngine ); + + for ( var i = 0; i < numCharacters; i++ ) + { + var randomCharacter = randomEngine.From( characterSet ); + id.Append( randomCharacter ); + } + + return id.ToString(); + } + + } +} \ No newline at end of file diff --git a/Runtime/Random/IDGenerator.cs.uid b/Runtime/Random/IDGenerator.cs.uid new file mode 100644 index 0000000..dd5767b --- /dev/null +++ b/Runtime/Random/IDGenerator.cs.uid @@ -0,0 +1 @@ +uid://bc5kpq03hnesn diff --git a/Runtime/Selectors/SelectorFlag.cs b/Runtime/Selectors/SelectorFlag.cs index f662537..f27f943 100644 --- a/Runtime/Selectors/SelectorFlag.cs +++ b/Runtime/Selectors/SelectorFlag.cs @@ -12,6 +12,9 @@ namespace Rokojori [GlobalClass] public partial class SelectorFlag:Resource { - + public override string ToString() + { + return HierarchyName.Of( this ); + } } } \ No newline at end of file diff --git a/Runtime/Shading/Materials/CustomMaterialProperty.cs b/Runtime/Shading/Materials/CustomMaterialProperty.cs index 400b17d..f9b31b6 100644 --- a/Runtime/Shading/Materials/CustomMaterialProperty.cs +++ b/Runtime/Shading/Materials/CustomMaterialProperty.cs @@ -20,6 +20,8 @@ namespace Rokojori return _name as S; } + public string propertyName => _name.propertyName; + public T Get() { return _name._Get( _material, default( T ) ); diff --git a/Runtime/Structures/MapList.cs b/Runtime/Structures/MapList.cs index f4b8d5e..82a5309 100644 --- a/Runtime/Structures/MapList.cs +++ b/Runtime/Structures/MapList.cs @@ -21,6 +21,16 @@ namespace Rokojori this[ key ].Add( value ); } + public void AddIfNotPresent( K key, V value ) + { + if ( ContainsKey( key ) && this[ key ].Contains( value ) ) + { + return; + } + + Add( key, value ); + } + public void Remove( K key, V value ) { if ( ! ContainsKey( key ) ) diff --git a/Runtime/Testing/CheckAttribute.cs b/Runtime/Testing/CheckAttribute.cs new file mode 100644 index 0000000..e69de29 diff --git a/Runtime/Testing/CheckAttribute.cs.uid b/Runtime/Testing/CheckAttribute.cs.uid new file mode 100644 index 0000000..03509e1 --- /dev/null +++ b/Runtime/Testing/CheckAttribute.cs.uid @@ -0,0 +1 @@ +uid://be3ypxsvvjele diff --git a/Runtime/Testing/CheckTransforms.cs b/Runtime/Testing/CheckTransforms.cs new file mode 100644 index 0000000..3110e71 --- /dev/null +++ b/Runtime/Testing/CheckTransforms.cs @@ -0,0 +1,81 @@ +using Godot; + +using System.Collections.Generic; +using System; +using System.Threading.Tasks; +using System.Reflection; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class CheckTransforms:DebugAction + { + protected new const string name = "Check Transforms"; + + [Export] + public Node[] roots = []; + + + int _numProcessed = 0; + + protected override void _OnTrigger() + { + ClearMessages(); + + _numProcessed = 0; + + var id = DispatchStart(); + + + roots.ForEach( + ( r )=> + { + Nodes.ForEach( r, n => CheckTransformsOf( n ) ); + } + ); + + UpdateStatus( "Processed: " + _numProcessed ); + + FinishMessages(); + DispatchEnd( id ); + } + + void CheckTransformsOf( Node3D node3D ) + { + if ( ! Math3D.IsValid( node3D.GlobalPosition ) ) + { + Error( node3D, "GlobalPosition not valid", node3D.GlobalPosition ); + } + + if ( ! Math3D.IsValid( node3D.Position ) ) + { + Error( node3D, "Position not valid", node3D.Position ); + } + + if ( ! Math3D.IsValid( node3D.GlobalRotation ) ) + { + Error( node3D, "GlobalRotation not valid", node3D.GlobalRotation ); + } + + if ( ! Math3D.IsValid( node3D.Rotation ) ) + { + Error( node3D, "Rotation not valid", node3D.Rotation ); + } + + if ( ! Math3D.IsValid( node3D.Scale ) ) + { + Error( node3D, "Scale not valid", node3D.Scale ); + } + + if ( Math3D.IsZero( node3D.Scale ) ) + { + Error( node3D, "Scale is zero", node3D.Scale ); + } + + _numProcessed ++; + } + + + } +} \ No newline at end of file diff --git a/Runtime/Testing/CheckTransforms.cs.uid b/Runtime/Testing/CheckTransforms.cs.uid new file mode 100644 index 0000000..60a7748 --- /dev/null +++ b/Runtime/Testing/CheckTransforms.cs.uid @@ -0,0 +1 @@ +uid://cau3dsmyw72km diff --git a/Runtime/Testing/CheckWarnings.cs b/Runtime/Testing/CheckWarnings.cs new file mode 100644 index 0000000..f7811c9 --- /dev/null +++ b/Runtime/Testing/CheckWarnings.cs @@ -0,0 +1,55 @@ +using Godot; + +using System.Collections.Generic; +using System; +using System.Threading.Tasks; +using System.Reflection; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class CheckWarnings:DebugAction + { + protected new const string name = "Check Warnings"; + + [Export] + public Node[] roots = []; + + int _numProcessed = 0; + + protected override void _OnTrigger() + { + ClearMessages(); + + _numProcessed = 0; + + var id = DispatchStart(); + + + roots.ForEach( + ( r )=> + { + Nodes.ForEach( r, n => CheckWarningsOf( n ) ); + } + ); + + UpdateStatus( "Processed: " + _numProcessed ); + + FinishMessages(); + DispatchEnd( id ); + } + + void CheckWarningsOf( Node n ) + { + var warnings = n._GetConfigurationWarnings(); + + if ( warnings != null && warnings.Length > 0 ) + { + Warning( n, "Has " + warnings.Length + " warnings"); + } + + _numProcessed ++; + } + } +} \ No newline at end of file diff --git a/Runtime/Testing/CheckWarnings.cs.uid b/Runtime/Testing/CheckWarnings.cs.uid new file mode 100644 index 0000000..f6c7b18 --- /dev/null +++ b/Runtime/Testing/CheckWarnings.cs.uid @@ -0,0 +1 @@ +uid://dfxk0nger1ug diff --git a/Runtime/Testing/DebugAction.cs b/Runtime/Testing/DebugAction.cs new file mode 100644 index 0000000..2ad40fd --- /dev/null +++ b/Runtime/Testing/DebugAction.cs @@ -0,0 +1,102 @@ +using Godot; + +using System.Collections.Generic; +using System; +using System.Threading.Tasks; +using System.Reflection; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class DebugAction:SequenceAction + { + protected const string name = "Run"; + + + protected List _messages = []; + + [Export] + public DebugMessage[] messages = []; + + public void ClearMessages() + { + _messages.Clear(); + messages = []; + } + + public void FinishMessages() + { + messages = _messages.ToArray(); + } + + [Export(PropertyHint.MultilineText)] + public string status = ""; + + + public virtual void UpdateStatus( string status) + { + this.status = RJLog.Stringify( + status + ( status == "" ? "" : "," ), + "Errors:", + _messages.FindAll( m => m.type == MessageType.Error ).Count + ",", + + "Warnings:", + _messages.FindAll( m => m.type == MessageType.Warning ).Count + ); + } + + [ExportToolButton( name )] + public Callable RunButton => Callable.From( + ()=> + { + Trigger( this ); + } + ); + + void AddMessage( MessageType type, Node n, params object[] messages ) + { + var msg = new DebugMessage(); + msg.type = type; + msg.node = n.GetPath(); + msg.content = HierarchyName.Of( n ) + ":" + RJLog.Stringify( messages ); + + _messages.Add( msg ); + } + + void AddMessage( MessageType type, params object[] messages ) + { + var msg = new DebugMessage(); + msg.type = type; + msg.content = RJLog.Stringify( messages ); + + _messages.Add( msg ); + } + + public void Verbose( Node n, params object[] messages ) + { + AddMessage( MessageType.Verbose, n, messages ); + } + + public void Verbose( params object[] messages ) + { + AddMessage( MessageType.Verbose, messages ); + } + + + public void Info( Node n, params object[] messages ) + { + AddMessage( MessageType.Info, n, messages ); + } + + public void Error( Node n, params object[] messages ) + { + AddMessage( MessageType.Error, n, messages ); + } + + public void Warning( Node n, params object[] messages ) + { + AddMessage( MessageType.Warning, n, messages ); + } + } +} \ No newline at end of file diff --git a/Runtime/Testing/DebugAction.cs.uid b/Runtime/Testing/DebugAction.cs.uid new file mode 100644 index 0000000..0e32fe1 --- /dev/null +++ b/Runtime/Testing/DebugAction.cs.uid @@ -0,0 +1 @@ +uid://bpch2aat78rqo diff --git a/Runtime/Testing/DebugMessage.cs b/Runtime/Testing/DebugMessage.cs new file mode 100644 index 0000000..849a1d2 --- /dev/null +++ b/Runtime/Testing/DebugMessage.cs @@ -0,0 +1,62 @@ +using Godot; + +using System.Collections.Generic; +using System; +using System.Threading.Tasks; +using System.Reflection; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class DebugMessage:Resource + { + [Export] + public MessageType type; + + [Export(PropertyHint.MultilineText)] + public string content; + + [ExportToolButton( "Show Node")] + public Callable ShowNodeButton => Callable.From( + ( ) => + { + if ( node == null ) + { + return; + } + + + + #if TOOLS + + var root = EditorInterface.Singleton.GetEditedSceneRoot(); + + var resolvedNode = root.GetNode( node ); + + if ( resolvedNode == null ) + { + this.LogError( "Couldn't resolve node", node ); + return; + } + + this.LogInfo( resolvedNode ); + // var selection = EditorInterface.Singleton.GetSelection(); + // selection.Clear(); + // selection.AddNode( resolvedNode ); + + EditorInterface.Singleton.InspectObject( resolvedNode ); + + + #endif + } + ); + + [Export] + public NodePath node; + + [Export] + public Resource resource; + + } +} \ No newline at end of file diff --git a/Runtime/Testing/DebugMessage.cs.uid b/Runtime/Testing/DebugMessage.cs.uid new file mode 100644 index 0000000..b70dca9 --- /dev/null +++ b/Runtime/Testing/DebugMessage.cs.uid @@ -0,0 +1 @@ +uid://b2pay1d2traba diff --git a/Runtime/Time/DateTime/DateMath.cs b/Runtime/Time/DateTime/DateMath.cs new file mode 100644 index 0000000..e187b1b --- /dev/null +++ b/Runtime/Time/DateTime/DateMath.cs @@ -0,0 +1,26 @@ + +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using System; +using Godot; + + +namespace Rokojori +{ + public static class DateMath + { + public static float GetDifference( this DateTime a, DateTime b ) + { + return (float) ( ( a - b ).TotalSeconds ); + } + + public static bool HasExpired( this DateTime oldTime, float duration ) + { + var difference = GetDifference( DateTime.Now, oldTime ); + + return difference >= duration; + } + } + +} \ No newline at end of file diff --git a/Runtime/Time/DateTime/DateMath.cs.uid b/Runtime/Time/DateTime/DateMath.cs.uid new file mode 100644 index 0000000..a271c11 --- /dev/null +++ b/Runtime/Time/DateTime/DateMath.cs.uid @@ -0,0 +1 @@ +uid://ua87gtx3gt06 diff --git a/Runtime/Time/TImeLineManager_Scheduling.cs b/Runtime/Time/TImeLineManager_Scheduling.cs index 57f5255..99b27e0 100644 --- a/Runtime/Time/TImeLineManager_Scheduling.cs +++ b/Runtime/Time/TImeLineManager_Scheduling.cs @@ -73,6 +73,11 @@ namespace Rokojori timeline = TimeLineManager.Ensure( timeline ); var runner = timeline.runner; + if ( runner == null ) + { + return null; + } + var start = timeline.position + delay; var end = start + duration; diff --git a/Runtime/Time/TimeLineManager.cs b/Runtime/Time/TimeLineManager.cs index 8ea6013..a8ddd39 100644 --- a/Runtime/Time/TimeLineManager.cs +++ b/Runtime/Time/TimeLineManager.cs @@ -79,7 +79,7 @@ namespace Rokojori public int GetTimeLineIndex( TimeLine timeLine ) { - return Arrays.IndexOf( timeLines, timeLine ); + return timeLines == null ? -1 : Arrays.IndexOf( timeLines, timeLine ); } public void Modulate( TimeLine timeline, AnimationCurve c, Action onReady ) diff --git a/Runtime/Time/TimeLines/UITime.tres b/Runtime/Time/TimeLines/UITime.tres new file mode 100644 index 0000000..483564e --- /dev/null +++ b/Runtime/Time/TimeLines/UITime.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="TimeLine" load_steps=2 format=3 uid="uid://b4iykcwesp1y6"] + +[ext_resource type="Script" uid="uid://fqm54rn8fnnl" path="res://addons/rokojori_action_library/Runtime/Time/TimeLine.cs" id="1_xynux"] + +[resource] +script = ExtResource("1_xynux") +isLooping = false +loopStart = 0.0 +loopEnd = 100000.0 +startSpeed = 1.0 +autoStart = true diff --git a/Runtime/Tools/Arrays.cs b/Runtime/Tools/Arrays.cs index 557bdc4..98d07a2 100644 --- a/Runtime/Tools/Arrays.cs +++ b/Runtime/Tools/Arrays.cs @@ -53,13 +53,25 @@ namespace Rokojori return -1; } - public static T Find( T[] values, Func predicate ) + public static T Find( this T[] values, Func predicate ) { var entryIndex = FindIndex( values, predicate ); return entryIndex == -1 ? default(T) : values[ entryIndex ]; } + public static T FindNonNull( this T[] values, Func predicate ) + { + if ( values == null ) + { + return default(T); + } + + var entryIndex = FindIndex( values, ( v ) => v != null && predicate( v ) ); + + return entryIndex == -1 ? default(T) : values[ entryIndex ]; + } + public static bool Contains ( T[] values, T other ) { return Array.IndexOf( values, other ) != -1; diff --git a/Runtime/Tools/Boxed/BoxedFloatValue.cs b/Runtime/Tools/Boxed/BoxedFloatValue.cs new file mode 100644 index 0000000..a546916 --- /dev/null +++ b/Runtime/Tools/Boxed/BoxedFloatValue.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class BoxedFloatValue:Resource + { + + public virtual float GetFloatValue() + { + return 0; + } + + public virtual void SetFloatValue( float value ) + { + + } + + public override string ToString() + { + return this.GetType().Name + "( " + RegexUtility.NumberToString( GetFloatValue() ) + " )"; + } + + + public static void Lerp( BoxedFloatValue a, BoxedFloatValue b, float amount, BoxedFloatValue output ) + { + if ( a == null || b == null || output == null ) + { + return; + } + + output.SetFloatValue( Mathf.Lerp( a.GetFloatValue(), b.GetFloatValue(), amount ) ); + } + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/BoxedFloatValue.cs.uid b/Runtime/Tools/Boxed/BoxedFloatValue.cs.uid new file mode 100644 index 0000000..f46d756 --- /dev/null +++ b/Runtime/Tools/Boxed/BoxedFloatValue.cs.uid @@ -0,0 +1 @@ +uid://d2l63proa4fod diff --git a/Runtime/Tools/Boxed/ColorValue.cs b/Runtime/Tools/Boxed/ColorValue.cs index bd29cd3..cd0bc23 100644 --- a/Runtime/Tools/Boxed/ColorValue.cs +++ b/Runtime/Tools/Boxed/ColorValue.cs @@ -26,6 +26,19 @@ namespace Rokojori return cv; } + public static ColorValue Create( ColorValue value ) + { + if ( value == null ) + { + return null; + } + + var cv = new ColorValue(); + cv.value = value.value; + return cv; + + } + public static ColorValue Clone( ColorValue value, bool deepClone ) { if ( deepClone ) diff --git a/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs b/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs new file mode 100644 index 0000000..b464d79 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class BoolFloatValue:BoxedFloatValue + { + [Export] + public bool value; + + public override float GetFloatValue() + { + return value ? 1f : 9f; + } + + public override void SetFloatValue( float value ) + { + this.value = value > 0.5f; + } + + public static BoolFloatValue Create( float value ) + { + var fv = new BoolFloatValue(); + fv.value = value > 0.5f; + + return fv; + } + + public static BoolFloatValue Create( double value ) + { + return Create( (float) value ); + } + + public static BoolFloatValue Clone( BoolFloatValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ? 1f : 0f); + } + + return value; + } + + public static BoolFloatValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new BoolFloatValue { value = floatValue.GetFloatValue() > 0.5f }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs.uid b/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs.uid new file mode 100644 index 0000000..54bd2d9 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/BoolFloatValue.cs.uid @@ -0,0 +1 @@ +uid://y1ku3iitb6bh diff --git a/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs b/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs new file mode 100644 index 0000000..c7a959d --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Float16Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,16")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Float16Value Create( float value ) + { + var fv = new Float16Value(); + fv.value = value; + + return fv; + } + + public static Float16Value Create( double value ) + { + return Create( (float) value ); + } + + public static Float16Value Clone( Float16Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Float16Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Float16Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs.uid new file mode 100644 index 0000000..6848ca2 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float16Value.cs.uid @@ -0,0 +1 @@ +uid://b0kgrebe0q3ht diff --git a/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs b/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs new file mode 100644 index 0000000..3c3ce46 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Float256Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,256")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Float256Value Create( float value ) + { + var fv = new Float256Value(); + fv.value = value; + + return fv; + } + + public static Float256Value Create( double value ) + { + return Create( (float) value ); + } + + public static Float256Value Clone( Float256Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Float256Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Float256Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs.uid new file mode 100644 index 0000000..543e0ac --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float256Value.cs.uid @@ -0,0 +1 @@ +uid://72iqkk7yl6d8 diff --git a/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs b/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs new file mode 100644 index 0000000..2ba5926 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Float2Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,2")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Float2Value Create( float value ) + { + var fv = new Float2Value(); + fv.value = value; + + return fv; + } + + public static Float2Value Create( double value ) + { + return Create( (float) value ); + } + + public static Float2Value Clone( Float2Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Float2Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Float2Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs.uid new file mode 100644 index 0000000..9545ac0 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float2Value.cs.uid @@ -0,0 +1 @@ +uid://2gc332dhq6h6 diff --git a/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs b/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs new file mode 100644 index 0000000..5057bba --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Float4Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,4")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Float4Value Create( float value ) + { + var fv = new Float4Value(); + fv.value = value; + + return fv; + } + + public static Float4Value Create( double value ) + { + return Create( (float) value ); + } + + public static Float4Value Clone( Float4Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Float4Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Float4Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs.uid new file mode 100644 index 0000000..2ee0d3f --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float4Value.cs.uid @@ -0,0 +1 @@ +uid://bc40dwhrgpsr0 diff --git a/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs b/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs new file mode 100644 index 0000000..a740a9e --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Float8Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,8")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Float8Value Create( float value ) + { + var fv = new Float8Value(); + fv.value = value; + + return fv; + } + + public static Float8Value Create( double value ) + { + return Create( (float) value ); + } + + public static Float8Value Clone( Float8Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Float8Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Float8Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs.uid new file mode 100644 index 0000000..8747f55 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Float8Value.cs.uid @@ -0,0 +1 @@ +uid://fcr85dhuuhx7 diff --git a/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs b/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs new file mode 100644 index 0000000..106fffc --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class FloatDOFDistanceValue:BoxedFloatValue + { + [Export(PropertyHint.Range,"0.01,8192")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static FloatDOFDistanceValue Create( float value ) + { + var fv = new FloatDOFDistanceValue(); + fv.value = value; + + return fv; + } + + public static FloatDOFDistanceValue Create( double value ) + { + return Create( (float) value ); + } + + public static FloatDOFDistanceValue Clone( FloatDOFDistanceValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static FloatDOFDistanceValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new FloatDOFDistanceValue { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs.uid b/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs.uid new file mode 100644 index 0000000..c5342e2 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/FloatDOFDistance.cs.uid @@ -0,0 +1 @@ +uid://ju7lmk5w3ofw diff --git a/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs b/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs new file mode 100644 index 0000000..cc57a12 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class FloatDOFTransitionValue:BoxedFloatValue + { + [Export(PropertyHint.Range,"-1,8192")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static FloatDOFTransitionValue Create( float value ) + { + var fv = new FloatDOFTransitionValue(); + fv.value = value; + + return fv; + } + + public static FloatDOFTransitionValue Create( double value ) + { + return Create( (float) value ); + } + + public static FloatDOFTransitionValue Clone( FloatDOFTransitionValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static FloatDOFTransitionValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new FloatDOFTransitionValue { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs.uid b/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs.uid new file mode 100644 index 0000000..bf71cd1 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/FloatDOFTransitionValue.cs.uid @@ -0,0 +1 @@ +uid://b26si6ilxpea diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs b/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs new file mode 100644 index 0000000..ba36bbd --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Polar1024Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"-1024,1024")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Polar1024Value Create( float value ) + { + var fv = new Polar1024Value(); + fv.value = value; + + return fv; + } + + public static Polar1024Value Create( double value ) + { + return Create( (float) value ); + } + + public static Polar1024Value Clone( Polar1024Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Polar1024Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Polar1024Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs.uid new file mode 100644 index 0000000..a0ac2b5 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar1024Value.cs.uid @@ -0,0 +1 @@ +uid://bfa4er62bvogk diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs b/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs new file mode 100644 index 0000000..f2b4183 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Polar16Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"-16,16")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Polar16Value Create( float value ) + { + var fv = new Polar16Value(); + fv.value = value; + + return fv; + } + + public static Polar16Value Create( double value ) + { + return Create( (float) value ); + } + + public static Polar16Value Clone( Polar16Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Polar16Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Polar16Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs.uid new file mode 100644 index 0000000..28e38f2 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar16Value.cs.uid @@ -0,0 +1 @@ +uid://bjjubtyf02q1v diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs b/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs new file mode 100644 index 0000000..115d17d --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class Polar2Value:BoxedFloatValue + { + [Export(PropertyHint.Range,"-2,2")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static Polar2Value Create( float value ) + { + var fv = new Polar2Value(); + fv.value = value; + + return fv; + } + + public static Polar2Value Create( double value ) + { + return Create( (float) value ); + } + + public static Polar2Value Clone( Polar2Value value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static Polar2Value Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new Polar2Value { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs.uid b/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs.uid new file mode 100644 index 0000000..b4c1aab --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/Polar2Value.cs.uid @@ -0,0 +1 @@ +uid://ddh3df5imkqkq diff --git a/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs b/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs new file mode 100644 index 0000000..b6a2d29 --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class PolarValue:BoxedFloatValue + { + [Export(PropertyHint.Range,"-1,1")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static PolarValue Create( float value ) + { + var fv = new PolarValue(); + fv.value = value; + + return fv; + } + + public static PolarValue Create( double value ) + { + return Create( (float) value ); + } + + public static PolarValue Clone( PolarValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + public static PolarValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new PolarValue { value = floatValue.GetFloatValue() }; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs.uid b/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs.uid new file mode 100644 index 0000000..5a4bb1c --- /dev/null +++ b/Runtime/Tools/Boxed/FloatRanges/PolarValue.cs.uid @@ -0,0 +1 @@ +uid://csmp7gbpbwb5w diff --git a/Runtime/Tools/Boxed/FloatValue.cs b/Runtime/Tools/Boxed/FloatValue.cs index 9f11fba..c1e01db 100644 --- a/Runtime/Tools/Boxed/FloatValue.cs +++ b/Runtime/Tools/Boxed/FloatValue.cs @@ -8,16 +8,21 @@ namespace Rokojori { [Tool] [GlobalClass] - public partial class FloatValue:Resource + public partial class FloatValue:BoxedFloatValue { [Export] public float value; - public override string ToString() + public override float GetFloatValue() { - return "FloatValue( " + RegexUtility.NumberToString( value ) + " )"; + return value; } + public override void SetFloatValue( float value ) + { + this.value = value; + } + public static FloatValue Create( float value ) { var fv = new FloatValue(); @@ -41,15 +46,15 @@ namespace Rokojori return value; } - - public static void Lerp( FloatValue a, FloatValue b, float amount, FloatValue output ) + public static FloatValue Create( BoxedFloatValue floatValue ) { - if ( a == null || b == null || output == null ) + if ( floatValue == null ) { - return; + return null; } - output.value = Mathf.Lerp( a.value, b.value, amount ); - } + return new FloatValue { value = floatValue.GetFloatValue() }; + } + } } \ No newline at end of file diff --git a/Runtime/Tools/Boxed/NormalizedValue.cs b/Runtime/Tools/Boxed/NormalizedValue.cs new file mode 100644 index 0000000..42832c5 --- /dev/null +++ b/Runtime/Tools/Boxed/NormalizedValue.cs @@ -0,0 +1,62 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class NormalizedValue:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,1")] + public float value; + + public override float GetFloatValue() + { + return value; + } + + public override void SetFloatValue( float value ) + { + this.value = value; + } + + public static NormalizedValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new NormalizedValue { value = floatValue.GetFloatValue() }; + } + + + public static NormalizedValue Create( float value ) + { + var fv = new NormalizedValue(); + fv.value = value; + + return fv; + } + + + public static NormalizedValue Create( double value ) + { + return Create( (float) value ); + } + + public static NormalizedValue Clone( NormalizedValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value ); + } + + return value; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/NormalizedValue.cs.uid b/Runtime/Tools/Boxed/NormalizedValue.cs.uid new file mode 100644 index 0000000..f6b479f --- /dev/null +++ b/Runtime/Tools/Boxed/NormalizedValue.cs.uid @@ -0,0 +1 @@ +uid://b0mm8ah33f6id diff --git a/Runtime/Tools/Boxed/PowerValue.cs b/Runtime/Tools/Boxed/PowerValue.cs new file mode 100644 index 0000000..2ce1f6a --- /dev/null +++ b/Runtime/Tools/Boxed/PowerValue.cs @@ -0,0 +1,66 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class PowerValue:BoxedFloatValue + { + [Export(PropertyHint.Range,"0,1")] + public float value; + + [Export(PropertyHint.Range,"0.1,10")] + public float power = 1.0f; + + public override float GetFloatValue() + { + return Mathf.Pow( value, power ); + } + + public override void SetFloatValue( float value ) + { + this.value = MathX.Base( power, value ); + } + + public static PowerValue Create( BoxedFloatValue floatValue ) + { + if ( floatValue == null ) + { + return null; + } + + return new PowerValue { value = floatValue.GetFloatValue() }; + } + + + public static PowerValue Create( float value, float power = 1.0f ) + { + var fv = new PowerValue(); + fv.value = value; + fv.power = power; + + return fv; + } + + + public static PowerValue Create( double value ) + { + return Create( (float) value ); + } + + public static PowerValue Clone( PowerValue value, bool deepClone ) + { + if ( deepClone ) + { + return value == null ? null : Create( value.value, value.power ); + } + + return value; + } + + } +} \ No newline at end of file diff --git a/Runtime/Tools/Boxed/PowerValue.cs.uid b/Runtime/Tools/Boxed/PowerValue.cs.uid new file mode 100644 index 0000000..0eba199 --- /dev/null +++ b/Runtime/Tools/Boxed/PowerValue.cs.uid @@ -0,0 +1 @@ +uid://1a3u3dm571er diff --git a/Runtime/Tools/Lists.cs b/Runtime/Tools/Lists.cs index 58eef5c..5753d85 100644 --- a/Runtime/Tools/Lists.cs +++ b/Runtime/Tools/Lists.cs @@ -13,6 +13,7 @@ namespace Rokojori int _offset; int _length; + public ListView( List list, int offset, int length ) { _list = list; @@ -50,6 +51,24 @@ namespace Rokojori public static class Lists { + public static void Union( this List list, List other ) + { + var set = new HashSet( list ); + set.UnionWith( other ); + list.Clear(); + list.AddRange( [.. set ] ); + } + + public static void AddIfNotPresent( this List values, T value ) + { + if ( values.Contains( value ) ) + { + return; + } + + values.Add( value ); + } + public static bool IsOneOf( T value, params T[] values ) { for ( int i = 0; i < values.Length; i++ ) @@ -660,7 +679,7 @@ namespace Rokojori } - public static List FilterType( List inputList ) where R:T + public static List FilterType( this List inputList ) where R:T { var list = new List(); diff --git a/Runtime/UI/Components/UIDragging.cs b/Runtime/UI/Components/UIDragging.cs new file mode 100644 index 0000000..f12a23f --- /dev/null +++ b/Runtime/UI/Components/UIDragging.cs @@ -0,0 +1,418 @@ + +using Godot; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Rokojori +{ + public class UIDragging + { + public class UIDraggingCallbacks: ICustomDisposer + { + public UI ui; + public Control control; + + public bool wasDisposed = false; + + public Action onMouseClick; + public Callable callable; + public Action onDragging; + public Action onProcess; + public Dictionary mouseEvents = new Dictionary(); + + public Dictionary mouseEventsDragging = new Dictionary(); + + public string uid = IDGenerator.GenerateID(); + public string GetUID(){ return uid; } + + string info = ""; + public string GetInfo(){ return info;} + + public void Set( Control c, Func callback ) + { + var callbacks = this; + callbacks.control = c; + callbacks.ui = c.FindParentThatIs(); + + callbacks.ui.AddForDisposing( callbacks ); + + info = HierarchyName.Of( c ); + + + callbacks.onProcess = (float delta )=> + { + foreach ( var m in callbacks.mouseEvents ) + { + callback( callbacks.mouseEvents[ m.Key ] ); + } + }; + + callbacks.onDragging = ( InputEvent ie ) => + { + + if ( ie is InputEventMouseButton mb && ! mb.Pressed ) + { + callbacks.mouseEventsDragging[ mb.ButtonIndex ] = false; + + callbacks.mouseEvents[ mb.ButtonIndex ].UpdatePosition( mb.GlobalPosition, true ); + + callback( callbacks.mouseEvents[ mb.ButtonIndex ] ); + + if ( ! callbacks.hasAnyMouseDragging ) + { + callbacks.ui.onInputEvent.RemoveAction( callbacks.onDragging ); + callbacks.ui.onProcess.RemoveAction( callbacks.onProcess ); + callbacks.hasDraggingCallback = false; + + if ( c is UIStylePropertyContainer sc ) + { + sc.GetUISelectorFlags().Remove( UISelectorFlag.Dragging ); + } + } + } + + if ( ie is InputEventMouseMotion mo ) + { + var globalPosition = mo.GlobalPosition; + + foreach ( var m in callbacks.mouseEvents ) + { + callbacks.mouseEvents[ m.Key ].UpdatePosition( globalPosition ); + // callback( callbacks.mouseEvents[ m.Key ] ); + } + } + + + }; + + callbacks.onMouseClick = ( InputEvent ie )=> + { + if ( ! ( ie is InputEventMouseButton b && b.Pressed ) ) + { + return; + } + + var mb = ie as InputEventMouseButton; + + var button = mb.ButtonIndex; + + var draggingEvent = callbacks.GetMouseEvent( button ); + + draggingEvent.SetStart( mb.GlobalPosition ); + var result = callback( draggingEvent ); + + if ( ! result ) + { + return; + } + + if ( c is UIStylePropertyContainer sc ) + { + sc.GetUISelectorFlags().AddIfNotPresent( UISelectorFlag.Dragging ); + } + callbacks.mouseEventsDragging[ button ] = true; + + if ( ! callbacks.hasDraggingCallback ) + { + callbacks.ui.onInputEvent.AddAction( callbacks.onDragging ); + callbacks.ui.onProcess.AddAction( callbacks.onProcess ); + } + + }; + + + callbacks.Connect(); + + wasDisposed = false; + + } + + public void Dispose() + { + wasDisposed = true; + + if ( control != null && Node.IsInstanceValid( control ) ) + { + control.Disconnect( "gui_input", callable ); + } + + + + // ui = null; + // control = null; + + + onMouseClick = null; + onDragging = null; + onProcess = null; + + mouseEvents.Clear(); + + mouseEventsDragging.Clear(); + + // mouseEvents = null; + // mouseEventsDragging = null; + + } + + public bool hasAnyMouseDragging + { + get + { + foreach ( var mb in mouseEventsDragging ) + { + if ( mb.Value ) + { + return true; + } + + } + + return false; + } + } + + public bool hasDraggingCallback = false; + + public EditableUIDraggingEvent GetMouseEvent( MouseButton mb ) + { + if ( ! mouseEvents.ContainsKey( mb ) ) + { + mouseEvents[ mb ] = new EditableUIDraggingEvent( mb ); + } + + mouseEvents[ mb ].SetUI( ui ); + + return mouseEvents[ mb ]; + } + + public void Clear() + { + control.Disconnect( "gui_input", callable ); + } + + public void Connect() + { + callable = Callable.From( onMouseClick ); + control.Connect( "gui_input", callable ); + } + } + + public class UIDraggingEvent + { + public enum Phase + { + Start, + Dragging, + End + } + + protected Phase _phase = Phase.Start; + + public bool isStart => Phase.Start == _phase; + public bool isDragging => Phase.Dragging == _phase; + public bool isEnd => Phase.End == _phase; + protected UI _ui; + public UI ui => _ui; + + protected MouseButton _mouseButton; + public MouseButton mouseButton => _mouseButton; + public bool isLeftMouseButton => MouseButton.Left == _mouseButton; + public bool isMiddleMouseButton => MouseButton.Middle == _mouseButton; + public bool isRightMouseButton => MouseButton.Right == _mouseButton; + public Vector2 customOffset; + + protected int _touchID = -1; + + protected Vector2 _startPosition; + protected Vector2 _position; + protected Vector2 _lastPosition; + protected Vector2 _furthestPointFromStart; + protected float _biggestDistance; + + public Vector2 startPosition => _startPosition; + public Vector2 position => _position; + public Vector2 lastPosition => _lastPosition; + + public Vector2 movementSinceLastFrame => _position - lastPosition; + public Vector2 distanceToStart => _position - _startPosition; + + public Vector2 furthestPointToStart => _furthestPointFromStart; + public float maximumMovement => _biggestDistance; + + public UIDraggingEvent( MouseButton mb ) + { + _mouseButton = mb; + } + + public UIDraggingEvent( int touchID ) + { + this._touchID = touchID; + } + + } + + public class EditableUIDraggingEvent:UIDraggingEvent + { + + public EditableUIDraggingEvent( MouseButton mb ):base( mb ){} + public EditableUIDraggingEvent( int touchID ):base( touchID ){} + + public void SetUI( UI ui ) + { + _ui = ui; + } + + public void SetStart( Vector2 startPosition ) + { + _startPosition = startPosition; + _position = startPosition; + _lastPosition = startPosition; + _furthestPointFromStart = Vector2.Zero; + _phase = Phase.Start; + } + + public void UpdatePosition( Vector2 position, bool isEnd = false ) + { + _lastPosition = _position; + _position = position; + + var d = position.DistanceTo( _startPosition ); + + if ( d > _biggestDistance ) + { + _biggestDistance = d; + _furthestPointFromStart = position; + } + + _phase = isEnd ? Phase.End : Phase.Dragging; + } + } + + public static UIDraggingCallbacks OnLeftMouseButton( Control c, Action callback ) + { + return OnOneMouseButton( c, MouseButton.Left, callback ); + } + + public static UIDraggingCallbacks OnMiddleMouseButton( Control c, Action callback ) + { + return OnOneMouseButton( c, MouseButton.Middle, callback ); + } + + public static UIDraggingCallbacks OnRightMouseButton( Control c, Action callback ) + { + return OnOneMouseButton( c, MouseButton.Right, callback ); + } + + public static UIDraggingCallbacks OnOneMouseButton( Control c, MouseButton mouseButton, Action callback ) + { + var oneButtonCallback = ( UIDraggingEvent ev ) => + { + if ( ev.mouseButton != mouseButton ) + { + return false; + } + + callback( ev ); + + return true; + }; + + return OnAnyMouseButton( c, oneButtonCallback ); + } + + public static UIDraggingCallbacks OnAnyMouseButton( Control c, Func callback ) + { + + var callbacks = new UIDraggingCallbacks(); + callbacks.Set( c, callback ); + + // callbacks.control = c; + // callbacks.ui = c.FindParentThatIs(); + + // callbacks.ui.AddForDisposing( callbacks ); + + + // callbacks.onProcess = (float delta )=> + // { + // foreach ( var m in callbacks.mouseEvents ) + // { + // callback( callbacks.mouseEvents[ m.Key ] ); + // } + // }; + + // callbacks.onDragging = ( InputEvent ie ) => + // { + + // if ( ie is InputEventMouseButton mb && ! mb.Pressed ) + // { + // callbacks.mouseEventsDragging[ mb.ButtonIndex ] = false; + + // callbacks.mouseEvents[ mb.ButtonIndex ].UpdatePosition( mb.GlobalPosition, true ); + + // callback( callbacks.mouseEvents[ mb.ButtonIndex ] ); + + // if ( ! callbacks.hasAnyMouseDragging ) + // { + // callbacks.ui.onInputEvent.RemoveAction( callbacks.onDragging ); + // callbacks.ui.onProcess.RemoveAction( callbacks.onProcess ); + // callbacks.hasDraggingCallback = false; + // } + // } + + // if ( ie is InputEventMouseMotion mo ) + // { + // var globalPosition = mo.GlobalPosition; + + // foreach ( var m in callbacks.mouseEvents ) + // { + // callbacks.mouseEvents[ m.Key ].UpdatePosition( globalPosition ); + // // callback( callbacks.mouseEvents[ m.Key ] ); + // } + // } + + + // }; + + // callbacks.onMouseClick = ( InputEvent ie )=> + // { + // if ( ! ( ie is InputEventMouseButton b && b.Pressed ) ) + // { + // return; + // } + + // var mb = ie as InputEventMouseButton; + + // var button = mb.ButtonIndex; + + // var draggingEvent = callbacks.GetMouseEvent( button ); + + // draggingEvent.SetStart( mb.GlobalPosition ); + // var result = callback( draggingEvent ); + + // if ( ! result ) + // { + // return; + // } + + // callbacks.mouseEventsDragging[ button ] = true; + + // if ( ! callbacks.hasDraggingCallback ) + // { + // callbacks.ui.onInputEvent.AddAction( callbacks.onDragging ); + // callbacks.ui.onProcess.AddAction( callbacks.onProcess ); + // } + + // }; + + + // callbacks.Connect(); + + // c.Connect( "gui_input", Callable.From( callbacks.onMouseClick ) ); + // c.GuiInput += callbacks.onMouseClick; + + return callbacks; + } + } +} \ No newline at end of file diff --git a/Runtime/UI/Components/UIDragging.cs.uid b/Runtime/UI/Components/UIDragging.cs.uid new file mode 100644 index 0000000..aefe816 --- /dev/null +++ b/Runtime/UI/Components/UIDragging.cs.uid @@ -0,0 +1 @@ +uid://b7ykgc6yec5fj diff --git a/Runtime/UI/Components/UISlider.cs b/Runtime/UI/Components/UISlider.cs new file mode 100644 index 0000000..4460363 --- /dev/null +++ b/Runtime/UI/Components/UISlider.cs @@ -0,0 +1,354 @@ + +using Godot; +using System; +using System.IO; + +namespace Rokojori +{ + [Tool][GlobalClass] + public partial class UISlider : Node, IAssemblyReload + { + + [Export] + public Control button; + + [Export] + public Control background; + + [Export] + public Smoothing smoothing; + + public enum Direction + { + Vertical, + Horizontal, + Both + } + + [Export] + public Direction direction = Direction.Vertical; + + [Export] + public Vector2 sliderValue; + + [ExportGroup( "Scrolling")] + [Export] + public Control scrollTarget; + [Export] + public Control scrollContainer; + + [Export] + public bool adjustButtonSizeToScrollContent; + + [Export( PropertyHint.Range, "0,500, suffix:px")] + public float mouseWheelAbsoluteScroll = 10f; + + [Export( PropertyHint.Range, "0,100, suffix:%")] + public float mouseWheelRelativeScroll = 10f; + + Vector2 cachedMouseOffset; + Vector2 cachedButtonPosition; + + public void OnAssemblyReloaded() + { + AddDraggingListener(); + } + + string scrollID = IDGenerator.GenerateID(); + + public override void _Ready() + { + // button.GuiInput += OnGUIInput; + + // this.LogInfo( "S Adding new listeners" ); + AddDraggingListener(); + + if ( scrollTarget != null && scrollContainer != null ) + { + scrollContainer.Resized += SyncScroll; + + scrollContainer.GuiInput += ( InputEvent ie )=> + { + + if ( ie is InputEventMouseButton mb && + ( mb.ButtonIndex == MouseButton.WheelUp || mb.ButtonIndex == MouseButton.WheelDown || + mb.ButtonIndex == MouseButton.WheelLeft || mb.ButtonIndex == MouseButton.WheelRight ) + ) + { + var range = GetScrollRange(); + // var percentageAmount = 0.1f; + // var relativeToAbsolute = percentageAmount * range; + var absoluteAmount = mouseWheelAbsoluteScroll; + var absoluteToRelative = mouseWheelAbsoluteScroll * Vector2.One / range; + var buttonRange = absoluteToRelative * GetButtonScrollRange(); + + var scrollDelta = buttonRange; + + // this.LogInfo( leftMouseCallback == null, leftMouseCallback?.GetUID(), leftMouseCallback?.GetInfo(), leftMouseCallback?.wasDisposed ); + + + // scrollContainer.LogInfo( "Input", ie ); + + if ( mb.ButtonIndex == MouseButton.WheelUp ) + { + scrollDelta.Y *= -1; + } + + if ( mb.ButtonIndex == MouseButton.WheelLeft ) + { + scrollDelta.X *= -1; + } + + // sliderValue += scrollDelta; + // sliderValue = sliderValue.Clamp( 0, 1 ); + // SyncScroll(); + + if ( Direction.Horizontal == direction ) + { + scrollDelta.Y = 0; + } + else if ( Direction.Vertical == direction ) + { + scrollDelta.X = 0; + } + + + nextValue = ( button.Position + scrollDelta ).Clamp( Vector2.Zero, GetButtonScrollRange() ); + + // this.LogInfo( scrollDelta ); + + var ui = this.FindParentThatIs(); + + ui.onProcess.AddAction( UpdatePosition ); + ( button as UIStylePropertyContainer ).AddUISelectorFlag( UISelectorFlag.Scrolling, scrollID ); + + + } + }; + } + + if ( adjustButtonSizeToScrollContent ) + { + scrollTarget.Resized += UpdateButtonSize; + scrollContainer.Resized += UpdateButtonSize; + + UpdateButtonSize(); + } + + + } + + void UpdateButtonSize() + { + var value = new UINumber(); + var target = button as UIStylePropertyContainer; + + if ( Direction.Vertical == direction ) + { + value.value = Mathf.Min( 10, background.Size.Y - Mathf.Max( 10, scrollTarget.Size.Y - scrollContainer.Size.Y ) ); + target.SetUIStyleNumberProperty( UIStyleNumberProperty.Height, value ); + } + + if ( Direction.Horizontal == direction ) + { + value.value = Mathf.Min( 10, background.Size.X - Mathf.Max( 10, scrollTarget.Size.X - scrollContainer.Size.X ) ); + target.SetUIStyleNumberProperty( UIStyleNumberProperty.Width, value ); + } + } + + bool _dragging = false; + bool _updatingPosition = false; + + UIDragging.UIDraggingCallbacks leftMouseCallback; + + void AddDraggingListener() + { + + leftMouseCallback = UIDragging.OnLeftMouseButton( button, + ( ev )=> + { + if ( ev.isStart ) + { + cachedButtonPosition = button.Position; + smoothing.SetCurrent( cachedButtonPosition ); + + _dragging = true; + _updatingPosition = true; + + ev.ui.onProcess.AddAction( UpdatePosition ); + ( button as UIStylePropertyContainer ).AddUISelectorFlag( UISelectorFlag.Scrolling, scrollID ); + } + else if ( ev.isEnd ) + { + _dragging = false; + } + + var nextPosition = cachedButtonPosition + ev.distanceToStart; + nextValue = nextPosition.Clamp( Vector2.Zero, GetButtonScrollRange() ); + + } + ); + + UIDragging.OnMiddleMouseButton( scrollContainer, + ( ev )=> + { + if ( ev.isStart ) + { + cachedButtonPosition = button.Position; + smoothing.SetCurrent( cachedButtonPosition ); + + _dragging = true; + _updatingPosition = true; + + ev.ui.onProcess.AddAction( UpdatePosition ); + ( button as UIStylePropertyContainer ).AddUISelectorFlag( UISelectorFlag.Scrolling, scrollID ); + ev.customOffset = Vector2.Zero; + } + else if ( ev.isEnd ) + { + _dragging = false; + } + + ev.customOffset += ev.distanceToStart * 0.1f; + var nextPosition = cachedButtonPosition + ev.customOffset; + nextValue = nextPosition.Clamp( Vector2.Zero, GetButtonScrollRange() ); + ev.customOffset = nextValue - cachedButtonPosition; + + } + ); + + + } + + Vector2 cachedOffset = Vector2.Zero; + void UpdatePosition( float delta ) + { + + var value = Smoothing.Apply( smoothing, nextValue, delta ); + + var uiStyleContainer = ( UIStylePropertyContainer ) button; + + if ( ! _dragging && ( value - nextValue ).Length() < 1 ) + { + var ui = this.FindParentThatIs(); + ui.onProcess.RemoveAction( UpdatePosition ); + _updatingPosition = false; + // this.LogInfo( "Removed Processing" ); + + value = nextValue; + + uiStyleContainer.RemoveUISelectorFlag( UISelectorFlag.Scrolling, scrollID ); + + } + + + + + + if ( Direction.Both == direction || Direction.Horizontal == direction ) + { + var left = new UINumber(); + left.value = value.X; + uiStyleContainer.SetUIStyleNumberProperty( UIStyleNumberProperty.Left, left ); + } + + if ( Direction.Both == direction || Direction.Vertical == direction ) + { + var top = new UINumber(); + top.value = value.Y; + uiStyleContainer.SetUIStyleNumberProperty( UIStyleNumberProperty.Top, top ); + } + + var range = background.Size - button.Size; + sliderValue = button.Position / range; + + if ( scrollTarget != null && scrollContainer != null ) + { + var scrollRange = scrollTarget.Size - scrollContainer.Size; + + var scrollOffset = scrollRange * sliderValue; + + if ( Direction.Both == direction || Direction.Horizontal == direction ) + { + var left = new UINumber(); + left.value = -scrollOffset.X; + ( scrollTarget as UIStylePropertyContainer ).SetUIStyleNumberProperty( UIStyleNumberProperty.Left, left ); + } + + if ( Direction.Both == direction || Direction.Vertical == direction ) + { + var top = new UINumber(); + top.value = -scrollOffset.Y; + ( scrollTarget as UIStylePropertyContainer ).SetUIStyleNumberProperty( UIStyleNumberProperty.Top, top ); + } + } + + } + + Vector2 nextValue; + + Vector2 GetButtonScrollRange() + { + return ( background.Size - button.Size ).Max( Vector2.Zero ); + } + + Vector2 GetScrollRange() + { + return ( scrollTarget.Size - scrollContainer.Size ).Max( Vector2.Zero ); + } + + void SyncScroll() + { + if ( _dragging || _updatingPosition ) + { + // this.LogInfo( "SyncScroll blocked" ); + return; + } + + // this.LogInfo( "SyncScroll" ); + + var uiStyleContainer = ( UIStylePropertyContainer ) button; + var value = GetButtonScrollRange() * sliderValue; + + if ( Direction.Both == direction || Direction.Horizontal == direction ) + { + var left = new UINumber(); + left.value = value.X; + uiStyleContainer.SetUIStyleNumberProperty( UIStyleNumberProperty.Left, left ); + } + + if ( Direction.Both == direction || Direction.Vertical == direction ) + { + var top = new UINumber(); + top.value = value.Y; + uiStyleContainer.SetUIStyleNumberProperty( UIStyleNumberProperty.Top, top ); + } + + if ( scrollTarget != null && scrollContainer != null ) + { + var scrollRange = scrollTarget.Size - scrollContainer.Size; + + var scrollOffset = scrollRange * sliderValue; + + if ( Direction.Both == direction || Direction.Horizontal == direction ) + { + var left = new UINumber(); + left.value = -scrollOffset.X; + ( scrollTarget as UIStylePropertyContainer ).SetUIStyleNumberProperty( UIStyleNumberProperty.Left, left ); + } + + if ( Direction.Both == direction || Direction.Vertical == direction ) + { + var top = new UINumber(); + top.value = -scrollOffset.Y; + ( scrollTarget as UIStylePropertyContainer ).SetUIStyleNumberProperty( UIStyleNumberProperty.Top, top ); + } + } + } + + + + + + } +} \ No newline at end of file diff --git a/Runtime/UI/Components/UISlider.cs.uid b/Runtime/UI/Components/UISlider.cs.uid new file mode 100644 index 0000000..38d1ff0 --- /dev/null +++ b/Runtime/UI/Components/UISlider.cs.uid @@ -0,0 +1 @@ +uid://btwjt483gljv7 diff --git a/Runtime/UI/Layouts/UIFlowLayout.cs b/Runtime/UI/Layouts/UIFlowLayout.cs index bb66679..85b982c 100644 --- a/Runtime/UI/Layouts/UIFlowLayout.cs +++ b/Runtime/UI/Layouts/UIFlowLayout.cs @@ -80,12 +80,12 @@ namespace Rokojori } else { - maxWidth = UINumber.Compute( region, UIStyleNumberProperty.Width ); + maxWidth = UINumber.Compute( region, UIStyleNumberProperty.Width, 0 ); } - if ( ! UINumber.IsNullOrNone( UIStyle.GetUINumberProperty( region, UIStyleNumberProperty.Height ) ) ) + if ( ! UINumber.IsNullOrNone( UIStyle.GetUINumberProperty( region, UIStyleNumberProperty.Height, "", region ) ) ) { - maxHeight = UINumber.Compute( region, UIStyleNumberProperty.Height ); + maxHeight = UINumber.Compute( region, UIStyleNumberProperty.Height, 0 ); maxVerticalPlacementOffset = maxHeight - maxLineY; } diff --git a/Runtime/UI/Layouts/UILayouting.cs b/Runtime/UI/Layouts/UILayouting.cs index b27adbd..0c0c667 100644 --- a/Runtime/UI/Layouts/UILayouting.cs +++ b/Runtime/UI/Layouts/UILayouting.cs @@ -1,4 +1,5 @@ +using System.Linq; using Godot; using Rokojori; @@ -71,35 +72,52 @@ namespace Rokojori if ( uiImage.Material != null ) { - var ui = Unique.Get(); - - if ( ui == null ) - { - ui = NodesWalker.Get().GetInParents( control, n => n is UI ) as UI; - } + var ui = uiImage.GetUI(); if ( ui == null ) { - RJLog.Log( "No UI Found" ); + RJLog.Log( "No UI Found", HierarchyName.Of( uiImage ) ); return; } if ( ui.settings == null ) { - // RJLog.Log( "No UI.settings Found" ); + RJLog.Log( "No UI settings Found", HierarchyName.Of( uiImage ) ); return; } if ( ui.settings.sizePropertyName == null ) { - RJLog.Log( "No UI.settings.sizePropertyName Found" ); + // RJLog.Log( "No UI.settings.sizePropertyName Found" ); return; } //RJLog.Log( "Setting Size", ui.settings.sizePropertyName.propertyName, HierarchyName.Of( uiImage ) ); ui.settings.sizePropertyName.Set( uiImage.Material, uiImage.Size ); - UIShaderProperties.UpdateProperties( uiImage, uiImage.Material ); + // UIShaderProperties.UpdatePropertiesInHierarchy( uiImage, uiImage.Material ); + + var colorProperties = uiImage.imageType != null ? uiImage.imageType.GetColorShaderProperties() : []; + var colorPropertyName = new ColorPropertyName(); + foreach ( var c in colorProperties ) + { + // uiImage.LogInfo( c ); + var color = UIColor.Compute( control, UIStyleColorProperty.ColorShaderProperty, c, Colors.White ); + colorPropertyName.propertyName = c; + colorPropertyName.Set( uiImage.Material, color ); + } + + var numberProperties = uiImage.imageType != null ? uiImage.imageType.GetNumberShaderProperties() : []; + var numberPropertyName = new FloatPropertyName(); + foreach ( var n in numberProperties ) + { + // uiImage.LogInfo( c ); + var value = UINumber.Compute( control, UIStyleNumberProperty.FloatShaderProperty, n ); + numberPropertyName.propertyName = n; + numberPropertyName.Set( uiImage.Material, value ); + } + + return; } @@ -111,22 +129,23 @@ namespace Rokojori var container = (UIStylePropertyContainer) control; - text.uiTextLabelSettings.FontSize = - UINumber.ComputeInt( control, UIStyleNumberProperty.FontSize, UINumber.em(), UINumber.em() / 100f ); + text.uiTextLabelSettings.FontSize = Mathf.Max( 1, + UINumber.ComputeInt( control, UIStyleNumberProperty.FontSize, UINumber.em( control ), UINumber.em( control ) / 100f ) ); + text.uiTextLabelSettings.FontColor = - UIColor.Compute( control, UIStyleColorProperty.FontColor, Colors.White ); + UIColor.Compute( control, UIStyleColorProperty.FontColor, "", Colors.White ); text.uiTextLabelSettings.OutlineSize = UINumber.ComputeInt( control, UIStyleNumberProperty.FontOutlineSize, 0 ); text.uiTextLabelSettings.OutlineColor = - UIColor.Compute( control, UIStyleColorProperty.FontOutlineColor, Colors.Transparent ); + UIColor.Compute( control, UIStyleColorProperty.FontOutlineColor, "", Colors.Transparent ); text.uiTextLabelSettings.ShadowSize = UINumber.ComputeInt( control, UIStyleNumberProperty.FontShadowSize, 0 ); text.uiTextLabelSettings.ShadowColor = - UIColor.Compute( control, UIStyleColorProperty.FontShadowColor, Colors.Black ); + UIColor.Compute( control, UIStyleColorProperty.FontShadowColor, "", Colors.Black ); text.uiTextLabelSettings.ShadowOffset = new Vector2( UINumber.Compute( control, UIStyleNumberProperty.FontShadowOffsetX, 0 ), @@ -137,8 +156,19 @@ namespace Rokojori control.UpdateMinimumSize(); if ( text.alwaysMinimumSize ) - { - + { + if ( text.AutowrapMode == TextServer.AutowrapMode.Word ) + { + text.AutowrapMode = TextServer.AutowrapMode.Off; + var minSize = text.GetMinimumSize(); + text.AutowrapMode = TextServer.AutowrapMode.Word; + + var w = UINumber.Compute( control, UIStyleNumberProperty.Width, minSize.X, minSize.X / 100f ); + var h = UINumber.Compute( control, UIStyleNumberProperty.Height, minSize.Y, minSize.Y / 100f ); + + control.CustomMinimumSize = new Vector2( Mathf.Min( minSize.X, w ), 0 ); + } + control.Size = control.GetMinimumSize(); } else diff --git a/Runtime/UI/Nodes/UIHolder.cs b/Runtime/UI/Nodes/UIHolder.cs new file mode 100644 index 0000000..3a29292 --- /dev/null +++ b/Runtime/UI/Nodes/UIHolder.cs @@ -0,0 +1,21 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori +{ + public interface UIHolderControl + { + public void SetUI( UI ui); + public UI GetUI(); + } + + public class UIHolder + { + public static UI GetUI( Control c ) + { + return c is UIHolderControl ? ( (UIHolderControl)c ).GetUI() : c.FindParentThatIs(); + } + } +} \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIHolder.cs.uid b/Runtime/UI/Nodes/UIHolder.cs.uid new file mode 100644 index 0000000..4fa556c --- /dev/null +++ b/Runtime/UI/Nodes/UIHolder.cs.uid @@ -0,0 +1 @@ +uid://c3626fy08o6w2 diff --git a/Runtime/UI/Nodes/UIHoverable.cs b/Runtime/UI/Nodes/UIHoverable.cs new file mode 100644 index 0000000..c2a537d --- /dev/null +++ b/Runtime/UI/Nodes/UIHoverable.cs @@ -0,0 +1,12 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori +{ + public interface UIHoverable + { + public void SetUnhovered(); + } +} \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIHoverable.cs.uid b/Runtime/UI/Nodes/UIHoverable.cs.uid new file mode 100644 index 0000000..affda2a --- /dev/null +++ b/Runtime/UI/Nodes/UIHoverable.cs.uid @@ -0,0 +1 @@ +uid://cu4uhwhrfyct2 diff --git a/Runtime/UI/Nodes/UIImage.cs b/Runtime/UI/Nodes/UIImage.cs index 08890b0..907cef9 100644 --- a/Runtime/UI/Nodes/UIImage.cs +++ b/Runtime/UI/Nodes/UIImage.cs @@ -2,28 +2,21 @@ using Godot; using Rokojori; using System.Collections.Generic; - +using System.Linq; + namespace Rokojori { [Tool] [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UIImage.svg")] - public partial class UIImage:TextureRect, UIStylePropertyContainer + public partial class UIImage:TextureRect, UIStylePropertyContainer, UIHolderControl, IAssemblyReload { - [Export] - public bool freezeImageType = false; - UIImageType _imageType; [Export] public UIImageType imageType { get => _imageType; set - { - if ( freezeImageType ) - { - return; - } - + { if ( _imageType != value ) { if ( _imageType != null ) @@ -38,16 +31,72 @@ namespace Rokojori } } + UI ui; + + public void SetUI( UI ui ) + { + this.ui = ui; + } + + + public UI GetUI() + { + var ui = this.ui != null ? this.ui : Unique.Get(); + + if ( ui == null ) + { + ui = this.FindParentThatIs(); + + if ( ui == null ) + { + this.LogInfo( "No UI in parents >", ui ); + + return null; + } + } + + return ui; + } + void UpdateImageType() { ResetImageType(); if ( _imageType != null ) { + this.LogInfo( "Assigning Image Type:", _imageType ); _imageType.Assign( this ); } } + string hoverID = IDGenerator.GenerateID(); + + public override void _Ready() + { + MouseEntered += ()=> + { + AddUISelectorFlag( UISelectorFlag.Hover, hoverID ); + + }; + + MouseExited += ()=> + { + RemoveUISelectorFlag( UISelectorFlag.Hover, hoverID ); + }; + + UpdateImageType(); + } + + public override void _EnterTree() + { + UpdateImageType(); + } + + public void OnAssemblyReloaded() + { + UpdateImageType(); + } + void ResetImageType() { ExpandMode = TextureRect.ExpandModeEnum.IgnoreSize; @@ -55,6 +104,52 @@ namespace Rokojori Material = null; } + protected override void Dispose( bool disposing) + { + _selectorFlagReferenceCounter.Clear(); + } + + MapList _selectorFlagReferenceCounter = new MapList(); + + public void AddUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, true ); + } + + public void RemoveUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, false ); + } + + void SetSelectorFlagReference( UISelectorFlag flag, string reference, bool enable ) + { + if ( enable ) + { + _selectorFlagReferenceCounter.AddIfNotPresent( flag, reference ); + } + else + { + _selectorFlagReferenceCounter.Remove( flag ); + } + + _selectorFlags = _selectorFlagReferenceCounter.Keys.ToList(); + + UISelector.UpdateParentUISelectorFlags( this ); + } + + List _selectorFlags = []; + List _parentSelectorFlags = []; + + public List GetUISelectorFlags() + { + return _selectorFlags; + } + + public List GetParentUISelectorFlags() + { + return _parentSelectorFlags; + } + public void CopyNumberShaderPropertyFrom( CustomMaterialProperty name, UINumber number, TransitionSettings transition ) { SetNumberShaderProperty( name.GetPropertyName(), number, transition ); @@ -94,7 +189,6 @@ namespace Rokojori } shaderUINumber.number = number; - shaderUINumber.transitionSettings = transition; } public void CopyColorShaderPropertyFrom( CustomMaterialProperty name, UIColor color ) @@ -118,7 +212,6 @@ namespace Rokojori } } - if ( color == null ) { var index = Arrays.FindIndex( colorProperties, p => p != null && p.colorPropertyName.propertyName == name.propertyName ); @@ -126,10 +219,6 @@ namespace Rokojori return; } - - - - var shaderUIColor = Arrays.Find( colorProperties, p => p != null && p.colorPropertyName.propertyName == name.propertyName ); if ( shaderUIColor == null ) @@ -201,19 +290,19 @@ namespace Rokojori [ExportGroup( "Shader Properties" )] [Export] public ShaderUIColor[] colorProperties = new ShaderUIColor[ 0 ]; - public List> activeShaderColorTransitions = new List>(); - public List> GetActiveShaderUIColorTransitions() - { - return activeShaderColorTransitions; - } + // public List> activeShaderColorTransitions = new List>(); + // public List> GetActiveShaderUIColorTransitions() + // { + // return activeShaderColorTransitions; + // } [Export] public ShaderUINumber[] numberProperties = new ShaderUINumber[ 0 ]; - public List> activeShaderNumberTransitions = new List>(); - public List> GetActiveShaderUINumberTransitions() - { - return activeShaderNumberTransitions; - } + // public List> activeShaderNumberTransitions = new List>(); + // public List> GetActiveShaderUINumberTransitions() + // { + // return activeShaderNumberTransitions; + // } [ExportGroup("Transitions")] [Export] @@ -230,8 +319,8 @@ namespace Rokojori return numberTransitions; } - public List> activeNumberTransitions = new List>(); - public List> GetActiveUINumberTransitions() + public List> activeNumberTransitions = new List>(); + public List> GetActiveUINumberTransitions() { return activeNumberTransitions; } @@ -243,8 +332,8 @@ namespace Rokojori return colorTransitions; } - public List> activeColorTransitions = new List>(); - public List> GetActiveUIColorTransitions() + public List> activeColorTransitions = new List>(); + public List> GetActiveUIColorTransitions() { return activeColorTransitions; } @@ -282,8 +371,9 @@ namespace Rokojori return numberProperties; } - public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property ) + public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { + switch ( property ) { case UIStyleNumberProperty.Width: return width; @@ -311,12 +401,72 @@ namespace Rokojori case UIStyleNumberProperty.ScaleY: return scaleY; } + if ( UIStyleNumberProperty.FloatShaderProperty == property ) + { + var numberProperty = numberProperties.Find( n => n.floatPropertyName.propertyName == shaderPropertyName ); + + if ( numberProperty != null ) + { + return numberProperty.number; + } + + } + + return null; } - public UIColor GetUIStyleColorProperty( UIStyleColorProperty property ) + public void SetUIStyleNumberProperty( UIStyleNumberProperty property, UINumber number ) { - return null; + switch ( property ) + { + case UIStyleNumberProperty.Left: { left = number; } break; + case UIStyleNumberProperty.Right: { right = number; } break; + case UIStyleNumberProperty.Top: { top = number; } break; + case UIStyleNumberProperty.Bottom: { bottom = number; } break; + + case UIStyleNumberProperty.Width: { width = number; } break; + case UIStyleNumberProperty.Height: { height = number; } break; + + case UIStyleNumberProperty.Margin: { margin = number; } break; + + case UIStyleNumberProperty.MarginLeft: { marginLeft = number; } break; + case UIStyleNumberProperty.MarginRight: { marginRight = number; } break; + case UIStyleNumberProperty.MarginTop: { marginTop = number; } break; + case UIStyleNumberProperty.MarginBottom: { marginBottom = number; } break; + + case UIStyleNumberProperty.PivotX: { pivotX = number; } break; + case UIStyleNumberProperty.PivotY: { pivotY = number; } break; + case UIStyleNumberProperty.Rotation: { rotation = number; } break; + + case UIStyleNumberProperty.Scale: { scale = number; } break; + case UIStyleNumberProperty.ScaleX: { scaleX = number; } break; + case UIStyleNumberProperty.ScaleY: { scaleY = number; } break; + } + + } + + public UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) + { + if ( property != UIStyleColorProperty.ColorShaderProperty ) + { + return null; + } + + if ( imageType != null ) + { + var uiColor = imageType.GetUIStyleColorProperty( property, shaderPropertyName ); + + if ( uiColor != null ) + { + return uiColor; + } + } + + var shaderUIColor = colorProperties.Find( c => c.colorPropertyName.propertyName == shaderPropertyName ); + + return shaderUIColor != null ? shaderUIColor.color : null; + } public Font GetFont() diff --git a/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs b/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs index efb3642..8840e06 100644 --- a/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs +++ b/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs @@ -11,6 +11,27 @@ namespace Rokojori { Dictionary _materials = new Dictionary(); + static readonly string[] colorProperties = [ + RoundedRectangleShader.fillColor.propertyName, + RoundedRectangleShader.strokeColor.propertyName + ]; + + public override string[] GetColorShaderProperties() + { + return colorProperties; + } + + static readonly string[] numberProperties = [ + RoundedRectangleShader.borderRadius.propertyName, + RoundedRectangleShader.strokeSize.propertyName, + RoundedRectangleShader.offset.propertyName + ]; + + public override string[] GetNumberShaderProperties() + { + return numberProperties; + } + UIColor _fillColor; [Export] public UIColor fillColor @@ -35,13 +56,13 @@ namespace Rokojori set { _borderRadius = value; onChange.DispatchEvent( null ); } } - TransitionSettings _borderRadiusTransition; - [Export] - public TransitionSettings borderRadiusTransition - { - get => _borderRadiusTransition; - set { _borderRadiusTransition = value; onChange.DispatchEvent( null ); } - } + // TransitionSettings _borderRadiusTransition; + // [Export] + // public TransitionSettings borderRadiusTransition + // { + // get => _borderRadiusTransition; + // set { _borderRadiusTransition = value; onChange.DispatchEvent( null ); } + // } UINumber _strokeSize; [Export] @@ -51,13 +72,13 @@ namespace Rokojori set { _strokeSize = value; onChange.DispatchEvent( null ); } } - TransitionSettings _strokeSizeTransition; - [Export] - public TransitionSettings strokeSizeTransition - { - get => _strokeSizeTransition; - set { _strokeSizeTransition = value; onChange.DispatchEvent( null ); } - } + // TransitionSettings _strokeSizeTransition; + // [Export] + // public TransitionSettings strokeSizeTransition + // { + // get => _strokeSizeTransition; + // set { _strokeSizeTransition = value; onChange.DispatchEvent( null ); } + // } UINumber _offset; [Export] @@ -67,18 +88,38 @@ namespace Rokojori set { _offset = value; onChange.DispatchEvent( null ); } } - TransitionSettings _offsetTransition; - [Export] - public TransitionSettings offsetTransition + // TransitionSettings _offsetTransition; + // [Export] + // public TransitionSettings offsetTransition + // { + // get => _offsetTransition; + // set { _offsetTransition = value; onChange.DispatchEvent( null ); } + // } + + public override UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName ) { - get => _offsetTransition; - set { _offsetTransition = value; onChange.DispatchEvent( null ); } + if ( RoundedRectangleShader.fillColor.propertyName == shaderPropertyName ) + { + return fillColor; + } + + if ( RoundedRectangleShader.strokeColor.propertyName == shaderPropertyName ) + { + return strokeColor; + } + + return null; } protected override void _Assign( UIImage image ) { if ( _materials.ContainsKey( image ) ) { + if ( image.Material == null ) + { + image.Material = _materials[ image ]; + } + return; } @@ -101,18 +142,21 @@ namespace Rokojori protected override void _ApplyChange( UIImage image ) { - var material = _materials[ image ]; - image.CopyColorShaderPropertyFrom( material.fillColor, _fillColor ); - image.CopyColorShaderPropertyFrom( material.strokeColor, _strokeColor ); + // AssignColor( image, material.fillColor, _fillColor ); + // // image.CopyColorShaderPropertyFrom( material.fillColor, GetUIColor( _fillColor, image, material.fillColor.propertyName ) ); + // AssignColor( image, material.strokeColor, _strokeColor ); - image.CopyNumberShaderPropertyFrom( material.borderRadius, _borderRadius, _borderRadiusTransition ); - image.CopyNumberShaderPropertyFrom( material.strokeSize, _strokeSize, _strokeSizeTransition ); - image.CopyNumberShaderPropertyFrom( material.offset, _offset, _offsetTransition ); + // image.CopyNumberShaderPropertyFrom( material.borderRadius, _borderRadius, _borderRadiusTransition ); + // image.CopyNumberShaderPropertyFrom( material.strokeSize, _strokeSize, _strokeSizeTransition ); + // image.CopyNumberShaderPropertyFrom( material.offset, _offset, _offsetTransition ); } + + + } } \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIImageTypes/UIImageType.cs b/Runtime/UI/Nodes/UIImageTypes/UIImageType.cs index b564c39..49b5fea 100644 --- a/Runtime/UI/Nodes/UIImageTypes/UIImageType.cs +++ b/Runtime/UI/Nodes/UIImageTypes/UIImageType.cs @@ -2,7 +2,8 @@ using Godot; using Rokojori; using System.Collections.Generic; - +using System.Linq; + namespace Rokojori { [Tool] @@ -11,6 +12,7 @@ namespace Rokojori { public readonly EventSlot onChange = new EventSlot(); List _images = new List(); + public UIImageType() { @@ -35,6 +37,11 @@ namespace Rokojori _images.ForEach( i => _ApplyChange( i ) ); } + public virtual UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName ) + { + return null; + } + protected virtual void _ApplyChange( UIImage image ) { @@ -50,5 +57,40 @@ namespace Rokojori } + public virtual string[] GetColorShaderProperties() + { + return []; + } + + public virtual string[] GetNumberShaderProperties() + { + return []; + } + + protected UIColor GetUIColor( UIColor member, UIImage parent, string name ) + { + if ( member != null ) + { + return member; + } + + var style = parent.parentStyle; + + if ( style == null ) + { + return null; + } + + var colorProperty = style.colorProperties.Find( c => c.colorPropertyName.propertyName == name ); + + return colorProperty == null ? null : colorProperty.color; + } + + + protected void AssignColor( UIImage image, CustomMaterialProperty colorProperty, UIColor memberColor ) + { + image.CopyColorShaderPropertyFrom( colorProperty, GetUIColor( memberColor, image, colorProperty.propertyName ) ); + } + } } \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIInputInfo.cs b/Runtime/UI/Nodes/UIInputInfo.cs index 7304410..b26fd36 100644 --- a/Runtime/UI/Nodes/UIInputInfo.cs +++ b/Runtime/UI/Nodes/UIInputInfo.cs @@ -92,9 +92,17 @@ namespace Rokojori } + + UI ui; + + public void SetUI( UI ui ) + { + this.ui = ui; + } + InputIconsLibrary GetInputIconsLibrary() { - var ui = Unique.Get(); + var ui = this.ui != null ? this.ui : Unique.Get(); if ( ui == null ) { @@ -108,7 +116,7 @@ namespace Rokojori } } - var lib = ui.inputIconsLibrary; + var lib = ui.settings.inputIconsLibrary; return lib; } diff --git a/Runtime/UI/Nodes/UIRegion.cs b/Runtime/UI/Nodes/UIRegion.cs index d83bcd3..60116c6 100644 --- a/Runtime/UI/Nodes/UIRegion.cs +++ b/Runtime/UI/Nodes/UIRegion.cs @@ -1,12 +1,13 @@ using Godot; using System.Collections.Generic; - +using System.Linq; + namespace Rokojori { [Tool] [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UIRegion.svg")] - public partial class UIRegion : Control, UIStylePropertyContainer + public partial class UIRegion : Control, UIStylePropertyContainer, UIHolderControl { [Export] public UIStyle parentStyle; @@ -85,15 +86,15 @@ namespace Rokojori [Export] public UINumber shadowOffsetY; - public List> GetActiveShaderUIColorTransitions() - { - return null; - } + // public List> GetActiveShaderUIColorTransitions() + // { + // return null; + // } - public List> GetActiveShaderUINumberTransitions() - { - return null; - } + // public List> GetActiveShaderUINumberTransitions() + // { + // return null; + // } [ExportGroup("Transitions")] [Export] @@ -110,8 +111,8 @@ namespace Rokojori return numberTransitions; } - public List> activeNumberTransitions = new List>(); - public List> GetActiveUINumberTransitions() + public List> activeNumberTransitions = new List>(); + public List> GetActiveUINumberTransitions() { return activeNumberTransitions; } @@ -123,12 +124,29 @@ namespace Rokojori return colorTransitions; } - public List> activeColorTransitions = new List>(); - public List> GetActiveUIColorTransitions() + public List> activeColorTransitions = new List>(); + public List> GetActiveUIColorTransitions() { return activeColorTransitions; } + + #if TOOLS + [ExportGroup("Editor SceneSetup")] + [Export] + public UISettings uiSettings; + [Export] + public float fontZoom = 1f; + [Export] + public bool updateInEditor; + [Export] + public bool reassignUI; + [ExportGroup("Editor SceneSetup/Read Only")] + [Export] + public float computedFontSize = 0f; + #endif + + public UIStyle GetUIStyleParent() { return parentStyle; @@ -169,7 +187,7 @@ namespace Rokojori return GetSize(); } - public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property ) + public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { switch ( property ) { @@ -205,8 +223,43 @@ namespace Rokojori return null; } - public UIColor GetUIStyleColorProperty( UIStyleColorProperty property ) + public void SetUIStyleNumberProperty( UIStyleNumberProperty property, UINumber number ) { + switch ( property ) + { + case UIStyleNumberProperty.Left: { left = number; } break; + case UIStyleNumberProperty.Right: { right = number; } break; + case UIStyleNumberProperty.Top: { top = number; } break; + case UIStyleNumberProperty.Bottom: { bottom = number; } break; + + case UIStyleNumberProperty.HorizontalAlignment: { horizontalAlignment = number; } break; + case UIStyleNumberProperty.VerticalAlignment: { verticalAlignment = number; } break; + case UIStyleNumberProperty.VerticalPlacement: { verticalPlacement = number; } break; + case UIStyleNumberProperty.ElementSpacing: { elementSpacing = number; } break; + case UIStyleNumberProperty.LineSpacing: { lineSpacing = number; } break; + + + case UIStyleNumberProperty.Width: { width = number; } break; + case UIStyleNumberProperty.Height: { height = number; } break; + case UIStyleNumberProperty.Margin: { margin = number; } break; + + case UIStyleNumberProperty.MarginLeft: { marginLeft = number; } break; + case UIStyleNumberProperty.MarginRight: { marginRight = number; } break; + case UIStyleNumberProperty.MarginTop: { marginTop = number; } break; + case UIStyleNumberProperty.MarginBottom: { marginBottom = number; } break; + + case UIStyleNumberProperty.FontSize: { fontSize = number; } break; + case UIStyleNumberProperty.FontOutlineSize: { outlineSize = number; } break; + case UIStyleNumberProperty.FontShadowSize: { shadowSize = number; } break; + case UIStyleNumberProperty.FontShadowOffsetX: { shadowOffsetX = number; } break; + case UIStyleNumberProperty.FontShadowOffsetY: { shadowOffsetY = number; } break; + + } + + } + + public UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) + { switch ( property ) { case UIStyleColorProperty.FontColor: return fontColor; @@ -217,7 +270,69 @@ namespace Rokojori return null; } - public void Layout() + string hoverID = IDGenerator.GenerateID(); + + public override void _Ready() + { + MouseEntered += ()=> + { + AddUISelectorFlag( UISelectorFlag.Hover, hoverID ); + + }; + + MouseExited += ()=> + { + RemoveUISelectorFlag( UISelectorFlag.Hover, hoverID ); + }; + } + + MapList _selectorFlagReferenceCounter = new MapList(); + + public void AddUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, true ); + } + + public void RemoveUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, false ); + } + + protected override void Dispose( bool disposing) + { + _selectorFlagReferenceCounter.Clear(); + } + + void SetSelectorFlagReference( UISelectorFlag flag, string reference, bool enable ) + { + if ( enable ) + { + _selectorFlagReferenceCounter.AddIfNotPresent( flag, reference ); + } + else + { + _selectorFlagReferenceCounter.Remove( flag ); + } + + _selectorFlags = _selectorFlagReferenceCounter.Keys.ToList(); + + UISelector.UpdateParentUISelectorFlags( this ); + } + + List _selectorFlags = []; + List _parentSelectorFlags = []; + + public List GetUISelectorFlags() + { + return _selectorFlags; + } + + public List GetParentUISelectorFlags() + { + return _parentSelectorFlags; + } + + public virtual void Layout() { var layout = UIStyle.Layout( this ); @@ -235,6 +350,31 @@ namespace Rokojori public Vector2 contentSize = Vector2.Zero; public Vector2 contentOffset = Vector2.Zero; - + UI ui; + + public void SetUI( UI ui ) + { + this.ui = ui; + } + + public UI GetUI() + { + var ui = this.ui != null ? this.ui : Unique.Get(); + + if ( ui == null ) + { + ui = this.FindParentThatIs(); + + if ( ui == null ) + { + this.LogInfo( "No UI in parents >", ui ); + + return null; + } + } + + return ui; + } + } } \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIText.cs b/Runtime/UI/Nodes/UIText.cs index 122a7cf..f86bd7c 100644 --- a/Runtime/UI/Nodes/UIText.cs +++ b/Runtime/UI/Nodes/UIText.cs @@ -2,12 +2,13 @@ using Godot; using Rokojori; using System.Collections.Generic; - +using System.Linq; + namespace Rokojori { [Tool] [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UIText.svg")] - public partial class UIText:Label,UIStylePropertyContainer, iLocalizable + public partial class UIText:Label,UIStylePropertyContainer, iLocalizable, UIHolderControl, IAssemblyReload { LocalizedString _locale; @@ -41,6 +42,12 @@ namespace Rokojori } + public void OnAssemblyReloaded() + { + UpdateLocalization(); + UpdateFont(); + } + [Export] public bool alwaysMinimumSize = true; @@ -152,15 +159,110 @@ namespace Rokojori } - public List> GetActiveShaderUIColorTransitions() + + + string hoverID = IDGenerator.GenerateID(); + + public override void _Ready() { - return null; + MouseEntered += ()=> + { + AddUISelectorFlag( UISelectorFlag.Hover, hoverID ); + + }; + + MouseExited += ()=> + { + RemoveUISelectorFlag( UISelectorFlag.Hover, hoverID ); + }; } + + protected override void Dispose( bool disposing) + { + _selectorFlagReferenceCounter.Clear(); + } + + MapList _selectorFlagReferenceCounter = new MapList(); + + public void AddUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, true ); + } + + public void RemoveUISelectorFlag( UISelectorFlag flag, string reference = "" ) + { + SetSelectorFlagReference( flag, reference, false ); + } + + void SetSelectorFlagReference( UISelectorFlag flag, string reference, bool enable ) + { + if ( enable ) + { + _selectorFlagReferenceCounter.AddIfNotPresent( flag, reference ); + } + else + { + _selectorFlagReferenceCounter.Remove( flag ); + } + + _selectorFlags = _selectorFlagReferenceCounter.Keys.ToList(); + + UISelector.UpdateParentUISelectorFlags( this ); + } + + List _selectorFlags = []; + List _parentSelectorFlags = []; + + public List GetUISelectorFlags() + { + return _selectorFlags; + } + + public List GetParentUISelectorFlags() + { + return _parentSelectorFlags; + } + + public override void _GuiInput( InputEvent inputEvent ) + { + if ( ! handleMouseEvents ) + { + return; + } + + if ( inputEvent is InputEventMouseButton mb ) + { + if ( mb.Pressed ) + { + if ( mb.ButtonIndex == MouseButton.Left ) + { + Action.Trigger( onLeftClick ); + } + + if ( mb.ButtonIndex == MouseButton.Middle ) + { + Action.Trigger( onMiddleClick ); + } + + if ( mb.ButtonIndex == MouseButton.Right ) + { + Action.Trigger( onRightClick ); + } + } + } + + } + + + // public List> GetActiveShaderUIColorTransitions() + // { + // return null; + // } - public List> GetActiveShaderUINumberTransitions() - { - return null; - } + // public List> GetActiveShaderUINumberTransitions() + // { + // return null; + // } [ExportGroup("Transitions")] [Export] @@ -177,8 +279,8 @@ namespace Rokojori return numberTransitions; } - public List> activeNumberTransitions = new List>(); - public List> GetActiveUINumberTransitions() + public List> activeNumberTransitions = new List>(); + public List> GetActiveUINumberTransitions() { return activeNumberTransitions; } @@ -190,15 +292,15 @@ namespace Rokojori return colorTransitions; } - public List> activeColorTransitions = new List>(); - public List> GetActiveUIColorTransitions() + public List> activeColorTransitions = new List>(); + public List> GetActiveUIColorTransitions() { return activeColorTransitions; } LabelSettings _labelSettings; - + public LabelSettings uiTextLabelSettings { @@ -220,6 +322,19 @@ namespace Rokojori } } + [ExportGroup("Events")] + [Export] + public bool handleMouseEvents = false; + + [Export] + public Action onLeftClick; + + [Export] + public Action onMiddleClick; + + [Export] + public Action onRightClick; + public UIStyle GetUIStyleParent() { return parentStyle; @@ -252,7 +367,7 @@ namespace Rokojori - public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property ) + public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { switch ( property ) { @@ -287,15 +402,53 @@ namespace Rokojori case UIStyleNumberProperty.FontShadowOffsetY: return shadowOffsetY; } + return null; } + public void SetUIStyleNumberProperty( UIStyleNumberProperty property, UINumber number ) + { + switch ( property ) + { + case UIStyleNumberProperty.Left: { left = number; } break; + case UIStyleNumberProperty.Right: { right = number; } break; + case UIStyleNumberProperty.Top: { top = number; } break; + case UIStyleNumberProperty.Bottom: { bottom = number; } break; + + case UIStyleNumberProperty.Width: { width = number; } break; + case UIStyleNumberProperty.Height: { height = number; } break; + + + + case UIStyleNumberProperty.Margin: { margin = number; } break; + + case UIStyleNumberProperty.MarginLeft: { marginLeft = number; } break; + case UIStyleNumberProperty.MarginRight: { marginRight = number; } break; + case UIStyleNumberProperty.MarginTop: { marginTop = number; } break; + case UIStyleNumberProperty.MarginBottom: { marginBottom = number; } break; + + case UIStyleNumberProperty.FontSize: { fontSize = number; } break; + case UIStyleNumberProperty.FontOutlineSize: { outlineSize = number; } break; + case UIStyleNumberProperty.FontShadowSize: { shadowSize = number; } break; + case UIStyleNumberProperty.FontShadowOffsetX: { shadowOffsetX = number; } break; + case UIStyleNumberProperty.FontShadowOffsetY: { shadowOffsetY = number; } break; + + case UIStyleNumberProperty.PivotX: { pivotX = number; } break; + case UIStyleNumberProperty.PivotY: { pivotY = number; } break; + case UIStyleNumberProperty.Rotation: { rotation = number; } break; + + case UIStyleNumberProperty.Scale: { scale = number; } break; + case UIStyleNumberProperty.ScaleX: { scaleX = number; } break; + case UIStyleNumberProperty.ScaleY: { scaleY = number; } break; + } + } + public Vector2 GetUISize() { return GetSize(); } - public UIColor GetUIStyleColorProperty( UIStyleColorProperty property ) + public UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { switch ( property ) { @@ -306,5 +459,31 @@ namespace Rokojori return null; } + + UI ui; + + public void SetUI( UI ui ) + { + this.ui = ui; + } + + public UI GetUI() + { + var ui = this.ui != null ? this.ui : Unique.Get(); + + if ( ui == null ) + { + ui = this.FindParentThatIs(); + + if ( ui == null ) + { + // this.LogInfo( "No UI in parents >", HierarchyName.Of( this ) ); + + return null; + } + } + + return ui; + } } } \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIWrapper.cs b/Runtime/UI/Nodes/UIWrapper.cs new file mode 100644 index 0000000..ae2d9f8 --- /dev/null +++ b/Runtime/UI/Nodes/UIWrapper.cs @@ -0,0 +1,26 @@ + +using Godot; +using System.Collections.Generic; + +namespace Rokojori +{ + [Tool] + [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UIRegion.svg")] + public partial class UIWrapper : UIRegion + { + [Export] + public Control wrappedControl; + + public override void Layout() + { + base.Layout(); + + if ( wrappedControl != null ) + { + wrappedControl.Size = Size; + wrappedControl.Position = Vector2.Zero; + } + } + + } +} \ No newline at end of file diff --git a/Runtime/UI/Nodes/UIWrapper.cs.uid b/Runtime/UI/Nodes/UIWrapper.cs.uid new file mode 100644 index 0000000..1470d41 --- /dev/null +++ b/Runtime/UI/Nodes/UIWrapper.cs.uid @@ -0,0 +1 @@ +uid://bq65b10laqpg8 diff --git a/Runtime/UI/Optimization/RedrawCue.cs b/Runtime/UI/Optimization/RedrawCue.cs new file mode 100644 index 0000000..2f3f6e2 --- /dev/null +++ b/Runtime/UI/Optimization/RedrawCue.cs @@ -0,0 +1,15 @@ + +using Godot; +using System; + +namespace Rokojori +{ + public class RedrawCue + { + public enum CueType + { + Self, + Layout + } + } +} \ No newline at end of file diff --git a/Runtime/UI/Optimization/RedrawCue.cs.uid b/Runtime/UI/Optimization/RedrawCue.cs.uid new file mode 100644 index 0000000..9502046 --- /dev/null +++ b/Runtime/UI/Optimization/RedrawCue.cs.uid @@ -0,0 +1 @@ +uid://dslml1gawhij5 diff --git a/Runtime/UI/ShaderProperties/ShaderUIColor.cs b/Runtime/UI/ShaderProperties/ShaderUIColor.cs index d398fd5..d7d9369 100644 --- a/Runtime/UI/ShaderProperties/ShaderUIColor.cs +++ b/Runtime/UI/ShaderProperties/ShaderUIColor.cs @@ -17,6 +17,11 @@ namespace Rokojori public void UpdateMaterial( UIStylePropertyContainer container, Material material ) { + if ( colorPropertyName == null || color == null ) + { + return; + } + var colorValue = UIColor.Compute( container as Control, color, Colors.White ); colorPropertyName.Set( material, colorValue ); } diff --git a/Runtime/UI/ShaderProperties/ShaderUINumber.cs b/Runtime/UI/ShaderProperties/ShaderUINumber.cs index 0f59d9e..d36de29 100644 --- a/Runtime/UI/ShaderProperties/ShaderUINumber.cs +++ b/Runtime/UI/ShaderProperties/ShaderUINumber.cs @@ -15,32 +15,24 @@ namespace Rokojori [Export] public UINumber number; - [Export] - public TransitionSettings transitionSettings; + // [Export] + // public TransitionSettings transitionSettings; public void UpdateMaterial( UIStylePropertyContainer container, Material material ) { - var control = container as Control; - var numberValue = UINumber.Compute( container as Control, number, 0f ); - - var allSettings = UIStyle.GetTransitionSettingsAll( container ); - var usesTransition = transitionSettings != null || allSettings != null && allSettings.transitionAllProperties; - - if ( ! usesTransition ) + if ( floatPropertyName == null || number == null ) { - floatPropertyName.Set( material, numberValue ); return; } - /* - var transitionValue = ActiveStyleTransition.ProcessTransition( - container, numberValue, container.GetActiveShaderUINumberTransitions(), - number, floatPropertyName, - ()=>{ return UIStyle.GetTransitionSettings( container ); } - - ); - */ + var numberValue = UINumber.Compute( container as Control, number, 0f ); + floatPropertyName.Set( material, numberValue ); } + + public override string ToString() + { + return RJLog.GetInfo( floatPropertyName, number ); + } } } \ No newline at end of file diff --git a/Runtime/UI/ShaderProperties/UIShaderProperties.cs b/Runtime/UI/ShaderProperties/UIShaderProperties.cs index 56ea623..e4a9835 100644 --- a/Runtime/UI/ShaderProperties/UIShaderProperties.cs +++ b/Runtime/UI/ShaderProperties/UIShaderProperties.cs @@ -38,5 +38,55 @@ namespace Rokojori } } } + + public static void UpdatePropertiesInHierarchy( UIStylePropertyContainer styleContainer, Material material ) + { + UpdatePropertiesInHierarchy( styleContainer, styleContainer, material ); + } + + public static void UpdatePropertiesInHierarchy( UIStylePropertyContainer styleContainer, UIStylePropertyContainer materialContainer, Material material ) + { + var parent = styleContainer.GetUIStyleParent(); + + if ( parent != null ) + { + UpdatePropertiesInHierarchy( parent, materialContainer, material ); + } + + UpdatePropertiesWith( styleContainer, materialContainer, material ); + } + + public static void UpdatePropertiesWith( UIStylePropertyContainer styleContainer, UIStylePropertyContainer materialContainer, Material material ) + { + var numbers = styleContainer.GetShaderUINumbers(); + + if ( numbers != null ) + { + foreach ( var n in numbers ) + { + if ( n == null ) + { + continue; + } + + n.UpdateMaterial( materialContainer, material ); + } + } + + var colors = styleContainer.GetShaderUIColors(); + + if ( colors != null ) + { + foreach ( var c in colors ) + { + if ( c == null ) + { + continue; + } + + c.UpdateMaterial( materialContainer, material ); + } + } + } } } \ No newline at end of file diff --git a/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader b/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader index 4c22bdc..156e5fb 100644 --- a/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader +++ b/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader @@ -81,8 +81,10 @@ void fragment() float mask = max ( fillMask , strokeMask ); mask = fillMask + strokeMask; + + vec4 tex = texture( TEXTURE, UV ); - COLOR = vec4( outputColor.rgb, outputColor.a * mask * opacity ); + COLOR = vec4( outputColor.rgb * tex.rgb, outputColor.a * mask * opacity * tex.a); // Called for every pixel the material is visible on. } diff --git a/Runtime/UI/Styling/UIColor.cs b/Runtime/UI/Styling/UIColor.cs index 00f2ebc..eb94643 100644 --- a/Runtime/UI/Styling/UIColor.cs +++ b/Runtime/UI/Styling/UIColor.cs @@ -36,76 +36,86 @@ namespace Rokojori [Export] public TimeLine timeLine; - public static Color Compute( Control control, UIStyleColorProperty property, Color defaultColor ) + + public static Color Compute( Control control, UIStyleColorProperty property, string shaderPropertyName, Color defaultColor ) { var container = control as UIStylePropertyContainer; - var transition = UIStyle.GetTransition( container, property ); - var uiColor = UIStyle.GetUIColorProperty( control as UIStylePropertyContainer, property ); - var computedColor = Compute( control, uiColor, defaultColor ); + // Get selected ui color + var uiColor = UIStyle.GetUIColorProperty( container, property, shaderPropertyName, container ); + var computedColor = Compute( control, uiColor, defaultColor ); - var allSettings = UIStyle.GetTransitionSettingsAll( container ); + var transition = UIStyle.GetTransition( container, property, shaderPropertyName ); + var transitionAll = UIStyle.GetTransitionSettingsAll( container ); - var usesTransition = transition != null || allSettings != null && allSettings.transitionAllProperties; + var usesTransition = transition != null || transitionAll != null && transitionAll.transitionAllProperties; if ( ! usesTransition ) { return computedColor; } - var activeNumberTransitions = container.GetActiveUIColorTransitions(); + var activeColorTransitions = container.GetActiveUIColorTransitions(); - var propertyTransition = activeNumberTransitions.Find( t => t != null && t.propertyType == property ); + var propertyTransition = activeColorTransitions.Find( t => t != null && t.propertyType.Matches( property, shaderPropertyName ) ); + propertyTransition = EnsureTransitionObject( propertyTransition, control, uiColor, property, shaderPropertyName ); - if ( propertyTransition == null ) + var endValueChanged = uiColor != propertyTransition.value; + + if ( endValueChanged ) { - propertyTransition = new ActiveStyleTransition(); - propertyTransition.propertyType = property; - propertyTransition.value = uiColor; - propertyTransition.transitioning = false; - - activeNumberTransitions.Add( propertyTransition ); - - return computedColor; - } - else - { - - if ( propertyTransition.value != uiColor && ! propertyTransition.transitioning && UIStyle.GetTransitionSettings( container, property ) != null) - { - var transitionSettings = UIStyle.GetTransitionSettings( container, property ); - propertyTransition.timeLine = transitionSettings.timeLine; - propertyTransition.start = transitionSettings.timeLine.position; - propertyTransition.end = propertyTransition.start + transitionSettings.duration; - propertyTransition.transitioning = true; - propertyTransition.curve = transitionSettings.curve; - } + var transitionSettings = UIStyle.GetTransitionSettings( container, property, shaderPropertyName ); + propertyTransition.StartTransition( control, uiColor, transitionSettings ); } - if ( propertyTransition.value == uiColor ) + if ( ! propertyTransition.transitioning ) { - propertyTransition.transitioning = false; return computedColor; } - var computedTransitionValue = Compute( control, propertyTransition.value, defaultColor ); - - var transitionPhase = propertyTransition.timeLine.ComputeRange( propertyTransition.start, propertyTransition.end ); - - if ( transitionPhase >= 1 ) + var computedTransitionValue = new Color( 0, 0, 0, 0 ); + + for ( int i = 0; i < propertyTransition.lastValues.Count; i++ ) { - activeNumberTransitions.Remove( propertyTransition ); + var lastValue = Compute( control, propertyTransition.lastValues[ i ], defaultColor ); + computedTransitionValue += lastValue * propertyTransition.lastWeights[ i ]; } - var amount = MathX.Clamp01( transitionPhase ); - var curveAmount = amount; + var phase = propertyTransition.GetUnclampedTransitionPhase(); + var lerpWeight = propertyTransition.ComputeTransitionWeight( phase ); - if ( propertyTransition.curve != null ) + if ( phase >= 1f ) { - curveAmount = propertyTransition.curve.Sample( curveAmount ); + propertyTransition.EndTransition(); } - return ColorX.Lerp( computedTransitionValue, computedColor, curveAmount ); + var result = ColorX.Lerp( computedTransitionValue, computedColor, lerpWeight ); + + return result; + } + + static ActiveStyleTransition EnsureTransitionObject( + ActiveStyleTransition propertyTransition, + Control control, UIColor uiColor, UIStyleColorProperty property, string shaderPropertyName ) + { + + if ( propertyTransition != null ) + { + return propertyTransition; + } + + var container = control as UIStylePropertyContainer; + propertyTransition = new ActiveStyleTransition(); + propertyTransition.propertyType = UIStyleColorPropertyAndName.Create( property, shaderPropertyName ); + + var transitionSettings = UIStyle.GetTransitionSettings( container, property, shaderPropertyName ); + propertyTransition.value = uiColor; + propertyTransition.timeLine = UI.GetTimeLine( control, transitionSettings.timeLine ); + propertyTransition.transitioning = false; + + container.GetActiveUIColorTransitions().Add( propertyTransition ); + + return propertyTransition; } public static Color Compute( Control control, UIColor color, Color defaultColor ) @@ -120,8 +130,9 @@ namespace Rokojori return color.color; } - // var phase = TimeLineManager.GetPhase( color.timeLine, color.animationDuration, color.animationOffset ); - var phase = color.timeLine.ComputePhase( color.animationDuration, color.animationOffset ); + var timeLine = UI.GetTimeLine( control, color.timeLine ); + + var phase = timeLine.ComputePhase( color.animationDuration, color.animationOffset ); var gradientColor = color.animationGradient.Sample( phase ); diff --git a/Runtime/UI/Styling/UINumber.cs b/Runtime/UI/Styling/UINumber.cs index 2d29e6f..c046fe6 100644 --- a/Runtime/UI/Styling/UINumber.cs +++ b/Runtime/UI/Styling/UINumber.cs @@ -77,7 +77,7 @@ namespace Rokojori public static bool IsNullOrNone( UIStylePropertyContainer container, UIStyleNumberProperty property ) { - return IsNullOrNone( UIStyle.GetUINumberProperty( container, property ) ); + return IsNullOrNone( UIStyle.GetUINumberProperty( container, property, "", container ) ); } public static bool IsNullOrNone( UINumber number ) @@ -97,7 +97,12 @@ namespace Rokojori public static int ComputeInt( Control control, UIStyleNumberProperty property, float alternative = 0, float relative = 100 ) { - return Mathf.RoundToInt( Compute( control, property, alternative, relative ) ); + return ComputeInt( control, property, "", alternative, relative ); + } + + public static int ComputeInt( Control control, UIStyleNumberProperty property, string shaderPropertyName = "", float alternative = 0, float relative = 100 ) + { + return Mathf.RoundToInt( Compute( control, property, shaderPropertyName, alternative, relative ) ); } public bool Equals( UINumber other ) @@ -168,74 +173,138 @@ namespace Rokojori } public static float Compute( Control control, UIStyleNumberProperty property, float alternative = 0, float relative = 100 ) + { + return Compute( control, property, "", alternative, relative ); + } + + public static float Compute( Control control, UIStyleNumberProperty property, string shaderPropertyName = "", float alternative = 0, float relative = 100 ) { var container = control as UIStylePropertyContainer; - var transition = UIStyle.GetTransition( container, property ); + + // Get selected ui number + var uiNumber = UIStyle.GetUINumberProperty( control as UIStylePropertyContainer, property, shaderPropertyName, container ); + var computedNumber = Compute( control, uiNumber, alternative, relative ); - var number = UIStyle.GetUINumberProperty( control as UIStylePropertyContainer, property ); - var computedValue = Compute( control, number, alternative, relative ); + var transition = UIStyle.GetTransition( container, property, shaderPropertyName ); + var transitionAll = UIStyle.GetTransitionSettingsAll( container ); - var allSettings = UIStyle.GetTransitionSettingsAll( container ); - - var usesTransition = transition != null || allSettings != null && allSettings.transitionAllProperties; + var usesTransition = transition != null || transitionAll != null && transitionAll.transitionAllProperties; if ( ! usesTransition ) { - return computedValue; + return computedNumber; } var activeNumberTransitions = container.GetActiveUINumberTransitions(); - var propertyTransition = activeNumberTransitions.Find( t => t != null && t.propertyType == property ); + var propertyTransition = activeNumberTransitions.Find( t => t != null && t.propertyType.Matches( property, shaderPropertyName ) ); + propertyTransition = EnsureTransitionObject( propertyTransition, control, uiNumber, property, shaderPropertyName ); - if ( propertyTransition == null ) + var endValueChanged = uiNumber != propertyTransition.value; + + if ( endValueChanged ) { - propertyTransition = new ActiveStyleTransition(); - propertyTransition.propertyType = property; - propertyTransition.value = number; - propertyTransition.transitioning = false; - - activeNumberTransitions.Add( propertyTransition ); - - return computedValue; - } - else - { - if ( propertyTransition.value != number && ! propertyTransition.transitioning && UIStyle.GetTransitionSettings( container, property ) != null ) - { - var transitionSettings = UIStyle.GetTransitionSettings( container, property ); - propertyTransition.timeLine = transitionSettings.timeLine; - propertyTransition.start = transitionSettings.timeLine.position; - propertyTransition.end = propertyTransition.start + transitionSettings.duration; - propertyTransition.transitioning = true; - propertyTransition.curve = transitionSettings.curve; - } + var transitionSettings = UIStyle.GetTransitionSettings( container, property, shaderPropertyName ); + propertyTransition.StartTransition( control, uiNumber, transitionSettings ); } - if ( propertyTransition.value == number ) + if ( ! propertyTransition.transitioning ) { - propertyTransition.transitioning = false; - return computedValue; + return computedNumber; } - var computedTransitionValue = Compute( control, propertyTransition.value, alternative, relative ); + var computedTransitionValue = 0f; + + for ( int i = 0; i < propertyTransition.lastValues.Count; i++ ) + { + var lastValue = Compute( control, propertyTransition.lastValues[ i ], 0f ); + computedTransitionValue += lastValue * propertyTransition.lastWeights[ i ]; + } - var transitionPhase = propertyTransition.timeLine.ComputeRange( propertyTransition.start, propertyTransition.end ); + var phase = propertyTransition.GetUnclampedTransitionPhase(); + var lerpWeight = propertyTransition.ComputeTransitionWeight( phase ); + + if ( phase >= 1f ) + { + propertyTransition.EndTransition(); + } + + var result = Mathf.Lerp( computedTransitionValue, computedNumber, lerpWeight ); + + return result; + + // if ( propertyTransition == null ) + // { + // propertyTransition = new ActiveStyleTransition(); + // propertyTransition.propertyType = property; + // propertyTransition.value = number; + // propertyTransition.transitioning = false; + + // activeNumberTransitions.Add( propertyTransition ); + + // return computedValue; + // } + // else + // { + // if ( propertyTransition.value != number && ! propertyTransition.transitioning && UIStyle.GetTransitionSettings( container, property ) != null ) + // { + // var transitionSettings = UIStyle.GetTransitionSettings( container, property ); + // propertyTransition.timeLine = UI.GetTimeLine( control, transitionSettings.timeLine ); + // propertyTransition.start = propertyTransition.timeLine.position; + // propertyTransition.end = propertyTransition.start + transitionSettings.duration; + // propertyTransition.transitioning = true; + // propertyTransition.curve = transitionSettings.curve; + // } + // } + + // if ( propertyTransition.value == number ) + // { + // propertyTransition.transitioning = false; + // return computedValue; + // } + + // var computedTransitionValue = Compute( control, propertyTransition.value, alternative, relative ); + + // var transitionPhase = propertyTransition.timeLine.ComputeRange( propertyTransition.start, propertyTransition.end ); - if ( transitionPhase >= 1 ) + // if ( transitionPhase >= 1 ) + // { + // activeNumberTransitions.Remove( propertyTransition ); + // } + + // var amount = MathX.Clamp01( transitionPhase ); + // var curveAmount = amount; + + // if ( propertyTransition.curve != null ) + // { + // curveAmount = propertyTransition.curve.Sample( curveAmount ); + // } + + // return Mathf.Lerp( computedTransitionValue, computedValue, curveAmount ); + } + + static ActiveStyleTransition EnsureTransitionObject( + ActiveStyleTransition propertyTransition, + Control control, UINumber uiNUmber, UIStyleNumberProperty property, string shaderPropertyName ) + { + + if ( propertyTransition != null ) { - activeNumberTransitions.Remove( propertyTransition ); + return propertyTransition; } - var amount = MathX.Clamp01( transitionPhase ); - var curveAmount = amount; + var container = control as UIStylePropertyContainer; + propertyTransition = new ActiveStyleTransition(); + propertyTransition.propertyType = UIStyleNumberPropertyAndName.Create( property, shaderPropertyName ); + + var transitionSettings = UIStyle.GetTransitionSettings( container, property, shaderPropertyName ); + propertyTransition.value = uiNUmber; + propertyTransition.timeLine = UI.GetTimeLine( control, transitionSettings.timeLine ); + propertyTransition.transitioning = false; - if ( propertyTransition.curve != null ) - { - curveAmount = propertyTransition.curve.Sample( curveAmount ); - } + container.GetActiveUINumberTransitions().Add( propertyTransition ); - return Mathf.Lerp( computedTransitionValue, computedValue, curveAmount ); + return propertyTransition; } @@ -254,13 +323,26 @@ namespace Rokojori } - static UI _ui; - public static float em() + public static float em( Control control ) { - return _ui == null ? 12 : _ui.X_computedFontSizePixels; + var ui = UIHolder.GetUI( control ); + return ui == null ? 12 : ui.X_computedFontSizePixels; } + public static float uiw( Control control ) + { + var ui = UIHolder.GetUI( control ); + return ui == null ? 1920 : ui.Size.X; + } + + public static float uih( Control control ) + { + var ui = UIHolder.GetUI( control ); + return ui == null ? 1080 : ui.Size.Y; + } + + public static float Compute( Control control, UINumber number, float width, float height, float relative ) { var value = ComputeWithoutAnimation( control, number, width, height, relative ); @@ -270,7 +352,8 @@ namespace Rokojori return value; } - var phase = number.timeLine.ComputePhase( number.animationDuration, number.animationOffset ); + var timeLine = UI.GetTimeLine( control, number.timeLine ); + var phase = timeLine.ComputePhase( number.animationDuration, number.animationOffset ); return number.animationCurve.Sample( phase ) * value; @@ -286,6 +369,8 @@ namespace Rokojori "cw","ch", "cx","cy", + "uiw", "uih", + "relative", "value" }; @@ -297,18 +382,15 @@ namespace Rokojori return 0; } - if ( _ui == null ) - { - _ui = NodesWalker.Get().GetInParents( control, n => n is UI ) as UI; - } - switch ( number.unit ) { case "em": { - return number.value * em(); + return number.value * em( control ); } + + case "vw": { return number.value * width / 100f; @@ -321,37 +403,48 @@ namespace Rokojori case "pw": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? width : parent.Size.X ); } case "cw": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? width : UILayouting.GetContentSize( parent ).X ); } case "ch": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? height : UILayouting.GetContentSize( parent ).Y ); } case "cx": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? 0 : UILayouting.GetContentOffset( parent ).X ); } case "cy": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? 0 : UILayouting.GetContentOffset( parent ).Y ); } + case "uiw": + { + return number.value * uiw( control ); + } + + case "uih": + { + return number.value * uih( control ); + } + + case "ph": { - var parent = control.GetParent(); + var parent = control.GetParent() as Control; return number.value / 100f * ( parent == null ? height : parent.Size.Y ); } @@ -382,10 +475,12 @@ namespace Rokojori return 0; } - var parentControl = control.GetParent(); + var parentControl = control.GetParent() as Control;; var inputs = new Godot.Collections.Array(); - inputs.Add( em() ); + + // em + inputs.Add( em( control ) ); // vw, vh inputs.Add( width / 100f ); inputs.Add( height / 100f ); @@ -402,6 +497,10 @@ namespace Rokojori inputs.Add( ( parentControl == null ? 0 : UILayouting.GetContentOffset( parentControl ).X ) / 100f ); inputs.Add( ( parentControl == null ? 0 : UILayouting.GetContentOffset( parentControl ).Y ) / 100f ); + // uiw, uih + inputs.Add( uiw( control ) ); + inputs.Add( uih( control ) ); + // "relative" inputs.Add( relative / 100f ); diff --git a/Runtime/UI/Styling/UISelector.cs b/Runtime/UI/Styling/UISelector.cs new file mode 100644 index 0000000..434d778 --- /dev/null +++ b/Runtime/UI/Styling/UISelector.cs @@ -0,0 +1,144 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; +using System.Linq; + +namespace Rokojori +{ + + [Tool] + [GlobalClass] + public partial class UISelector:Resource + { + public enum Value + { + ___, + True, + False, + True_For_Any_Parent, + False_For_All_Parents + } + + [Export] + public Value hover = Value.___; + + [Export] + public Value dragging = Value.___; + + [Export] + public Value scrolling = Value.___; + + [Export] + public Value focus = Value.___; + + [Export] + public Value active = Value.___; + + [Export] + public UISelectorFlagEntry[] selectors = []; + + + bool Matches( UIStylePropertyContainer container, Value value, UISelectorFlag flag ) + { + if ( Value.___ == value ) + { + return true; + } + + if ( Value.True == value || Value.False == value ) + { + return container.GetUISelectorFlags().Contains( flag ) == ( Value.True == value ); + } + + if ( Value.True_For_Any_Parent == value || Value.False_For_All_Parents == value ) + { + return container.GetParentUISelectorFlags().Contains( flag ) == ( Value.True_For_Any_Parent == value ); + } + + return true; + + } + + public bool Selects( UIStylePropertyContainer container ) + { + + if ( ! Matches( container, hover, UISelectorFlag.Hover ) ) + { + return false; + } + + if ( ! Matches( container, dragging, UISelectorFlag.Dragging ) ) + { + return false; + } + + if ( ! Matches( container, scrolling, UISelectorFlag.Scrolling ) ) + { + return false; + } + + if ( ! Matches( container, focus, UISelectorFlag.Focus ) ) + { + return false; + } + + if ( ! Matches( container, active, UISelectorFlag.Active ) ) + { + return false; + } + + foreach ( var entry in selectors ) + { + if ( ! Matches( container, entry.value, entry.selectorFlag ) ) + { + return false; + } + } + + + return true; + } + + + public static void UpdateParentUISelectorFlags( UIStylePropertyContainer target ) + { + var node = target as Node; + var walker = NodesWalker.Get(); + + CombineParentFlags( target ); + + walker.PruneChildTraversal( node, + ( Node n ) => + { + if ( n != node && n is UIStylePropertyContainer c ) + { + UpdateParentUISelectorFlags( c ); + return false; + } + else + { + return true; + } + } + ); + + } + + static void CombineParentFlags( UIStylePropertyContainer target ) + { + var parentFlags = target.GetParentUISelectorFlags(); + parentFlags.Clear(); + parentFlags.AddRange( target.GetUISelectorFlags() ); + + var parent = UI.GetStylePropertyContainerParent( target as Control); + + if ( parent != null ) + { + parentFlags.Union( parent.GetParentUISelectorFlags() ); + } + + } + + } +} \ No newline at end of file diff --git a/Runtime/UI/Styling/UISelector.cs.uid b/Runtime/UI/Styling/UISelector.cs.uid new file mode 100644 index 0000000..d5aa367 --- /dev/null +++ b/Runtime/UI/Styling/UISelector.cs.uid @@ -0,0 +1 @@ +uid://brmxttyvbwoit diff --git a/Runtime/UI/Styling/UISelectorFlag.cs b/Runtime/UI/Styling/UISelectorFlag.cs new file mode 100644 index 0000000..46f478d --- /dev/null +++ b/Runtime/UI/Styling/UISelectorFlag.cs @@ -0,0 +1,40 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori +{ + + [Tool] + [GlobalClass] + public partial class UISelectorFlag:SelectorFlag + { + public static readonly string selectorsPath = "res://addons/rokojori_action_library/Runtime/UI/UI-Selectors/"; + + public static CachedResource CreateCached( string selector ) + { + var path = selectorsPath + "UI " + selector + " Selector Flag.tres"; + + return new CachedResource( path ); + } + + readonly static CachedResource HoverCached = CreateCached( "Hover" ); + public static UISelectorFlag Hover => HoverCached.Get(); + + readonly static CachedResource DraggingCached = CreateCached( "Dragging" ); + public static UISelectorFlag Dragging => DraggingCached.Get(); + + readonly static CachedResource ScrollingCached = CreateCached( "Scrolling" ); + public static UISelectorFlag Scrolling => ScrollingCached.Get(); + + readonly static CachedResource FocusCached = CreateCached( "Focus" ); + public static UISelectorFlag Focus => FocusCached.Get(); + + readonly static CachedResource ActiveCached = CreateCached( "Active" ); + public static UISelectorFlag Active => ActiveCached.Get(); + + + public readonly static List NoFlags = new List(); + } +} \ No newline at end of file diff --git a/Runtime/UI/Styling/UISelectorFlag.cs.uid b/Runtime/UI/Styling/UISelectorFlag.cs.uid new file mode 100644 index 0000000..bfc488b --- /dev/null +++ b/Runtime/UI/Styling/UISelectorFlag.cs.uid @@ -0,0 +1 @@ +uid://n2lc266yedxq diff --git a/Runtime/UI/Styling/UISelectorFlagEntry.cs b/Runtime/UI/Styling/UISelectorFlagEntry.cs new file mode 100644 index 0000000..280e5c5 --- /dev/null +++ b/Runtime/UI/Styling/UISelectorFlagEntry.cs @@ -0,0 +1,19 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori +{ + + [Tool] + [GlobalClass] + public partial class UISelectorFlagEntry:SelectorFlag + { + [Export] + public UISelectorFlag selectorFlag; + + [Export] + public UISelector.Value value; + } +} \ No newline at end of file diff --git a/Runtime/UI/Styling/UISelectorFlagEntry.cs.uid b/Runtime/UI/Styling/UISelectorFlagEntry.cs.uid new file mode 100644 index 0000000..fa5825c --- /dev/null +++ b/Runtime/UI/Styling/UISelectorFlagEntry.cs.uid @@ -0,0 +1 @@ +uid://m12qb4hw4xyv diff --git a/Runtime/UI/Styling/UISelectorStyle.cs b/Runtime/UI/Styling/UISelectorStyle.cs new file mode 100644 index 0000000..78f8ecc --- /dev/null +++ b/Runtime/UI/Styling/UISelectorStyle.cs @@ -0,0 +1,19 @@ + +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori +{ + + [Tool] + [GlobalClass] + public partial class UISelectorStyle:Resource + { + [Export] + public UISelector selector; + + [Export] + public UIStyle style; + } +} \ No newline at end of file diff --git a/Runtime/UI/Styling/UISelectorStyle.cs.uid b/Runtime/UI/Styling/UISelectorStyle.cs.uid new file mode 100644 index 0000000..5b85974 --- /dev/null +++ b/Runtime/UI/Styling/UISelectorStyle.cs.uid @@ -0,0 +1 @@ +uid://bqypmtxqo5rnf diff --git a/Runtime/UI/Styling/UIStyle.cs b/Runtime/UI/Styling/UIStyle.cs index e038958..bd82077 100644 --- a/Runtime/UI/Styling/UIStyle.cs +++ b/Runtime/UI/Styling/UIStyle.cs @@ -13,6 +13,9 @@ namespace Rokojori [Export] public UIStyle parentStyle; + [Export] + public UISelectorStyle[] selectorStyles = []; + [ExportGroup( "Layout" )] [Export] public UILayout layout; @@ -139,7 +142,7 @@ namespace Rokojori return numberTransitions; } - public List> GetActiveUINumberTransitions() + public List> GetActiveUINumberTransitions() { return null; } @@ -152,9 +155,9 @@ namespace Rokojori return colorTransitions; } - public List> GetActiveUIColorTransitions() + public List> GetActiveUIColorTransitions() { - return null;; + return null; } @@ -188,7 +191,30 @@ namespace Rokojori return numberProperties; } - public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property ) + public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) + { + for ( int i = 0; i < selectorStyles.Length; i++ ) + { + if ( selectorStyles[ i ] == null || selectorStyles[ i ].style == null ) + { + continue; + } + + if ( selectorStyles[ i ].selector == null || selectorStyles[ i ].selector.Selects( source ) ) + { + var selectedProperty = selectorStyles[ i ].style.GetUIStyleNumberProperty( property, shaderPropertyName ); + + if ( selectedProperty != null ) + { + return selectedProperty; + } + } + } + + return GetUIStyleNumberProperty( property, shaderPropertyName ); + } + + public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName ) { switch ( property ) { @@ -231,34 +257,143 @@ namespace Rokojori case UIStyleNumberProperty.ScaleY: return scaleY; } + if ( UIStyleNumberProperty.FloatShaderProperty == property ) + { + var numberProperty = numberProperties.Find( n => n.floatPropertyName.propertyName == shaderPropertyName ); + + if ( numberProperty != null ) + { + return numberProperty.number; + } + + } + return null; } + public void SetUIStyleNumberProperty( UIStyleNumberProperty property, UINumber number ) + { + switch ( property ) + { + case UIStyleNumberProperty.Left: { left = number; } break; + case UIStyleNumberProperty.Right: { right = number; } break; + case UIStyleNumberProperty.Top: { top = number; } break; + case UIStyleNumberProperty.Bottom: { bottom = number; } break; + + case UIStyleNumberProperty.HorizontalAlignment: { horizontalAlignment = number; } break; + case UIStyleNumberProperty.VerticalAlignment: { verticalAlignment = number; } break; + case UIStyleNumberProperty.VerticalPlacement: { verticalPlacement = number; } break; + case UIStyleNumberProperty.ElementSpacing: { elementSpacing = number; } break; + case UIStyleNumberProperty.LineSpacing: { lineSpacing = number; } break; + + + case UIStyleNumberProperty.Width: { width = number; } break; + case UIStyleNumberProperty.Height: { height = number; } break; + + + + case UIStyleNumberProperty.Margin: { margin = number; } break; + + case UIStyleNumberProperty.MarginLeft: { marginLeft = number; } break; + case UIStyleNumberProperty.MarginRight: { marginRight = number; } break; + case UIStyleNumberProperty.MarginTop: { marginTop = number; } break; + case UIStyleNumberProperty.MarginBottom: { marginBottom = number; } break; + + case UIStyleNumberProperty.FontSize: { fontSize = number; } break; + case UIStyleNumberProperty.FontOutlineSize: { outlineSize = number; } break; + case UIStyleNumberProperty.FontShadowSize: { shadowSize = number; } break; + case UIStyleNumberProperty.FontShadowOffsetX: { shadowOffsetX = number; } break; + case UIStyleNumberProperty.FontShadowOffsetY: { shadowOffsetY = number; } break; + + case UIStyleNumberProperty.PivotX: { pivotX = number; } break; + case UIStyleNumberProperty.PivotY: { pivotY = number; } break; + case UIStyleNumberProperty.Rotation: { rotation = number; } break; + + case UIStyleNumberProperty.Scale: { scale = number; } break; + case UIStyleNumberProperty.ScaleX: { scaleX = number; } break; + case UIStyleNumberProperty.ScaleY: { scaleY = number; } break; + } + + } + public Vector2 GetUISize() { return new Vector2( 1, 1 ); } - public UIColor GetUIStyleColorProperty( UIStyleColorProperty property ) + public List GetUISelectorFlags() + { + return UISelectorFlag.NoFlags; + } + + public List GetParentUISelectorFlags() + { + return UISelectorFlag.NoFlags; + } + + public void AddUISelectorFlag( UISelectorFlag flag, string reference = "" ) + {} + + public void RemoveUISelectorFlag( UISelectorFlag flag, string reference = "" ) + {} + + public void UpdateParentUISelectorFlags() + {} + + public UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) + { + + for ( int i = 0; i < selectorStyles.Length; i++ ) + { + if ( selectorStyles[ i ] == null || selectorStyles[ i ].style == null ) + { + continue; + } + + if ( selectorStyles[ i ].selector == null || selectorStyles[ i ].selector.Selects( source ) ) + { + var selectedProperty = selectorStyles[ i ].style.GetUIStyleColorProperty( property, shaderPropertyName ); + + if ( selectedProperty != null ) + { + return selectedProperty; + } + } + } + + return GetUIStyleColorProperty( property, shaderPropertyName ); + } + + public UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName ) { switch ( property ) { case UIStyleColorProperty.FontColor: return fontColor; case UIStyleColorProperty.FontOutlineColor: return outlineColor; case UIStyleColorProperty.FontShadowColor: return shadowColor; + case UIStyleColorProperty.ColorShaderProperty: + { + var shaderUIColor = Arrays.FindNonNull( colorProperties, + c => + c.colorPropertyName?.propertyName == shaderPropertyName + ); + + return shaderUIColor != null ? shaderUIColor.color : null; + } } return null; } - public static UINumber GetReferenceableNumberProperty( UIStylePropertyContainer container, UIStyleNumberProperty property ) + public static UINumber GetReferenceableNumberProperty( UIStylePropertyContainer container, + UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { if ( container == null ) { return null; } - var ownProperty = container.GetUIStyleNumberProperty( property ); + var ownProperty = container.GetUIStyleNumberProperty( property, shaderPropertyName, source ); if ( ownProperty != null ) { @@ -267,17 +402,18 @@ namespace Rokojori var style = container.GetUIStyleParent(); - return GetReferenceableNumberProperty( style, property ); + return GetReferenceableNumberProperty( style, property, shaderPropertyName, source ); } - public static UIColor GetReferenceableColorProperty( UIStylePropertyContainer container, UIStyleColorProperty property ) + public static UIColor GetReferenceableColorProperty( UIStylePropertyContainer container, + UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { if ( container == null ) { return null; } - var ownProperty = container.GetUIStyleColorProperty( property ); + var ownProperty = container.GetUIStyleColorProperty( property, shaderPropertyName, source ); if ( ownProperty != null ) { @@ -286,10 +422,10 @@ namespace Rokojori var style = container.GetUIStyleParent(); - return GetReferenceableColorProperty( style, property ); + return GetReferenceableColorProperty( style, property, shaderPropertyName, source ); } - public static UINumberTransition GetTransition( UIStylePropertyContainer container, UIStyleNumberProperty property ) + public static UINumberTransition GetTransition( UIStylePropertyContainer container, UIStyleNumberProperty property, string shaderPropertyName ) { switch ( property ) { @@ -298,16 +434,17 @@ namespace Rokojori case UIStyleNumberProperty.FontShadowSize: case UIStyleNumberProperty.FontShadowOffsetX: case UIStyleNumberProperty.FontShadowOffsetY: + case UIStyleNumberProperty.FloatShaderProperty: { - return _GetTransition( true, container, property ); + return _GetTransition( true, container, property, shaderPropertyName ); } } - return _GetTransition( false, container, property ); + return _GetTransition( false, container, property, shaderPropertyName); } - static UINumberTransition _GetTransition( bool inheritable, UIStylePropertyContainer container, UIStyleNumberProperty property ) + static UINumberTransition _GetTransition( bool inheritable, UIStylePropertyContainer container, UIStyleNumberProperty property, string shaderPropertyName ) { var transitions = container.GetNumberTransitions(); @@ -325,7 +462,7 @@ namespace Rokojori return null; } - var styleParentTransition = _GetTransition( false, styleParent, property ); + var styleParentTransition = _GetTransition( false, styleParent, property, shaderPropertyName ); if ( styleParentTransition != null ) { @@ -349,7 +486,7 @@ namespace Rokojori } var container = (UIStylePropertyContainer) it; - parentTransition = _GetTransition( true, container, property ); + parentTransition = _GetTransition( true, container, property, shaderPropertyName ); return parentTransition != null; } @@ -405,9 +542,11 @@ namespace Rokojori return GetTransitionSettings( styleParent, floatProperty ); } */ - public static TransitionSettings GetTransitionSettings( UIStylePropertyContainer container, UIStyleColorProperty colorProperty ) + + + public static TransitionSettings GetTransitionSettings( UIStylePropertyContainer container, UIStyleColorProperty colorProperty, string shaderPropertyName ) { - var transition = GetTransition( container, colorProperty ); + var transition = GetTransition( container, colorProperty, shaderPropertyName ); if ( transition != null && transition.settings != null ) { @@ -428,12 +567,14 @@ namespace Rokojori return null; } - return GetTransitionSettings( styleParent, colorProperty ); + return GetTransitionSettings( styleParent, colorProperty, shaderPropertyName ); } + + - public static TransitionSettings GetTransitionSettings( UIStylePropertyContainer container, UIStyleNumberProperty numberProperty ) + public static TransitionSettings GetTransitionSettings( UIStylePropertyContainer container, UIStyleNumberProperty numberProperty, string shaderPropertyName ) { - var transition = GetTransition( container, numberProperty ); + var transition = GetTransition( container, numberProperty, shaderPropertyName ); if ( transition != null && transition.settings != null ) { @@ -454,34 +595,38 @@ namespace Rokojori return null; } - return GetTransitionSettings( styleParent, numberProperty ); + return GetTransitionSettings( styleParent, numberProperty, shaderPropertyName ); } - public static UIColorTransition GetTransition( UIStylePropertyContainer container, UIStyleColorProperty property ) + public static UIColorTransition GetTransition( UIStylePropertyContainer container, UIStyleColorProperty property, string shaderPropertyName ) { switch ( property ) { case UIStyleColorProperty.FontColor: case UIStyleColorProperty.FontOutlineColor: case UIStyleColorProperty.FontShadowColor: + case UIStyleColorProperty.ColorShaderProperty: { - return _GetTransition( true, container, property ); + return _GetTransition( true, container, property, shaderPropertyName ); } } - return _GetTransition( false, container, property ); + return _GetTransition( false, container, property, shaderPropertyName ); } - static UIColorTransition _GetTransition( bool inheritable, UIStylePropertyContainer container, UIStyleColorProperty property ) + static UIColorTransition _GetTransition( + bool inheritable, UIStylePropertyContainer container, + UIStyleColorProperty property, string shaderPropertyName + ) { var transitions = container.GetColorTransitions(); - var index = transitions == null ? -1 : Arrays.FindIndex( transitions, t => t != null && t.property == property ); + var transition = transitions.Find( t => t != null && t.Matches( property, shaderPropertyName ) ); - if ( index != -1 ) + if ( transition != null ) { - return transitions[ index ]; + return transition; } var styleParent = container.GetUIStyleParent(); @@ -491,7 +636,7 @@ namespace Rokojori return null; } - var styleParentTransition = _GetTransition( false, styleParent, property ); + var styleParentTransition = _GetTransition( false, styleParent, property, shaderPropertyName ); if ( styleParentTransition != null ) { @@ -515,7 +660,7 @@ namespace Rokojori } var container = (UIStylePropertyContainer) it; - parentTransition = _GetTransition( true, container, property ); + parentTransition = _GetTransition( true, container, property, shaderPropertyName ); return parentTransition != null; } @@ -526,14 +671,15 @@ namespace Rokojori } - public static UINumber GetInheritableNumberProperty( UIStylePropertyContainer container, UIStyleNumberProperty property ) + public static UINumber GetInheritableNumberProperty( UIStylePropertyContainer container, + UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { if ( container == null ) { return null; } - var ownProperty = container.GetUIStyleNumberProperty( property ); + var ownProperty = container.GetUIStyleNumberProperty( property, shaderPropertyName, source ); if ( ownProperty != null ) { @@ -541,7 +687,7 @@ namespace Rokojori } var parentStyle = container.GetUIStyleParent(); - var parentStyleProperty = GetReferenceableNumberProperty( parentStyle, property ); + var parentStyleProperty = GetReferenceableNumberProperty( parentStyle, property, shaderPropertyName, source ); if ( parentStyleProperty != null ) { @@ -565,7 +711,7 @@ namespace Rokojori } var container = (UIStylePropertyContainer) it; - parentNumber = GetReferenceableNumberProperty( container, property ); + parentNumber = GetReferenceableNumberProperty( container, property, shaderPropertyName, source ); return parentNumber != null; } @@ -575,14 +721,15 @@ namespace Rokojori } - public static UIColor GetInheritableColorProperty( UIStylePropertyContainer container, UIStyleColorProperty property ) + public static UIColor GetInheritableColorProperty( UIStylePropertyContainer container, + UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { if ( container == null ) { return null; } - var ownProperty = container.GetUIStyleColorProperty( property ); + var ownProperty = container.GetUIStyleColorProperty( property, shaderPropertyName, source ); if ( ownProperty != null ) { @@ -590,7 +737,7 @@ namespace Rokojori } var parentStyle = container.GetUIStyleParent(); - var parentStyleProperty = GetReferenceableColorProperty( parentStyle, property ); + var parentStyleProperty = GetReferenceableColorProperty( parentStyle, property, shaderPropertyName, source ); if ( parentStyleProperty != null ) { @@ -614,7 +761,7 @@ namespace Rokojori } var container = (UIStylePropertyContainer) it; - parentColor = GetReferenceableColorProperty( container, property ); + parentColor = GetReferenceableColorProperty( container, property, shaderPropertyName, source ); return parentColor != null; } @@ -756,11 +903,11 @@ namespace Rokojori if ( font == null ) { - var ui = control.FindParentThatIs(); + var ui = UI.Get( control ); - if ( ui != null ) + if ( ui != null && ui.settings != null ) { - return ui.defaultFont; + return ui.settings.defaultFont; } } @@ -768,7 +915,8 @@ namespace Rokojori return font; } - public static UINumber GetUINumberProperty( UIStylePropertyContainer container, UIStyleNumberProperty property ) + public static UINumber GetUINumberProperty( UIStylePropertyContainer container, + UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { switch ( property ) { @@ -777,27 +925,30 @@ namespace Rokojori case UIStyleNumberProperty.FontShadowSize: case UIStyleNumberProperty.FontShadowOffsetX: case UIStyleNumberProperty.FontShadowOffsetY: + case UIStyleNumberProperty.FloatShaderProperty: { - return GetInheritableNumberProperty( container, property ); + return GetInheritableNumberProperty( container, property, shaderPropertyName, source ); } } - return GetReferenceableNumberProperty( container, property ); + return GetReferenceableNumberProperty( container, property, shaderPropertyName, source ); } - public static UIColor GetUIColorProperty( UIStylePropertyContainer container, UIStyleColorProperty property ) + public static UIColor GetUIColorProperty( UIStylePropertyContainer container, + UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ) { switch ( property ) { case UIStyleColorProperty.FontColor: case UIStyleColorProperty.FontOutlineColor: case UIStyleColorProperty.FontShadowColor: + case UIStyleColorProperty.ColorShaderProperty: { - return GetInheritableColorProperty( container, property ); + return GetInheritableColorProperty( container, property, shaderPropertyName, source ); } } - return GetReferenceableColorProperty( container, property ); + return GetReferenceableColorProperty( container, property, shaderPropertyName, source ); } } diff --git a/Runtime/UI/Styling/UIStyleProperty.cs b/Runtime/UI/Styling/UIStyleProperty.cs index edceb7a..2ad5d6f 100644 --- a/Runtime/UI/Styling/UIStyleProperty.cs +++ b/Runtime/UI/Styling/UIStyleProperty.cs @@ -39,13 +39,98 @@ namespace Rokojori FontOutlineSize, FontShadowSize, FontShadowOffsetX, - FontShadowOffsetY + FontShadowOffsetY, + + FloatShaderProperty + } + + public class UIStyleNumberPropertyAndName + { + public UIStyleNumberProperty styleProperty; + public string shaderPropertyName; + + public static UIStyleNumberPropertyAndName Create( UIStyleNumberProperty property, string shaderPropertyName ) + { + var pn = new UIStyleNumberPropertyAndName(); + pn.styleProperty = property; + pn.shaderPropertyName = shaderPropertyName; + return pn; + } + + public override string ToString() + { + if ( UIStyleNumberProperty.FloatShaderProperty == styleProperty ) + { + return styleProperty + ": " + shaderPropertyName; + } + + return styleProperty + ""; + } + + public bool Matches( UIStyleNumberProperty styleProperty, string shaderPropertyName ) + { + if ( this.styleProperty != styleProperty ) + { + return false; + } + + if ( UIStyleNumberProperty.FloatShaderProperty != styleProperty ) + { + return true; + } + + return shaderPropertyName == this.shaderPropertyName; + } + } public enum UIStyleColorProperty { FontColor, FontOutlineColor, - FontShadowColor + FontShadowColor, + + ColorShaderProperty } + + public class UIStyleColorPropertyAndName + { + public UIStyleColorProperty styleProperty; + public string shaderPropertyName; + + public static UIStyleColorPropertyAndName Create( UIStyleColorProperty property, string shaderPropertyName ) + { + var pn = new UIStyleColorPropertyAndName(); + pn.styleProperty = property; + pn.shaderPropertyName = shaderPropertyName; + return pn; + } + + public override string ToString() + { + if ( UIStyleColorProperty.ColorShaderProperty == styleProperty ) + { + return styleProperty + ": " + shaderPropertyName; + } + + return styleProperty + ""; + } + + public bool Matches( UIStyleColorProperty styleProperty, string shaderPropertyName ) + { + if ( this.styleProperty != styleProperty ) + { + return false; + } + + if ( UIStyleColorProperty.ColorShaderProperty != styleProperty ) + { + return true; + } + + return shaderPropertyName == this.shaderPropertyName; + } + } + + } \ No newline at end of file diff --git a/Runtime/UI/Styling/UIStylePropertyContainer.cs b/Runtime/UI/Styling/UIStylePropertyContainer.cs index 9798887..f83d978 100644 --- a/Runtime/UI/Styling/UIStylePropertyContainer.cs +++ b/Runtime/UI/Styling/UIStylePropertyContainer.cs @@ -17,20 +17,29 @@ namespace Rokojori Font GetFont(); - UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property ); - UIColor GetUIStyleColorProperty( UIStyleColorProperty property ); + UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property, string shaderPropertyName, UIStylePropertyContainer source ); + void SetUIStyleNumberProperty( UIStyleNumberProperty property, UINumber number ); + + UIColor GetUIStyleColorProperty( UIStyleColorProperty property, string shaderPropertyName, UIStylePropertyContainer source ); ShaderUIColor[] GetShaderUIColors(); - List> GetActiveShaderUIColorTransitions(); + // List> GetActiveShaderUIColorTransitions(); ShaderUINumber[] GetShaderUINumbers(); - List> GetActiveShaderUINumberTransitions(); + // List> GetActiveShaderUINumberTransitions(); TransitionSettingsAll GetTransitionSettingsAll(); UINumberTransition[] GetNumberTransitions(); - List> GetActiveUINumberTransitions(); + List> GetActiveUINumberTransitions(); UIColorTransition[] GetColorTransitions(); - List> GetActiveUIColorTransitions(); + List> GetActiveUIColorTransitions(); + + List GetUISelectorFlags(); + List GetParentUISelectorFlags(); + void AddUISelectorFlag( UISelectorFlag flag, string reference = "" ); + void RemoveUISelectorFlag( UISelectorFlag flag, string reference = "" ); + + } } \ No newline at end of file diff --git a/Runtime/UI/Transitions/ActiveStyleTransition.cs b/Runtime/UI/Transitions/ActiveStyleTransition.cs index 079061b..86dc349 100644 --- a/Runtime/UI/Transitions/ActiveStyleTransition.cs +++ b/Runtime/UI/Transitions/ActiveStyleTransition.cs @@ -6,77 +6,141 @@ using System; namespace Rokojori { - [Tool] public class ActiveStyleTransition { public V value; + public List lastValues = []; + public List lastWeights = []; public P propertyType; public TimeLine timeLine; public float start; public float end; public Curve curve; public bool transitioning; + - public static O ProcessTransition( - UIStylePropertyContainer container, O computedValue, - List> activeTransitions, V activeValue, P property, - Func getTransitionSettings, - Func computeValue, - Func lerpValue - ) + public float GetUnclampedTransitionPhase() { - var propertyTransition = activeTransitions.Find( t => t != null && EqualityComparer

.Default.Equals( t.propertyType, property ) ); + var transitionPhase = timeLine.ComputeRange( start, end ); + return transitionPhase; + } - if ( propertyTransition == null ) + public float ComputeTransitionWeight( float phase ) + { + var amount = MathX.Clamp01( phase ); + + if ( curve != null ) { - propertyTransition = new ActiveStyleTransition(); - propertyTransition.propertyType = property; - propertyTransition.value = activeValue; - propertyTransition.transitioning = false; + amount = curve.Sample( amount ); + } - activeTransitions.Add( propertyTransition ); + return amount; + } - return computedValue; - } + public float GetTransitionWeight() + { + var transitionPhase = GetUnclampedTransitionPhase(); + return ComputeTransitionWeight( transitionPhase ); + } + + public void EndTransition() + { + transitioning = false; + lastValues = []; + lastWeights = []; + + } + + public void StartTransition( Control control, V nextValue, TransitionSettings transitionSettings ) + { + if ( ! transitioning ) + { + lastValues = [ value ]; + lastWeights = [ 1f ]; + } else { - if ( ! EqualityComparer.Default.Equals( propertyTransition.value, activeValue ) && - ! propertyTransition.transitioning && getTransitionSettings() != null ) + var valueWeight = GetTransitionWeight(); + var lastWeight = 1f - valueWeight; + + for ( int i = 0; i < lastWeights.Count; i++ ) { - var transitionSettings = getTransitionSettings(); - propertyTransition.timeLine = transitionSettings.timeLine; - propertyTransition.start = transitionSettings.timeLine.position; - propertyTransition.end = propertyTransition.start + transitionSettings.duration; - propertyTransition.transitioning = true; - propertyTransition.curve = transitionSettings.curve; + lastWeights[ i ] *= lastWeight; } + + lastValues.Add( value ); + lastWeights.Add( valueWeight ); } - if ( EqualityComparer.Default.Equals( propertyTransition.value, activeValue ) ) - { - propertyTransition.transitioning = false; - return computedValue; - } + value = nextValue; - var computedTransitionValue = computeValue( propertyTransition.value ); - - var transitionPhase = propertyTransition.timeLine.ComputeRange( propertyTransition.start, propertyTransition.end ); - - if ( transitionPhase >= 1 ) - { - activeTransitions.Remove( propertyTransition ); - } - - var amount = MathX.Clamp01( transitionPhase ); - var curveAmount = amount; - - if ( propertyTransition.curve != null ) - { - curveAmount = propertyTransition.curve.Sample( curveAmount ); - } - - return lerpValue( computedTransitionValue, computedValue, curveAmount ); + timeLine = UI.GetTimeLine( control, transitionSettings.timeLine ); + start = timeLine.position; + end = start + transitionSettings.duration; + transitioning = true; + curve = transitionSettings.curve; } + + // public static O ProcessTransition( + // UIStylePropertyContainer container, O computedValue, + // List> activeTransitions, V activeValue, P property, + // Func getTransitionSettings, + // Func computeValue, + // Func lerpValue + // ) + // { + // var propertyTransition = activeTransitions.Find( t => t != null && EqualityComparer

.Default.Equals( t.propertyType, property ) ); + + // if ( propertyTransition == null ) + // { + // propertyTransition = new ActiveStyleTransition(); + // propertyTransition.propertyType = property; + // propertyTransition.value = activeValue; + // propertyTransition.transitioning = false; + + // activeTransitions.Add( propertyTransition ); + + // return computedValue; + // } + // else + // { + // if ( ! EqualityComparer.Default.Equals( propertyTransition.value, activeValue ) && + // ! propertyTransition.transitioning && getTransitionSettings() != null ) + // { + // var transitionSettings = getTransitionSettings(); + // propertyTransition.timeLine = transitionSettings.timeLine; + // propertyTransition.start = transitionSettings.timeLine.position; + // propertyTransition.end = propertyTransition.start + transitionSettings.duration; + // propertyTransition.transitioning = true; + // propertyTransition.curve = transitionSettings.curve; + // } + // } + + // if ( EqualityComparer.Default.Equals( propertyTransition.value, activeValue ) ) + // { + // propertyTransition.transitioning = false; + // return computedValue; + // } + + // var computedTransitionValue = computeValue( propertyTransition.value ); + + // var transitionPhase = propertyTransition.timeLine.ComputeRange( propertyTransition.start, propertyTransition.end ); + + // if ( transitionPhase >= 1 ) + // { + // activeTransitions.Remove( propertyTransition ); + // } + + // var amount = MathX.Clamp01( transitionPhase ); + // var curveAmount = amount; + + // if ( propertyTransition.curve != null ) + // { + // curveAmount = propertyTransition.curve.Sample( curveAmount ); + // } + + // return lerpValue( computedTransitionValue, computedValue, curveAmount ); + // } } } \ No newline at end of file diff --git a/Runtime/UI/Transitions/UIColorTransition.cs b/Runtime/UI/Transitions/UIColorTransition.cs index bc8f8b6..f93f871 100644 --- a/Runtime/UI/Transitions/UIColorTransition.cs +++ b/Runtime/UI/Transitions/UIColorTransition.cs @@ -12,8 +12,28 @@ namespace Rokojori [Export] public UIStyleColorProperty property; + [Export] + public string shaderPropertyName; + [Export] public TransitionSettings settings; + public bool Matches( UIStyleColorProperty property, string name ) + { + var hasSameProperty = this.property == property; + + if ( ! hasSameProperty ) + { + return false; + } + + if ( UIStyleColorProperty.ColorShaderProperty == property ) + { + return true; + } + + return name == shaderPropertyName; + } + } } \ No newline at end of file diff --git a/Runtime/UI/Transitions/UINumberTransition.cs b/Runtime/UI/Transitions/UINumberTransition.cs index 0c25f21..85008f0 100644 --- a/Runtime/UI/Transitions/UINumberTransition.cs +++ b/Runtime/UI/Transitions/UINumberTransition.cs @@ -12,6 +12,9 @@ namespace Rokojori [Export] public UIStyleNumberProperty property; + [Export] + public string shaderPropertyName; + [Export] public TransitionSettings settings; } diff --git a/Runtime/UI/UI-Selectors/UI Active Selector Flag.tres b/Runtime/UI/UI-Selectors/UI Active Selector Flag.tres new file mode 100644 index 0000000..2734ab4 --- /dev/null +++ b/Runtime/UI/UI-Selectors/UI Active Selector Flag.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="UISelectorFlag" load_steps=2 format=3 uid="uid://bpm40sb3qq3ov"] + +[ext_resource type="Script" uid="uid://n2lc266yedxq" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorFlag.cs" id="1_s6l7t"] + +[resource] +script = ExtResource("1_s6l7t") +metadata/_custom_type_script = "uid://n2lc266yedxq" diff --git a/Runtime/UI/UI-Selectors/UI Dragging Selector Flag.tres b/Runtime/UI/UI-Selectors/UI Dragging Selector Flag.tres new file mode 100644 index 0000000..d3d6a9e --- /dev/null +++ b/Runtime/UI/UI-Selectors/UI Dragging Selector Flag.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="UISelectorFlag" load_steps=2 format=3 uid="uid://x1w1ht0ri7bh"] + +[ext_resource type="Script" uid="uid://n2lc266yedxq" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorFlag.cs" id="1_aefxm"] + +[resource] +script = ExtResource("1_aefxm") +metadata/_custom_type_script = "uid://n2lc266yedxq" diff --git a/Runtime/UI/UI-Selectors/UI Focus Selector Flag.tres b/Runtime/UI/UI-Selectors/UI Focus Selector Flag.tres new file mode 100644 index 0000000..a0a3e41 --- /dev/null +++ b/Runtime/UI/UI-Selectors/UI Focus Selector Flag.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="UISelectorFlag" load_steps=2 format=3 uid="uid://b1ylhdxhl00md"] + +[ext_resource type="Script" uid="uid://n2lc266yedxq" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorFlag.cs" id="1_l76s3"] + +[resource] +script = ExtResource("1_l76s3") +metadata/_custom_type_script = "uid://n2lc266yedxq" diff --git a/Runtime/UI/UI-Selectors/UI Hover Selector Flag.tres b/Runtime/UI/UI-Selectors/UI Hover Selector Flag.tres new file mode 100644 index 0000000..114515a --- /dev/null +++ b/Runtime/UI/UI-Selectors/UI Hover Selector Flag.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="UISelectorFlag" load_steps=2 format=3 uid="uid://doblbnl2fu6u6"] + +[ext_resource type="Script" uid="uid://n2lc266yedxq" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorFlag.cs" id="1_30u76"] + +[resource] +script = ExtResource("1_30u76") +metadata/_custom_type_script = "uid://n2lc266yedxq" diff --git a/Runtime/UI/UI-Selectors/UI Scrolling Selector Flag.tres b/Runtime/UI/UI-Selectors/UI Scrolling Selector Flag.tres new file mode 100644 index 0000000..dc0d9b7 --- /dev/null +++ b/Runtime/UI/UI-Selectors/UI Scrolling Selector Flag.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="UISelectorFlag" load_steps=2 format=3 uid="uid://dleim1i076r0k"] + +[ext_resource type="Script" uid="uid://n2lc266yedxq" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorFlag.cs" id="1_hxexc"] + +[resource] +script = ExtResource("1_hxexc") +metadata/_custom_type_script = "uid://n2lc266yedxq" diff --git a/Runtime/UI/UI-Settings-Default.tres b/Runtime/UI/UI-Settings-Default.tres index d372244..540ead5 100644 --- a/Runtime/UI/UI-Settings-Default.tres +++ b/Runtime/UI/UI-Settings-Default.tres @@ -1,8 +1,32 @@ -[gd_resource type="Resource" script_class="UISettings" load_steps=3 format=3 uid="uid://dp57o0ykhkqfj"] +[gd_resource type="Resource" script_class="UISettings" load_steps=10 format=3 uid="uid://dp57o0ykhkqfj"] +[ext_resource type="SystemFont" uid="uid://s1pi67tbxu24" path="res://3rdPerson/Inputs/Jost-Font.tres" id="1_0wska"] [ext_resource type="Script" uid="uid://cgdxalxhdbmjn" path="res://addons/rokojori_action_library/Runtime/UI/UISettings.cs" id="1_5a283"] +[ext_resource type="Resource" uid="uid://b4iykcwesp1y6" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/UITime.tres" id="1_6vky0"] [ext_resource type="Resource" uid="uid://bhy8b3gopkq4m" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/Vector2/Size.tres" id="2_cdd3u"] +[ext_resource type="Script" uid="uid://cebfjne1ewhnm" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/Vector2PropertyName.cs" id="3_e2b6y"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="3_xon8j"] +[ext_resource type="Resource" uid="uid://dq52vhnqr5m6" path="res://addons/rokojori_action_library/Runtime/Sensors/Default-Sensors/Default-Input-Icons-Library.tres" id="4_v6r6i"] + +[sub_resource type="Resource" id="Resource_wm644"] +script = ExtResource("3_xon8j") +value = 1.5 +unit = "vw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_6vky0"] +script = ExtResource("3_e2b6y") +propertyName = "texture_size" +metadata/_custom_type_script = "uid://cebfjne1ewhnm" [resource] script = ExtResource("1_5a283") +inputIconsLibrary = ExtResource("4_v6r6i") +fontSize = SubResource("Resource_wm644") +defaultFont = ExtResource("1_0wska") sizePropertyName = ExtResource("2_cdd3u") +textureSizePropertyName = SubResource("Resource_6vky0") +defaultTimeline = ExtResource("1_6vky0") diff --git a/Runtime/UI/UI.cs b/Runtime/UI/UI.cs index cb76256..a0cc1d6 100644 --- a/Runtime/UI/UI.cs +++ b/Runtime/UI/UI.cs @@ -1,46 +1,212 @@ using Godot; - +using System; +using System.Collections.Generic; + namespace Rokojori { [Tool] [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UI.svg")] - public partial class UI : Control - { + public partial class UI : Control, IDisposable + { + [Export] public UISettings settings; - [Export] - public InputIconsLibrary inputIconsLibrary; - - [ExportGroup("Font Settings")] - - [Export] - public UINumber fontSize; - - [Export] - public Font defaultFont; - [Export] public float fontZoom = 1; - [ExportGroup("Update Mode")] + public enum UpdateMode + { + Always, + Only_Manual_Updates + } [Export] - public bool updateFlag = false; + public UpdateMode updateMode = UpdateMode.Always; + + [Export] + public bool useParentSize = false; + + [ExportGroup("Functions")] + [ExportToolButton( "Mouse:Stop => Pass")] + public Callable StopToPassButton => Callable.From( ()=>{ MakeStopToPass(); } ); [Export] - public bool updateAlways = true; + public Node[] stopToPassRoots = []; [ExportGroup("Read Only")] [Export] public float X_computedFontSizePixels = 1; + + + List _customDisposers = []; + + public void AddForDisposing( ICustomDisposer customDisposer ) + { + _customDisposers.Add( customDisposer ); + } + + protected override void Dispose( bool disposing ) + { + _customDisposers.ForEach( cd => cd.Dispose() ); + _customDisposers = []; + } + + [Export] + public string[] customDisposerIDs = []; + + public void MakeStopToPass() + { + var roots = stopToPassRoots; + + if ( roots == null || roots.Length == 0 ) + { + roots = [ this ]; + } + + foreach ( var n in roots ) + { + if ( n is Control c ) + { + if ( c.MouseFilter == MouseFilterEnum.Stop ) + { + c.MouseFilter = MouseFilterEnum.Pass; + } + } + + n.ForEach( + ( c )=> + { + if ( c.MouseFilter == MouseFilterEnum.Stop ) + { + c.MouseFilter = MouseFilterEnum.Pass; + } + } + ); + } + } + + Vector2 cachedSize; + + public static UI Get( Control c ) + { + return UIHolder.GetUI( c ); + } + + public static UIStylePropertyContainer GetStylePropertyContainerParent( Control c ) + { + var it = c as Node; + var walker = NodesWalker.Get(); + + it = walker.Parent( it ); + + if ( it is UI ) + { + return null; + } + + while ( it != null ) + { + if ( it is UIStylePropertyContainer ) + { + return it as UIStylePropertyContainer; + } + + it = walker.Parent( it ); + + if ( it is UI ) + { + it = null; + } + } + + return null; + } + + + public static TimeLine GetTimeLine( Control c, TimeLine timeLine ) + { + if ( timeLine != null ) + { + return timeLine; + } + + var ui = Get( c ); + + if ( ui == null || ui.settings == null ) + { + return null; + } + + return ui.settings.defaultTimeline; + } + public override void _Process( double delta ) { + if ( settings == null ) + { + return; + } + + if ( useParentSize ) + { + var parentSize = GetParent().Size; + + if ( parentSize != cachedSize ) + { + Size = parentSize; + + cachedSize = parentSize; + + // this.LogInfo( "Size Changed" ); + } + + + } + + onProcess.DispatchEvent( (float)delta ); UpdateFontSize(); UpdateUIElements(); + + // customDisposerIDs = _customDisposers.Map( c => c.GetUID() + ":" + c.GetInfo() ).ToArray(); + + } + + public void UpdateExternal( float delta) + { + onProcess.DispatchEvent( delta ); + UpdateFontSize(); + } + + public readonly EventSlot onInputEvent = new EventSlot(); + public readonly EventSlot onProcess = new EventSlot(); + + public override void _Input( InputEvent ie ) + { + onInputEvent.DispatchEvent( ie ); + } + + List hoveredControls = new List(); + + public void SetHovered( UIHoverable control ) + { + hoveredControls.Add( control ); + } + + public void BindOwnChildren() + { + BindChildrenOf( this ); + } + + public void BindChildrenOf( Node node ) + { + node.ForEach( img => img.SetUI( this ) ); + node.ForEach( info => info.SetUI( this ) ); + node.ForEach( text => text.SetUI( this ) ); + node.ForEach( region => region.SetUI( this ) ); } public override void _Ready() @@ -64,7 +230,13 @@ namespace Rokojori void UpdateFontSize() { - X_computedFontSizePixels = UINumber.Compute( this, fontSize ) * fontZoom; + if ( settings == null ) + { + return; + } + + X_computedFontSizePixels = UINumber.Compute( this, settings.fontSize ) * fontZoom; + if ( Theme != null ) { @@ -74,16 +246,18 @@ namespace Rokojori void UpdateUIElements() { - if ( ! ( updateFlag || updateAlways ) ) + if ( UpdateMode.Always != updateMode ) { return; } - updateFlag = false; - - Nodes.ForEachDirectChild( this, r => r.Layout() ); + UpdateAllUIRegions(); } + public void UpdateAllUIRegions() + { + Nodes.ForEachDirectChild( this, r => r.Layout() ); + } public static float GetWindowWidth( Control control ) { diff --git a/Runtime/UI/UISettings.cs b/Runtime/UI/UISettings.cs index 2d0321b..c270dee 100644 --- a/Runtime/UI/UISettings.cs +++ b/Runtime/UI/UISettings.cs @@ -7,10 +7,24 @@ namespace Rokojori [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/UI.svg")] public partial class UISettings : Resource { + [Export] + public InputIconsLibrary inputIconsLibrary; + + [Export] + public UINumber fontSize; + + [Export] + public Font defaultFont; + [Export] public Vector2PropertyName sizePropertyName; [Export] public Vector2PropertyName textureSizePropertyName; + + [Export] + public TimeLine defaultTimeline; + + } } \ No newline at end of file diff --git a/Runtime/VirtualCameras/CameraSlotSelectors/SetActiveCamera.cs b/Runtime/VirtualCameras/CameraSlotSelectors/SetActiveCamera.cs index ba7a418..d38d748 100644 --- a/Runtime/VirtualCameras/CameraSlotSelectors/SetActiveCamera.cs +++ b/Runtime/VirtualCameras/CameraSlotSelectors/SetActiveCamera.cs @@ -33,7 +33,7 @@ namespace Rokojori slot.camera = virtualCamera; slot.flags = slotFlags; - vm.RefreshSlots(); + vm.RefreshSlots( true ); } return slot; diff --git a/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs b/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs new file mode 100644 index 0000000..bd1c3ab --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs @@ -0,0 +1,71 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class CenterAndRangeDepthOfFieldEffect:_XX_DepthOfFieldEffect + { + + [Export( PropertyHint.Range, "0,1000")] + public float centerDistance = 10; + + [Export( PropertyHint.Range, "0,50")] + public float centerDistanceDetails = 0; + + [Export( PropertyHint.Range, "0,1")] + public float centerDistanceMicro = 0; + + [Export( PropertyHint.Range, "0,1000")] + public float absoluteRange = 1; + + [Export( PropertyHint.Range, "0,0.5")] + public float distanceRelativeRange = 0.1f; + + + [Export( PropertyHint.Range, "0,100")] + public float absoluteTransition = 1; + + [Export( PropertyHint.Range, "0,1")] + public float distanceRelativeTransition = 0.1f; + + [Export( PropertyHint.Range, "0.1,10")] + public float nearTransitionScale = 0.5f; + + [Export( PropertyHint.Range, "0.1,10")] + public float farTransitionScale = 2.5f; + + [Export] + public NormalizedValue amount; + + [Export] + public Float8Value exposure; + + public override BoxedFloatValue[] GetFloatValues() + { + var distance = MathX.Max( 0, centerDistance + centerDistanceDetails + centerDistanceMicro ); + var range = absoluteRange + distance * distanceRelativeRange; + var far = distance + range; + var near = distance - range; + + var farTransition = ( absoluteTransition + ( distanceRelativeTransition * far ) ) * farTransitionScale; + var nearTransition = ( absoluteTransition + ( distanceRelativeTransition * near ) )* nearTransitionScale; + + _values[ 0 ] = BoolFloatValue.Create( 1 ); + _values[ 1 ] = FloatValue.Create( far ); + _values[ 2 ] = FloatValue.Create( farTransition ); + + _values[ 3 ] = BoolFloatValue.Create( 1 ); + _values[ 4 ] = FloatValue.Create( near ); + _values[ 5 ] = FloatValue.Create( nearTransition ); + + _values[ 6 ] = amount; + _values[ 7 ] = exposure; + + return _values; + } + } + +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs.uid new file mode 100644 index 0000000..c04f917 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/CenterAndRangeDepthOfFieldEffect.cs.uid @@ -0,0 +1 @@ +uid://dsou2hpnpk77s diff --git a/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs b/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs new file mode 100644 index 0000000..25c5df6 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs @@ -0,0 +1,66 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class FixedDepthOfFieldEffect:_XX_DepthOfFieldEffect + { + [Export] + public BoolFloatValue farEnabled; + + [Export] + public FloatDOFDistanceValue farDistance; + + [Export] + public FloatDOFTransitionValue farTransition; + + [Export] + public BoolFloatValue nearEnabled; + + [Export] + public FloatDOFDistanceValue nearDistance; + + [Export] + public FloatDOFTransitionValue nearTransition; + + [Export] + public NormalizedValue amount; + + [Export] + public Float8Value exposure; + + public override BoxedFloatValue[] GetFloatValues() + { + _values[ 0 ] = farEnabled; + _values[ 1 ] = farDistance; + _values[ 2 ] = farTransition; + + _values[ 3 ] = nearEnabled; + _values[ 4 ] = nearDistance; + _values[ 5 ] = nearTransition; + + _values[ 6 ] = amount; + _values[ 7 ] = exposure; + + return _values; + } + + // public override void SetFloatValues( BoxedFloatValue[] values ) + // { + + // farEnabled = BoolFloatValue.Create( _values[ 0 ] ); + // farDistance = FloatDOFDistanceValue.Create( _values[ 1 ] ); + // farTransition = FloatDOFTransitionValue.Create( _values[ 2 ] ); + + // nearEnabled = BoolFloatValue.Create( _values[ 3 ] ); + // nearDistance = FloatDOFDistanceValue.Create( _values[ 4 ] ); + // nearTransition = FloatDOFTransitionValue.Create( _values[ 5 ] ); + + // amount = NormalizedValue.Create( _values[ 6 ] ); + // exposure = Float8Value.Create( _values[ 7 ] ); + // } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs.uid new file mode 100644 index 0000000..57db90a --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FixedDepthOfFieldEffect.cs.uid @@ -0,0 +1 @@ +uid://b2bnxnhb016fs diff --git a/Runtime/VirtualCameras/PostProcess/FogEffect.cs b/Runtime/VirtualCameras/PostProcess/FogEffect.cs new file mode 100644 index 0000000..0a24e8f --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FogEffect.cs @@ -0,0 +1,148 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class FogEffect:PostProcessVolumeEffect + { + [Export] + public ColorValue lightColor; + + [Export] + public Float16Value lightEnergy; + + [Export] + public NormalizedValue sunScatter; + + [Export] + public PowerValue density; + + [Export] + public NormalizedValue aerialPerspective; + + [Export] + public NormalizedValue skyEffect; + + [Export] + public Polar1024Value height; + + [Export] + public Polar16Value heightDensity; + + BoxedFloatValue[] _values = new BoxedFloatValue[ 7 ]; + + + public override BoxedFloatValue[] GetFloatValues() + { + _values[ 0 ] = lightEnergy; + _values[ 1 ] = sunScatter; + _values[ 2 ] = density; + _values[ 3 ] = aerialPerspective; + _values[ 4 ] = skyEffect; + _values[ 5 ] = height; + _values[ 6 ] = heightDensity; + + return _values; + } + + public override void SetFloatValues( BoxedFloatValue[] values ) + { + lightEnergy = Float16Value.Create( _values[ 0 ] ); + sunScatter = NormalizedValue.Create( _values[ 1 ] ); + density = PowerValue.Create( _values[ 2 ] ); + aerialPerspective = NormalizedValue.Create( _values[ 3 ] ); + skyEffect = NormalizedValue.Create( _values[ 4 ] ); + height = Polar1024Value.Create( _values[ 5 ] ); + heightDensity = Polar16Value.Create( _values[ 6 ] ); + } + + ColorValue[] _colors = new ColorValue[ 1 ]; + + + public override ColorValue[] GetColorValues() + { + _colors[ 0 ] = lightColor; + + return _colors; + } + + public override void SetColorValues( ColorValue[] values ) + { + lightColor = ColorValue.Create( values[ 0 ] ); + } + + public override void Lerp( object fogEffects, List volumes ) + { + LerpFrom( (List) fogEffects, volumes ); + } + + public void LerpFrom( List fogEffects, List volumes ) + { + LerpColors( fogEffects, volumes ); + LerpFloats( fogEffects, volumes ); + } + + public override void Apply( WorldEnvironment worldEnvironment ) + { + if ( worldEnvironment == null || worldEnvironment.Environment == null ) + { + return; + } + + if ( lightColor != null ) + { + worldEnvironment.Environment.FogLightColor = lightColor.value; + } + + /* + + _values[ 0 ] = lightEnergy; + _values[ 1 ] = sunScatter; + _values[ 2 ] = density; + _values[ 3 ] = aerialPerspective; + _values[ 4 ] = skyEffect; + _values[ 5 ] = height; + _values[ 6 ] = heightDensity; + + */ + + if ( lightEnergy != null ) + { + worldEnvironment.Environment.FogLightEnergy = lightEnergy.value; + } + + if ( sunScatter != null ) + { + worldEnvironment.Environment.FogSunScatter = sunScatter.value; + } + + if ( density != null ) + { + worldEnvironment.Environment.FogDensity = density.value; + } + + if ( aerialPerspective != null ) + { + worldEnvironment.Environment.FogAerialPerspective = aerialPerspective.value; + } + + if ( skyEffect != null ) + { + worldEnvironment.Environment.FogSkyAffect = skyEffect.value; + } + + if ( height != null ) + { + worldEnvironment.Environment.FogHeight = height.value; + } + + if ( heightDensity != null ) + { + worldEnvironment.Environment.FogHeightDensity = heightDensity.value; + } + } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/FogEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/FogEffect.cs.uid new file mode 100644 index 0000000..9791cbf --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FogEffect.cs.uid @@ -0,0 +1 @@ +uid://cmhbynml7hyhj diff --git a/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs b/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs new file mode 100644 index 0000000..3ef45df --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs @@ -0,0 +1,77 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class FollowDepthOfFieldEffect:_XX_DepthOfFieldEffect + { + [Export] + public NodePath node; + + protected float centerDistance = 0; + + [Export( PropertyHint.Range, "-10,10")] + public float offsetDistanceDetails = 0; + + [Export( PropertyHint.Range, "-1,1")] + public float offsetDistanceMicro = 0; + + [Export( PropertyHint.Range, "0,1000")] + public float absoluteRange = 1; + + [Export( PropertyHint.Range, "0,0.5")] + public float distanceRelativeRange = 0.1f; + + + [Export( PropertyHint.Range, "0,100")] + public float absoluteTransition = 1; + + [Export( PropertyHint.Range, "0,1")] + public float distanceRelativeTransition = 0.1f; + + [Export( PropertyHint.Range, "0.1,10")] + public float nearTransitionScale = 0.5f; + + [Export( PropertyHint.Range, "0.1,10")] + public float farTransitionScale = 2.5f; + + [Export] + public NormalizedValue amount; + + [Export] + public Float8Value exposure; + + public void SetCenterDistance( float distance ) + { + centerDistance = distance; + } + + public override BoxedFloatValue[] GetFloatValues() + { + var distance = MathX.Max( 0, centerDistance + offsetDistanceDetails + offsetDistanceMicro ); + var range = absoluteRange + distance * distanceRelativeRange; + var far = distance + range; + var near = distance - range; + + var farTransition = ( absoluteTransition + ( distanceRelativeTransition * far ) ) * farTransitionScale; + var nearTransition = ( absoluteTransition + ( distanceRelativeTransition * near ) )* nearTransitionScale; + + _values[ 0 ] = BoolFloatValue.Create( 1 ); + _values[ 1 ] = FloatValue.Create( far ); + _values[ 2 ] = FloatValue.Create( farTransition ); + + _values[ 3 ] = BoolFloatValue.Create( 1 ); + _values[ 4 ] = FloatValue.Create( near ); + _values[ 5 ] = FloatValue.Create( nearTransition ); + + _values[ 6 ] = amount; + _values[ 7 ] = exposure; + + return _values; + } + } + +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs.uid new file mode 100644 index 0000000..54bae01 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/FollowDepthOfFieldEffect.cs.uid @@ -0,0 +1 @@ +uid://d0vnyofpv743a diff --git a/Runtime/VirtualCameras/PostProcess/GlowEffect.cs b/Runtime/VirtualCameras/PostProcess/GlowEffect.cs new file mode 100644 index 0000000..8494803 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/GlowEffect.cs @@ -0,0 +1,138 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class GlowEffect:PostProcessVolumeEffect + { + [Export] + public GlowEffectLevels levels; + + [Export] + public Float8Value intensity; + + [Export] + public Float2Value strength; + + [Export] + public NormalizedValue bloom; + + [Export] + public Float4Value hdrTreshold; + + [Export] + public Float4Value hdrScale; + + [Export] + public Float256Value hdrLuminanceCap; + + [Export] + public NormalizedValue mapStrength; + + + BoxedFloatValue[] _values = new BoxedFloatValue[ 7 ]; + + + public override BoxedFloatValue[] GetFloatValues() + { + _values[ 0 ] = intensity; + _values[ 1 ] = strength; + _values[ 2 ] = bloom; + _values[ 3 ] = hdrTreshold; + _values[ 4 ] = hdrScale; + _values[ 5 ] = hdrLuminanceCap; + _values[ 6 ] = mapStrength; + + return _values; + } + + public override void SetFloatValues( BoxedFloatValue[] values ) + { + intensity = Float8Value.Create( _values[ 0 ] ); + strength = Float2Value.Create(_values[ 1 ] ); + bloom = NormalizedValue.Create( _values[ 2 ] ); + hdrTreshold = Float4Value.Create(_values[ 3 ] ); + hdrScale = Float4Value.Create(_values[ 4 ] ); + hdrLuminanceCap = Float256Value.Create(_values[ 5 ] ); + mapStrength = NormalizedValue.Create(_values[ 6 ] ); + } + + public override void Lerp( object glowEffects, List volumes ) + { + LerpFrom( (List) glowEffects, volumes ); + } + + public void LerpFrom( List glowEffects, List volumes ) + { + if ( levels == null && glowEffects.Find( g => g.levels != null ) != null ) + { + levels = new GlowEffectLevels(); + } + + if ( levels != null ) + { + levels.LerpFrom( glowEffects, volumes ); + } + + LerpFloats( glowEffects, volumes ); + + } + + public override void Apply( WorldEnvironment worldEnvironment ) + { + if ( worldEnvironment == null || worldEnvironment.Environment == null ) + { + return; + } + + if ( levels != null ) + { + var normalizer = levels.normalizer; + + worldEnvironment.Environment.SetGlowLevel( 0, levels.level1 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 1, levels.level2 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 2, levels.level3 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 3, levels.level4 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 4, levels.level5 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 5, levels.level6 * normalizer ); + worldEnvironment.Environment.SetGlowLevel( 6, levels.level7 * normalizer ); + + } + + if ( intensity != null ) + { + worldEnvironment.Environment.GlowIntensity = intensity.GetFloatValue(); + } + + if ( strength != null ) + { + worldEnvironment.Environment.GlowStrength = strength.GetFloatValue(); + } + + if ( bloom != null ) + { + worldEnvironment.Environment.GlowBloom = bloom.GetFloatValue(); + } + + if ( hdrTreshold != null ) + { + worldEnvironment.Environment.GlowHdrThreshold = hdrTreshold.GetFloatValue(); + } + + if ( hdrScale != null ) + { + worldEnvironment.Environment.GlowHdrScale = hdrScale.GetFloatValue(); + } + + if ( mapStrength != null ) + { + worldEnvironment.Environment.GlowMapStrength = mapStrength.GetFloatValue(); + } + + + } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/GlowEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/GlowEffect.cs.uid new file mode 100644 index 0000000..7901a48 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/GlowEffect.cs.uid @@ -0,0 +1 @@ +uid://bcw4w7f5c1n0x diff --git a/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs b/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs new file mode 100644 index 0000000..3c8d23f --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs @@ -0,0 +1,83 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class GlowEffectLevels:Resource + { + [Export(PropertyHint.Range,"0,10")] + public float level1 = 1f; + [Export(PropertyHint.Range,"0,10")] + public float level2 = 1f; + [Export(PropertyHint.Range,"0,10")] + public float level3 = 1f; + [Export(PropertyHint.Range,"0,10")] + + public float level4 = 1f; + [Export(PropertyHint.Range,"0,10")] + public float level5 = 1f; + [Export(PropertyHint.Range,"0,10")] + public float level6 = 1f; + [Export(PropertyHint.Range,"0,10")] + public float level7 = 1f; + + [Export] + public bool normalized = true; + + public float sum => level1 + level2 + level3 + level4 + level5 + level6 + level7; + public float normalizer => normalized ? 1f / sum : 1f; + + public void LerpFrom( List glowEffects, List volumes ) + { + level1 = 0; + level2 = 0; + level3 = 0; + level4 = 0; + level5 = 0; + level6 = 0; + level7 = 0; + + float weight = 0; + + for ( int i = 0; i < glowEffects.Count; i++ ) + { + var levels = glowEffects[ i ].levels; + + if ( levels == null ) + { + continue; + } + + var normalizer = levels.normalizer; + + level1 += levels.level1 * normalizer; + level2 += levels.level2 * normalizer; + level3 += levels.level3 * normalizer; + level4 += levels.level4 * normalizer; + level5 += levels.level5 * normalizer; + level6 += levels.level6 * normalizer; + level7 += levels.level7 * normalizer; + + weight += volumes[ i ].combinedWeight; + } + + if ( weight == 0 ) + { + return; + } + + level1 /= weight; + level2 /= weight; + level3 /= weight; + level4 /= weight; + level5 /= weight; + level6 /= weight; + level7 /= weight; + + } + + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs.uid b/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs.uid new file mode 100644 index 0000000..ac95c14 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/GlowEffectLevels.cs.uid @@ -0,0 +1 @@ +uid://cqr3g8hjix8hu diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs b/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs new file mode 100644 index 0000000..9232fcc --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs @@ -0,0 +1,46 @@ + +using Godot; +using System.Collections.Generic; +using System; +using System.Linq; +namespace Rokojori +{ + public interface IPostProcessEffectProcessor + { + public void ClearForStackUpdate(); + public void OnVolumeUpdate( PostProcessVolume volume, List allEffects ); + public void Apply( WorldEnvironment worldEnvironment ); + } + + public class PostProcessEffectProcessor:IPostProcessEffectProcessor where T:PostProcessVolumeEffect, new() + { + public T combinedEffect = new T(); + public List activeEffects = []; + public List activeVolumes = []; + + public void ClearForStackUpdate() + { + activeEffects.Clear(); + activeVolumes.Clear(); + } + + public void OnVolumeUpdate( PostProcessVolume volume, List allEffects ) + { + var glows = GetEffectType( allEffects ); + activeEffects.AddRange( glows ); + + glows.ForEach( g => activeVolumes.Add( volume ) ); + } + + List GetEffectType( List effects ) where T:PostProcessVolumeEffect + { + return effects.FilterType(); + } + + public void Apply( WorldEnvironment worldEnvironment ) + { + combinedEffect.Lerp( activeEffects, activeVolumes ); + combinedEffect.Apply( worldEnvironment ); + } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs.uid b/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs.uid new file mode 100644 index 0000000..97ad805 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessEffectProcessor.cs.uid @@ -0,0 +1 @@ +uid://bqapmsksmn66d diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs b/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs new file mode 100644 index 0000000..8cbef15 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs @@ -0,0 +1,75 @@ + +using Godot; +using System.Collections.Generic; +using System; +using System.Linq; +namespace Rokojori +{ + [Tool] + [GlobalClass, Icon("res://addons/rokojori_action_library/Icons/PostProcess.svg") ] + public partial class PostProcessVolume: Node3D + { + [Export] + public bool enabled = true; + + [Export] + public float weight; + + public float combinedWeight => ! enabled ? 0 : weight; + + [Export] + public int priority = 0; + + [Export] + public PostProcessVolumeEffect[] effects; + + [ExportToolButton("Add To Camera Manager")] + public Callable AddButton => Callable.From( + ( ) => + { + var volumes = VirtualCamera3DManager.Get().postProcessVolumes; + + if ( volumes.Contains( this ) ) + { + return; + } + + VirtualCamera3DManager.Get().postProcessVolumes = Arrays.Add( volumes, this ); + } + ); + + public void UpdateEffects( VirtualCamera3DManager manager ) + { + effects.ForEach( + ( e )=> + { + if ( e is FollowDepthOfFieldEffect fd ) + { + var node = GetNode( fd.node ); + + var d = 0f; + + if ( node != null && node is Node3D n3 ) + { + var camera = manager.camera; + + #if TOOLS + + if ( Engine.IsEditorHint() ) + { + camera = EditorInterface.Singleton.GetEditorViewport3D().GetCamera3D(); + } + + #endif + + d = camera.GlobalDistanceTo( n3 ); + } + + fd.SetCenterDistance( d ); + } + } + ); + } + + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs.uid b/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs.uid new file mode 100644 index 0000000..18c17a9 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessVolume.cs.uid @@ -0,0 +1 @@ +uid://d2200y7g0bqlw diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs b/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs new file mode 100644 index 0000000..7b9c807 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs @@ -0,0 +1,236 @@ + +using Godot; +using System.Collections.Generic; +using System; +using System.Linq; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class PostProcessVolumeEffect: Resource + { + public virtual void Apply( WorldEnvironment worldEnvironment ) + { + + } + + public virtual void Lerp( object listOfOwnType, List volumes ) + { + + } + + public virtual BoxedFloatValue[] GetFloatValues() + { + return []; + } + + public virtual void SetFloatValues( BoxedFloatValue[] values ) + { + + } + + public void LerpFloats( IReadOnlyList effects, List volumes) + { + var floatValues = GetFloatValues(); + + for ( int i = 0; i < floatValues.Length; i++ ) + { + if ( floatValues[ i ] == null ) + { + var hasEffect = false; + + for ( int j = 0; j < effects.Count; j++ ) + { + if ( effects[ j ].GetFloatValues() [ i ] != null ) + { + hasEffect = true; + j = effects.Count; + } + } + + if ( hasEffect ) + { + floatValues[ i ] = new FloatValue(); + } + else + { + floatValues[ i ] = null; + } + } + + + if ( floatValues[ i ] == null ) + { + continue; + } + + floatValues[ i ].SetFloatValue( 0f ); + + } + + var valueWeights = new float[ floatValues.Length ]; + var priorities = new int[ floatValues.Length ]; + + for ( int i = 0; i < floatValues.Length; i++ ) + { + valueWeights[ i ] = 0; + priorities[ i ] = -100000; + } + + for ( int i = 0; i < effects.Count; i++ ) + { + var otherValues = effects[ i ].GetFloatValues(); + + // this.LogInfo( "effects:", HierarchyName.Of( effects[ i ] ) ); + + for ( int j = 0; j < floatValues.Length; j++ ) + { + if ( floatValues[ j ] == null || otherValues[ j ] == null ) + { + continue; + } + + if ( volumes[ i ].priority < priorities[ j ] ) + { + continue; + } + + if ( priorities[ j ] < volumes[ i ].priority ) + { + valueWeights[ j ] = 0f; + floatValues[ j ].SetFloatValue( 0f ); + } + + priorities[ j ] = volumes[ i ].priority; + + var value = floatValues[ j ].GetFloatValue(); + + floatValues[ j ].SetFloatValue( value + otherValues[ j ].GetFloatValue() ); + valueWeights[ j ] += volumes[ i ].combinedWeight; + + // this.LogInfo( "Lerping", j, otherValues[ j ].value, valueWeights[ j ] ); + + + } + } + + for ( int i = 0; i < floatValues.Length; i++) + { + if ( floatValues[ i ] == null ) + { + continue; + } + + floatValues[ i ].SetFloatValue( floatValues[ i ].GetFloatValue() / valueWeights[ i ] ); + } + + SetFloatValues( floatValues ); + } + + public virtual ColorValue[] GetColorValues() + { + return []; + } + + public virtual void SetColorValues( ColorValue[] values ) + { + + } + + public void LerpColors( IReadOnlyList effects, List volumes) + { + var colorValues = GetColorValues(); + + for ( int i = 0; i < colorValues.Length; i++ ) + { + if ( colorValues[ i ] == null ) + { + var hasEffect = false; + + for ( int j = 0; j < effects.Count; j++ ) + { + if ( effects[ j ].GetColorValues() [ i ] != null ) + { + hasEffect = true; + j = effects.Count; + } + } + + if ( hasEffect ) + { + colorValues[ i ] = new ColorValue(); + } + else + { + colorValues[ i ] = null; + } + } + + + if ( colorValues[ i ] == null ) + { + continue; + } + + colorValues[ i ].value = new Color( 0, 0, 0, 0 ); + + } + + var valueWeights = new float[ colorValues.Length ]; + var priorities = new int[ colorValues.Length ]; + + for ( int i = 0; i < colorValues.Length; i++ ) + { + valueWeights[ i ] = 0; + priorities[ i ] = -100000; + } + + for ( int i = 0; i < effects.Count; i++ ) + { + var otherValues = effects[ i ].GetColorValues(); + + // this.LogInfo( "effects:", HierarchyName.Of( effects[ i ] ) ); + + for ( int j = 0; j < colorValues.Length; j++ ) + { + if ( colorValues[ j ] == null || otherValues[ j ] == null ) + { + continue; + } + + if ( volumes[ i ].priority < priorities[ j ] ) + { + continue; + } + + if ( priorities[ j ] < volumes[ i ].priority ) + { + valueWeights[ j ] = 0f; + colorValues[ j ].value = new Color( 0, 0, 0, 0 ); + } + + priorities[ j ] = volumes[ i ].priority; + + colorValues[ j ].value += otherValues[ j ].value; + valueWeights[ j ] += volumes[ i ].combinedWeight; + + // this.LogInfo( "Lerping", j, otherValues[ j ].value, valueWeights[ j ] ); + + + } + } + + for ( int i = 0; i < colorValues.Length; i++) + { + if ( colorValues[ i ] == null ) + { + continue; + } + + colorValues[ i ].value /= valueWeights[ i ]; + } + + SetColorValues( colorValues ); + } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs.uid new file mode 100644 index 0000000..5111dcd --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/PostProcessVolumeEffect.cs.uid @@ -0,0 +1 @@ +uid://bxstkmfake6ek diff --git a/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs b/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs new file mode 100644 index 0000000..3b24a15 --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs @@ -0,0 +1,90 @@ + +using Godot; +using System.Collections.Generic; +using System; +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class _XX_DepthOfFieldEffect:PostProcessVolumeEffect + { + + protected BoxedFloatValue[] _values = new BoxedFloatValue[ 8 ]; + + + public override BoxedFloatValue[] GetFloatValues() + { + return _values; + } + + public override void SetFloatValues( BoxedFloatValue[] values ) + { + _values = values; + } + + public override void Lerp( object depthOfFieldEffects, List volumes ) + { + LerpFrom( (List<_XX_DepthOfFieldEffect>) depthOfFieldEffects, volumes ); + } + + public void LerpFrom( List<_XX_DepthOfFieldEffect> depthOfFieldEffects, List volumes ) + { + LerpFloats( depthOfFieldEffects, volumes ); + } + + public override void Apply( WorldEnvironment worldEnvironment ) + { + if ( worldEnvironment == null || + worldEnvironment.CameraAttributes == null || + ! ( worldEnvironment.CameraAttributes is CameraAttributesPractical ) + ) + { + return; + } + + var cap = (CameraAttributesPractical) worldEnvironment.CameraAttributes; + + var floatValues = GetFloatValues(); + + if ( floatValues[ 0 ] != null ) + { + cap.DofBlurFarEnabled = floatValues[ 0 ].GetFloatValue() > 0.5f; + } + + if ( floatValues[ 1 ] != null ) + { + cap.DofBlurFarDistance = floatValues[ 1 ].GetFloatValue(); + } + + if ( floatValues[ 2 ] != null ) + { + cap.DofBlurFarTransition = floatValues[ 2 ].GetFloatValue(); + } + + if ( floatValues[ 3 ] != null ) + { + cap.DofBlurNearEnabled = floatValues[ 3 ].GetFloatValue() > 0.5f; + } + + if ( floatValues[ 4 ] != null ) + { + cap.DofBlurNearDistance = floatValues[ 4 ].GetFloatValue(); + } + + if ( floatValues[ 5 ] != null ) + { + cap.DofBlurNearTransition = floatValues[ 5 ].GetFloatValue(); + } + + if ( floatValues[ 6 ] != null ) + { + cap.DofBlurAmount = floatValues[ 6 ].GetFloatValue(); + } + + if ( floatValues[ 7 ] != null ) + { + cap.ExposureMultiplier = floatValues[ 7 ].GetFloatValue(); + } + } + } +} \ No newline at end of file diff --git a/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs.uid b/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs.uid new file mode 100644 index 0000000..e245afd --- /dev/null +++ b/Runtime/VirtualCameras/PostProcess/_XX_DepthOfFieldEffect.cs.uid @@ -0,0 +1 @@ +uid://c0fj1ycw6fqn8 diff --git a/Runtime/VirtualCameras/VirtualCamera3DManager.cs b/Runtime/VirtualCameras/VirtualCamera3DManager.cs index c9afb70..37a11ae 100644 --- a/Runtime/VirtualCameras/VirtualCamera3DManager.cs +++ b/Runtime/VirtualCameras/VirtualCamera3DManager.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System; using Godot; +using System.Linq; namespace Rokojori @@ -15,12 +16,20 @@ namespace Rokojori [Export] public Camera3D camera; + [Export] + public WorldEnvironment worldEnvironment; + [Export] public bool refreshSlots = false; [Export] public bool active = false; + [Export] + public bool postProcess = false; + + [Export] + public PostProcessVolume[] postProcessVolumes = []; public static VirtualCamera3DManager Get() { @@ -35,6 +44,31 @@ namespace Rokojori } } + [ExportGroup("Read Only" )] + [Export] + public bool lerpingCameras; + [Export] + public bool lerpingPostProcessing; + + bool _lerpingCameras = false; + const int minimalLerpFrames = 100; + int _cameraLerpCounter = 0; + int _postProcessLerpCounter = 0; + + + bool _lerpingPostProcessVolumes = false; + + + public void StartLerping() + { + _lerpingCameras = true; + lerpingCameras = _lerpingCameras; + _cameraLerpCounter = minimalLerpFrames; + + this.LogInfo( "Started Lerping" ); + } + + List prios = new List(); public override void _Process( double delta ) { if ( ! active ) @@ -42,9 +76,175 @@ namespace Rokojori return; } - LerpCameras( delta ); + + ProcessCameras( delta ); + ProcessPostProcess( delta ); + + } + + PostProcessEffectProcessor glowEffectProcessor = new PostProcessEffectProcessor(); + PostProcessEffectProcessor fogEffectProcessor = new PostProcessEffectProcessor(); + PostProcessEffectProcessor<_XX_DepthOfFieldEffect> depthOfFieldProcessor = new PostProcessEffectProcessor<_XX_DepthOfFieldEffect>(); + + void SetAllPostProcessors() + { + _allPostProcessors =new List() + { + glowEffectProcessor, + fogEffectProcessor, + depthOfFieldProcessor + }; + } + + List _allPostProcessors; + + bool updatePostEffectStack = true; + + [Export] + public bool postStackUpdate = false; + + void ProcessPostProcess( double delta ) + { + if ( ! postProcess || postProcessVolumes == null ) + { + return; + } + + + postProcessVolumes.ForEach( + v => + { + if ( v == null ) + { return; } + + v.UpdateEffects( this ); + } + ); + + if ( postStackUpdate ) + { + updatePostEffectStack =true; + postStackUpdate = false; + } + + UpdatePostEffectStack(); + + + + _allPostProcessors.ForEach( p => p.Apply( worldEnvironment ) ); + + } + + int _postEffectsSize = -1; + + + + void UpdatePostEffectStack() + { + if ( _allPostProcessors == null || _allPostProcessors.Count == 0 ) + { + SetAllPostProcessors(); + } + + if ( _postEffectsSize != postProcessVolumes.Length ) + { + updatePostEffectStack = true; + } + + if ( ! updatePostEffectStack ) + { + return; + } + + _postEffectsSize = postProcessVolumes.Length; + + _allPostProcessors.ForEach( p => p.ClearForStackUpdate() ); + + postProcessVolumes.ForEach( + volume => + { + var allEffects = volume.effects.ToList(); + + _allPostProcessors.ForEach( p => p.OnVolumeUpdate( volume, allEffects ) ); + } + ); + } + + void ProcessCameras( double delta ) + { + if ( ! _lerpingCameras ) + { + RefreshSlots(); + + var cam = activeSlot; + + if ( camera == null || cam == null || cam.camera == null ) + { + return; + } + + SetSingleCamera( cam ); + + } + else + { + LerpCameras( delta ); + } + } + + void SetSingleCamera( VirtualCamera3DSlot c ) + { + var rotation = c.GetCameraRotation(); + + if ( ! rotation.IsFinite() || rotation.Length() == 0 ) + { + rotation = new Quaternion(); + rotation.X = 0; + rotation.Y = 0; + rotation.Z = 0; + rotation.W = 1; + rotation = rotation.Normalized(); + } + + + var vUp = rotation * Vector3.Up; + var vForward = rotation * Vector3.Forward; + + var position = c.GetCameraPosition(); + var up = vUp; + var forward = vForward; + var fov = c.GetCameraFOV(); + + if ( forward.LengthSquared() == 0 ) + { + forward = camera.Basis.Z; + } + else + { + forward = forward.Normalized(); + } + + if ( up.LengthSquared() == 0 ) + { + up = camera.Basis.Y; + } + else + { + up = up.Normalized(); + } + + // RJLog.Log( "Set Cam", position ); + + + + camera.GlobalPosition = position; + camera.LookAt( position - forward, up ); + camera.Fov = fov; + } + + [Export] public float CameraPrioritySmoothingCoefficient = 0.1f; @@ -73,15 +273,27 @@ namespace Rokojori public void SetActiveSlot( VirtualCamera3DSlot slot ) { - _cameraSlots.ForEach( c => c.priority = c == slot ? 1 : 0 ); + _cameraSlots.ForEach( c => c.priority = ( c == slot ? 1 : 0 ) ); + StartLerping(); } - public void RefreshSlots() + public void RefreshSlots( bool forceUpdate = false ) { + + var needsUpdate = forceUpdate || refreshSlots || _cameraSlots == null || _cameraSlots.Count == 0; + + if ( ! needsUpdate ) + { + return; + } + refreshSlots = false; _cameraSlots = Nodes.GetDirectChildren( this ); + StartLerping(); } + + public void RemoveSlot( VirtualCamera3DSlot slot ) { if ( slot == null || slot.GetParent() != this ) @@ -91,26 +303,52 @@ namespace Rokojori Nodes.RemoveAndDelete( slot ); - RefreshSlots(); + RefreshSlots( true ); } void LerpCameras( double delta ) { - if ( refreshSlots || _cameraSlots == null || _cameraSlots.Count == 0 ) - { - RefreshSlots(); - } + RefreshSlots(); + var sumPriority = 0f; + if ( prios.Count != _cameraSlots.Count ) + { + prios = _cameraSlots.Map( c => c.smoothedPriority ); + } + + var numWithNonZero = 0; + + _cameraSlots.ForEach( c => { c.Update( delta, this ); sumPriority += MathF.Max( 0, c.smoothedPriority ); + + if ( c.smoothedPriority > 0.001f ) + { + numWithNonZero ++; + } } ); + if ( _cameraLerpCounter > 0 ) + { + _cameraLerpCounter --; + } + + if ( _cameraLerpCounter == 0 && numWithNonZero == 1 ) + { + _lerpingCameras = false; + lerpingCameras = _lerpingCameras; + + // this.LogInfo( "Stopped Lerping" ); + // return; + } + + if ( sumPriority == 0 ) { return; @@ -171,6 +409,8 @@ namespace Rokojori // RJLog.Log( "Set Cam", position ); + + camera.GlobalPosition = position; camera.LookAt( position - forward, up ); camera.Fov = fov; diff --git a/Tools/Messages/Active Font Style.tres b/Tools/Messages/Active Font Style.tres new file mode 100644 index 0000000..8f115ab --- /dev/null +++ b/Tools/Messages/Active Font Style.tres @@ -0,0 +1,25 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=4 format=3 uid="uid://cnas6k8vuim3h"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_nh37u"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_whu34"] + +[sub_resource type="Resource" id="Resource_h7wmn"] +script = ExtResource("1_nh37u") +color = Color(1, 1, 1, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[resource] +script = ExtResource("1_whu34") +layout = 0 +fontColor = SubResource("Resource_h7wmn") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Idle Font Style.tres b/Tools/Messages/Idle Font Style.tres new file mode 100644 index 0000000..cee2656 --- /dev/null +++ b/Tools/Messages/Idle Font Style.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=6 format=3 uid="uid://64meo4kcdldu"] + +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_idqg4"] +[ext_resource type="Script" uid="uid://3bymmno3avag" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/TransitionSettingsAll.cs" id="2_lh08y"] +[ext_resource type="Resource" uid="uid://b4iykcwesp1y6" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/UITime.tres" id="3_rbu1a"] + +[sub_resource type="Curve" id="Curve_016cl"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Resource" id="Resource_rbu1a"] +script = ExtResource("2_lh08y") +transitionAllProperties = true +duration = 1.0 +curve = SubResource("Curve_016cl") +timeLine = ExtResource("3_rbu1a") +metadata/_custom_type_script = "uid://3bymmno3avag" + +[resource] +script = ExtResource("1_idqg4") +layout = 0 +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +transitionSettings = SubResource("Resource_rbu1a") +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Background.tres b/Tools/Messages/Message Background.tres new file mode 100644 index 0000000..7133f32 --- /dev/null +++ b/Tools/Messages/Message Background.tres @@ -0,0 +1,59 @@ +[gd_resource type="Resource" script_class="RoundedRectangleUIImageType" load_steps=9 format=3 uid="uid://bliw5flmiq30c"] + +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="1_4fcac"] +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="2_m58tc"] +[ext_resource type="Script" uid="uid://dwuimn03cvh3" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs" id="3_uxf5k"] + +[sub_resource type="Resource" id="Resource_yp323"] +script = ExtResource("1_4fcac") +value = 0.35 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_tqqfk"] +script = ExtResource("2_m58tc") +color = Color(0.109394, 0.185443, 0.377804, 0.278431) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_bbety"] +script = ExtResource("1_4fcac") +value = 0.304 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_aywh2"] +script = ExtResource("2_m58tc") +color = Color(1, 0, 0, 0) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_deji5"] +script = ExtResource("1_4fcac") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("3_uxf5k") +fillColor = SubResource("Resource_tqqfk") +strokeColor = SubResource("Resource_aywh2") +borderRadius = SubResource("Resource_yp323") +strokeSize = SubResource("Resource_deji5") +offset = SubResource("Resource_bbety") +metadata/_custom_type_script = "uid://dwuimn03cvh3" diff --git a/Tools/Messages/Message Content.tres b/Tools/Messages/Message Content.tres new file mode 100644 index 0000000..d1ad1b2 --- /dev/null +++ b/Tools/Messages/Message Content.tres @@ -0,0 +1,37 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=6 format=3 uid="uid://gearoalaecoi"] + +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_h0nak"] +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_mxep8"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="3_yyf6n"] + +[sub_resource type="Resource" id="Resource_b7ax2"] +script = ExtResource("1_mxep8") +color = Color(1, 1, 1, 0.843137) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_ceyak"] +script = ExtResource("3_yyf6n") +value = 1.0 +unit = "100*pw - 3*em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("1_h0nak") +selectorStyles = [] +layout = 0 +width = SubResource("Resource_ceyak") +fontColor = SubResource("Resource_b7ax2") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Icon.tres b/Tools/Messages/Message Icon.tres new file mode 100644 index 0000000..e06f88b --- /dev/null +++ b/Tools/Messages/Message Icon.tres @@ -0,0 +1,46 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=6 format=3 uid="uid://c0hm8flp73453"] + +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_54agi"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="1_pa65f"] + +[sub_resource type="Resource" id="Resource_ck6db"] +script = ExtResource("1_pa65f") +value = 0.7 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_lp6ep"] +script = ExtResource("1_pa65f") +value = 0.3 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_075oq"] +script = ExtResource("1_pa65f") +value = 0.7 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("1_54agi") +selectorStyles = [] +layout = 0 +width = SubResource("Resource_075oq") +height = SubResource("Resource_ck6db") +marginRight = SubResource("Resource_lp6ep") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Link.tres b/Tools/Messages/Message Link.tres new file mode 100644 index 0000000..30d7460 --- /dev/null +++ b/Tools/Messages/Message Link.tres @@ -0,0 +1,55 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=10 format=3 uid="uid://edlgnn70amm"] + +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_4hxpd"] +[ext_resource type="Script" uid="uid://c5k6edrmdr3qc" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/UIColorTransition.cs" id="1_7jmns"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="1_gjlxr"] +[ext_resource type="Script" uid="uid://5w3jvlqxrvaf" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/TransitionSettings.cs" id="2_78ecd"] + +[sub_resource type="Curve" id="Curve_13l3q"] +_data = [Vector2(0, 0), 0.0, 3.0482, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Resource" id="Resource_u0n27"] +script = ExtResource("2_78ecd") +duration = 0.2 +curve = SubResource("Curve_13l3q") +metadata/_custom_type_script = "uid://5w3jvlqxrvaf" + +[sub_resource type="Resource" id="Resource_elisx"] +script = ExtResource("1_7jmns") +property = 0 +shaderPropertyName = "" +settings = SubResource("Resource_u0n27") +metadata/_custom_type_script = "uid://c5k6edrmdr3qc" + +[sub_resource type="Resource" id="Resource_qf1n2"] +script = ExtResource("1_gjlxr") +value = 0.8 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_7jmns"] +script = ExtResource("1_gjlxr") +value = 1.0 +unit = "100*pw - 3.5*em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("1_4hxpd") +selectorStyles = [] +layout = 0 +width = SubResource("Resource_7jmns") +fontSize = SubResource("Resource_qf1n2") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [SubResource("Resource_elisx")] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Node Link.tres b/Tools/Messages/Message Node Link.tres new file mode 100644 index 0000000..44ab7f6 --- /dev/null +++ b/Tools/Messages/Message Node Link.tres @@ -0,0 +1,73 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=12 format=3 uid="uid://d0elf2nq444o0"] + +[ext_resource type="Resource" uid="uid://edlgnn70amm" path="res://addons/rokojori_action_library/Tools/Messages/Message Link.tres" id="1_5kevg"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_17dfy"] +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_44whx"] +[ext_resource type="Script" uid="uid://bqypmtxqo5rnf" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorStyle.cs" id="4_6esib"] +[ext_resource type="Script" uid="uid://brmxttyvbwoit" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelector.cs" id="5_k10uw"] + +[sub_resource type="Resource" id="Resource_pckfw"] +script = ExtResource("1_44whx") +color = Color(0.2226, 0.710943, 0.914108, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_x56uc"] +script = ExtResource("5_k10uw") +hover = 1 +dragging = 0 +scrolling = 0 +focus = 0 +active = 0 +selectors = [] +metadata/_custom_type_script = "uid://brmxttyvbwoit" + +[sub_resource type="Gradient" id="Gradient_6esib"] +offsets = PackedFloat32Array(0, 0.472727, 0.930303, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.464972, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) + +[sub_resource type="Resource" id="Resource_7gw0p"] +script = ExtResource("1_44whx") +color = Color(1, 1, 1, 1) +isAnimated = true +animationGradient = SubResource("Gradient_6esib") +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_fcjob"] +script = ExtResource("1_17dfy") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_7gw0p") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_ghsdo"] +script = ExtResource("4_6esib") +selector = SubResource("Resource_x56uc") +style = SubResource("Resource_fcjob") +metadata/_custom_type_script = "uid://bqypmtxqo5rnf" + +[resource] +script = ExtResource("1_17dfy") +parentStyle = ExtResource("1_5kevg") +selectorStyles = [SubResource("Resource_ghsdo")] +layout = 0 +fontColor = SubResource("Resource_pckfw") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Resource Link.tres b/Tools/Messages/Message Resource Link.tres new file mode 100644 index 0000000..d663846 --- /dev/null +++ b/Tools/Messages/Message Resource Link.tres @@ -0,0 +1,73 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=12 format=3 uid="uid://3l4054xmleyf"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_8jptn"] +[ext_resource type="Resource" uid="uid://edlgnn70amm" path="res://addons/rokojori_action_library/Tools/Messages/Message Link.tres" id="2_m5bwv"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_sxu30"] +[ext_resource type="Script" uid="uid://bqypmtxqo5rnf" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorStyle.cs" id="4_1oi01"] +[ext_resource type="Script" uid="uid://brmxttyvbwoit" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelector.cs" id="5_daxbm"] + +[sub_resource type="Resource" id="Resource_8jptn"] +script = ExtResource("1_8jptn") +color = Color(0.289366, 0.771546, 0.496309, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_x56uc"] +script = ExtResource("5_daxbm") +hover = 1 +dragging = 0 +scrolling = 0 +focus = 0 +active = 0 +selectors = [] +metadata/_custom_type_script = "uid://brmxttyvbwoit" + +[sub_resource type="Gradient" id="Gradient_6esib"] +offsets = PackedFloat32Array(0, 0.472727, 0.930303, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.464972, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) + +[sub_resource type="Resource" id="Resource_7gw0p"] +script = ExtResource("1_8jptn") +color = Color(1, 1, 1, 1) +isAnimated = true +animationGradient = SubResource("Gradient_6esib") +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_fcjob"] +script = ExtResource("3_sxu30") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_7gw0p") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_ghsdo"] +script = ExtResource("4_1oi01") +selector = SubResource("Resource_x56uc") +style = SubResource("Resource_fcjob") +metadata/_custom_type_script = "uid://bqypmtxqo5rnf" + +[resource] +script = ExtResource("3_sxu30") +parentStyle = ExtResource("2_m5bwv") +selectorStyles = [SubResource("Resource_ghsdo")] +layout = 0 +fontColor = SubResource("Resource_8jptn") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Time Stamp.tres b/Tools/Messages/Message Time Stamp.tres new file mode 100644 index 0000000..951ae62 --- /dev/null +++ b/Tools/Messages/Message Time Stamp.tres @@ -0,0 +1,39 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=7 format=3 uid="uid://bilueedl68o8b"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_pt717"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="2_flljc"] +[ext_resource type="Resource" uid="uid://cgyecs7isf4ca" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title.tres" id="2_rrmye"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_flljc"] + +[sub_resource type="Resource" id="Resource_81uta"] +script = ExtResource("1_pt717") +color = Color(0.75201, 0.831706, 0.90732, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_jdhyg"] +script = ExtResource("2_flljc") +value = 0.32 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("3_flljc") +parentStyle = ExtResource("2_rrmye") +selectorStyles = [] +layout = 0 +marginLeft = SubResource("Resource_jdhyg") +fontColor = SubResource("Resource_81uta") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Type Title Error.tres b/Tools/Messages/Message Type Title Error.tres new file mode 100644 index 0000000..f84d180 --- /dev/null +++ b/Tools/Messages/Message Type Title Error.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=5 format=3 uid="uid://2n7cs4bvcd5j"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_gj2m3"] +[ext_resource type="Resource" uid="uid://cgyecs7isf4ca" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title.tres" id="2_gj2m3"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_mqb76"] + +[sub_resource type="Resource" id="Resource_ovcff"] +script = ExtResource("1_gj2m3") +color = Color(1, 0.467117, 0.467117, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[resource] +script = ExtResource("3_mqb76") +parentStyle = ExtResource("2_gj2m3") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_ovcff") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Type Title Info.tres b/Tools/Messages/Message Type Title Info.tres new file mode 100644 index 0000000..7208fbd --- /dev/null +++ b/Tools/Messages/Message Type Title Info.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=5 format=3 uid="uid://cq2jnafaynckr"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_81uta"] +[ext_resource type="Resource" uid="uid://cgyecs7isf4ca" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title.tres" id="2_lui7p"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_3cwat"] + +[sub_resource type="Resource" id="Resource_81uta"] +script = ExtResource("1_81uta") +color = Color(0.75201, 0.831706, 0.90732, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[resource] +script = ExtResource("3_3cwat") +parentStyle = ExtResource("2_lui7p") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_81uta") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Type Title Warning.tres b/Tools/Messages/Message Type Title Warning.tres new file mode 100644 index 0000000..cc19290 --- /dev/null +++ b/Tools/Messages/Message Type Title Warning.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=5 format=3 uid="uid://ddjfwysev2ff4"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_mxsjn"] +[ext_resource type="Resource" uid="uid://cgyecs7isf4ca" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title.tres" id="2_6p2kl"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_g7mng"] + +[sub_resource type="Resource" id="Resource_mxsjn"] +script = ExtResource("1_mxsjn") +color = Color(0.948052, 0.694699, 0.430382, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[resource] +script = ExtResource("3_g7mng") +parentStyle = ExtResource("2_6p2kl") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_mxsjn") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Type Title.tres b/Tools/Messages/Message Type Title.tres new file mode 100644 index 0000000..db7bc45 --- /dev/null +++ b/Tools/Messages/Message Type Title.tres @@ -0,0 +1,26 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=4 format=3 uid="uid://cgyecs7isf4ca"] + +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="2_l4n3o"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_7br78"] + +[sub_resource type="Resource" id="Resource_v6xot"] +script = ExtResource("2_l4n3o") +value = 0.5 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("3_7br78") +selectorStyles = [] +layout = 0 +fontSize = SubResource("Resource_v6xot") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message Web Link.tres b/Tools/Messages/Message Web Link.tres new file mode 100644 index 0000000..a127446 --- /dev/null +++ b/Tools/Messages/Message Web Link.tres @@ -0,0 +1,73 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=12 format=3 uid="uid://c4x06404fxbq2"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_6ind3"] +[ext_resource type="Resource" uid="uid://edlgnn70amm" path="res://addons/rokojori_action_library/Tools/Messages/Message Link.tres" id="2_1ghm3"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="3_xuv2l"] +[ext_resource type="Script" uid="uid://bqypmtxqo5rnf" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorStyle.cs" id="4_lw2q5"] +[ext_resource type="Script" uid="uid://brmxttyvbwoit" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelector.cs" id="5_r2qhu"] + +[sub_resource type="Resource" id="Resource_6ind3"] +script = ExtResource("1_6ind3") +color = Color(0.914108, 0.8403, 0.2226, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_x56uc"] +script = ExtResource("5_r2qhu") +hover = 1 +dragging = 0 +scrolling = 0 +focus = 0 +active = 0 +selectors = [] +metadata/_custom_type_script = "uid://brmxttyvbwoit" + +[sub_resource type="Gradient" id="Gradient_6esib"] +offsets = PackedFloat32Array(0, 0.472727, 0.930303, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.464972, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) + +[sub_resource type="Resource" id="Resource_7gw0p"] +script = ExtResource("1_6ind3") +color = Color(1, 1, 1, 1) +isAnimated = true +animationGradient = SubResource("Gradient_6esib") +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_fcjob"] +script = ExtResource("3_xuv2l") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_7gw0p") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_ghsdo"] +script = ExtResource("4_lw2q5") +selector = SubResource("Resource_x56uc") +style = SubResource("Resource_fcjob") +metadata/_custom_type_script = "uid://bqypmtxqo5rnf" + +[resource] +script = ExtResource("3_xuv2l") +parentStyle = ExtResource("2_1ghm3") +selectorStyles = [SubResource("Resource_ghsdo")] +layout = 0 +fontColor = SubResource("Resource_6ind3") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Message.cs b/Tools/Messages/Message.cs new file mode 100644 index 0000000..0310d28 --- /dev/null +++ b/Tools/Messages/Message.cs @@ -0,0 +1,29 @@ +#if TOOLS +using Godot; +using Rokojori; +using System.Collections.Generic; + +namespace Rokojori.Tools +{ + [Tool] + public partial class Message:Node + { + [Export] + public Node[] titleNodes; + + [Export] + public UIText content; + + [Export] + public UIText nodeLink; + + [Export] + public UIText resourceLink; + + [Export] + public UIText webLink; + } + +} + +#endif \ No newline at end of file diff --git a/Tools/Messages/Message.cs.uid b/Tools/Messages/Message.cs.uid new file mode 100644 index 0000000..e655507 --- /dev/null +++ b/Tools/Messages/Message.cs.uid @@ -0,0 +1 @@ +uid://bvaltw071whox diff --git a/Tools/Messages/Message.tscn b/Tools/Messages/Message.tscn new file mode 100644 index 0000000..1eaaa38 --- /dev/null +++ b/Tools/Messages/Message.tscn @@ -0,0 +1,1175 @@ +[gd_scene load_steps=165 format=3 uid="uid://d728w4qocmyb"] + +[ext_resource type="Script" uid="uid://c2hicupu28nbi" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIRegion.cs" id="1_g2m0s"] +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="2_3bqvc"] +[ext_resource type="Resource" uid="uid://bsihoklttoc6o" path="res://addons/rokojori_action_library/Tools/Messages/MessageStyle.tres" id="3_8nk55"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="4_psfq2"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="5_1tota"] +[ext_resource type="Resource" uid="uid://dp57o0ykhkqfj" path="res://addons/rokojori_action_library/Runtime/UI/UI-Settings-Default.tres" id="6_3bqvc"] +[ext_resource type="Script" uid="uid://dlu21piejg7w0" path="res://addons/rokojori_action_library/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangleMaterial.cs" id="6_wmt7q"] +[ext_resource type="Shader" uid="uid://x1a008jxt3ej" path="res://addons/rokojori_action_library/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader" id="7_aeebn"] +[ext_resource type="Script" uid="uid://bvaltw071whox" path="res://addons/rokojori_action_library/Tools/Messages/Message.cs" id="7_wmt7q"] +[ext_resource type="Script" uid="uid://bx0bk663u3hj5" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImage.cs" id="8_gyhi8"] +[ext_resource type="Resource" uid="uid://bliw5flmiq30c" path="res://addons/rokojori_action_library/Tools/Messages/Message Background.tres" id="9_wmt7q"] +[ext_resource type="Script" uid="uid://y2p0r8c5rs45" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/ColorPropertyName.cs" id="10_btdid"] +[ext_resource type="Script" uid="uid://f7s137m6egkj" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUIColor.cs" id="11_x3h2c"] +[ext_resource type="Script" uid="uid://jqgdm3r2u8xq" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/FloatPropertyName.cs" id="12_xevu7"] +[ext_resource type="Script" uid="uid://j3mk8vwv56ui" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUINumber.cs" id="13_1jemv"] +[ext_resource type="Script" uid="uid://ce5eo6r5jqilt" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImageTypes/UIImageType.cs" id="14_1hp7s"] +[ext_resource type="SystemFont" uid="uid://s1pi67tbxu24" path="res://3rdPerson/Inputs/Jost-Font.tres" id="15_nro64"] +[ext_resource type="Script" uid="uid://rqs2m0u6yvvf" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIText.cs" id="16_0e03u"] +[ext_resource type="Resource" uid="uid://c0hm8flp73453" path="res://addons/rokojori_action_library/Tools/Messages/Message Icon.tres" id="16_1tota"] +[ext_resource type="Script" uid="uid://bvj322mokkq63" path="res://addons/rokojori_action_library/Runtime/Localization/LocaleText.cs" id="17_illef"] +[ext_resource type="Resource" uid="uid://2n7cs4bvcd5j" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title Error.tres" id="18_qjby8"] +[ext_resource type="Script" uid="uid://cd0ikdsdhutn0" path="res://addons/rokojori_action_library/Runtime/Actions/RJLogMessage.cs" id="19_ul0js"] +[ext_resource type="Resource" uid="uid://gearoalaecoi" path="res://addons/rokojori_action_library/Tools/Messages/Message Content.tres" id="20_hj653"] +[ext_resource type="Resource" uid="uid://d0elf2nq444o0" path="res://addons/rokojori_action_library/Tools/Messages/Message Node Link.tres" id="21_v6jx4"] +[ext_resource type="Resource" uid="uid://ddjfwysev2ff4" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title Warning.tres" id="21_wmt7q"] +[ext_resource type="Resource" uid="uid://cq2jnafaynckr" path="res://addons/rokojori_action_library/Tools/Messages/Message Type Title Info.tres" id="22_aeebn"] +[ext_resource type="Resource" uid="uid://bilueedl68o8b" path="res://addons/rokojori_action_library/Tools/Messages/Message Time Stamp.tres" id="24_jm3cb"] +[ext_resource type="Resource" uid="uid://3l4054xmleyf" path="res://addons/rokojori_action_library/Tools/Messages/Message Resource Link.tres" id="27_gyhi8"] +[ext_resource type="Resource" uid="uid://c4x06404fxbq2" path="res://addons/rokojori_action_library/Tools/Messages/Message Web Link.tres" id="28_jm3cb"] +[ext_resource type="Script" uid="uid://dwuimn03cvh3" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs" id="30_btdid"] + +[sub_resource type="Resource" id="Resource_8aipl"] +script = ExtResource("2_3bqvc") +color = Color(0.893742, 0.523281, 0.523281, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_xyx4e"] +script = ExtResource("4_psfq2") +parentStyle = ExtResource("3_8nk55") +selectorStyles = [] +layout = 0 +fontColor = SubResource("Resource_8aipl") +position = 0 +lineWrap = 0 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_j6msh"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_kfok7"] +script = ExtResource("5_1tota") +value = 1.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_8waa8"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_btdid"] +shader = ExtResource("7_aeebn") +shader_parameter/size = Vector2(1156.56, 137.56) +shader_parameter/sharpness = 5.0 +shader_parameter/borderRadius = 6.048 +shader_parameter/strokeSize = 0.0 +shader_parameter/offset = 5.25312 +shader_parameter/fillColor = Color(0.109394, 0.185443, 0.377804, 0.278431) +shader_parameter/fillUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVMovement = Vector2(0, 0) +shader_parameter/strokeColor = Color(1, 0, 0, 0) +shader_parameter/strokeUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVMovment = Vector2(0, 0) +shader_parameter/opacity = 1.0 +script = ExtResource("6_wmt7q") + +[sub_resource type="Gradient" id="Gradient_2tvfn"] +offsets = PackedFloat32Array(0, 0.5, 1) +colors = PackedColorArray(0.149416, 0.170169, 0.187722, 1, 0.591214, 0.651513, 0.702511, 1, 0.941263, 0.900122, 0.70586, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_dmcan"] +gradient = SubResource("Gradient_2tvfn") +fill_from = Vector2(0.521368, 1) +fill_to = Vector2(0.0811966, 0.0811966) + +[sub_resource type="Resource" id="Resource_pyi7r"] +script = ExtResource("5_1tota") +value = 1.0 +unit = "100 * pw - 2*1.5em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_7ph4h"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_ewfp6"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_4qn2p"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_tqqfk"] +script = ExtResource("2_3bqvc") +color = Color(0.117, 0.19435, 0.39, 0.239216) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_31bho"] +script = ExtResource("10_btdid") +propertyName = "fillColor" + +[sub_resource type="Resource" id="Resource_sniaq"] +script = ExtResource("11_x3h2c") +colorPropertyName = SubResource("Resource_31bho") +color = SubResource("Resource_tqqfk") + +[sub_resource type="Resource" id="Resource_aywh2"] +script = ExtResource("2_3bqvc") +color = Color(1, 0, 0, 0) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_5dbwq"] +script = ExtResource("10_btdid") +propertyName = "strokeColor" + +[sub_resource type="Resource" id="Resource_bjlp7"] +script = ExtResource("11_x3h2c") +colorPropertyName = SubResource("Resource_5dbwq") +color = SubResource("Resource_aywh2") + +[sub_resource type="Resource" id="Resource_aaxts"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_yp323"] +script = ExtResource("5_1tota") +value = 0.35 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_hnno2"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_aaxts") +number = SubResource("Resource_yp323") + +[sub_resource type="Resource" id="Resource_mnb7u"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_deji5"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_s2nfa"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_mnb7u") +number = SubResource("Resource_deji5") + +[sub_resource type="Resource" id="Resource_pq5hs"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_bbety"] +script = ExtResource("5_1tota") +value = 0.304 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_4q8wd"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_pq5hs") +number = SubResource("Resource_bbety") + +[sub_resource type="Gradient" id="Gradient_8nk55"] +offsets = PackedFloat32Array(0.107527, 0.784946, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.968418, 0.305551, 0.235825, 1, 0.95484, 0, 0.146975, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_yp323"] +gradient = SubResource("Gradient_8nk55") +fill = 1 +fill_from = Vector2(0.5, 0.5) +fill_to = Vector2(0.5, 0) + +[sub_resource type="Resource" id="Resource_t61p3"] +script = ExtResource("14_1hp7s") +metadata/_custom_type_script = "uid://ce5eo6r5jqilt" + +[sub_resource type="Resource" id="Resource_va46q"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_memo1"] +script = ExtResource("5_1tota") +value = 0.4885 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_macjr"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_va46q") +number = SubResource("Resource_memo1") + +[sub_resource type="Resource" id="Resource_d0wk4"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_noiai"] +script = ExtResource("5_1tota") +value = 0.2005 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_ew3dw"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_d0wk4") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_qt6vy"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_48nmj"] +script = ExtResource("5_1tota") +value = 0.083 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_qhwe7"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_qt6vy") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_j5pjb"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_fcuvy"] +script = ExtResource("5_1tota") +value = 0.2035 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_j472m"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_j5pjb") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_ik5ry"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_6cai2"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_ik5ry") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_3dgqq"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_yb361"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_3dgqq") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_jojhw"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_ksie1"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_jojhw") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_wu65d"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_6qeiq"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_wu65d") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_7usvr"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_twj2p"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_7usvr") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_osyhn"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_7sy8b"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_osyhn") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_acwk6"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_2ac6n"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_acwk6") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_gkdfx"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_l4k31"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_gkdfx") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_nclop"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_g5k3r"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_nclop") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_bym6j"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_vmo32"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_bym6j") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_r3bdf"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_wbdh3"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_r3bdf") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_xs6j7"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_r3dq4"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_xs6j7") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_bc7t6"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_0oj4b"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_bc7t6") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_5reeo"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_m63u0"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_5reeo") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_ockpq"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_wvcvs"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_ockpq") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_x3kou"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_bynrr"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_x3kou") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_gilgh"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_yw6cj"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_gilgh") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_7ixc3"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_n0edm"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_7ixc3") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_dm74w"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_eugs8"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_dm74w") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_ca8cm"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_e1gs7"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_ca8cm") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_kkgrc"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_vyn0n"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_kkgrc") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_hrcv7"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_gt0xu"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_hrcv7") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_fq1vm"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_kwlix"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_fq1vm") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_ldjkg"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_eifi1"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_ldjkg") +number = SubResource("Resource_fcuvy") + +[sub_resource type="Resource" id="Resource_trn7k"] +script = ExtResource("12_xevu7") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_c6to6"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_trn7k") +number = SubResource("Resource_noiai") + +[sub_resource type="Resource" id="Resource_0xsof"] +script = ExtResource("12_xevu7") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_8v33o"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_0xsof") +number = SubResource("Resource_48nmj") + +[sub_resource type="Resource" id="Resource_2o7sc"] +script = ExtResource("12_xevu7") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_bq8c4"] +script = ExtResource("13_1jemv") +floatPropertyName = SubResource("Resource_2o7sc") +number = SubResource("Resource_fcuvy") + +[sub_resource type="LabelSettings" id="LabelSettings_x3h2c"] +font_size = 9 +font_color = Color(1, 0.467117, 0.467117, 1) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="Resource" id="Resource_uulg6"] +script = ExtResource("17_illef") +en = "ERROR" +entries = [] +context = "" +metadata/_custom_type_script = "uid://bvj322mokkq63" + +[sub_resource type="Gradient" id="Gradient_psfq2"] +offsets = PackedFloat32Array(0.107527, 0.727599, 0.967742, 1) +colors = PackedColorArray(1, 0.99772, 0.980085, 1, 1, 0.698429, 0.0593736, 1, 0.95484, 0.532052, 0.168634, 0.447368, 0.95484, 0.33978, 0, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_1tota"] +gradient = SubResource("Gradient_psfq2") +fill = 1 +fill_from = Vector2(0.5, 0.5) +fill_to = Vector2(0.5, 0) + +[sub_resource type="LabelSettings" id="LabelSettings_xevu7"] + +[sub_resource type="Resource" id="Resource_gyhi8"] +script = ExtResource("17_illef") +en = "WARNING" +entries = [] +context = "" +metadata/_custom_type_script = "uid://bvj322mokkq63" + +[sub_resource type="Gradient" id="Gradient_wmt7q"] +offsets = PackedFloat32Array(0.107527, 0.784946, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.651149, 0.723293, 0.791912, 1, 0, 0.317571, 0.95484, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_aeebn"] +gradient = SubResource("Gradient_wmt7q") +fill = 1 +fill_from = Vector2(0.5, 0.5) +fill_to = Vector2(0.5, 0) + +[sub_resource type="LabelSettings" id="LabelSettings_qjby8"] + +[sub_resource type="Resource" id="Resource_jm3cb"] +script = ExtResource("17_illef") +en = "INFO" +entries = [] +context = "" +metadata/_custom_type_script = "uid://bvj322mokkq63" + +[sub_resource type="LabelSettings" id="LabelSettings_1jemv"] +font_size = 9 +font_color = Color(0.75201, 0.831706, 0.90732, 1) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="LabelSettings" id="LabelSettings_1hp7s"] +font_size = 17 +font_color = Color(1, 1, 1, 0.843137) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="Resource" id="Resource_jn787"] +script = ExtResource("17_illef") +en = "Ein etwas anderer Text! Hello das ist eine Nachricht! Huhe!" +entries = [] +context = "" +metadata/_custom_type_script = "uid://bvj322mokkq63" + +[sub_resource type="LabelSettings" id="LabelSettings_nro64"] +font_size = 14 +font_color = Color(0.2226, 0.710943, 0.914108, 1) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="Resource" id="Resource_7rt2a"] +script = ExtResource("17_illef") +en = "Node3D > Static Environment > SomeThing > MyNodes > SomeNode" +entries = [] +context = "" +metadata/_custom_type_script = "uid://bvj322mokkq63" + +[sub_resource type="LabelSettings" id="LabelSettings_0e03u"] +font_size = 14 +font_color = Color(0.289366, 0.771546, 0.496309, 1) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="LabelSettings" id="LabelSettings_illef"] +font_size = 14 +font_color = Color(0.914108, 0.8403, 0.2226, 1) +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="Resource" id="Resource_qjby8"] +script = ExtResource("5_1tota") +value = 2.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_ul0js"] +script = ExtResource("5_1tota") +value = 2.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_hj653"] +script = ExtResource("5_1tota") +value = 0.4425 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_v6jx4"] +script = ExtResource("5_1tota") +value = 2.227 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_qjby8"] +shader = ExtResource("7_aeebn") +shader_parameter/size = Vector2(34.5601, 34.56) +shader_parameter/sharpness = 5.0 +shader_parameter/borderRadius = 3.46464 +shader_parameter/strokeSize = 8.44128 +shader_parameter/offset = 3.51648 +shader_parameter/fillColor = Color(1, 1, 1, 1) +shader_parameter/fillUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVMovement = Vector2(0, 0) +shader_parameter/strokeColor = Color(1, 1, 1, 1) +shader_parameter/strokeUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVMovment = Vector2(0, 0) +shader_parameter/opacity = 1.0 +script = ExtResource("6_wmt7q") + +[sub_resource type="Gradient" id="Gradient_0y4e2"] +offsets = PackedFloat32Array(0.753247, 0.841991, 0.928571) +colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_xra5h"] +gradient = SubResource("Gradient_0y4e2") +fill = 1 +fill_from = Vector2(0.5, 0.5) +fill_to = Vector2(0.5, 0) + +[sub_resource type="Resource" id="Resource_0y4e2"] +script = ExtResource("5_1tota") +value = 0.0095 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_xra5h"] +script = ExtResource("5_1tota") +value = 0.6585 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_27g0e"] +script = ExtResource("30_btdid") +strokeSize = SubResource("Resource_xra5h") +offset = SubResource("Resource_0y4e2") +metadata/_custom_type_script = "uid://dwuimn03cvh3" + +[sub_resource type="Resource" id="Resource_rv4f4"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_q6r63"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_d4jqe"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_7ortd"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="LabelSettings" id="LabelSettings_ul0js"] +font_size = 26 +outline_color = Color(1, 1, 1, 0) +shadow_size = 0 +shadow_color = Color(0, 0, 0, 1) +shadow_offset = Vector2(0, 0) + +[sub_resource type="Resource" id="Resource_btdid"] +script = ExtResource("5_1tota") +value = 1.5 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_y0a04"] +script = ExtResource("2_3bqvc") +color = Color(1, 1, 1, 1) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_cad7s"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_xxu7r"] +script = ExtResource("5_1tota") +value = 100.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_dbo5u"] +script = ExtResource("5_1tota") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_d6p1o"] +script = ExtResource("5_1tota") +value = -0.3055 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[node name="Message" type="Control"] +layout_mode = 3 +anchors_preset = 0 +offset_right = 1186.56 +offset_bottom = 137.56 +pivot_offset = Vector2(570.32, 47.78) +mouse_filter = 1 +script = ExtResource("1_g2m0s") +parentStyle = SubResource("Resource_xyx4e") +width = SubResource("Resource_j6msh") +margin = SubResource("Resource_kfok7") +marginRight = SubResource("Resource_8waa8") +lineWrap = 2 +uiSettings = ExtResource("6_3bqvc") +updateInEditor = true +computedFontSize = 17.28 +metadata/_custom_type_script = "uid://c2hicupu28nbi" + +[node name="Message" type="Node" parent="." node_paths=PackedStringArray("titleNodes", "content", "nodeLink")] +script = ExtResource("7_wmt7q") +titleNodes = [NodePath("../Error Icon"), NodePath("../Error Title"), NodePath("../Warning Icon"), NodePath("../Warning Title"), NodePath("../Info Icon"), NodePath("../Info Title")] +content = NodePath("../Content") +nodeLink = NodePath("../Node Link") + +[node name="Background" type="TextureRect" parent="."] +material = SubResource("ShaderMaterial_btdid") +layout_mode = 0 +offset_right = 1156.56 +offset_bottom = 137.56 +pivot_offset = Vector2(593.28, 68.78) +texture = SubResource("GradientTexture2D_dmcan") +expand_mode = 1 +script = ExtResource("8_gyhi8") +imageType = ExtResource("9_wmt7q") +width = SubResource("Resource_pyi7r") +height = SubResource("Resource_7ph4h") +position = 2 +left = SubResource("Resource_ewfp6") +top = SubResource("Resource_4qn2p") +colorProperties = [SubResource("Resource_sniaq"), SubResource("Resource_bjlp7")] +numberProperties = [SubResource("Resource_hnno2"), SubResource("Resource_s2nfa"), SubResource("Resource_4q8wd")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="Error Icon" type="TextureRect" parent="."] +layout_mode = 0 +offset_left = 17.28 +offset_top = 18.232 +offset_right = 29.376 +offset_bottom = 30.328 +pivot_offset = Vector2(6.048, 6.048) +texture = SubResource("GradientTexture2D_yp323") +expand_mode = 1 +script = ExtResource("8_gyhi8") +imageType = SubResource("Resource_t61p3") +parentStyle = ExtResource("16_1tota") +numberProperties = [SubResource("Resource_macjr"), SubResource("Resource_ew3dw"), SubResource("Resource_qhwe7"), SubResource("Resource_j472m"), SubResource("Resource_6cai2"), SubResource("Resource_yb361"), SubResource("Resource_ksie1"), SubResource("Resource_6qeiq"), SubResource("Resource_twj2p"), SubResource("Resource_7sy8b"), SubResource("Resource_2ac6n"), SubResource("Resource_l4k31"), SubResource("Resource_g5k3r"), SubResource("Resource_vmo32"), SubResource("Resource_wbdh3"), SubResource("Resource_r3dq4"), SubResource("Resource_0oj4b"), SubResource("Resource_m63u0"), SubResource("Resource_wvcvs"), SubResource("Resource_bynrr"), SubResource("Resource_yw6cj"), SubResource("Resource_n0edm"), SubResource("Resource_eugs8"), SubResource("Resource_e1gs7"), SubResource("Resource_vyn0n"), SubResource("Resource_gt0xu"), SubResource("Resource_kwlix"), SubResource("Resource_eifi1"), SubResource("Resource_c6to6"), SubResource("Resource_8v33o"), SubResource("Resource_bq8c4")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="Error Title" type="Label" parent="."] +custom_minimum_size = Vector2(29, 0) +layout_mode = 0 +offset_left = 34.56 +offset_top = 17.28 +offset_right = 63.56 +offset_bottom = 31.28 +pivot_offset = Vector2(14.5, 7) +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +text = "ERROR" +label_settings = SubResource("LabelSettings_x3h2c") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_uulg6") +parentStyle = ExtResource("18_qjby8") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Warning Icon" type="TextureRect" parent="."] +visible = false +layout_mode = 0 +offset_left = 17.28 +offset_top = 17.28 +offset_right = 29.376 +offset_bottom = 29.376 +pivot_offset = Vector2(6.048, 6.048) +texture = SubResource("GradientTexture2D_1tota") +expand_mode = 1 +script = ExtResource("8_gyhi8") +imageType = SubResource("Resource_t61p3") +parentStyle = ExtResource("16_1tota") +numberProperties = [SubResource("Resource_macjr"), SubResource("Resource_ew3dw"), SubResource("Resource_qhwe7"), SubResource("Resource_j472m"), SubResource("Resource_6cai2"), SubResource("Resource_yb361"), SubResource("Resource_ksie1"), SubResource("Resource_6qeiq"), SubResource("Resource_twj2p"), SubResource("Resource_7sy8b"), SubResource("Resource_2ac6n"), SubResource("Resource_l4k31"), SubResource("Resource_g5k3r"), SubResource("Resource_vmo32"), SubResource("Resource_wbdh3"), SubResource("Resource_r3dq4"), SubResource("Resource_0oj4b"), SubResource("Resource_m63u0"), SubResource("Resource_wvcvs"), SubResource("Resource_bynrr"), SubResource("Resource_yw6cj"), SubResource("Resource_n0edm"), SubResource("Resource_eugs8"), SubResource("Resource_e1gs7"), SubResource("Resource_vyn0n"), SubResource("Resource_gt0xu"), SubResource("Resource_kwlix"), SubResource("Resource_eifi1"), SubResource("Resource_c6to6"), SubResource("Resource_8v33o"), SubResource("Resource_bq8c4")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="Warning Title" type="Label" parent="."] +visible = false +custom_minimum_size = Vector2(44, 0) +layout_mode = 0 +offset_left = 34.56 +offset_top = 17.28 +offset_right = 78.56 +offset_bottom = 31.28 +pivot_offset = Vector2(22, 7) +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +text = "WARNING" +label_settings = SubResource("LabelSettings_xevu7") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_gyhi8") +parentStyle = ExtResource("21_wmt7q") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Info Icon" type="TextureRect" parent="."] +visible = false +layout_mode = 0 +offset_left = 17.28 +offset_top = 17.28 +offset_right = 29.376 +offset_bottom = 29.376 +pivot_offset = Vector2(6.048, 6.048) +texture = SubResource("GradientTexture2D_aeebn") +expand_mode = 1 +script = ExtResource("8_gyhi8") +imageType = SubResource("Resource_t61p3") +parentStyle = ExtResource("16_1tota") +numberProperties = [SubResource("Resource_macjr"), SubResource("Resource_ew3dw"), SubResource("Resource_qhwe7"), SubResource("Resource_j472m"), SubResource("Resource_6cai2"), SubResource("Resource_yb361"), SubResource("Resource_ksie1"), SubResource("Resource_6qeiq"), SubResource("Resource_twj2p"), SubResource("Resource_7sy8b"), SubResource("Resource_2ac6n"), SubResource("Resource_l4k31"), SubResource("Resource_g5k3r"), SubResource("Resource_vmo32"), SubResource("Resource_wbdh3"), SubResource("Resource_r3dq4"), SubResource("Resource_0oj4b"), SubResource("Resource_m63u0"), SubResource("Resource_wvcvs"), SubResource("Resource_bynrr"), SubResource("Resource_yw6cj"), SubResource("Resource_n0edm"), SubResource("Resource_eugs8"), SubResource("Resource_e1gs7"), SubResource("Resource_vyn0n"), SubResource("Resource_gt0xu"), SubResource("Resource_kwlix"), SubResource("Resource_eifi1"), SubResource("Resource_c6to6"), SubResource("Resource_8v33o"), SubResource("Resource_bq8c4")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="Info Title" type="Label" parent="."] +visible = false +custom_minimum_size = Vector2(22, 0) +layout_mode = 0 +offset_left = 34.56 +offset_top = 17.28 +offset_right = 56.56 +offset_bottom = 31.28 +pivot_offset = Vector2(11, 7) +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +text = "INFO" +label_settings = SubResource("LabelSettings_qjby8") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_jm3cb") +parentStyle = ExtResource("22_aeebn") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Time Stamp" type="Label" parent="."] +custom_minimum_size = Vector2(1, 0) +layout_mode = 0 +offset_left = 69.0896 +offset_top = 17.28 +offset_right = 70.0896 +offset_bottom = 31.28 +pivot_offset = Vector2(0.5, 7) +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +label_settings = SubResource("LabelSettings_1jemv") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +disableLocalization = true +parentStyle = ExtResource("24_jm3cb") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Content" type="Label" parent="."] +custom_minimum_size = Vector2(441, 0) +layout_mode = 0 +offset_left = 17.28 +offset_top = 31.28 +offset_right = 458.28 +offset_bottom = 57.28 +pivot_offset = Vector2(220.5, 13) +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +text = "Ein etwas anderer Text! Hello das ist eine Nachricht! Huhe!" +label_settings = SubResource("LabelSettings_1hp7s") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_jn787") +parentStyle = ExtResource("20_hj653") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Node Link" type="Label" parent="."] +custom_minimum_size = Vector2(432, 0) +layout_mode = 0 +offset_left = 17.28 +offset_top = 57.28 +offset_right = 449.28 +offset_bottom = 78.28 +pivot_offset = Vector2(216, 10.5) +mouse_filter = 1 +mouse_default_cursor_shape = 2 +theme_override_fonts/font = ExtResource("15_nro64") +text = "Node3D > Static Environment > SomeThing > MyNodes > SomeNode" +label_settings = SubResource("LabelSettings_nro64") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_7rt2a") +parentStyle = ExtResource("21_v6jx4") +handleMouseEvents = true +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Open Node in Inspector" type="Node" parent="Node Link"] +script = ExtResource("19_ul0js") +message = "Hi" +printPath = true +metadata/_custom_type_script = "uid://cd0ikdsdhutn0" + +[node name="Resource Link" type="Label" parent="."] +custom_minimum_size = Vector2(432, 0) +layout_mode = 0 +offset_left = 17.28 +offset_top = 78.28 +offset_right = 449.28 +offset_bottom = 99.28 +pivot_offset = Vector2(216, 10.5) +mouse_filter = 1 +mouse_default_cursor_shape = 2 +theme_override_fonts/font = ExtResource("15_nro64") +text = "Node3D > Static Environment > SomeThing > MyNodes > SomeNode" +label_settings = SubResource("LabelSettings_0e03u") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_7rt2a") +parentStyle = ExtResource("27_gyhi8") +handleMouseEvents = true +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Open Resource in Inspector" type="Node" parent="Resource Link"] +script = ExtResource("19_ul0js") +message = "Hi" +printPath = true +metadata/_custom_type_script = "uid://cd0ikdsdhutn0" + +[node name="Web Link" type="Label" parent="."] +custom_minimum_size = Vector2(432, 0) +layout_mode = 0 +offset_left = 17.28 +offset_top = 99.28 +offset_right = 449.28 +offset_bottom = 120.28 +pivot_offset = Vector2(216, 10.5) +mouse_filter = 1 +mouse_default_cursor_shape = 2 +theme_override_fonts/font = ExtResource("15_nro64") +text = "Node3D > Static Environment > SomeThing > MyNodes > SomeNode" +label_settings = SubResource("LabelSettings_illef") +autowrap_mode = 2 +script = ExtResource("16_0e03u") +locale = SubResource("Resource_7rt2a") +parentStyle = ExtResource("28_jm3cb") +handleMouseEvents = true +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" + +[node name="Open In Browser" type="Node" parent="Web Link"] +script = ExtResource("19_ul0js") +message = "Hi" +printPath = true +metadata/_custom_type_script = "uid://cd0ikdsdhutn0" + +[node name="Close Button" type="Control" parent="."] +visible = false +anchors_preset = 0 +offset_left = 1113.52 +offset_top = 7.6464 +offset_right = 1148.08 +offset_bottom = 42.2064 +pivot_offset = Vector2(17.28, 17.28) +script = ExtResource("1_g2m0s") +width = SubResource("Resource_qjby8") +height = SubResource("Resource_ul0js") +position = 2 +top = SubResource("Resource_hj653") +right = SubResource("Resource_v6jx4") +metadata/_custom_type_script = "uid://c2hicupu28nbi" + +[node name="Info Icon2" type="TextureRect" parent="Close Button"] +material = SubResource("ShaderMaterial_qjby8") +layout_mode = 0 +offset_right = 34.5601 +offset_bottom = 34.56 +pivot_offset = Vector2(17.28, 17.28) +texture = SubResource("GradientTexture2D_xra5h") +expand_mode = 1 +script = ExtResource("8_gyhi8") +imageType = SubResource("Resource_27g0e") +parentStyle = ExtResource("16_1tota") +width = SubResource("Resource_rv4f4") +height = SubResource("Resource_q6r63") +position = 2 +left = SubResource("Resource_d4jqe") +top = SubResource("Resource_7ortd") +numberProperties = [SubResource("Resource_macjr"), SubResource("Resource_ew3dw"), SubResource("Resource_qhwe7"), SubResource("Resource_j472m"), SubResource("Resource_6cai2"), SubResource("Resource_yb361"), SubResource("Resource_ksie1"), SubResource("Resource_6qeiq"), SubResource("Resource_twj2p"), SubResource("Resource_7sy8b"), SubResource("Resource_2ac6n"), SubResource("Resource_l4k31"), SubResource("Resource_g5k3r"), SubResource("Resource_vmo32"), SubResource("Resource_wbdh3"), SubResource("Resource_r3dq4"), SubResource("Resource_0oj4b"), SubResource("Resource_m63u0"), SubResource("Resource_wvcvs"), SubResource("Resource_bynrr"), SubResource("Resource_yw6cj"), SubResource("Resource_n0edm"), SubResource("Resource_eugs8"), SubResource("Resource_e1gs7"), SubResource("Resource_vyn0n"), SubResource("Resource_gt0xu"), SubResource("Resource_kwlix"), SubResource("Resource_eifi1"), SubResource("Resource_c6to6"), SubResource("Resource_8v33o"), SubResource("Resource_bq8c4")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="x" type="Label" parent="Close Button"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 0 +offset_top = -5.27904 +offset_right = 34.5601 +offset_bottom = 32.721 +mouse_filter = 1 +theme_override_fonts/font = ExtResource("15_nro64") +text = "x" +label_settings = SubResource("LabelSettings_ul0js") +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 2 +script = ExtResource("16_0e03u") +disableLocalization = true +alwaysMinimumSize = false +fontSize = SubResource("Resource_btdid") +fontColor = SubResource("Resource_y0a04") +width = SubResource("Resource_cad7s") +height = SubResource("Resource_xxu7r") +position = 2 +left = SubResource("Resource_dbo5u") +top = SubResource("Resource_d6p1o") +metadata/_custom_type_script = "uid://rqs2m0u6yvvf" diff --git a/Tools/Messages/MessageStyle.tres b/Tools/Messages/MessageStyle.tres new file mode 100644 index 0000000..98ecab8 --- /dev/null +++ b/Tools/Messages/MessageStyle.tres @@ -0,0 +1,36 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=5 format=3 uid="uid://bsihoklttoc6o"] + +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="1_nyeia"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_wwvd0"] + +[sub_resource type="Resource" id="Resource_tkiun"] +script = ExtResource("1_nyeia") +value = 0.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_t8yr5"] +script = ExtResource("1_nyeia") +value = 99.274 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("1_wwvd0") +selectorStyles = [] +layout = 1 +horizontalAlignment = SubResource("Resource_tkiun") +width = SubResource("Resource_t8yr5") +position = 0 +lineWrap = 2 +colorProperties = [] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" diff --git a/Tools/Messages/Messages.tscn b/Tools/Messages/Messages.tscn new file mode 100644 index 0000000..93743e2 --- /dev/null +++ b/Tools/Messages/Messages.tscn @@ -0,0 +1,450 @@ +[gd_scene load_steps=58 format=3 uid="uid://bcyaxa6206l4d"] + +[ext_resource type="Script" uid="uid://bu6np1t32bddg" path="res://addons/rokojori_action_library/Runtime/UI/UI.cs" id="1_op0b4"] +[ext_resource type="Resource" uid="uid://dp57o0ykhkqfj" path="res://addons/rokojori_action_library/Runtime/UI/UI-Settings-Default.tres" id="2_iufyf"] +[ext_resource type="Resource" uid="uid://b4iykcwesp1y6" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/UITime.tres" id="2_kfok7"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="4_05c0h"] +[ext_resource type="Script" uid="uid://c2hicupu28nbi" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIRegion.cs" id="5_05c0h"] +[ext_resource type="PackedScene" uid="uid://d728w4qocmyb" path="res://addons/rokojori_action_library/Tools/Messages/Message.tscn" id="5_u3an3"] +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="6_j2i2l"] +[ext_resource type="Script" uid="uid://dlu21piejg7w0" path="res://addons/rokojori_action_library/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangleMaterial.cs" id="9_a81dy"] +[ext_resource type="Shader" uid="uid://x1a008jxt3ej" path="res://addons/rokojori_action_library/Runtime/UI/Shaders/RoundedRectangle/RoundedRectangle.gdshader" id="10_fbdhv"] +[ext_resource type="Script" uid="uid://dwuimn03cvh3" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImageTypes/RoundedRectangleUIImageType.cs" id="12_8waa8"] +[ext_resource type="Script" uid="uid://bx0bk663u3hj5" path="res://addons/rokojori_action_library/Runtime/UI/Nodes/UIImage.cs" id="12_kfok7"] +[ext_resource type="Script" uid="uid://y2p0r8c5rs45" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/ColorPropertyName.cs" id="14_pugir"] +[ext_resource type="Script" uid="uid://f7s137m6egkj" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUIColor.cs" id="15_ojjyv"] +[ext_resource type="Script" uid="uid://jqgdm3r2u8xq" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/FloatPropertyName.cs" id="16_bjurn"] +[ext_resource type="Script" uid="uid://j3mk8vwv56ui" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUINumber.cs" id="17_pyi7r"] +[ext_resource type="Script" uid="uid://3bymmno3avag" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/TransitionSettingsAll.cs" id="22_fbdhv"] +[ext_resource type="Resource" uid="uid://vbvri2ltruat" path="res://addons/rokojori_action_library/Tools/Messages/Vertical-Slider.tres" id="24_8aipl"] +[ext_resource type="Script" uid="uid://btwjt483gljv7" path="res://addons/rokojori_action_library/Runtime/UI/Components/UISlider.cs" id="25_8waa8"] +[ext_resource type="Script" uid="uid://lhuuedx87rem" path="res://addons/rokojori_action_library/Runtime/Animation/Smoothing/FrameSmoothing.cs" id="26_pugir"] + +[sub_resource type="Resource" id="Resource_bjurn"] +script = ExtResource("4_05c0h") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_kw2vf"] +script = ExtResource("4_05c0h") +value = 100.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_3d233"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_d5ifl"] +script = ExtResource("4_05c0h") +value = 1.0 +unit = "100.0*pw - 1.5*em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_8hjge"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 + +[sub_resource type="Resource" id="Resource_5piug"] +script = ExtResource("4_05c0h") +value = 1.5 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_fad61"] +script = ExtResource("4_05c0h") +value = 1.0 +unit = "100*ph - 1*em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_yf77t"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_u3an3"] +shader = ExtResource("10_fbdhv") +shader_parameter/size = Vector2(25.92, 566.72) +shader_parameter/sharpness = 5.0 +shader_parameter/borderRadius = 10.1434 +shader_parameter/strokeSize = 0.0 +shader_parameter/offset = 8.7264 +shader_parameter/fillColor = Color(0.405788, 0.519986, 0.717237, 0.164706) +shader_parameter/fillUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVMovement = Vector2(0, 0) +shader_parameter/strokeColor = Color(1, 1, 1, 1) +shader_parameter/strokeUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVMovment = Vector2(0, 0) +shader_parameter/opacity = 1.0 +script = ExtResource("9_a81dy") + +[sub_resource type="Gradient" id="Gradient_pugir"] + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_ojjyv"] +gradient = SubResource("Gradient_pugir") + +[sub_resource type="Resource" id="Resource_njmq0"] +script = ExtResource("4_05c0h") +value = 0.587 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_nti5i"] +script = ExtResource("6_j2i2l") +color = Color(0.405788, 0.519986, 0.717237, 0.164706) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_nqfew"] +script = ExtResource("4_05c0h") +value = 0.505 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_qx88e"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_6tpwj"] +script = ExtResource("12_8waa8") +fillColor = SubResource("Resource_nti5i") +borderRadius = SubResource("Resource_njmq0") +strokeSize = SubResource("Resource_qx88e") +offset = SubResource("Resource_nqfew") +metadata/_custom_type_script = "uid://dwuimn03cvh3" + +[sub_resource type="Resource" id="Resource_6yun5"] +script = ExtResource("4_05c0h") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_341ao"] +script = ExtResource("4_05c0h") +value = 100.0 +unit = "ph" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_b80i2"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_hk8o2"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_s0h4r"] +script = ExtResource("14_pugir") +propertyName = "fillColor" + +[sub_resource type="Resource" id="Resource_6n8ht"] +script = ExtResource("15_ojjyv") +colorPropertyName = SubResource("Resource_s0h4r") +color = SubResource("Resource_nti5i") + +[sub_resource type="Resource" id="Resource_aaxts"] +script = ExtResource("16_bjurn") +propertyName = "borderRadius" + +[sub_resource type="Resource" id="Resource_savpf"] +script = ExtResource("17_pyi7r") +floatPropertyName = SubResource("Resource_aaxts") +number = SubResource("Resource_njmq0") + +[sub_resource type="Resource" id="Resource_mnb7u"] +script = ExtResource("16_bjurn") +propertyName = "strokeSize" + +[sub_resource type="Resource" id="Resource_22me6"] +script = ExtResource("17_pyi7r") +floatPropertyName = SubResource("Resource_mnb7u") +number = SubResource("Resource_qx88e") + +[sub_resource type="Resource" id="Resource_pq5hs"] +script = ExtResource("16_bjurn") +propertyName = "offset" + +[sub_resource type="Resource" id="Resource_big0f"] +script = ExtResource("17_pyi7r") +floatPropertyName = SubResource("Resource_pq5hs") +number = SubResource("Resource_nqfew") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_k2icm"] +shader = ExtResource("10_fbdhv") +shader_parameter/size = Vector2(25.92, 172.8) +shader_parameter/sharpness = 5.0 +shader_parameter/borderRadius = 17.28 +shader_parameter/strokeSize = 0.0 +shader_parameter/offset = 7.77601 +shader_parameter/fillColor = Color(1, 1, 1, 0.184314) +shader_parameter/fillUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenfillMultiplyUVMovement = Vector2(0, 0) +shader_parameter/strokeColor = Color(1, 1, 1, 1) +shader_parameter/strokeUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVTransform = Vector4(0, 0, 0, 0) +shader_parameter/screenStrokeMultiplyUVMovment = Vector2(0, 0) +shader_parameter/opacity = 1.0 +script = ExtResource("9_a81dy") + +[sub_resource type="Gradient" id="Gradient_ndr6p"] +offsets = PackedFloat32Array(1) +colors = PackedColorArray(1, 1, 1, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_1l3k4"] +gradient = SubResource("Gradient_ndr6p") + +[sub_resource type="Resource" id="Resource_sp4ww"] +script = ExtResource("4_05c0h") +value = 0.71 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_a7iwp"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_v1pjs"] +script = ExtResource("12_8waa8") +borderRadius = SubResource("Resource_sp4ww") +strokeSize = SubResource("Resource_a7iwp") +metadata/_custom_type_script = "uid://dwuimn03cvh3" + +[sub_resource type="Resource" id="Resource_x0i5b"] +script = ExtResource("4_05c0h") +value = 0.0 +unit = "" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 + +[sub_resource type="Curve" id="Curve_ojjyv"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Resource" id="Resource_55od3"] +script = ExtResource("22_fbdhv") +transitionAllProperties = false +duration = 0.5 +curve = SubResource("Curve_ojjyv") +timeLine = ExtResource("2_kfok7") +metadata/_custom_type_script = "uid://3bymmno3avag" + +[sub_resource type="Resource" id="Resource_ud4em"] +script = ExtResource("26_pugir") +frames = 20.0 +metadata/_custom_type_script = "uid://lhuuedx87rem" + +[node name="Messages" type="Control"] +layout_mode = 3 +anchor_right = 0.983 +anchor_bottom = 0.901 +offset_right = -0.416016 +offset_bottom = 0.151978 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="UI" type="Control" parent="."] +anchors_preset = 0 +offset_right = 1132.0 +offset_bottom = 584.0 +mouse_filter = 1 +script = ExtResource("1_op0b4") +settings = ExtResource("2_iufyf") +useParentSize = true +X_computedFontSizePixels = 17.28 +customDisposerIDs = PackedStringArray("ciOsgmckohhN3Ejw:Messages ▸ UI ▸ Scroller ▸ Vertical Scroller ▸ Button", "9ak1UYtRMpBsDldi:Messages ▸ UI ▸ Scroller") +metadata/_custom_type_script = "uid://bu6np1t32bddg" + +[node name="Scroller" type="Control" parent="UI"] +clip_contents = true +anchors_preset = 0 +offset_right = 1132.0 +offset_bottom = 584.0 +mouse_filter = 1 +script = ExtResource("5_05c0h") +width = SubResource("Resource_bjurn") +height = SubResource("Resource_kw2vf") +metadata/_custom_type_script = "uid://c2hicupu28nbi" + +[node name="Messages" type="Control" parent="UI/Scroller"] +anchors_preset = 0 +offset_right = 1106.08 +offset_bottom = 962.92 +pivot_offset = Vector2(553.04, 481.46) +mouse_filter = 1 +script = ExtResource("5_05c0h") +layout = 1 +horizontalAlignment = SubResource("Resource_3d233") +width = SubResource("Resource_d5ifl") +position = 2 +top = SubResource("Resource_8hjge") +metadata/_custom_type_script = "uid://c2hicupu28nbi" + +[node name="Message" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_right = 1140.64 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message2" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 137.56 +offset_right = 1140.64 +offset_bottom = 275.12 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message3" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 275.12 +offset_right = 1140.64 +offset_bottom = 412.68 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message4" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 412.68 +offset_right = 1140.64 +offset_bottom = 550.24 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message5" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 550.24 +offset_right = 1140.64 +offset_bottom = 687.8 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message6" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 687.8 +offset_right = 1140.64 +offset_bottom = 825.36 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Message7" parent="UI/Scroller/Messages" instance=ExtResource("5_u3an3")] +offset_top = 825.36 +offset_right = 1140.64 +offset_bottom = 962.92 +pivot_offset = Vector2(570.32, 68.78) + +[node name="Vertical Scroller" type="Control" parent="UI/Scroller"] +anchors_preset = 0 +offset_left = 1106.08 +offset_right = 1132.0 +offset_bottom = 566.72 +pivot_offset = Vector2(12.96, 283.36) +mouse_filter = 1 +script = ExtResource("5_05c0h") +width = SubResource("Resource_5piug") +height = SubResource("Resource_fad61") +position = 2 +right = SubResource("Resource_yf77t") +metadata/_custom_type_script = "uid://c2hicupu28nbi" + +[node name="Background" type="TextureRect" parent="UI/Scroller/Vertical Scroller"] +material = SubResource("ShaderMaterial_u3an3") +layout_mode = 0 +offset_right = 25.92 +offset_bottom = 566.72 +pivot_offset = Vector2(12.96, 283.36) +texture = SubResource("GradientTexture1D_ojjyv") +expand_mode = 1 +script = ExtResource("12_kfok7") +imageType = SubResource("Resource_6tpwj") +width = SubResource("Resource_6yun5") +height = SubResource("Resource_341ao") +position = 2 +left = SubResource("Resource_b80i2") +top = SubResource("Resource_hk8o2") +colorProperties = [SubResource("Resource_6n8ht")] +numberProperties = [SubResource("Resource_savpf"), SubResource("Resource_22me6"), SubResource("Resource_big0f")] +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="Button" type="TextureRect" parent="UI/Scroller/Vertical Scroller"] +material = SubResource("ShaderMaterial_k2icm") +layout_mode = 0 +offset_right = 25.92 +offset_bottom = 172.8 +pivot_offset = Vector2(12.96, 86.4) +texture = SubResource("GradientTexture1D_1l3k4") +expand_mode = 1 +script = ExtResource("12_kfok7") +imageType = SubResource("Resource_v1pjs") +parentStyle = ExtResource("24_8aipl") +top = SubResource("Resource_x0i5b") +transitionSettings = SubResource("Resource_55od3") +metadata/_custom_type_script = "uid://bx0bk663u3hj5" + +[node name="UISlider" type="Node" parent="UI/Scroller/Vertical Scroller" node_paths=PackedStringArray("button", "background", "scrollTarget", "scrollContainer")] +script = ExtResource("25_8waa8") +button = NodePath("../Button") +background = NodePath("../Background") +smoothing = SubResource("Resource_ud4em") +scrollTarget = NodePath("../../Messages") +scrollContainer = NodePath("../..") +mouseWheelAbsoluteScroll = 50.0 +mouseWheelRelativeScroll = 0.0 +metadata/_custom_type_script = "uid://btwjt483gljv7" diff --git a/Tools/Messages/Vertical-Slider.tres b/Tools/Messages/Vertical-Slider.tres new file mode 100644 index 0000000..243a531 --- /dev/null +++ b/Tools/Messages/Vertical-Slider.tres @@ -0,0 +1,299 @@ +[gd_resource type="Resource" script_class="UIStyle" load_steps=51 format=3 uid="uid://vbvri2ltruat"] + +[ext_resource type="Script" uid="uid://drqb0pm5ub64g" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIColor.cs" id="1_6vwm6"] +[ext_resource type="Script" uid="uid://chmcc71dvu4vj" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UIStyle.cs" id="1_75y86"] +[ext_resource type="Script" uid="uid://y2p0r8c5rs45" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/ColorPropertyName.cs" id="2_hnsvs"] +[ext_resource type="Script" uid="uid://f7s137m6egkj" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUIColor.cs" id="3_uwq18"] +[ext_resource type="Script" uid="uid://c5k6edrmdr3qc" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/UIColorTransition.cs" id="4_20qqy"] +[ext_resource type="Script" uid="uid://cnkyynboxg1qg" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UINumber.cs" id="4_ly1j0"] +[ext_resource type="Script" uid="uid://5w3jvlqxrvaf" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/TransitionSettings.cs" id="5_qjwj3"] +[ext_resource type="Resource" uid="uid://b4iykcwesp1y6" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/UITime.tres" id="6_a0omq"] +[ext_resource type="Script" uid="uid://bqypmtxqo5rnf" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelectorStyle.cs" id="6_quaxm"] +[ext_resource type="Script" uid="uid://brmxttyvbwoit" path="res://addons/rokojori_action_library/Runtime/UI/Styling/UISelector.cs" id="7_7ojah"] +[ext_resource type="Script" uid="uid://jqgdm3r2u8xq" path="res://addons/rokojori_action_library/Runtime/Shading/Properties/FloatPropertyName.cs" id="8_sg07i"] +[ext_resource type="Script" uid="uid://j3mk8vwv56ui" path="res://addons/rokojori_action_library/Runtime/UI/ShaderProperties/ShaderUINumber.cs" id="9_ia68h"] +[ext_resource type="Script" uid="uid://dvqqv47qdhlx0" path="res://addons/rokojori_action_library/Runtime/UI/Transitions/UINumberTransition.cs" id="10_ual3t"] + +[sub_resource type="Resource" id="Resource_20qqy"] +script = ExtResource("1_6vwm6") +color = Color(1, 1, 1, 0.184314) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_qjwj3"] +script = ExtResource("2_hnsvs") +propertyName = "fillColor" +metadata/_custom_type_script = "uid://y2p0r8c5rs45" + +[sub_resource type="Resource" id="Resource_a0omq"] +script = ExtResource("3_uwq18") +colorPropertyName = SubResource("Resource_qjwj3") +color = SubResource("Resource_20qqy") +metadata/_custom_type_script = "uid://f7s137m6egkj" + +[sub_resource type="Curve" id="Curve_isweu"] +_data = [Vector2(0, 0), 0.0, 2.04019, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Resource" id="Resource_43evt"] +script = ExtResource("5_qjwj3") +duration = 0.3 +curve = SubResource("Curve_isweu") +timeLine = ExtResource("6_a0omq") +metadata/_custom_type_script = "uid://5w3jvlqxrvaf" + +[sub_resource type="Resource" id="Resource_cl374"] +script = ExtResource("4_20qqy") +property = 3 +shaderPropertyName = "fillColor" +settings = SubResource("Resource_43evt") +metadata/_custom_type_script = "uid://c5k6edrmdr3qc" + +[sub_resource type="Resource" id="Resource_r7ur1"] +script = ExtResource("4_ly1j0") +value = 10.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 + +[sub_resource type="Resource" id="Resource_sg07i"] +script = ExtResource("4_ly1j0") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_p0ttq"] +script = ExtResource("8_sg07i") +propertyName = "offset" +metadata/_custom_type_script = "uid://jqgdm3r2u8xq" + +[sub_resource type="Resource" id="Resource_8usfd"] +script = ExtResource("4_ly1j0") +value = 30.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_kngt5"] +script = ExtResource("9_ia68h") +floatPropertyName = SubResource("Resource_p0ttq") +number = SubResource("Resource_8usfd") +metadata/_custom_type_script = "uid://j3mk8vwv56ui" + +[sub_resource type="Resource" id="Resource_lxev4"] +script = ExtResource("8_sg07i") +propertyName = "borderRadius" +metadata/_custom_type_script = "uid://jqgdm3r2u8xq" + +[sub_resource type="Resource" id="Resource_hskph"] +script = ExtResource("4_ly1j0") +value = 1.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_d3wu1"] +script = ExtResource("9_ia68h") +floatPropertyName = SubResource("Resource_lxev4") +number = SubResource("Resource_hskph") +metadata/_custom_type_script = "uid://j3mk8vwv56ui" + +[sub_resource type="Curve" id="Curve_7ojsi"] +_data = [Vector2(0, 0), 0.0, 2.45756, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Resource" id="Resource_gqfui"] +script = ExtResource("5_qjwj3") +duration = 0.1 +curve = SubResource("Curve_7ojsi") +timeLine = ExtResource("6_a0omq") +metadata/_custom_type_script = "uid://5w3jvlqxrvaf" + +[sub_resource type="Resource" id="Resource_aoc2v"] +script = ExtResource("10_ual3t") +property = 27 +shaderPropertyName = "offset" +settings = SubResource("Resource_gqfui") +metadata/_custom_type_script = "uid://dvqqv47qdhlx0" + +[sub_resource type="Resource" id="Resource_6vwm6"] +script = ExtResource("7_7ojah") +hover = 0 +dragging = 0 +scrolling = 1 +focus = 0 +active = 0 +selectors = [] +metadata/_custom_type_script = "uid://brmxttyvbwoit" + +[sub_resource type="Gradient" id="Gradient_lxev4"] +offsets = PackedFloat32Array(0, 0.148649, 0.472973, 0.837838, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.552941, 0.694118, 0.894118, 1, 0.325867, 0.538377, 0.839433, 1, 0.581326, 0.713539, 0.90084, 1, 1, 1, 1, 1) + +[sub_resource type="Resource" id="Resource_ual3t"] +script = ExtResource("1_6vwm6") +color = Color(1, 1, 1, 1) +isAnimated = true +animationGradient = SubResource("Gradient_lxev4") +blendMode = 2 +animationDuration = 0.3 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_teyq1"] +script = ExtResource("2_hnsvs") +propertyName = "fillColor" +metadata/_custom_type_script = "uid://y2p0r8c5rs45" + +[sub_resource type="Resource" id="Resource_46how"] +script = ExtResource("3_uwq18") +colorPropertyName = SubResource("Resource_teyq1") +color = SubResource("Resource_ual3t") +metadata/_custom_type_script = "uid://f7s137m6egkj" + +[sub_resource type="Curve" id="Curve_lxev4"] +_limits = [-1.0, 1.0, 0.0, 1.0] +_data = [Vector2(0, 0.0320257), 0.0, 0.0, 0, 0, Vector2(0.0907127, 0.521217), 0.0, 0.0, 0, 0, Vector2(0.265659, -0.248999), 0.0, 0.0, 0, 0, Vector2(0.313175, 0.208967), 0.0, 0.0, 0, 0, Vector2(0.483801, -0.353082), 0.0, 0.0, 0, 0, Vector2(0.688985, 0.760608), 0.0, 0.0, 0, 0, Vector2(0.758099, -0.311449), 0.0, 0.0, 0, 0, Vector2(0.799136, 0.0840672), 0.0, 0.0, 0, 0, Vector2(0.915767, -0.436349), 0.0, 0.0, 0, 0, Vector2(1, 0.0736589), 0.0, 0.0, 0, 0] +point_count = 10 + +[sub_resource type="Resource" id="Resource_pdxfl"] +script = ExtResource("4_ly1j0") +value = 0.4 +unit = "em" +isAnimated = true +animationCurve = SubResource("Curve_lxev4") +animationDuration = 0.5 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_mm258"] +script = ExtResource("8_sg07i") +propertyName = "offset" +metadata/_custom_type_script = "uid://jqgdm3r2u8xq" + +[sub_resource type="Resource" id="Resource_6nbtj"] +script = ExtResource("4_ly1j0") +value = 28.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_sq7wr"] +script = ExtResource("9_ia68h") +floatPropertyName = SubResource("Resource_mm258") +number = SubResource("Resource_6nbtj") +metadata/_custom_type_script = "uid://j3mk8vwv56ui" + +[sub_resource type="Resource" id="Resource_hnsvs"] +script = ExtResource("1_75y86") +selectorStyles = [] +layout = 0 +position = 0 +lineWrap = 0 +left = SubResource("Resource_pdxfl") +colorProperties = [SubResource("Resource_46how")] +numberProperties = [SubResource("Resource_sq7wr")] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_uwq18"] +script = ExtResource("6_quaxm") +selector = SubResource("Resource_6vwm6") +style = SubResource("Resource_hnsvs") +metadata/_custom_type_script = "uid://bqypmtxqo5rnf" + +[sub_resource type="Resource" id="Resource_ia68h"] +script = ExtResource("7_7ojah") +hover = 1 +dragging = 0 +scrolling = 0 +focus = 0 +active = 0 +selectors = [] +metadata/_custom_type_script = "uid://brmxttyvbwoit" + +[sub_resource type="Resource" id="Resource_ly1j0"] +script = ExtResource("1_6vwm6") +color = Color(1, 1, 1, 0.705882) +isAnimated = false +blendMode = 2 +animationDuration = 1.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://drqb0pm5ub64g" + +[sub_resource type="Resource" id="Resource_quaxm"] +script = ExtResource("2_hnsvs") +propertyName = "fillColor" +metadata/_custom_type_script = "uid://y2p0r8c5rs45" + +[sub_resource type="Resource" id="Resource_7ojah"] +script = ExtResource("3_uwq18") +colorPropertyName = SubResource("Resource_quaxm") +color = SubResource("Resource_ly1j0") +metadata/_custom_type_script = "uid://f7s137m6egkj" + +[sub_resource type="Resource" id="Resource_7i8al"] +script = ExtResource("1_75y86") +selectorStyles = [] +layout = 0 +position = 0 +lineWrap = 0 +colorProperties = [SubResource("Resource_7ojah")] +numberProperties = [] +numberTransitions = [] +colorTransitions = [] +metadata/_custom_type_script = "uid://chmcc71dvu4vj" + +[sub_resource type="Resource" id="Resource_gyvfj"] +script = ExtResource("6_quaxm") +selector = SubResource("Resource_ia68h") +style = SubResource("Resource_7i8al") +metadata/_custom_type_script = "uid://bqypmtxqo5rnf" + +[sub_resource type="Resource" id="Resource_7h6jy"] +script = ExtResource("4_ly1j0") +value = 0.0 +unit = "em" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[sub_resource type="Resource" id="Resource_ncnyk"] +script = ExtResource("4_ly1j0") +value = 100.0 +unit = "pw" +isAnimated = false +animationDuration = 0.0 +animationOffset = 0.0 +metadata/_custom_type_script = "uid://cnkyynboxg1qg" + +[resource] +script = ExtResource("1_75y86") +selectorStyles = [SubResource("Resource_uwq18"), SubResource("Resource_gyvfj")] +layout = 0 +width = SubResource("Resource_ncnyk") +height = SubResource("Resource_r7ur1") +position = 1 +lineWrap = 0 +left = SubResource("Resource_sg07i") +top = SubResource("Resource_7h6jy") +colorProperties = [SubResource("Resource_a0omq")] +numberProperties = [SubResource("Resource_kngt5"), SubResource("Resource_d3wu1")] +numberTransitions = [SubResource("Resource_aoc2v")] +colorTransitions = [SubResource("Resource_cl374")] +metadata/_custom_type_script = "uid://chmcc71dvu4vj"