From bed04dbf872983c15ba56ef7b96736ea2e12799e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 31 Jul 2024 14:40:30 +0200 Subject: [PATCH 1/2] Hide update_mode for non-root HSMs --- hsm/limbo_hsm.cpp | 7 +++++++ hsm/limbo_hsm.h | 1 + util/limbo_string_names.cpp | 1 + util/limbo_string_names.h | 1 + 4 files changed, 10 insertions(+) diff --git a/hsm/limbo_hsm.cpp b/hsm/limbo_hsm.cpp index cba7608c..022a52be 100644 --- a/hsm/limbo_hsm.cpp +++ b/hsm/limbo_hsm.cpp @@ -253,6 +253,13 @@ void LimboHSM::_initialize(Node *p_agent, const Ref &p_blackboard) { } } +void LimboHSM::_validate_property(PropertyInfo &p_property) const { + if (p_property.name == LW_NAME(update_mode) && !is_root()) { + // Hide update_mode for non-root HSMs. + p_property.usage = PROPERTY_USAGE_NONE; + } +} + void LimboHSM::_notification(int p_what) { switch (p_what) { case NOTIFICATION_POST_ENTER_TREE: { diff --git a/hsm/limbo_hsm.h b/hsm/limbo_hsm.h index 57606d3a..f0e14a15 100644 --- a/hsm/limbo_hsm.h +++ b/hsm/limbo_hsm.h @@ -64,6 +64,7 @@ class LimboHSM : public LimboState { static void _bind_methods(); void _notification(int p_what); + void _validate_property(PropertyInfo &p_property) const; virtual void _initialize(Node *p_agent, const Ref &p_blackboard) override; virtual bool _dispatch(const StringName &p_event, const Variant &p_cargo = Variant()) override; diff --git a/util/limbo_string_names.cpp b/util/limbo_string_names.cpp index 32260223..c4f7d508 100644 --- a/util/limbo_string_names.cpp +++ b/util/limbo_string_names.cpp @@ -156,6 +156,7 @@ LimboStringNames::LimboStringNames() { Tools = SN("Tools"); Tree = SN("Tree"); TripleBar = SN("TripleBar"); + update_mode = SN("update_mode"); update_task = SN("update_task"); update_tree = SN("update_tree"); updated = SN("updated"); diff --git a/util/limbo_string_names.h b/util/limbo_string_names.h index 641b1212..d7ee5021 100644 --- a/util/limbo_string_names.h +++ b/util/limbo_string_names.h @@ -173,6 +173,7 @@ class LimboStringNames { StringName Tools; StringName Tree; StringName TripleBar; + StringName update_mode; StringName update_task; StringName update_tree; StringName updated; From 9e79183579643dbee87de18c88f57777cb07227e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 31 Jul 2024 14:50:56 +0200 Subject: [PATCH 2/2] Update demo import --- demo/demo/assets/fonts/junction_bold.otf.import | 1 + demo/demo/assets/fonts/knewave_regular.ttf.import | 1 + demo/demo/scenes/showcase.tscn | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/demo/demo/assets/fonts/junction_bold.otf.import b/demo/demo/assets/fonts/junction_bold.otf.import index b3a9e688..5b19f13b 100644 --- a/demo/demo/assets/fonts/junction_bold.otf.import +++ b/demo/demo/assets/fonts/junction_bold.otf.import @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/junction_bold.otf-4db2200a8b1a6423bafe2a4e7c7 Rendering=null antialiasing=1 generate_mipmaps=false +disable_embedded_bitmaps=true multichannel_signed_distance_field=false msdf_pixel_range=8 msdf_size=48 diff --git a/demo/demo/assets/fonts/knewave_regular.ttf.import b/demo/demo/assets/fonts/knewave_regular.ttf.import index 32d5a2ef..4deeba75 100644 --- a/demo/demo/assets/fonts/knewave_regular.ttf.import +++ b/demo/demo/assets/fonts/knewave_regular.ttf.import @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/knewave_regular.ttf-955953b059f713782c7b07e66 Rendering=null antialiasing=1 generate_mipmaps=false +disable_embedded_bitmaps=true multichannel_signed_distance_field=false msdf_pixel_range=8 msdf_size=48 diff --git a/demo/demo/scenes/showcase.tscn b/demo/demo/scenes/showcase.tscn index 5e7946ad..fa864e32 100644 --- a/demo/demo/scenes/showcase.tscn +++ b/demo/demo/scenes/showcase.tscn @@ -234,18 +234,18 @@ unique_name_in_owner = true custom_minimum_size = Vector2(0, 140) layout_mode = 2 size_flags_vertical = 3 -theme_override_font_sizes/normal_font_size = 20 -theme_override_font_sizes/bold_font_size = 20 -theme_override_font_sizes/italics_font_size = 20 theme_override_font_sizes/bold_italics_font_size = 20 +theme_override_font_sizes/italics_font_size = 20 theme_override_font_sizes/mono_font_size = 20 +theme_override_font_sizes/normal_font_size = 20 +theme_override_font_sizes/bold_font_size = 20 bbcode_enabled = true text = "[b]Behavior Trees[/b] are composed of tasks that represent specific actions or decision-making rules. Tasks can be broadly categorized into two main types: control tasks and leaf tasks. Control tasks determine the execution flow within the tree. They include Sequence, Selector, and Invert. Leaf tasks represent specific actions to perform, like moving or attacking, or conditions that need to be checked. The BTTask class provides the foundation for various building blocks of the Behavior Trees. BT tasks can share data with the help of the Blackboard." fit_content = true [node name="CodePopup" type="PopupPanel" parent="UI Layer/Control"] unique_name_in_owner = true -position = Vector2i(135, 60) +position = Vector2i(0, 60) size = Vector2i(1024, 708) visible = true