├── .github
└── FUNDING.yml
├── helper_pack_project
├── test
│ ├── files
│ │ ├── test.txt
│ │ ├── test.json
│ │ └── test_var_data_vector2.json
│ ├── services
│ │ ├── test_service_a_impl2.gd
│ │ ├── test_service_a_impl1.gd
│ │ └── test_service_a.gd
│ └── unit
│ │ └── core
│ │ ├── util
│ │ ├── test_property_settings_helper.gd
│ │ ├── test_stop_watch.gd
│ │ ├── test_stats_util.gd
│ │ ├── test_enum_util.gd
│ │ ├── test_node_util.gd
│ │ ├── test_property_util.gd
│ │ ├── test_string_util.gd
│ │ └── test_file_util.gd
│ │ ├── state_machine
│ │ ├── a.gd
│ │ ├── test_state_machine.tscn
│ │ └── test_state_machine.gd
│ │ ├── test_signal_mgr.gd
│ │ ├── 2d
│ │ └── vector
│ │ │ └── test_vector2_util.gd
│ │ ├── test_globals.gd
│ │ └── test_service_mgr.gd
├── .gitignore
├── icon.png
├── addons
│ ├── gut
│ │ ├── icon.png
│ │ ├── gui
│ │ │ ├── arrow.png
│ │ │ ├── play.png
│ │ │ ├── Settings.tscn
│ │ │ ├── ResizeHandle.tscn
│ │ │ ├── GutSceneTheme.tres
│ │ │ ├── GutRunner.tscn
│ │ │ ├── play.png.import
│ │ │ ├── ResultsTree.tscn
│ │ │ ├── arrow.png.import
│ │ │ ├── ShortcutButton.tscn
│ │ │ ├── editor_globals.gd
│ │ │ ├── GutControl.tscn
│ │ │ ├── RunAtCursor.tscn
│ │ │ └── gut_user_preferences.gd
│ │ ├── images
│ │ │ ├── green.png
│ │ │ ├── red.png
│ │ │ ├── yellow.png
│ │ │ ├── Folder.svg
│ │ │ ├── Script.svg
│ │ │ ├── red.png.import
│ │ │ ├── green.png.import
│ │ │ ├── yellow.png.import
│ │ │ ├── Folder.svg.import
│ │ │ └── Script.svg.import
│ │ ├── double_templates
│ │ │ ├── init_template.txt
│ │ │ ├── function_template.txt
│ │ │ └── script_template.txt
│ │ ├── fonts
│ │ │ ├── LobsterTwo-Bold.ttf
│ │ │ ├── AnonymousPro-Bold.ttf
│ │ │ ├── CourierPrime-Bold.ttf
│ │ │ ├── LobsterTwo-Italic.ttf
│ │ │ ├── LobsterTwo-Regular.ttf
│ │ │ ├── AnonymousPro-Italic.ttf
│ │ │ ├── AnonymousPro-Regular.ttf
│ │ │ ├── CourierPrime-Italic.ttf
│ │ │ ├── CourierPrime-Regular.ttf
│ │ │ ├── LobsterTwo-BoldItalic.ttf
│ │ │ ├── AnonymousPro-BoldItalic.ttf
│ │ │ ├── CourierPrime-BoldItalic.ttf
│ │ │ ├── LobsterTwo-Bold.ttf.import
│ │ │ ├── AnonymousPro-Bold.ttf.import
│ │ │ ├── CourierPrime-Bold.ttf.import
│ │ │ ├── LobsterTwo-Italic.ttf.import
│ │ │ ├── AnonymousPro-Italic.ttf.import
│ │ │ ├── CourierPrime-Italic.ttf.import
│ │ │ ├── LobsterTwo-Regular.ttf.import
│ │ │ ├── AnonymousPro-Regular.ttf.import
│ │ │ ├── CourierPrime-Regular.ttf.import
│ │ │ ├── LobsterTwo-BoldItalic.ttf.import
│ │ │ ├── AnonymousPro-BoldItalic.ttf.import
│ │ │ └── CourierPrime-BoldItalic.ttf.import
│ │ ├── plugin.cfg
│ │ ├── source_code_pro.fnt.import
│ │ ├── GutScene.tscn
│ │ ├── parameter_handler.gd
│ │ ├── icon.png.import
│ │ ├── thing_counter.gd
│ │ ├── LICENSE.md
│ │ ├── dynamic_gdscript.gd
│ │ ├── one_to_many.gd
│ │ ├── lazy_loader.gd
│ │ ├── UserFileViewer.gd
│ │ ├── compare_result.gd
│ │ ├── hook_script.gd
│ │ ├── diff_formatter.gd
│ │ ├── inner_class_registry.gd
│ │ ├── gut_plugin.gd
│ │ ├── gut_vscode_debugger.gd
│ │ ├── version_conversion.gd
│ │ ├── double_tools.gd
│ │ ├── autofree.gd
│ │ ├── gut_cmdln.gd
│ │ ├── spy.gd
│ │ ├── parameter_factory.gd
│ │ └── result_exporter.gd
│ └── godot_helper_pack
│ │ ├── plugin.cfg
│ │ ├── core
│ │ ├── 2d
│ │ │ ├── shape
│ │ │ │ ├── circle_2d.tscn
│ │ │ │ ├── global_blocking_color_monitor.tscn
│ │ │ │ ├── global_blocking_color_monitor.gd
│ │ │ │ ├── shape_draw_2d.tscn
│ │ │ │ ├── circle_2d.gd
│ │ │ │ ├── blocking_block_2d.tscn
│ │ │ │ └── shape2d_util.gd
│ │ │ ├── camera
│ │ │ │ └── behavior
│ │ │ │ │ ├── camera_move.tscn
│ │ │ │ │ ├── camera_zoom.tscn
│ │ │ │ │ ├── camera_shake.tscn
│ │ │ │ │ ├── camera_limiter.tscn
│ │ │ │ │ ├── camera_limiter.gd
│ │ │ │ │ ├── camera_zoom.gd
│ │ │ │ │ └── camera_shake.gd
│ │ │ ├── util
│ │ │ │ ├── polygon_util.gd
│ │ │ │ ├── distribution
│ │ │ │ │ ├── random_distribution_area_layer.tscn
│ │ │ │ │ ├── random_distribution_area.tscn
│ │ │ │ │ ├── multi_mesh_instance_distribution_area.tscn
│ │ │ │ │ ├── random_distribution_area.svg.import
│ │ │ │ │ ├── random_distribution_area_layer.svg.import
│ │ │ │ │ └── random_distribution_area_layer.gd
│ │ │ │ ├── rect2_util.gd
│ │ │ │ ├── rotate_it.gd
│ │ │ │ └── mover_2d.gd
│ │ │ └── vector
│ │ │ │ └── vector2_util.gd
│ │ ├── 3d
│ │ │ ├── shape
│ │ │ │ ├── shape_draw_3d.tscn
│ │ │ │ └── shape_draw_3d.gd
│ │ │ └── camera
│ │ │ │ └── camera3d_move.gd
│ │ ├── audio
│ │ │ ├── sound_track_mgr.tscn
│ │ │ ├── scene_sound_track.tscn
│ │ │ ├── scene_sound_track.gd
│ │ │ └── sound_track_mgr.gd
│ │ ├── util
│ │ │ ├── node_util.gd
│ │ │ ├── bit_flag_util.gd
│ │ │ ├── project_settings_helper.gd
│ │ │ ├── property_util.gd
│ │ │ ├── stop_watch.gd
│ │ │ ├── string_util.gd
│ │ │ ├── wait_any.gd
│ │ │ ├── enum_util.gd
│ │ │ ├── array_util.gd
│ │ │ ├── wait_all.gd
│ │ │ ├── angle_util.gd
│ │ │ ├── yield_util.gd
│ │ │ ├── file_util.gd
│ │ │ └── stats_util.gd
│ │ ├── globals.gd
│ │ ├── control
│ │ │ └── pressable_menu_button.gd
│ │ ├── state_machine
│ │ │ ├── state.svg.import
│ │ │ ├── state_machine.svg.import
│ │ │ └── state.gd
│ │ └── service_mgr.gd
│ │ └── godot_helper_pack_settings.gd
├── demos
│ ├── core
│ │ ├── 2d
│ │ │ ├── shape
│ │ │ │ ├── nine_patch.png
│ │ │ │ ├── godot_helper_pack_file_fav_blocking_block.png
│ │ │ │ ├── godot_helper_pack_global_blocking_color_setting.png
│ │ │ │ ├── godot_helper_pack_scene_tree_blocking_block_warning.png
│ │ │ │ ├── nine_patch.png.import
│ │ │ │ ├── godot_helper_pack_file_fav_blocking_block.png.import
│ │ │ │ ├── godot_helper_pack_global_blocking_color_setting.png.import
│ │ │ │ └── godot_helper_pack_scene_tree_blocking_block_warning.png.import
│ │ │ ├── util
│ │ │ │ ├── assets
│ │ │ │ │ ├── bigtree01.png
│ │ │ │ │ ├── bigtree02.png
│ │ │ │ │ ├── bigtree03.png
│ │ │ │ │ ├── grasses01.png
│ │ │ │ │ ├── grasses02.png
│ │ │ │ │ ├── grasses03.png
│ │ │ │ │ ├── grasses04.png
│ │ │ │ │ ├── grasses05.png
│ │ │ │ │ ├── brick_wall.png
│ │ │ │ │ ├── trees-and-bushes.png
│ │ │ │ │ ├── spr_boulder_0_grayscale.png
│ │ │ │ │ ├── bigtree01.png.import
│ │ │ │ │ ├── grasses01.png.import
│ │ │ │ │ ├── bigtree02.png.import
│ │ │ │ │ ├── bigtree03.png.import
│ │ │ │ │ ├── brick_wall.png.import
│ │ │ │ │ ├── grasses02.png.import
│ │ │ │ │ ├── grasses03.png.import
│ │ │ │ │ ├── grasses04.png.import
│ │ │ │ │ ├── grasses05.png.import
│ │ │ │ │ ├── trees-and-bushes.png.import
│ │ │ │ │ └── spr_boulder_0_grayscale.png.import
│ │ │ │ ├── random_distribution_area_demo.gd
│ │ │ │ ├── mover_2d_demo.gd
│ │ │ │ ├── rand_dist_carving_demo.gd
│ │ │ │ └── mover_2d_demo.tscn
│ │ │ └── camera
│ │ │ │ └── behavior
│ │ │ │ ├── axis_markers.png
│ │ │ │ ├── axis_markers.png.import
│ │ │ │ └── camera_behavior_demo.gd
│ │ ├── control
│ │ │ ├── pressable_menu_button_demo.gd
│ │ │ └── pressable_menu_button_demo.tscn
│ │ ├── 3d
│ │ │ ├── camera3d_move_demo.gd
│ │ │ └── camera3d_move_demo.tscn
│ │ └── audio
│ │ │ └── audio_demo.tscn
│ ├── demo_hud.gd
│ ├── 402739__sirplus__actionscaryfunloop32.ogg
│ ├── 578066__sirplus__rainbowglazeloop16_mastered.ogg
│ ├── 402739__sirplus__actionscaryfunloop32.ogg.import
│ ├── 578066__sirplus__rainbowglazeloop16_mastered.ogg.import
│ ├── demo_hud.tscn
│ ├── sound_track_mgr_demo.tscn
│ ├── demos.gd
│ └── demos.tscn
├── default_env.tres
├── icon.png.import
└── .gut_editor_config.json
├── readme_images
└── bmc-button.png
├── .gitignore
├── LICENSE
└── README.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | buy_me_a_coffee: jlothamer
--------------------------------------------------------------------------------
/helper_pack_project/test/files/test.txt:
--------------------------------------------------------------------------------
1 | Lorem ipsum dolor sit amet
2 |
--------------------------------------------------------------------------------
/helper_pack_project/.gitignore:
--------------------------------------------------------------------------------
1 | # Godot 4+ specific ignores
2 | .godot/
3 |
--------------------------------------------------------------------------------
/helper_pack_project/test/files/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "Lorem": "ipsum"
3 | }
4 |
--------------------------------------------------------------------------------
/helper_pack_project/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/icon.png
--------------------------------------------------------------------------------
/helper_pack_project/test/files/test_var_data_vector2.json:
--------------------------------------------------------------------------------
1 | {
2 | "sub_dictionary": {
3 | "vector2": Vector2(1, 1)
4 | }
5 | }
--------------------------------------------------------------------------------
/readme_images/bmc-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/readme_images/bmc-button.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/icon.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/gui/arrow.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/gui/play.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/images/green.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/images/red.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/images/yellow.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/nine_patch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/shape/nine_patch.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/double_templates/init_template.txt:
--------------------------------------------------------------------------------
1 | {func_decleration}:
2 | super({super_params})
3 | __gutdbl.spy_on('{method_name}', {param_array})
4 |
5 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/LobsterTwo-Bold.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/AnonymousPro-Bold.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/CourierPrime-Bold.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/LobsterTwo-Italic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/LobsterTwo-Regular.ttf
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/bigtree01.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/bigtree02.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/bigtree03.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/grasses01.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/grasses02.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/grasses03.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/grasses04.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/grasses05.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/AnonymousPro-Italic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/AnonymousPro-Regular.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/CourierPrime-Italic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/CourierPrime-Regular.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/LobsterTwo-BoldItalic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/brick_wall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/brick_wall.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/demo_hud.gd:
--------------------------------------------------------------------------------
1 | extends CanvasLayer
2 |
3 |
4 | func _on_back_btn_pressed():
5 | get_tree().change_scene_to_file("res://demos/demos.tscn")
6 | queue_free()
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/AnonymousPro-BoldItalic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/addons/gut/fonts/CourierPrime-BoldItalic.ttf
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/random_distribution_area_demo.gd:
--------------------------------------------------------------------------------
1 | extends Node2D
2 |
3 |
4 |
5 | func _on_repopulateBtn_pressed():
6 | $RandomDistributionArea.do_distribution()
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 |
3 | name="Gut"
4 | description="Unit Testing tool for Godot."
5 | author="Butch Wesley"
6 | version="9.3.0"
7 | script="gut_plugin.gd"
8 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/402739__sirplus__actionscaryfunloop32.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/402739__sirplus__actionscaryfunloop32.ogg
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/camera/behavior/axis_markers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/camera/behavior/axis_markers.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/trees-and-bushes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/trees-and-bushes.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/578066__sirplus__rainbowglazeloop16_mastered.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/578066__sirplus__rainbowglazeloop16_mastered.ogg
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/spr_boulder_0_grayscale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/util/assets/spr_boulder_0_grayscale.png
--------------------------------------------------------------------------------
/helper_pack_project/default_env.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Environment" load_steps=2 format=2]
2 |
3 | [sub_resource type="Sky" id=1]
4 |
5 | [resource]
6 | background_mode = 2
7 | background_sky = SubResource( 1 )
8 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_file_fav_blocking_block.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/shape/godot_helper_pack_file_fav_blocking_block.png
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_global_blocking_color_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/shape/godot_helper_pack_global_blocking_color_setting.png
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 |
3 | name="GodotHelperPack"
4 | description="Collection of helpful scripts and classes."
5 | author="Jason Lothamer"
6 | version="4.2.3"
7 | script="godot_helper_pack_plugin.gd"
8 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_scene_tree_blocking_block_warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhlothamer/godot_helper_pack/HEAD/helper_pack_project/demos/core/2d/shape/godot_helper_pack_scene_tree_blocking_block_warning.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Godot-specific ignores
2 | .import/
3 | export.cfg
4 | export_presets.cfg
5 | .godot/
6 |
7 | # Imported translations (automatically generated from CSV files)
8 | *.translation
9 |
10 | # Mono-specific ignores
11 | .mono/
12 | data_*/
13 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/Settings.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene format=3 uid="uid://cvvvtsah38l0e"]
2 |
3 | [node name="Settings" type="VBoxContainer"]
4 | offset_right = 388.0
5 | offset_bottom = 586.0
6 | size_flags_horizontal = 3
7 | size_flags_vertical = 3
8 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/mover_2d_demo.gd:
--------------------------------------------------------------------------------
1 | extends Node2D
2 |
3 |
4 | @onready var _mover2d: Mover2D = $Icon/Mover2D
5 |
6 |
7 | func _on_FollowMouseChkBtn_toggled(button_pressed):
8 | _mover2d.follow_mouse = button_pressed
9 |
10 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/rand_dist_carving_demo.gd:
--------------------------------------------------------------------------------
1 | extends Node2D
2 |
3 |
4 | @onready var _rand_dist_area: RandomDistributionArea = $RandomDistributionArea
5 |
6 |
7 | func _on_repopulateBtn_pressed():
8 | _rand_dist_area.do_distribution()
9 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/Folder.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/helper_pack_project/test/services/test_service_a_impl2.gd:
--------------------------------------------------------------------------------
1 | extends "res://test/services/test_service_a.gd"
2 |
3 |
4 | func foo():
5 | _test_service_a_foo_called_in = "TestServiceAImpl2"
6 |
7 |
8 | func bar():
9 | _test_service_a_bar_called_in = "TestServiceAImpl2"
10 |
--------------------------------------------------------------------------------
/helper_pack_project/test/services/test_service_a_impl1.gd:
--------------------------------------------------------------------------------
1 | extends "res://test/services/test_service_a.gd"
2 |
3 |
4 |
5 | func foo():
6 | _test_service_a_foo_called_in = "TestServiceAImpl1"
7 |
8 |
9 | func bar():
10 | _test_service_a_bar_called_in = "TestServiceAImpl1"
11 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/circle_2d.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dyyec81aqitkm"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/shape/circle_2d.gd" id="1"]
4 |
5 | [node name="Circle2D" type="Marker2D"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/3d/shape/shape_draw_3d.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://b6b1m6148hqtu"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/3d/shape/shape_draw_3d.gd" id="1"]
4 |
5 | [node name="ShapeDraw3D" type="Node3D"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/audio/sound_track_mgr.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dwywbcdyknra1"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/audio/sound_track_mgr.gd" id="1"]
4 |
5 | [node name="SoundTrackMgr" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/audio/scene_sound_track.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://j6qw4wfxd3ws"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/audio/scene_sound_track.gd" id="1"]
4 |
5 | [node name="SceneSoundTrack" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_move.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dqboncrpnsdvq"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/camera/behavior/camera_move.gd" id="1"]
4 |
5 | [node name="CameraMove" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_zoom.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://br7fjb0sukkgu"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/camera/behavior/camera_zoom.gd" id="1"]
4 |
5 | [node name="CameraZoom" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_shake.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://cxilwke88g32t"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/camera/behavior/camera_shake.gd" id="1"]
4 |
5 | [node name="CameraShake" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/double_templates/function_template.txt:
--------------------------------------------------------------------------------
1 | {func_decleration}
2 | {vararg_warning}__gutdbl.spy_on('{method_name}', {param_array})
3 | if(__gutdbl.is_stubbed_to_call_super('{method_name}', {param_array})):
4 | return {super_call}
5 | else:
6 | return await __gutdbl.handle_other_stubs('{method_name}', {param_array})
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_limiter.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dir3ayqg3t1mb"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/camera/behavior/camera_limiter.gd" id="1"]
4 |
5 | [node name="cameraLimiter" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/polygon_util.gd:
--------------------------------------------------------------------------------
1 | class_name PolygonUtil
2 | extends Object
3 |
4 |
5 | static func get_midpoint(polygon: PackedVector2Array) -> Vector2:
6 | var mid_point = Vector2.ZERO
7 | for v in polygon:
8 | mid_point += v
9 | mid_point = mid_point / float(polygon.size())
10 | return mid_point
11 |
12 |
--------------------------------------------------------------------------------
/helper_pack_project/test/services/test_service_a.gd:
--------------------------------------------------------------------------------
1 | class_name TestServiceA
2 | extends Node
3 |
4 | var _test_service_a_foo_called_in := ""
5 | var _test_service_a_bar_called_in := ""
6 |
7 |
8 | func foo():
9 | _test_service_a_foo_called_in = "TestServiceA"
10 |
11 |
12 | func bar():
13 | _test_service_a_bar_called_in = "TestServiceA"
14 |
15 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/ResizeHandle.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bvrqqgjpyouse"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/ResizeHandle.gd" id="1_oi5ed"]
4 |
5 | [node name="ResizeHandle" type="ColorRect"]
6 | custom_minimum_size = Vector2(20, 20)
7 | color = Color(1, 1, 1, 0)
8 | script = ExtResource("1_oi5ed")
9 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/GutSceneTheme.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Theme" load_steps=2 format=3 uid="uid://cstkhwkpajvqu"]
2 |
3 | [ext_resource type="FontFile" uid="uid://c6c7gnx36opr0" path="res://addons/gut/fonts/AnonymousPro-Regular.ttf" id="1_df57p"]
4 |
5 | [resource]
6 | default_font = ExtResource("1_df57p")
7 | Label/fonts/font = ExtResource("1_df57p")
8 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area_layer.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bdc68fjchgk5y"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area_layer.gd" id="1"]
4 |
5 | [node name="RandomDistributionAreaLayer" type="Node"]
6 | script = ExtResource("1")
7 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/rect2_util.gd:
--------------------------------------------------------------------------------
1 | class_name Rect2Util
2 | extends Object
3 |
4 | static func make_polygon(r: Rect2) -> Array:
5 | var pts = []
6 | #top right
7 | pts.append(Vector2(r.end.x, r.position.y))
8 | #bottom right
9 | pts.append(r.end)
10 | #bottom left
11 | pts.append(Vector2(r.position.x, r.end.y))
12 | #top left
13 | pts.append(r.position)
14 | return pts
15 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/node_util.gd:
--------------------------------------------------------------------------------
1 | class_name NodeUtil
2 | extends Object
3 |
4 | # Collection of node utility functions.
5 |
6 |
7 | # removes all children from a node, optionally freeing children
8 | static func remove_children(node: Node, free_children: bool = false) -> void:
9 | for child in node.get_children():
10 | node.remove_child(child)
11 | if free_children:
12 | child.queue_free()
13 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/bit_flag_util.gd:
--------------------------------------------------------------------------------
1 | class_name BitFlagUtil
2 | extends Object
3 |
4 |
5 | static func get_bit(value: int, bit_number: int) -> bool:
6 | return (value & (1 << (bit_number - 1))) > 0
7 |
8 |
9 | static func set_bit(value: int, bit_number: int, bit_value: bool) -> int:
10 | var temp = 1 << (bit_number - 1)
11 | if bit_value:
12 | return value | temp
13 | temp = ~temp
14 | return value & temp
15 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://orh5roboofds"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area.gd" id="1"]
4 |
5 | [node name="randomDistributionArea" type="ReferenceRect"]
6 | offset_right = 40.0
7 | offset_bottom = 40.0
8 | mouse_filter = 2
9 | script = ExtResource("1")
10 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_property_settings_helper.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 |
4 | func test_get_audio_channel_disable_threshold_db():
5 | var results = ProjectSettingsHelper.get_audio_channel_disable_threshold_db()
6 | assert_eq(results, -60)
7 |
8 |
9 | func test_get_audio_channel_dxisable_threshold_db():
10 | var results = ProjectSettingsHelper.get_physics_process_delta()
11 | assert_eq(results, 1.0/60.0)
12 |
13 |
14 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/distribution/multi_mesh_instance_distribution_area.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bvp0j6pcw8orq"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/util/distribution/multi_mesh_instance_distribution_area.gd" id="1"]
4 |
5 | [node name="MultiMeshInstanceDistributionArea" type="ReferenceRect"]
6 | offset_right = 200.0
7 | offset_bottom = 200.0
8 | script = ExtResource("1")
9 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/project_settings_helper.gd:
--------------------------------------------------------------------------------
1 | extends Object
2 |
3 | class_name ProjectSettingsHelper
4 |
5 | static func get_physics_process_delta() -> float:
6 | return 1.0 / convert(ProjectSettings.get_setting("physics/common/physics_ticks_per_second"), TYPE_FLOAT)
7 |
8 |
9 | static func get_audio_channel_disable_threshold_db() -> float:
10 | return convert(ProjectSettings.get("audio/buses/channel_disable_threshold_db"), TYPE_FLOAT)
11 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/source_code_pro.fnt.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_bmfont"
4 | type="FontFile"
5 | uid="uid://cfawt18qr4256"
6 | path="res://.godot/imported/source_code_pro.fnt-042fb383b3c7b4c19e67c852f7fbefca.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/source_code_pro.fnt"
11 | dest_files=["res://.godot/imported/source_code_pro.fnt-042fb383b3c7b4c19e67c852f7fbefca.fontdata"]
12 |
13 | [params]
14 |
15 | fallbacks=[]
16 | compress=true
17 | scaling_mode=2
18 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_stop_watch.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 | func test_stop_watch():
4 | var stop_watch = StopWatch.new()
5 | stop_watch.start()
6 | await get_tree().create_timer(.01).timeout
7 | stop_watch.stop()
8 | var msec = stop_watch.get_elapsed_msec()
9 | var usec = stop_watch.get_elapsed_usec()
10 | assert_true(msec > 0.0)
11 | assert_true(usec > 0.0)
12 | assert_true(stop_watch._stop_time > stop_watch._start_time)
13 | assert_true(is_equal_approx(msec * 1000.0, usec))
14 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_stats_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 |
4 | func test_linear_regression_known_good_data_and_results():
5 | #data from http://www.intellspot.com/linear-regression-examples/
6 | var x_array = [1.7,1.5,2.8,5,1.3,2.2,1.3]
7 | var y_array = [368,340,665,954,331,556,376]
8 | var line:StatsUtil.Line = StatsUtil.linear_regression(x_array, y_array)
9 | assert_not_null(line)
10 | assert_almost_eq(line.b, 125.8, .05)
11 | assert_almost_eq(line.m, 171.5, .05)
12 |
13 |
14 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/GutRunner.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://bqy3ikt6vu4b5"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/GutRunner.gd" id="1"]
4 | [ext_resource type="PackedScene" uid="uid://m28heqtswbuq" path="res://addons/gut/GutScene.tscn" id="2_6ruxb"]
5 |
6 | [node name="GutRunner" type="Node2D"]
7 | script = ExtResource("1")
8 |
9 | [node name="GutLayer" type="CanvasLayer" parent="."]
10 | layer = 128
11 |
12 | [node name="GutScene" parent="GutLayer" instance=ExtResource("2_6ruxb")]
13 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/control/pressable_menu_button_demo.gd:
--------------------------------------------------------------------------------
1 | extends Control
2 |
3 |
4 | @onready var _output:TextEdit = %OutputTextEdit
5 |
6 |
7 | func _add_output(msg: String) -> void:
8 | _output.text += "\n%s" % msg
9 |
10 |
11 | func _on_pressable_menu_button_id_focused(id: int) -> void:
12 | _add_output("id_focused: %d" % id)
13 |
14 |
15 | func _on_pressable_menu_button_id_pressed(id: int) -> void:
16 | _add_output("id_pressed: %d" % id)
17 |
18 |
19 | func _on_clear_output_btn_pressed():
20 | _output.text = ""
21 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/property_util.gd:
--------------------------------------------------------------------------------
1 | class_name PropertyUtil
2 | extends Object
3 |
4 | # collection of property utility functions.
5 |
6 |
7 | # checks if an object has a property and optionally of a given type
8 | static func has_property(obj: Object, property_name: String, property_type: int = -1) -> bool:
9 | for prop in obj.get_property_list():
10 | if prop.name == property_name:
11 | print(str(prop))
12 | if property_type > -1 && property_type != prop.type:
13 | return false
14 | return true
15 | return false
16 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/godot_helper_pack_settings.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | class_name GodotHelperPackSettings
3 | extends Object
4 |
5 |
6 | const PROJECT_SETTING_GLOBAL_BLOCKING_COLOR_KEY = "godot_helper_pack_plugin/blocking_global_color"
7 |
8 |
9 | static func get_global_blocking_color() -> Color:
10 | if !ProjectSettings.has_setting(PROJECT_SETTING_GLOBAL_BLOCKING_COLOR_KEY):
11 | ProjectSettings.set_setting(PROJECT_SETTING_GLOBAL_BLOCKING_COLOR_KEY, Color.WHITE)
12 | return ProjectSettings.get_setting(PROJECT_SETTING_GLOBAL_BLOCKING_COLOR_KEY)
13 |
14 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/global_blocking_color_monitor.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://syh5mgr5hfyv"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/shape/global_blocking_color_monitor.gd" id="1"]
4 |
5 | [node name="GlobalBlockingColorMonitor" type="Node"]
6 | script = ExtResource("1")
7 |
8 | [node name="ChangeCheckTimer" type="Timer" parent="."]
9 | wait_time = 0.5
10 | autostart = true
11 |
12 | [connection signal="timeout" from="ChangeCheckTimer" to="." method="_on_ChangeCheckTimer_timeout"]
13 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/3d/camera3d_move_demo.gd:
--------------------------------------------------------------------------------
1 | extends Node3D
2 |
3 |
4 | func _ready():
5 | Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
6 |
7 |
8 | func _input(event):
9 | if event.is_pressed() and event is InputEventKey:
10 | var ek: InputEventKey = event
11 | if ek.keycode == KEY_ESCAPE:
12 | if null == get_tree().root.get_node_or_null("DemoHud"):
13 | get_tree().quit()
14 | return
15 | if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
16 | Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
17 | else:
18 | Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
19 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/402739__sirplus__actionscaryfunloop32.ogg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="oggvorbisstr"
4 | type="AudioStreamOggVorbis"
5 | uid="uid://c2rsg37jfdvh0"
6 | path="res://.godot/imported/402739__sirplus__actionscaryfunloop32.ogg-8891c799f965a0be7e0d40488ca7243d.oggvorbisstr"
7 |
8 | [deps]
9 |
10 | source_file="res://demos/402739__sirplus__actionscaryfunloop32.ogg"
11 | dest_files=["res://.godot/imported/402739__sirplus__actionscaryfunloop32.ogg-8891c799f965a0be7e0d40488ca7243d.oggvorbisstr"]
12 |
13 | [params]
14 |
15 | loop=true
16 | loop_offset=0
17 | bpm=0
18 | beat_count=0
19 | bar_beats=4
20 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/state_machine/a.gd:
--------------------------------------------------------------------------------
1 | extends State
2 |
3 | var change_to_state: String = ""
4 | var init_called := false
5 | var enter_called := false
6 | var exit_called := false
7 | var physics_process_called := false
8 |
9 | func init(_state_machine, _host):
10 | super.init(_state_machine, _host)
11 | init_called = true
12 |
13 |
14 | func enter() -> void:
15 | enter_called = true
16 |
17 |
18 | func exit() -> void:
19 | exit_called = true
20 |
21 |
22 | func physics_process(_delta) -> void:
23 | physics_process_called = true
24 | if change_to_state != "":
25 | change_state(change_to_state)
26 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/Script.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/578066__sirplus__rainbowglazeloop16_mastered.ogg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="oggvorbisstr"
4 | type="AudioStreamOggVorbis"
5 | uid="uid://cnhvhmdchjq7b"
6 | path="res://.godot/imported/578066__sirplus__rainbowglazeloop16_mastered.ogg-2b6538a3971d9fac9407ac133c9e7ec3.oggvorbisstr"
7 |
8 | [deps]
9 |
10 | source_file="res://demos/578066__sirplus__rainbowglazeloop16_mastered.ogg"
11 | dest_files=["res://.godot/imported/578066__sirplus__rainbowglazeloop16_mastered.ogg-2b6538a3971d9fac9407ac133c9e7ec3.oggvorbisstr"]
12 |
13 | [params]
14 |
15 | loop=true
16 | loop_offset=0
17 | bpm=0
18 | beat_count=0
19 | bar_beats=4
20 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/stop_watch.gd:
--------------------------------------------------------------------------------
1 | class_name StopWatch
2 | extends RefCounted
3 |
4 | # StopWatch utility class.
5 |
6 |
7 | var _start_time : float
8 | var _stop_time : float
9 |
10 |
11 | # start stop watch
12 | func start():
13 | _start_time = Time.get_ticks_usec()
14 | _stop_time = _start_time
15 |
16 |
17 | # stop stop watch
18 | func stop():
19 | _stop_time = Time.get_ticks_usec()
20 |
21 |
22 | # gets elapsed microseconds
23 | func get_elapsed_usec():
24 | return _stop_time - _start_time
25 |
26 |
27 | # gets elapsed milliseconds
28 | func get_elapsed_msec():
29 | return get_elapsed_usec() / 1000.0
30 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/string_util.gd:
--------------------------------------------------------------------------------
1 | class_name StringUtil
2 | extends Object
3 |
4 | # Collection of string utility functions.
5 |
6 |
7 | # gets file name without extension
8 | static func get_file_name(s: String) -> String:
9 | var file_name = s.get_file()
10 | if !is_null_or_empty(file_name):
11 | var extension = s.get_extension()
12 | if !is_null_or_empty(extension):
13 | file_name = file_name.left(file_name.length() - extension.length() - 1)
14 | return file_name
15 |
16 |
17 | # returns true if string is null or empty
18 | static func is_null_or_empty(s: String) -> bool:
19 | return s == null or s == ""
20 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/global_blocking_color_monitor.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Node
3 |
4 | @onready var _timer:Timer = $ChangeCheckTimer
5 |
6 |
7 | var _prev_color: Color
8 |
9 |
10 | func _ready():
11 | if !Engine.is_editor_hint():
12 | _timer.stop()
13 | _prev_color = GodotHelperPackSettings.get_global_blocking_color()
14 |
15 |
16 | func _on_ChangeCheckTimer_timeout():
17 | var curr_color = GodotHelperPackSettings.get_global_blocking_color()
18 | if curr_color != _prev_color:
19 | _prev_color = curr_color
20 | print("color changed - calling update")
21 | get_tree().call_group("blocking_block", "update_from_global_blocking_color", curr_color)
22 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/test_signal_mgr.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 |
4 | class TestPublisher:
5 | #warning-ignore:unused_signal
6 | signal foo()
7 | #warning-ignore:unused_signal
8 | signal tree_exited()
9 |
10 |
11 | class TestSubscriber:
12 | #warning-ignore:unused_signal
13 | signal tree_exited()
14 | func bar():
15 | pass
16 |
17 |
18 | func test_mgr_connects_publisher_to_subscriber():
19 | var publisher = TestPublisher.new()
20 | SignalMgr.register_publisher(publisher, "foo")
21 | var subscriber = TestSubscriber.new()
22 | SignalMgr.register_subscriber(subscriber, "foo", "bar")
23 | assert_true(publisher.is_connected("foo",Callable(subscriber,"bar")))
24 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/state_machine/test_state_machine.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://b3gp5w5pmmcfs"]
2 |
3 | [ext_resource type="Script" path="res://test/unit/core/state_machine/test_state_machine.gd" id="1"]
4 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/state_machine/state_machine.gd" id="2"]
5 | [ext_resource type="Script" path="res://test/unit/core/state_machine/a.gd" id="4"]
6 |
7 | [node name="TestStateMachine" type="Node"]
8 | script = ExtResource("1")
9 |
10 | [node name="StateMachine" type="Node" parent="."]
11 | script = ExtResource("2")
12 |
13 | [node name="A" type="Node" parent="StateMachine"]
14 | script = ExtResource("4")
15 | is_starting_state = true
16 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/shape_draw_2d.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dr08xd3v5en34"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/shape/shape_draw_2d.gd" id="1"]
4 |
5 | [node name="shapeDraw" type="Node2D"]
6 | script = ExtResource("1")
7 | color = Color(1, 1, 1, 1)
8 | texture = null
9 | non_rect_texture_offset = Vector2(0, 0)
10 | non_rect_texture_scale = Vector2(1, 1)
11 | nine_patch_draw_center = true
12 | nine_patch_region_rect = Rect2(0, 0, 0, 0)
13 | nine_patch_patch_left = 0
14 | nine_patch_patch_right = 0
15 | nine_patch_patch_top = 0
16 | nine_patch_patch_bottom = 0
17 | nine_patch_axis_stretch_horizontal = 0
18 | nine_patch_axis_stretch_vertical = 0
19 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/GutScene.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://m28heqtswbuq"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/GutScene.gd" id="1_b4m8y"]
4 | [ext_resource type="PackedScene" uid="uid://duxblir3vu8x7" path="res://addons/gut/gui/NormalGui.tscn" id="2_j6ywb"]
5 | [ext_resource type="PackedScene" uid="uid://cnqqdfsn80ise" path="res://addons/gut/gui/MinGui.tscn" id="3_3glw1"]
6 |
7 | [node name="GutScene" type="Node2D"]
8 | script = ExtResource("1_b4m8y")
9 |
10 | [node name="Normal" parent="." instance=ExtResource("2_j6ywb")]
11 |
12 | [node name="Compact" parent="." instance=ExtResource("3_3glw1")]
13 | offset_left = 5.0
14 | offset_top = 273.0
15 | offset_right = 265.0
16 | offset_bottom = 403.0
17 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/globals.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | ## Maintains a dictionary of values. Property/values persist between scene changes.
3 |
4 |
5 | var _properties: Dictionary = {}
6 |
7 |
8 | ## adds or changes a property value
9 | func set_value(property_name, value) -> void:
10 | _properties[property_name] = value
11 |
12 |
13 | ## gets the value of a property. If the property has not been set, returns null.
14 | func get_value(property_name):
15 | return _properties.get(property_name)
16 |
17 |
18 | ## removes a property value.
19 | func erase(property_name: String) -> void:
20 | _properties.erase(property_name)
21 |
22 |
23 | ## removes all property values.
24 | func clear() -> void:
25 | _properties.clear()
26 |
27 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/control/pressable_menu_button.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | class_name PressableMenuButton
3 | extends MenuButton
4 | ## A menu button that exposes the underlying popup menu's id_pressed() and id_focused() signals
5 | ## so you don't have to write code to call get_popup() and connect to those signals.
6 |
7 |
8 | signal id_pressed(id: int)
9 | signal id_focused(id: int)
10 |
11 | func _ready():
12 | var popup_menu := get_popup()
13 | popup_menu.id_pressed.connect(_on_popup_menu_id_pressed)
14 | popup_menu.id_focused.connect(_on_popup_menu_id_focused)
15 |
16 |
17 | func _on_popup_menu_id_pressed(id: int) -> void:
18 | id_pressed.emit(id)
19 |
20 |
21 | func _on_popup_menu_id_focused(id: int) -> void:
22 | id_focused.emit(id)
23 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/wait_any.gd:
--------------------------------------------------------------------------------
1 | class_name WaitAny
2 | extends RefCounted
3 |
4 |
5 | signal completed()
6 |
7 |
8 | var _completed := false
9 |
10 |
11 | func add(s: Signal) -> void:
12 | if s.is_connected(self._signal_handler):
13 | return
14 | s.connect(self._signal_handler)
15 |
16 |
17 | func remove(s: Signal) -> void:
18 | if !s.is_connected(self._signal_handler):
19 | return
20 | s.disconnect(self._signal_handler)
21 |
22 |
23 | func reset() -> void:
24 | _completed = false
25 |
26 |
27 | func _signal_handler(_p0 = null, _p1 = null, _p2 = null, _p3 = null, _p4 = null, _p5 = null, _p6 = null, _p7 = null, _p8 = null, _p9 = null) -> void:
28 | if _completed:
29 | return
30 | _completed = true
31 | completed.emit()
32 |
33 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_enum_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 | enum LoremEnum {
4 | IPSUM=50,
5 | DOLOR=40,
6 | SIT=20,
7 | AMET=10,
8 | DUP=20
9 | }
10 |
11 | func test_get_array_returns_array_of_ids():
12 | var array = EnumUtil.get_array(LoremEnum)
13 | assert_eq(array, [50,40,20,10,20])
14 |
15 | func test_get_array_returns_array_of_strings():
16 | var array = EnumUtil.get_names_string_array(LoremEnum)
17 | assert_eq(array, ["IPSUM", "DOLOR", "SIT", "AMET","DUP"])
18 |
19 | func test_get_string_returns_correct_string():
20 | var results = EnumUtil.get_string(LoremEnum, LoremEnum.SIT)
21 | assert_eq(results, "SIT")
22 |
23 | func test_get_id_returns_correct_id():
24 | var results = EnumUtil.get_id(LoremEnum, "AMET")
25 | assert_eq(results, LoremEnum.AMET)
26 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/rotate_it.gd:
--------------------------------------------------------------------------------
1 | class_name RotateIt
2 | extends Node
3 |
4 | @export var rotation_speed_degrees = rad_to_deg(.25*PI) :
5 | set(mod_value):
6 | rotation_speed_degrees= mod_value
7 | _rotation_speed = deg_to_rad(rotation_speed_degrees)
8 | @export var clockwise := true
9 |
10 | var _rotation_speed := 0.0
11 |
12 | var _parent: Node2D
13 | @onready var _clockwise: float = 1 if clockwise else -1
14 |
15 |
16 | func _ready():
17 | self.rotation_speed_degrees = rotation_speed_degrees
18 | var temp = get_parent()
19 | if !temp is Node2D:
20 | printerr("RotateIt: parent must derived from Node2D")
21 | set_physics_process(false)
22 | return
23 | _parent = temp
24 |
25 |
26 | func _physics_process(delta):
27 | _parent.rotate(_rotation_speed * delta * _clockwise)
28 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/enum_util.gd:
--------------------------------------------------------------------------------
1 | class_name EnumUtil
2 | extends Object
3 |
4 | # Collection of enum utility.
5 |
6 |
7 | static func get_id(enum_class: Dictionary, enum_string: String) -> int:
8 | if !enum_class.has(enum_string):
9 | printerr("given enum string is not in enum class")
10 | return -1
11 | return enum_class[enum_string]
12 |
13 |
14 | static func get_string(enum_class: Dictionary, enum_int_value: int) -> String:
15 | var keys = enum_class.keys()
16 | for key in keys:
17 | if enum_class[key] == enum_int_value:
18 | return key
19 | printerr("given enum int value out of range for enum class")
20 | return ""
21 |
22 |
23 | static func get_array(enum_class: Dictionary) -> Array:
24 | return enum_class.values()
25 |
26 | static func get_names_string_array(enum_class: Dictionary) -> Array:
27 | return enum_class.keys()
28 |
29 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/parameter_handler.gd:
--------------------------------------------------------------------------------
1 | var _params = null
2 | var _call_count = 0
3 | var _logger = null
4 |
5 | func _init(params=null):
6 | _params = params
7 | _logger = GutUtils.get_logger()
8 | if(typeof(_params) != TYPE_ARRAY):
9 | _logger.error('You must pass an array to parameter_handler constructor.')
10 | _params = null
11 |
12 |
13 | func next_parameters():
14 | _call_count += 1
15 | return _params[_call_count -1]
16 |
17 | func get_current_parameters():
18 | return _params[_call_count]
19 |
20 | func is_done():
21 | var done = true
22 | if(_params != null):
23 | done = _call_count == _params.size()
24 | return done
25 |
26 | func get_logger():
27 | return _logger
28 |
29 | func set_logger(logger):
30 | _logger = logger
31 |
32 | func get_call_count():
33 | return _call_count
34 |
35 | func get_parameter_count():
36 | return _params.size()
37 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Bold.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://cmiuntu71oyl3"
6 | path="res://.godot/imported/LobsterTwo-Bold.ttf-7c7f734103b58a32491a4788186f3dcb.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/LobsterTwo-Bold.ttf"
11 | dest_files=["res://.godot/imported/LobsterTwo-Bold.ttf-7c7f734103b58a32491a4788186f3dcb.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Bold.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://c8axnpxc0nrk4"
6 | path="res://.godot/imported/AnonymousPro-Bold.ttf-9d8fef4d357af5b52cd60afbe608aa49.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/AnonymousPro-Bold.ttf"
11 | dest_files=["res://.godot/imported/AnonymousPro-Bold.ttf-9d8fef4d357af5b52cd60afbe608aa49.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Bold.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://bhjgpy1dovmyq"
6 | path="res://.godot/imported/CourierPrime-Bold.ttf-1f003c66d63ebed70964e7756f4fa235.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/CourierPrime-Bold.ttf"
11 | dest_files=["res://.godot/imported/CourierPrime-Bold.ttf-1f003c66d63ebed70964e7756f4fa235.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Italic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://dis65h8wxc3f2"
6 | path="res://.godot/imported/LobsterTwo-Italic.ttf-f93abf6c25390c85ad5fb6c4ee75159e.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/LobsterTwo-Italic.ttf"
11 | dest_files=["res://.godot/imported/LobsterTwo-Italic.ttf-f93abf6c25390c85ad5fb6c4ee75159e.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Italic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://hf5rdg67jcwc"
6 | path="res://.godot/imported/AnonymousPro-Italic.ttf-9989590b02137b799e13d570de2a42c1.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/AnonymousPro-Italic.ttf"
11 | dest_files=["res://.godot/imported/AnonymousPro-Italic.ttf-9989590b02137b799e13d570de2a42c1.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Italic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://mcht266g817e"
6 | path="res://.godot/imported/CourierPrime-Italic.ttf-baa9156a73770735a0f72fb20b907112.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/CourierPrime-Italic.ttf"
11 | dest_files=["res://.godot/imported/CourierPrime-Italic.ttf-baa9156a73770735a0f72fb20b907112.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-Regular.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://5e8msj0ih2pv"
6 | path="res://.godot/imported/LobsterTwo-Regular.ttf-f3fcfa01cd671c8da433dd875d0fe04b.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/LobsterTwo-Regular.ttf"
11 | dest_files=["res://.godot/imported/LobsterTwo-Regular.ttf-f3fcfa01cd671c8da433dd875d0fe04b.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-Regular.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://c6c7gnx36opr0"
6 | path="res://.godot/imported/AnonymousPro-Regular.ttf-856c843fd6f89964d2ca8d8ff1724f13.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/AnonymousPro-Regular.ttf"
11 | dest_files=["res://.godot/imported/AnonymousPro-Regular.ttf-856c843fd6f89964d2ca8d8ff1724f13.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-Regular.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://bnh0lslf4yh87"
6 | path="res://.godot/imported/CourierPrime-Regular.ttf-3babe7e4a7a588dfc9a84c14b4f1fe23.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/CourierPrime-Regular.ttf"
11 | dest_files=["res://.godot/imported/CourierPrime-Regular.ttf-3babe7e4a7a588dfc9a84c14b4f1fe23.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/LobsterTwo-BoldItalic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://bll38n2ct6qme"
6 | path="res://.godot/imported/LobsterTwo-BoldItalic.ttf-227406a33e84448e6aa974176016de19.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/LobsterTwo-BoldItalic.ttf"
11 | dest_files=["res://.godot/imported/LobsterTwo-BoldItalic.ttf-227406a33e84448e6aa974176016de19.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/icon.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c2b8uav6fokh6"
6 | path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://icon.png"
14 | dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/AnonymousPro-BoldItalic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://msst1l2s2s"
6 | path="res://.godot/imported/AnonymousPro-BoldItalic.ttf-4274bf704d3d6b9cd32c4f0754d8c83d.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/AnonymousPro-BoldItalic.ttf"
11 | dest_files=["res://.godot/imported/AnonymousPro-BoldItalic.ttf-4274bf704d3d6b9cd32c4f0754d8c83d.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/fonts/CourierPrime-BoldItalic.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://n6mxiov5sbgc"
6 | path="res://.godot/imported/CourierPrime-BoldItalic.ttf-65ebcc61dd5e1dfa8f96313da4ad7019.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://addons/gut/fonts/CourierPrime-BoldItalic.ttf"
11 | dest_files=["res://.godot/imported/CourierPrime-BoldItalic.ttf-65ebcc61dd5e1dfa8f96313da4ad7019.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[]
31 | language_support={}
32 | script_support={}
33 | opentype_features={}
34 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/array_util.gd:
--------------------------------------------------------------------------------
1 | class_name ArrayUtil
2 | extends Object
3 |
4 | # Collection of array utility functions.
5 |
6 |
7 | # appends all elements from source to dest array
8 | static func append_all(dest: Array, source: Array):
9 | for item in source:
10 | dest.append(item)
11 |
12 |
13 | static func get_rand(a: Array):
14 | if a.size() == 0:
15 | return null
16 | return a[int(randf_range(0, a.size())) % a.size()]
17 |
18 |
19 | static func has_any(a: Array, b: Array) -> bool:
20 | for b_item in b:
21 | if a.has(b_item):
22 | return true
23 | return false
24 |
25 |
26 | static func has_all(a: Array, b: Array) -> bool:
27 | for b_item in b:
28 | if !a.has(b_item):
29 | return false
30 | return true
31 |
32 |
33 | static func intersection(a: Array, b: Array) -> Array:
34 | var i := []
35 | for b_item in b:
36 | if !a.has(b_item):
37 | i.append(b_item)
38 | return i
39 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/icon.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bvo0uao7deu0q"
6 | path="res://.godot/imported/icon.png-91b084043b8aaf2f1c906e7b9fa92969.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/icon.png"
14 | dest_files=["res://.godot/imported/icon.png-91b084043b8aaf2f1c906e7b9fa92969.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/play.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cr6tvdv0ve6cv"
6 | path="res://.godot/imported/play.png-5c90e88e8136487a183a099d67a7de24.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/gui/play.png"
14 | dest_files=["res://.godot/imported/play.png-5c90e88e8136487a183a099d67a7de24.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/ResultsTree.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dls5r5f6157nq"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/ResultsTree.gd" id="1_b4uub"]
4 |
5 | [node name="ResultsTree" type="VBoxContainer"]
6 | custom_minimum_size = Vector2(10, 10)
7 | anchors_preset = 15
8 | anchor_right = 1.0
9 | anchor_bottom = 1.0
10 | offset_right = -70.0
11 | offset_bottom = -104.0
12 | grow_horizontal = 2
13 | grow_vertical = 2
14 | size_flags_horizontal = 3
15 | size_flags_vertical = 3
16 | script = ExtResource("1_b4uub")
17 |
18 | [node name="Tree" type="Tree" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 | size_flags_vertical = 3
22 | columns = 2
23 | hide_root = true
24 |
25 | [node name="TextOverlay" type="Label" parent="Tree"]
26 | visible = false
27 | layout_mode = 1
28 | anchors_preset = 15
29 | anchor_right = 1.0
30 | anchor_bottom = 1.0
31 | grow_horizontal = 2
32 | grow_vertical = 2
33 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/arrow.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://6wra5rxmfsrl"
6 | path="res://.godot/imported/arrow.png-2b5b2d838b5b3467cf300ac2da1630d9.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/gui/arrow.png"
14 | dest_files=["res://.godot/imported/arrow.png-2b5b2d838b5b3467cf300ac2da1630d9.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/red.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ba2sgost7my3x"
6 | path="res://.godot/imported/red.png-47a557c3922e800f76686bc1a4ad0c3c.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/images/red.png"
14 | dest_files=["res://.godot/imported/red.png-47a557c3922e800f76686bc1a4ad0c3c.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/green.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bvrnfjkcmpr8s"
6 | path="res://.godot/imported/green.png-e3a17091688e10a7013279b38edc7f8a.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/images/green.png"
14 | dest_files=["res://.godot/imported/green.png-e3a17091688e10a7013279b38edc7f8a.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/audio/audio_demo.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene format=3 uid="uid://bnfkin76nori6"]
2 |
3 | [node name="audio_demo" type="Control"]
4 | layout_mode = 3
5 | anchors_preset = 15
6 | anchor_right = 1.0
7 | anchor_bottom = 1.0
8 | grow_horizontal = 2
9 | grow_vertical = 2
10 |
11 | [node name="CenterContainer" type="CenterContainer" parent="."]
12 | layout_mode = 1
13 | anchors_preset = 15
14 | anchor_right = 1.0
15 | anchor_bottom = 1.0
16 | grow_horizontal = 2
17 | grow_vertical = 2
18 |
19 | [node name="Label" type="Label" parent="CenterContainer"]
20 | layout_mode = 2
21 | text = "This scene is just to demo the SoundTrackMgr switching sound tracks
22 | based on the scene. See the sound_track_mgr_demo.tscn scene to see how that works.
23 | Note that that scene is an Autoload, enabling it to start background music for the demos
24 | start scene.
25 |
26 | Music is from freesounds.org by sirplus. Please see github page/readme for links/license."
27 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/circle_2d.gd:
--------------------------------------------------------------------------------
1 | ## This node draw a circle.
2 | @tool
3 | class_name Circle2D
4 | extends Marker2D
5 |
6 | ## Radius of circle.
7 | @export_range(.1, 10000.0) var radius: float = 10.0 :
8 | set(mod_value):
9 | radius = mod_value
10 | queue_redraw()
11 | ## Fill color.
12 | @export var color: Color = Color.WHITE :
13 | set(mod_value):
14 | color = mod_value
15 | queue_redraw()
16 | ## Stroke color.
17 | @export var stroke_color := Color.TRANSPARENT :
18 | set(mod_value):
19 | stroke_color = mod_value
20 | queue_redraw()
21 | ## Stroke width.
22 | @export_range(1.0, 20.0) var stroke_width := 2.0 :
23 | set(mod_value):
24 | stroke_width = mod_value
25 | queue_redraw()
26 |
27 | func _draw():
28 | draw_circle(Vector2.ZERO, radius, color)
29 | if stroke_color != Color.TRANSPARENT:
30 | draw_arc(Vector2.ZERO, radius - (stroke_width/2.0), 0.0, 2*PI, 200,
31 | stroke_color, stroke_width, true)
32 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/yellow.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://o4mo2w2ftx1v"
6 | path="res://.godot/imported/yellow.png-b3cf3d463958a169d909273d3d742052.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/images/yellow.png"
14 | dest_files=["res://.godot/imported/yellow.png-b3cf3d463958a169d909273d3d742052.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/wait_all.gd:
--------------------------------------------------------------------------------
1 | class_name WaitAll
2 | extends RefCounted
3 |
4 |
5 | signal completed()
6 |
7 |
8 | var _wait_count := 0
9 | var _signaled_count := 0
10 | var _completed := false
11 |
12 |
13 | func add(s: Signal) -> void:
14 | if s.is_connected(self._signal_handler):
15 | return
16 | _wait_count += 1
17 | s.connect(self._signal_handler)
18 |
19 |
20 | func remove(s: Signal) -> void:
21 | if !s.is_connected(self._signal_handler):
22 | return
23 | _wait_count -= 1
24 | s.disconnect(self._signal_handler)
25 |
26 |
27 | func reset() -> void:
28 | _completed = false
29 | _signaled_count = 0
30 |
31 |
32 | func _signal_handler(_p0 = null, _p1 = null, _p2 = null, _p3 = null, _p4 = null, _p5 = null, _p6 = null, _p7 = null, _p8 = null, _p9 = null) -> void:
33 | if _completed:
34 | return
35 | _signaled_count += 1
36 | if _signaled_count >= _wait_count:
37 | _completed = true
38 | completed.emit()
39 |
40 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/nine_patch.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://yw75vpshtkn1"
6 | path="res://.godot/imported/nine_patch.png-d10f49e5feaa087d2e8bf70262e74b51.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/shape/nine_patch.png"
14 | dest_files=["res://.godot/imported/nine_patch.png-d10f49e5feaa087d2e8bf70262e74b51.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree01.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://mh2ejxul7phq"
6 | path="res://.godot/imported/bigtree01.png-5be3a69e220317eb01b939f539b1f984.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/bigtree01.png"
14 | dest_files=["res://.godot/imported/bigtree01.png-5be3a69e220317eb01b939f539b1f984.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses01.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://erbivnw1gjpo"
6 | path="res://.godot/imported/grasses01.png-2425ed586c55e9c88b19b906436b2a8d.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/grasses01.png"
14 | dest_files=["res://.godot/imported/grasses01.png-2425ed586c55e9c88b19b906436b2a8d.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree02.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dfxc2oq4nllhg"
6 | path="res://.godot/imported/bigtree02.png-8230f0e816258ca074ae2aee9d3416e0.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/bigtree02.png"
14 | dest_files=["res://.godot/imported/bigtree02.png-8230f0e816258ca074ae2aee9d3416e0.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/bigtree03.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bg5mbncivpyld"
6 | path="res://.godot/imported/bigtree03.png-dc49623b0b3d4fdbee53e909ca535df9.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/bigtree03.png"
14 | dest_files=["res://.godot/imported/bigtree03.png-dc49623b0b3d4fdbee53e909ca535df9.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/brick_wall.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bl3midkwp5huj"
6 | path="res://.godot/imported/brick_wall.png-dbb364291c54f5abf5ee6349ef5e1764.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/brick_wall.png"
14 | dest_files=["res://.godot/imported/brick_wall.png-dbb364291c54f5abf5ee6349ef5e1764.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=0
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses02.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://buvjc24c0vyac"
6 | path="res://.godot/imported/grasses02.png-e9a726610cbb94f85b0d16e359252c67.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/grasses02.png"
14 | dest_files=["res://.godot/imported/grasses02.png-e9a726610cbb94f85b0d16e359252c67.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses03.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b7h3o1lwl4yjx"
6 | path="res://.godot/imported/grasses03.png-61636386f2741814a29f0673fc5ab861.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/grasses03.png"
14 | dest_files=["res://.godot/imported/grasses03.png-61636386f2741814a29f0673fc5ab861.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses04.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bv24ajaficyqs"
6 | path="res://.godot/imported/grasses04.png-6e36b37c26aa5061447feac1d2d12e5e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/grasses04.png"
14 | dest_files=["res://.godot/imported/grasses04.png-6e36b37c26aa5061447feac1d2d12e5e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/grasses05.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cqyepsn62bdkx"
6 | path="res://.godot/imported/grasses05.png-d598a8da3b2d4e26add6f1f97b25f65c.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/grasses05.png"
14 | dest_files=["res://.godot/imported/grasses05.png-d598a8da3b2d4e26add6f1f97b25f65c.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/demo_hud.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dplu1ehyx0gg"]
2 |
3 | [ext_resource type="Script" path="res://demos/demo_hud.gd" id="1_m05aq"]
4 |
5 | [node name="DemoHud" type="CanvasLayer"]
6 | layer = 2
7 | script = ExtResource("1_m05aq")
8 |
9 | [node name="MarginContainer" type="MarginContainer" parent="."]
10 | anchors_preset = 3
11 | anchor_left = 1.0
12 | anchor_top = 1.0
13 | anchor_right = 1.0
14 | anchor_bottom = 1.0
15 | offset_left = -97.0
16 | offset_top = -70.0
17 | grow_horizontal = 0
18 | grow_vertical = 0
19 | theme_override_constants/margin_left = 10
20 | theme_override_constants/margin_top = 10
21 | theme_override_constants/margin_right = 10
22 | theme_override_constants/margin_bottom = 10
23 |
24 | [node name="BackBtn" type="Button" parent="MarginContainer"]
25 | layout_mode = 2
26 | theme_override_font_sizes/font_size = 30
27 | text = "Back"
28 |
29 | [connection signal="pressed" from="MarginContainer/BackBtn" to="." method="_on_back_btn_pressed"]
30 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/camera/behavior/axis_markers.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dvpl28yyln7b2"
6 | path="res://.godot/imported/axis_markers.png-25d6a1e273534fd69e1672087ee62b1b.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/camera/behavior/axis_markers.png"
14 | dest_files=["res://.godot/imported/axis_markers.png-25d6a1e273534fd69e1672087ee62b1b.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/trees-and-bushes.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cqax8x5ouunna"
6 | path="res://.godot/imported/trees-and-bushes.png-c15d976fa6719795462a96c8dbd4da36.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/trees-and-bushes.png"
14 | dest_files=["res://.godot/imported/trees-and-bushes.png-c15d976fa6719795462a96c8dbd4da36.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/util/assets/spr_boulder_0_grayscale.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c14wn3r5t1gxm"
6 | path="res://.godot/imported/spr_boulder_0_grayscale.png-85d8d5214c48898b6f45a0122b21456f.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/util/assets/spr_boulder_0_grayscale.png"
14 | dest_files=["res://.godot/imported/spr_boulder_0_grayscale.png-85d8d5214c48898b6f45a0122b21456f.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/Folder.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dhvl14hls3y2j"
6 | path="res://.godot/imported/Folder.svg-caa50e6a0be9d456fd81991dfb537916.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/images/Folder.svg"
14 | dest_files=["res://.godot/imported/Folder.svg-caa50e6a0be9d456fd81991dfb537916.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/images/Script.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cavojn74qp7ij"
6 | path="res://.godot/imported/Script.svg-34c66aae9c985e3e0470426acbbcda04.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/gut/images/Script.svg"
14 | dest_files=["res://.godot/imported/Script.svg-34c66aae9c985e3e0470426acbbcda04.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_node_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 |
4 | func test_remove_children_no_free():
5 | var parent_node := Node.new()
6 | var children := []
7 | for i in range(10):
8 | var child_node := Node.new()
9 | children.append(child_node)
10 | child_node.name = str(i)
11 | parent_node.add_child(child_node)
12 | assert_eq(10, parent_node.get_child_count())
13 | NodeUtil.remove_children(parent_node)
14 | assert_eq(0, parent_node.get_child_count())
15 | for child in children:
16 | assert_false(child.is_queued_for_deletion())
17 |
18 |
19 | func test_remove_children_with_free():
20 | var parent_node := Node.new()
21 | var children := []
22 | for i in range(10):
23 | var child_node := Node.new()
24 | children.append(child_node)
25 | child_node.name = str(i)
26 | parent_node.add_child(child_node)
27 | assert_eq(10, parent_node.get_child_count())
28 | NodeUtil.remove_children(parent_node, true)
29 | assert_eq(0, parent_node.get_child_count())
30 | for child in children:
31 | assert_true(child.is_queued_for_deletion())
32 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_file_fav_blocking_block.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dl6gni3eg0frn"
6 | path="res://.godot/imported/godot_helper_pack_file_fav_blocking_block.png-4f52ddd85a51492631f7505fbbac4e9b.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/shape/godot_helper_pack_file_fav_blocking_block.png"
14 | dest_files=["res://.godot/imported/godot_helper_pack_file_fav_blocking_block.png-4f52ddd85a51492631f7505fbbac4e9b.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/state_machine/state.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b8gm2pdd0bsvy"
6 | path="res://.godot/imported/state.svg-c72351ce93e870b6c1b8cec5fe528823.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/godot_helper_pack/core/state_machine/state.svg"
14 | dest_files=["res://.godot/imported/state.svg-c72351ce93e870b6c1b8cec5fe528823.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_global_blocking_color_setting.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ca5lmobg778p8"
6 | path="res://.godot/imported/godot_helper_pack_global_blocking_color_setting.png-6c9a4b2a6cc65a9b0fd6ee6cbbd0cea5.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/shape/godot_helper_pack_global_blocking_color_setting.png"
14 | dest_files=["res://.godot/imported/godot_helper_pack_global_blocking_color_setting.png-6c9a4b2a6cc65a9b0fd6ee6cbbd0cea5.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/shape/godot_helper_pack_scene_tree_blocking_block_warning.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ddtupiawd7h0b"
6 | path="res://.godot/imported/godot_helper_pack_scene_tree_blocking_block_warning.png-95b6533874e769f96069df961fdd022f.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://demos/core/2d/shape/godot_helper_pack_scene_tree_blocking_block_warning.png"
14 | dest_files=["res://.godot/imported/godot_helper_pack_scene_tree_blocking_block_warning.png-95b6533874e769f96069df961fdd022f.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Jason Lothamer
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/state_machine/state_machine.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://1ckcnpgkwpt2"
6 | path="res://.godot/imported/state_machine.svg-d9453876e4a5a08034e8e0bf96a3a30c.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/godot_helper_pack/core/state_machine/state_machine.svg"
14 | dest_files=["res://.godot/imported/state_machine.svg-d9453876e4a5a08034e8e0bf96a3a30c.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/thing_counter.gd:
--------------------------------------------------------------------------------
1 | var things = {}
2 |
3 | func get_unique_count():
4 | return things.size()
5 |
6 |
7 | func add_thing_to_count(thing):
8 | if(!things.has(thing)):
9 | things[thing] = 0
10 |
11 |
12 | func add(thing):
13 | if(things.has(thing)):
14 | things[thing] += 1
15 | else:
16 | things[thing] = 1
17 |
18 |
19 | func has(thing):
20 | return things.has(thing)
21 |
22 |
23 | func count(thing):
24 | var to_return = 0
25 | if(things.has(thing)):
26 | to_return = things[thing]
27 | return to_return
28 |
29 |
30 | func sum():
31 | var to_return = 0
32 | for key in things:
33 | to_return += things[key]
34 | return to_return
35 |
36 |
37 | func to_s():
38 | var to_return = ""
39 | for key in things:
40 | to_return += str(key, ": ", things[key], "\n")
41 | to_return += str("sum: ", sum())
42 | return to_return
43 |
44 |
45 | func get_max_count():
46 | var max_val = null
47 | for key in things:
48 | if(max_val == null or things[key] > max_val):
49 | max_val = things[key]
50 | return max_val
51 |
52 |
53 | func add_array_items(array):
54 | for i in range(array.size()):
55 | add(array[i])
56 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/angle_util.gd:
--------------------------------------------------------------------------------
1 | class_name AngleUtil
2 | extends Object
3 |
4 |
5 | static func between(angle: float, start_angle: float, end_angle: float) -> bool:
6 | # degenerate cases
7 | if start_angle == end_angle or abs(start_angle) == PI and abs(end_angle) == PI:
8 | return true
9 | # adapted from from https://stackoverflow.com/questions/42246870/clamp-angle-to-arbitrary-range
10 | var n_min = wrapf(start_angle - angle, -PI, PI)
11 | var n_max = wrapf(end_angle - angle, -PI, PI)
12 | if n_min <= .0 and n_max >= .0:
13 | return true
14 | return false
15 |
16 |
17 | static func clamp_angle(angle: float, start_angle: float, end_angle: float) -> float:
18 | # degenerate cases
19 | if start_angle == end_angle or abs(start_angle) == PI and abs(end_angle) == PI:
20 | return angle
21 | # taken from https://stackoverflow.com/questions/42246870/clamp-angle-to-arbitrary-range
22 | var n_min = wrapf(start_angle - angle, -PI, PI)
23 | var n_max = wrapf(end_angle - angle, -PI, PI)
24 | if n_min <= .0 and n_max >= .0:
25 | return angle
26 | if abs(n_min) < abs(n_max):
27 | return start_angle
28 | return end_angle
29 |
30 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b5ts7xlp6kpq5"
6 | path="res://.godot/imported/random_distribution_area.svg-5c65ef88ad0f0734795df789035f2bf0.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area.svg"
14 | dest_files=["res://.godot/imported/random_distribution_area.svg-5c65ef88ad0f0734795df789035f2bf0.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/double_templates/script_template.txt:
--------------------------------------------------------------------------------
1 | # ##############################################################################
2 | # Gut Doubled Script
3 | # ##############################################################################
4 | {extends}
5 |
6 | {constants}
7 |
8 | {properties}
9 |
10 | # ------------------------------------------------------------------------------
11 | # GUT stuff
12 | # ------------------------------------------------------------------------------
13 | var __gutdbl_values = {
14 | double = self,
15 | thepath = '{path}',
16 | subpath = '{subpath}',
17 | stubber = {stubber_id},
18 | spy = {spy_id},
19 | gut = {gut_id},
20 | from_singleton = '{singleton_name}',
21 | is_partial = {is_partial},
22 | doubled_methods = {doubled_methods},
23 | }
24 | var __gutdbl = load('res://addons/gut/double_tools.gd').new(__gutdbl_values)
25 |
26 | # Here so other things can check for a method to know if this is a double.
27 | func __gutdbl_check_method__():
28 | pass
29 |
30 | # ------------------------------------------------------------------------------
31 | # Doubled Methods
32 | # ------------------------------------------------------------------------------
33 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright (c) 2018 Tom "Butch" Wesley
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area_layer.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c3lsy5kwkej5m"
6 | path="res://.godot/imported/random_distribution_area_layer.svg-718757590c9f8bd722f1a5d9c8f4924b.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/godot_helper_pack/core/2d/util/distribution/random_distribution_area_layer.svg"
14 | dest_files=["res://.godot/imported/random_distribution_area_layer.svg-718757590c9f8bd722f1a5d9c8f4924b.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/blocking_block_2d.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://bmthijbuop6sj"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/shape/shape_draw_2d.gd" id="1"]
4 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/2d/shape/blocking_block_2d.gd" id="2"]
5 |
6 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_w8snx"]
7 | resource_local_to_scene = true
8 | size = Vector2(200, 200)
9 |
10 | [node name="BlockingBlock" type="CollisionShape2D" groups=["blocking_block"]]
11 | shape = SubResource("RectangleShape2D_w8snx")
12 | script = ExtResource("2")
13 | color = Color(0, 0.803922, 0.215686, 1)
14 |
15 | [node name="ShapeDraw2D" type="Node2D" parent="."]
16 | script = ExtResource("1")
17 | color = Color(0, 0.803922, 0.215686, 1)
18 | texture = null
19 | non_rect_texture_offset = Vector2(0, 0)
20 | non_rect_texture_scale = Vector2(1, 1)
21 | nine_patch_draw_center = true
22 | nine_patch_region_rect = Rect2(0, 0, 0, 0)
23 | nine_patch_patch_left = 0
24 | nine_patch_patch_right = 0
25 | nine_patch_patch_top = 0
26 | nine_patch_patch_bottom = 0
27 | nine_patch_axis_stretch_horizontal = 0
28 | nine_patch_axis_stretch_vertical = 0
29 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/dynamic_gdscript.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | var default_script_name_no_extension = 'gut_dynamic_script'
3 | var default_script_resource_path = 'res://addons/gut/not_a_real_file/'
4 |
5 | var _created_script_count = 0
6 |
7 |
8 | # Creates a loaded script from the passed in source. This loaded script is
9 | # returned unless there is an error. When an error occcurs the error number
10 | # is returned instead.
11 | func create_script_from_source(source, override_path=null):
12 | _created_script_count += 1
13 | var r_path = str(default_script_resource_path, default_script_name_no_extension, '_', _created_script_count)
14 | if(override_path != null):
15 | r_path = override_path
16 |
17 | var DynamicScript = GDScript.new()
18 | DynamicScript.source_code = source.dedent()
19 | # The resource_path must be unique or Godot thinks it is trying
20 | # to load something it has already loaded and generates an error like
21 | # ERROR: Another resource is loaded from path 'workaround for godot
22 | # issue #65263' (possible cyclic resource inclusion).
23 | DynamicScript.resource_path = r_path
24 | var result = DynamicScript.reload()
25 | if(result != OK):
26 | DynamicScript = result
27 |
28 | return DynamicScript
29 |
30 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_property_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 | @warning_ignore("unused_private_class_variable")
3 | var _property_1 := 1
4 | @warning_ignore("unused_private_class_variable")
5 | var _property_2
6 |
7 |
8 | func test_object_has_property_no_type():
9 | var results = PropertyUtil.has_property(self, "_property_1")
10 | assert_true(results)
11 |
12 |
13 | func test_object_has_property_with_type():
14 | var results = PropertyUtil.has_property(self, "_property_1", TYPE_INT)
15 | assert_true(results)
16 |
17 |
18 | func test_object_does_not_have_property_no_type():
19 | var results = PropertyUtil.has_property(self, "_property_x")
20 | assert_false(results)
21 |
22 |
23 | func test_object_does_not_have_property_with_type():
24 | var results = PropertyUtil.has_property(self, "_property_1", TYPE_BOOL)
25 | assert_false(results)
26 |
27 |
28 | func test_object_does_has_variant_property_no_type():
29 | var results = PropertyUtil.has_property(self, "_property_2")
30 | assert_true(results)
31 |
32 |
33 | func test_object_does_not_have_variant_property_with_type():
34 | var results = PropertyUtil.has_property(self, "_property_2", TYPE_FLOAT)
35 | assert_false(results)
36 |
37 |
38 |
--------------------------------------------------------------------------------
/helper_pack_project/.gut_editor_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "262626ff",
3 | "compact_mode": false,
4 | "config_file": "res://.gutconfig.json",
5 | "dirs": [
6 | "res://test/unit"
7 | ],
8 | "disable_colors": false,
9 | "double_strategy": 1,
10 | "errors_do_not_cause_failure": false,
11 | "font_color": "ccccccff",
12 | "font_name": "CourierPrime",
13 | "font_size": 16,
14 | "gut_on_top": true,
15 | "hide_orphans": false,
16 | "ignore_pause": false,
17 | "include_subdirs": true,
18 | "inner_class": null,
19 | "junit_xml_file": "",
20 | "junit_xml_timestamp": false,
21 | "log_level": 1,
22 | "opacity": 100,
23 | "paint_after": 0.1,
24 | "panel_options": {
25 | "font_name": "CourierPrime",
26 | "font_size": 30,
27 | "hide_output_text": false,
28 | "hide_result_tree": false,
29 | "hide_settings": false,
30 | "output_font_name": "CourierPrime",
31 | "output_font_size": 30,
32 | "use_colors": false
33 | },
34 | "post_run_script": "",
35 | "pre_run_script": "",
36 | "prefix": "test_",
37 | "selected": null,
38 | "should_exit": false,
39 | "should_exit_on_success": false,
40 | "should_maximize": false,
41 | "show_help": false,
42 | "suffix": ".gd",
43 | "tests": [],
44 | "unit_test_name": null
45 | }
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/one_to_many.gd:
--------------------------------------------------------------------------------
1 | # ------------------------------------------------------------------------------
2 | # This datastructure represents a simple one-to-many relationship. It manages
3 | # a dictionary of value/array pairs. It ignores duplicates of both the "one"
4 | # and the "many".
5 | # ------------------------------------------------------------------------------
6 | var _items = {}
7 |
8 | # return the size of _items or the size of an element in _items if "one" was
9 | # specified.
10 | func size(one=null):
11 | var to_return = 0
12 | if(one == null):
13 | to_return = _items.size()
14 | elif(_items.has(one)):
15 | to_return = _items[one].size()
16 | return to_return
17 |
18 | # Add an element to "one" if it does not already exist
19 | func add(one, many_item):
20 | if(_items.has(one) and !_items[one].has(many_item)):
21 | _items[one].append(many_item)
22 | else:
23 | _items[one] = [many_item]
24 |
25 | func clear():
26 | _items.clear()
27 |
28 | func has(one, many_item):
29 | var to_return = false
30 | if(_items.has(one)):
31 | to_return = _items[one].has(many_item)
32 | return to_return
33 |
34 | func to_s():
35 | var to_return = ''
36 | for key in _items:
37 | to_return += str(key, ": ", _items[key], "\n")
38 | return to_return
39 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/lazy_loader.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | # ------------------------------------------------------------------------------
3 | # Static
4 | # ------------------------------------------------------------------------------
5 | static var usage_counter = load('res://addons/gut/thing_counter.gd').new()
6 | static var WarningsManager = load('res://addons/gut/warnings_manager.gd')
7 |
8 | static func load_all():
9 | for key in usage_counter.things:
10 | key.get_loaded()
11 |
12 |
13 | static func print_usage():
14 | for key in usage_counter.things:
15 | print(key._path, ' (', usage_counter.things[key], ')')
16 |
17 |
18 | # ------------------------------------------------------------------------------
19 | # Class
20 | # ------------------------------------------------------------------------------
21 | var _loaded = null
22 | var _path = null
23 |
24 | func _init(path):
25 | _path = path
26 | usage_counter.add_thing_to_count(self)
27 |
28 |
29 | func get_loaded():
30 | if(_loaded == null):
31 | # if(ResourceLoader.has_cached(_path)):
32 | # print('---- already loaded ', _path, ' ----')
33 | # else:
34 | # print('---- loading ', _path, ' ----')
35 | _loaded = WarningsManager.load_script_ignoring_all_warnings(_path)
36 | usage_counter.add(self)
37 | return _loaded
38 |
39 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/audio/scene_sound_track.gd:
--------------------------------------------------------------------------------
1 | ## Used by a SoundTrackMgr node to map scenes to sound tracks. Add the
2 | ## scene paths to the scenes array and an AudioStreamPlayer as a child to
3 | ## this node.
4 | class_name SceneSoundTrack
5 | extends Node
6 |
7 |
8 | ## list of scenes to play soundtrack for
9 | @export var scenes: Array[PackedScene]
10 | ## Sound track plays automatically on start up. Best use case for this is
11 | ## if your game has only one sound track.
12 | @export var startup := false
13 |
14 |
15 | var _scene_names := []
16 |
17 |
18 | func _ready():
19 | for scene in scenes:
20 | _scene_names.append(scene.resource_path)
21 |
22 | if startup:
23 | _play_track()
24 |
25 |
26 | func _play_track() -> bool:
27 | for c in get_children():
28 | if c is AudioStreamPlayer or c is AudioStreamPlayer2D or c is AudioStreamPlayer3D:
29 | if !c.playing:
30 | c.play()
31 | return true
32 | return false
33 |
34 |
35 | func check_scene_and_play(file_path: String) -> bool:
36 | if !_scene_names.has(file_path):
37 | return false
38 | return _play_track()
39 |
40 | func stop() -> void:
41 | for c in get_children():
42 | if c is AudioStreamPlayer or c is AudioStreamPlayer2D or c is AudioStreamPlayer3D:
43 | if c.playing:
44 | c.stop()
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/2d/vector/test_vector2_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 | func test_equal():
4 | var v1 = Vector2(-0, -0)
5 | var v2 = Vector2(0, 0)
6 | var results = Vector2Util.equal(v1, v2)
7 | assert_true(results)
8 |
9 | func test_not_equal():
10 | var v1 = Vector2(-0, -0)
11 | var v2 = Vector2(1, 1)
12 | var results = Vector2Util.equal(v1, v2)
13 | assert_false(results)
14 |
15 |
16 | func test_vectors_left_vs_up():
17 | var results = Vector2Util.closest_angle_to(Vector2.LEFT, Vector2.UP)
18 | var rotated = Vector2.LEFT.rotated(results)
19 | assert_true(Vector2Util.equal(Vector2.UP, rotated))
20 |
21 |
22 | func test_vectors_left_vs_down():
23 | var results = Vector2Util.closest_angle_to(Vector2.LEFT, Vector2.DOWN)
24 | var rotated = Vector2.LEFT.rotated(results)
25 | assert_true(Vector2Util.equal(Vector2.DOWN, rotated))
26 |
27 |
28 | func test_vectors_up_vs_left():
29 | var results = Vector2Util.closest_angle_to(Vector2.UP, Vector2.LEFT)
30 | var rotated = Vector2.UP.rotated(results)
31 | assert_true(Vector2Util.equal(Vector2.LEFT, rotated))
32 |
33 |
34 | func test_vectors_down_vs_left():
35 | var results = Vector2Util.closest_angle_to(Vector2.DOWN, Vector2.LEFT)
36 | var rotated = Vector2.DOWN.rotated(results)
37 | assert_true(Vector2Util.equal(Vector2.LEFT, rotated))
38 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_string_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 | func test_non_empty_string_is_not_null_or_empty():
4 | var results = StringUtil.is_null_or_empty("not empty")
5 | assert_false(results)
6 |
7 |
8 | func test_empty_string_is_null_or_empty():
9 | var results = StringUtil.is_null_or_empty("")
10 | assert_true(results)
11 |
12 | func test_null_string_is_null_or_empty():
13 | @warning_ignore("unassigned_variable")
14 | var s : String
15 | var results = StringUtil.is_null_or_empty(s)
16 | assert_true(results)
17 |
18 | func test_get_file_name_with_actual_file_path():
19 | var file_path := "res://file.txt"
20 | var file_name = StringUtil.get_file_name(file_path)
21 | assert_eq("file", file_name)
22 |
23 | func test_get_file_name_with_empty_file_path():
24 | var file_path := ""
25 | var file_name = StringUtil.get_file_name(file_path)
26 | assert_eq("", file_name)
27 |
28 | func test_get_file_name_with_null_file_path():
29 | @warning_ignore("unassigned_variable")
30 | var file_path : String
31 | var file_name = StringUtil.get_file_name(file_path)
32 | assert_eq("", file_name)
33 |
34 | func test_get_file_name_from_path_with_no_extension():
35 | var file_path := "file_with_no_extension"
36 | var file_name = StringUtil.get_file_name(file_path)
37 | assert_eq(file_path, file_name)
38 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/UserFileViewer.gd:
--------------------------------------------------------------------------------
1 | extends Window
2 |
3 | @onready var rtl = $TextDisplay/RichTextLabel
4 |
5 | func _get_file_as_text(path):
6 | var to_return = null
7 | var f = FileAccess.open(path, FileAccess.READ)
8 | if(f != null):
9 | to_return = f.get_as_text()
10 | else:
11 | to_return = str('ERROR: Could not open file. Error code ', FileAccess.get_open_error())
12 | return to_return
13 |
14 | func _ready():
15 | rtl.clear()
16 |
17 | func _on_OpenFile_pressed():
18 | $FileDialog.popup_centered()
19 |
20 | func _on_FileDialog_file_selected(path):
21 | show_file(path)
22 |
23 | func _on_Close_pressed():
24 | self.hide()
25 |
26 | func show_file(path):
27 | var text = _get_file_as_text(path)
28 | if(text == ''):
29 | text = ''
30 | rtl.set_text(text)
31 | self.window_title = path
32 |
33 | func show_open():
34 | self.popup_centered()
35 | $FileDialog.popup_centered()
36 |
37 | func get_rich_text_label():
38 | return $TextDisplay/RichTextLabel
39 |
40 | func _on_Home_pressed():
41 | rtl.scroll_to_line(0)
42 |
43 | func _on_End_pressed():
44 | rtl.scroll_to_line(rtl.get_line_count() -1)
45 |
46 | func _on_Copy_pressed():
47 | return
48 | # OS.clipboard = rtl.text
49 |
50 | func _on_file_dialog_visibility_changed():
51 | if rtl.text.length() == 0 and not $FileDialog.visible:
52 | self.hide()
53 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/core/2d/camera/behavior/camera_behavior_demo.gd:
--------------------------------------------------------------------------------
1 | extends Node2D
2 |
3 | var _camera_limits := [
4 | Rect2(Vector2(-2000, -2000), Vector2(4000, 4000)),
5 | Rect2(Vector2(-2000, -2000), Vector2(2000, 2000)),
6 | Rect2(Vector2(0, -2000), Vector2(2000, 2000)),
7 | Rect2(Vector2(0, 0), Vector2(2000, 2000)),
8 | Rect2(Vector2(-2000, 0), Vector2(2000, 2000))
9 | ]
10 | var _camera_limits_descrition := [
11 | "All regions",
12 | "Red region",
13 | "Green region",
14 | "Yellow region",
15 | "Blue region"
16 | ]
17 | var _current_camera_limit := 0
18 |
19 | @onready var limit_region_desc_value := $CanvasLayer/MarginContainer/VBoxContainer/LimitRegionHBox/LimitRegionDescValue
20 |
21 | func _ready():
22 | _update_limit_region_desc_lbl()
23 |
24 | func _update_limit_region_desc_lbl():
25 | limit_region_desc_value.text = _camera_limits_descrition[_current_camera_limit]
26 |
27 | func _on_ShakeCameraBtn_pressed():
28 | var camera_shake:CameraShake2D = ServiceMgr.get_service(CameraShake2D)
29 | if !camera_shake:
30 | return
31 | camera_shake.shake_camera(1, 1.0, 15.0)
32 |
33 |
34 | func _on_LimitCameraBtn_pressed():
35 | _current_camera_limit = (_current_camera_limit + 1) % _camera_limits.size()
36 | var camera_limiter:CameraLimiter2D = ServiceMgr.get_service(CameraLimiter2D)
37 | if camera_limiter:
38 | camera_limiter.limit_camera(_camera_limits[_current_camera_limit])
39 | _update_limit_region_desc_lbl()
40 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/audio/sound_track_mgr.gd:
--------------------------------------------------------------------------------
1 | ## Changes what sound track is played based on what the current scene is.
2 | ## To configure what scenes go with what sound tracks, add SceneSoundTrack nodes
3 | ## as children.
4 | ## Please see wiki page for more instructions:
5 | ## https://github.com/jhlothamer/godot_helper_pack/wiki/SoundTrackMgr,-SceneSoundTrack
6 |
7 | class_name SoundTrackMgr
8 | extends Node
9 |
10 |
11 | var _current_scene_sound_track:SceneSoundTrack = null
12 |
13 |
14 | func _ready():
15 | var _results = get_tree().node_added.connect(_on_node_added)
16 | var current_scene = get_tree().get_current_scene()
17 | _on_node_added(current_scene)
18 |
19 |
20 | func _on_node_added(node : Node):
21 | if node.get_parent() != get_tree().root or node.scene_file_path.is_empty():
22 | return
23 | _play_scene(node.scene_file_path)
24 |
25 |
26 | func _play_scene(file_path: String) -> void:
27 | for child in get_children():
28 | if !child is SceneSoundTrack:
29 | continue
30 | var sceneSoundTrack:SceneSoundTrack = child
31 | if sceneSoundTrack.check_scene_and_play(file_path):
32 | if _current_scene_sound_track != sceneSoundTrack:
33 | if _current_scene_sound_track != null:
34 | _current_scene_sound_track.stop()
35 | _current_scene_sound_track = sceneSoundTrack
36 | return
37 | if _current_scene_sound_track != null:
38 | _current_scene_sound_track.stop()
39 | _current_scene_sound_track = null
40 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/shape/shape2d_util.gd:
--------------------------------------------------------------------------------
1 | class_name Shape2DUtil
2 | extends Object
3 |
4 |
5 | static func make_polygon_from_shape(shape2d: Shape2D, point_count:int = 100) -> Array:
6 | var polygon: Array
7 |
8 | if !shape2d:
9 | printerr("shape2d is null.")
10 | elif shape2d is RectangleShape2D:
11 | var rs:RectangleShape2D = shape2d
12 | var rect := Rect2(-1.0*rs.extents, 2.0*rs.extents)
13 | polygon = Rect2Util.make_polygon(rect)
14 | elif shape2d is CircleShape2D:
15 | var cs: CircleShape2D = shape2d
16 | var a := 2.0*PI/float(point_count)
17 | var v := Vector2.RIGHT*cs.radius
18 | for i in range(point_count):
19 | polygon.append(v)
20 | v = v.rotated(a)
21 | elif shape2d is ConvexPolygonShape2D:
22 | var cps:ConvexPolygonShape2D = shape2d
23 | polygon = cps.points
24 | elif shape2d is ConcavePolygonShape2D:
25 | var cps:ConcavePolygonShape2D = shape2d
26 | polygon = cps.segments
27 | elif shape2d is CapsuleShape2D:
28 | var cs:CapsuleShape2D = shape2d
29 | var a := 2.0*PI/float(point_count)
30 | var v := Vector2.RIGHT*cs.radius
31 | var c1center := Vector2.UP*(cs.height/2.0)
32 | var c2center := -1.0*c1center
33 | var pts := []
34 | for i in range(point_count):
35 | pts.append(v+c1center)
36 | pts.append(v+c2center)
37 | v = v.rotated(a)
38 | polygon = Geometry2D.convex_hull(pts)
39 | else:
40 | printerr("Unhandled shape 2d class: %s" % shape2d.get_class())
41 | return polygon
42 |
43 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/compare_result.gd:
--------------------------------------------------------------------------------
1 | var _are_equal = false
2 | var are_equal = false :
3 | get:
4 | return get_are_equal()
5 | set(val):
6 | set_are_equal(val)
7 |
8 | var _summary = null
9 | var summary = null :
10 | get:
11 | return get_summary()
12 | set(val):
13 | set_summary(val)
14 |
15 | var _max_differences = 30
16 | var max_differences = 30 :
17 | get:
18 | return get_max_differences()
19 | set(val):
20 | set_max_differences(val)
21 |
22 | var _differences = {}
23 | var differences :
24 | get:
25 | return get_differences()
26 | set(val):
27 | set_differences(val)
28 |
29 | func _block_set(which, val):
30 | push_error(str('cannot set ', which, ', value [', val, '] ignored.'))
31 |
32 | func _to_string():
33 | return str(get_summary()) # could be null, gotta str it.
34 |
35 | func get_are_equal():
36 | return _are_equal
37 |
38 | func set_are_equal(r_eq):
39 | _are_equal = r_eq
40 |
41 | func get_summary():
42 | return _summary
43 |
44 | func set_summary(smry):
45 | _summary = smry
46 |
47 | func get_total_count():
48 | pass
49 |
50 | func get_different_count():
51 | pass
52 |
53 | func get_short_summary():
54 | return summary
55 |
56 | func get_max_differences():
57 | return _max_differences
58 |
59 | func set_max_differences(max_diff):
60 | _max_differences = max_diff
61 |
62 | func get_differences():
63 | return _differences
64 |
65 | func set_differences(diffs):
66 | _block_set('differences', diffs)
67 |
68 | func get_brackets():
69 | return null
70 |
71 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/hook_script.gd:
--------------------------------------------------------------------------------
1 | class_name GutHookScript
2 | # ------------------------------------------------------------------------------
3 | # This script is the base for custom scripts to be used in pre and post
4 | # run hooks.
5 | #
6 | # To use, inherit from this script and then implement the run method.
7 | # ------------------------------------------------------------------------------
8 | var JunitXmlExport = load('res://addons/gut/junit_xml_export.gd')
9 |
10 | # This is the instance of GUT that is running the tests. You can get
11 | # information about the run from this object. This is set by GUT when the
12 | # script is instantiated.
13 | var gut = null
14 |
15 | # the exit code to be used by gut_cmdln. See set method.
16 | var _exit_code = null
17 |
18 | var _should_abort = false
19 |
20 | # Virtual method that will be called by GUT after instantiating
21 | # this script.
22 | func run():
23 | gut.logger.error("Run method not overloaded. Create a 'run()' method in your hook script to run your code.")
24 |
25 |
26 | # Set the exit code when running from the command line. If not set then the
27 | # default exit code will be returned (0 when no tests fail, 1 when any tests
28 | # fail).
29 | func set_exit_code(code):
30 | _exit_code = code
31 |
32 | func get_exit_code():
33 | return _exit_code
34 |
35 | # Usable by pre-run script to cause the run to end AFTER the run() method
36 | # finishes. post-run script will not be ran.
37 | func abort():
38 | _should_abort = true
39 |
40 | func should_abort():
41 | return _should_abort
42 |
--------------------------------------------------------------------------------
/helper_pack_project/demos/sound_track_mgr_demo.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=7 format=3 uid="uid://cvg6kb2l63uli"]
2 |
3 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/audio/sound_track_mgr.gd" id="1_qm8hl"]
4 | [ext_resource type="Script" path="res://addons/godot_helper_pack/core/audio/scene_sound_track.gd" id="2_8cfom"]
5 | [ext_resource type="PackedScene" uid="uid://triot0nlbp4e" path="res://demos/demos.tscn" id="3_wa1ml"]
6 | [ext_resource type="AudioStream" uid="uid://cnhvhmdchjq7b" path="res://demos/578066__sirplus__rainbowglazeloop16_mastered.ogg" id="3_yich8"]
7 | [ext_resource type="PackedScene" uid="uid://bnfkin76nori6" path="res://demos/core/audio/audio_demo.tscn" id="5_guhl7"]
8 | [ext_resource type="AudioStream" uid="uid://c2rsg37jfdvh0" path="res://demos/402739__sirplus__actionscaryfunloop32.ogg" id="6_xbo3x"]
9 |
10 | [node name="sound_track_mgr_demo" type="Node"]
11 | script = ExtResource("1_qm8hl")
12 |
13 | [node name="DemosSceneSoundTrack" type="Node" parent="."]
14 | script = ExtResource("2_8cfom")
15 | scenes = Array[PackedScene]([ExtResource("3_wa1ml")])
16 |
17 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="DemosSceneSoundTrack"]
18 | stream = ExtResource("3_yich8")
19 | volume_db = -18.0
20 |
21 | [node name="AudioDemoSceneSoundTrack" type="Node" parent="."]
22 | script = ExtResource("2_8cfom")
23 | scenes = Array[PackedScene]([ExtResource("5_guhl7")])
24 |
25 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="AudioDemoSceneSoundTrack"]
26 | stream = ExtResource("6_xbo3x")
27 | volume_db = -18.0
28 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/util/test_file_util.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 |
4 | func test_load_text_with_non_existent_file():
5 | var results = FileUtil.load_text("res://non_existent.txt")
6 | assert_eq(results, "")
7 |
8 |
9 | func test_load_text_returns_correct_string():
10 | var results = FileUtil.load_text("res://test/files/test.txt")
11 | var expected = "Lorem ipsum dolor sit amet"
12 | results = results.left(expected.length())
13 | assert_eq(results, expected)
14 |
15 |
16 | func test_load_json_data_with_non_existent_file():
17 | var results = FileUtil.load_json_data("res://non_existent.json")
18 | assert_not_null(results)
19 | assert_eq(results.size(), 0)
20 |
21 |
22 | func test_load_json_data_returns_correct_data():
23 | var results = FileUtil.load_json_data("res://test/files/test.json")
24 | assert_not_null(results)
25 | assert_eq(results.size(), 1)
26 | assert_true(results.has("Lorem"))
27 | assert_eq(results["Lorem"], "ipsum")
28 |
29 |
30 | func test_save_load_var_data_vector2():
31 | var data = {
32 | "sub_dictionary": {
33 | "vector2": Vector2.ONE
34 | }
35 | }
36 | var save_load_test_file = "res://test/files/test_var_data_vector2.json"
37 | FileUtil.save_var_data(save_load_test_file, data)
38 | var results = FileUtil.load_var_data(save_load_test_file)
39 | assert_true(results is Dictionary)
40 | assert_true(results.has("sub_dictionary"))
41 | assert_true(results["sub_dictionary"] is Dictionary)
42 | assert_true(results["sub_dictionary"].has("vector2"))
43 | assert_true(results["sub_dictionary"]["vector2"] is Vector2)
44 |
45 |
46 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/yield_util.gd:
--------------------------------------------------------------------------------
1 | # Replacement for GDScriptFunctionState that no longer exists in Godot 4.
2 | # How does it work?
3 | # 1. create an instance giving it the Callable to call
4 | # 2. call the run function, passing in any arguments as an array
5 | # 3. call is_completed() to see if the function has already completed
6 | # If this is already true - then the Callable didn't await - which may or may not be an error
7 | # 4. await on completed signal (but only if not already completed - see step 3)
8 | # 5. Check if there was an error by calling success()
9 | # 6. If successful then obtain the results by calling get_results()
10 | # If no return value was returned, this will be null
11 | class_name Yield
12 | extends RefCounted
13 |
14 | signal completed()
15 |
16 |
17 | var _coroutine: Callable
18 | var _results
19 | var _success := false
20 | var _is_completed := false
21 |
22 |
23 | func _init(coroutine: Callable) -> void:
24 | _coroutine = coroutine
25 |
26 |
27 | func run(arguments: Array = []) -> void:
28 | _success = false
29 | _is_completed = false
30 | _results = null
31 |
32 | var error_check_value = await _inner_run(arguments)
33 |
34 | if error_check_value == 1:
35 | _success = true
36 |
37 | completed.emit()
38 | _is_completed = true
39 |
40 |
41 | func _inner_run(arguments: Array):
42 | _results = await _coroutine.callv(arguments)
43 | return 1
44 |
45 |
46 | func get_results():
47 | return _results
48 |
49 |
50 | func success() -> bool:
51 | return _success
52 |
53 |
54 | func is_completed() -> bool:
55 | return _is_completed
56 |
57 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/file_util.gd:
--------------------------------------------------------------------------------
1 | class_name FileUtil
2 | extends Object
3 |
4 |
5 | static func load_text(file_path: String, default_value: String = "") -> String:
6 | var data_file := FileAccess.open(file_path, FileAccess.READ)
7 | if !data_file:
8 | return default_value
9 | var contents = data_file.get_as_text()
10 | data_file.close()
11 | return contents
12 |
13 |
14 | static func save_text(file_path: String, contents: String) -> bool:
15 | var data_file := FileAccess.open(file_path, FileAccess.WRITE)
16 | if !data_file:
17 | data_file.close()
18 | return false
19 | data_file.store_string(contents)
20 | data_file.close()
21 | return true
22 |
23 |
24 | static func load_json_data(file_path: String, default_value = {}) -> Dictionary:
25 | var json_text = load_text(file_path)
26 | if json_text == "":
27 | return default_value
28 | var test_json_conv = JSON.new()
29 | if OK != test_json_conv.parse(json_text):
30 | print("error parsing data: %s" % test_json_conv.get_error_message())
31 | print(test_json_conv.get_error_line())
32 | return default_value
33 | return test_json_conv.data
34 |
35 |
36 | static func save_json_data(file_path: String, data: Dictionary, delim: String = "") -> void:
37 | var json_string = JSON.stringify(data, delim)
38 | save_text(file_path, json_string)
39 |
40 |
41 | static func load_var_data(file_path: String):
42 | var text_data = load_text(file_path)
43 | if text_data == null:
44 | return text_data
45 | return str_to_var(text_data)
46 |
47 |
48 | static func save_var_data(file_path, data) -> void:
49 | var data_string = var_to_str(data)
50 | save_text(file_path, data_string)
51 |
52 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Looking for a version for Godot 3.x? Look at [this repo](https://github.com/jhlothamer/godot_helper_pack_3)
2 | # Godot Helper Pack (For Godot 4.x)
3 | This Godot Engine add-on is a collection of helper scripts and classes. Please see below for a list of classes and utilities for details.
4 |
5 |
6 | ## How to Install
7 | 1. Download the project zip file and unzip it.
8 | 2. Copy the folder godot_helper_pack\helper_pack_project\addons\godot_helper_pack into the addons folder of your Godot project
9 | 3. Go to the Plugins tab in the Project Settings of your Godot project and enable the GodotHelperPack plugin.
10 |
11 | Now all of the classes and utilities will be available for use. Also, after enabling the plugin 3 Autoload Singletons will be registered under the Autoload tab in Project Settings. These are Globals, SignalMgr and ServiceMgr. Please see their description of these services below.
12 |
13 |
14 | ## Classes and Utilities
15 |
16 | Please see the [repo wiki](https://github.com/jhlothamer/godot_helper_pack/wiki) for a list of classes and utilities.
17 |
18 |
19 | ## Credits
20 | The demo for this addon uses these sounds from freesound:
21 | "RainbowGlazeLoop16_mastered.wav" by sirplus ( http://freesound.org/s/578066/ ) licensed under CC0
22 | "ActionScaryFunLoop32.wav" by sirplus ( http://freesound.org/s/402739/ ) licensed under CC0
23 | Note: wav files have been converted to ogg to save file space. No other changes have been made.
24 |
25 | ## Support
26 | If you would like to support my development work to maintain this and other such projects you can do so at
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/state_machine/test_state_machine.gd:
--------------------------------------------------------------------------------
1 | extends GutTest
2 |
3 | var state_class
4 | var state_machine
5 |
6 | func before_each():
7 | if state_class == null:
8 | state_class = load("res://test/unit/core/state_machine/a.gd")
9 | if state_machine != null:
10 | remove_child(state_machine)
11 | state_machine.queue_free()
12 |
13 | state_machine = StateMachine.new()
14 | var a: State = state_class.new()
15 | a.name = "A"
16 | a.is_starting_state = true
17 | state_machine.add_child(a)
18 | var b: State = state_class.new()
19 | b.name = "B"
20 | state_machine.add_child(b)
21 |
22 | add_child(state_machine)
23 | emit_signal("ready")
24 |
25 | func after_each():
26 | state_machine.queue_free()
27 |
28 |
29 | func test_initial_state_functions_called():
30 | var a = state_machine.get_node("A")
31 | gut.simulate(state_machine, 1, .1)
32 | assert_true(a.init_called)
33 | assert_true(a.enter_called)
34 | assert_false(a.exit_called)
35 | assert_true(a.physics_process_called)
36 | var b = state_machine.get_node("B")
37 | assert_true(b.init_called)
38 | assert_false(b.enter_called)
39 | assert_false(b.exit_called)
40 | assert_false(b.physics_process_called)
41 |
42 | func test_transition_to_state_b():
43 | var a = state_machine.get_node("A")
44 | a.change_to_state = "B"
45 | gut.simulate(state_machine, 1, .1)
46 | assert_true(a.init_called)
47 | assert_true(a.enter_called)
48 | assert_true(a.exit_called)
49 | assert_true(a.physics_process_called)
50 | var b = state_machine.get_node("B")
51 | assert_true(b.init_called)
52 | assert_true(b.enter_called)
53 | assert_false(b.exit_called)
54 | assert_false(b.physics_process_called)
55 | gut.simulate(state_machine, 1, .1)
56 | assert_true(b.physics_process_called)
57 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_limiter.gd:
--------------------------------------------------------------------------------
1 | ## The is node will set the limits on it's parent Camera2D. There are two ways to do this.
2 | ## One is to set the Limit Reference Rect property to a ReferenceRect node.
3 | ## The other is to obtain a reference to the CameraLimiter2D service and call the limit_camera() function.
4 | @tool
5 | class_name CameraLimiter2D
6 | extends Node
7 |
8 | ## A ReferenceRect node that defines the limit rectangle.
9 | ## This is used to set the parent Camera2D's limits when the scene is loaded.
10 | @export var limit_reference_rect: ReferenceRect
11 |
12 |
13 | var _camera: Camera2D
14 |
15 |
16 | func _enter_tree():
17 | if Engine.is_editor_hint():
18 | return
19 | ServiceMgr.register_service(CameraLimiter2D, self)
20 |
21 |
22 | func _ready():
23 | if Engine.is_editor_hint():
24 | return
25 | var parent = get_parent()
26 | if parent is Camera2D:
27 | _camera = parent
28 | if limit_reference_rect:
29 | var limit_rect := Rect2(limit_reference_rect.global_position, limit_reference_rect.size)
30 | limit_camera(limit_rect)
31 |
32 |
33 | func _get_configuration_warnings() -> PackedStringArray:
34 | var warnings = []
35 | if !get_parent() is Camera2D:
36 | warnings = ['CameraLimiter2D must be child of Camera2D']
37 | return warnings
38 |
39 |
40 | ## Sets the limit properties of the parent Camera2D.
41 | ## Use this function to set the limit after the scene has already loaded.
42 | func limit_camera(limit_rect: Rect2) -> void:
43 | if !_camera:
44 | return
45 | _camera.limit_left = int(limit_rect.position.x)
46 | _camera.limit_top = int(limit_rect.position.y)
47 | _camera.limit_right = int(limit_rect.end.x)
48 | _camera.limit_bottom = int(limit_rect.end.y)
49 | _camera.align()
50 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/diff_formatter.gd:
--------------------------------------------------------------------------------
1 | var _strutils = GutUtils.Strutils.new()
2 | const INDENT = ' '
3 | var _max_to_display = 30
4 | const ABSOLUTE_MAX_DISPLAYED = 10000
5 | const UNLIMITED = -1
6 |
7 |
8 | func _single_diff(diff, depth=0):
9 | var to_return = ""
10 | var brackets = diff.get_brackets()
11 |
12 | if(brackets != null and !diff.are_equal):
13 | to_return = ''
14 | to_return += str(brackets.open, "\n",
15 | _strutils.indent_text(differences_to_s(diff.differences, depth), depth+1, INDENT), "\n",
16 | brackets.close)
17 | else:
18 | to_return = str(diff)
19 |
20 | return to_return
21 |
22 |
23 | func make_it(diff):
24 | var to_return = ''
25 | if(diff.are_equal):
26 | to_return = diff.summary
27 | else:
28 | if(_max_to_display == ABSOLUTE_MAX_DISPLAYED):
29 | to_return = str(diff.get_value_1(), ' != ', diff.get_value_2())
30 | else:
31 | to_return = diff.get_short_summary()
32 | to_return += str("\n", _strutils.indent_text(_single_diff(diff, 0), 1, ' '))
33 | return to_return
34 |
35 |
36 | func differences_to_s(differences, depth=0):
37 | var to_return = ''
38 | var keys = differences.keys()
39 | keys.sort()
40 | var limit = min(_max_to_display, differences.size())
41 |
42 | for i in range(limit):
43 | var key = keys[i]
44 | to_return += str(key, ": ", _single_diff(differences[key], depth))
45 |
46 | if(i != limit -1):
47 | to_return += "\n"
48 |
49 | if(differences.size() > _max_to_display):
50 | to_return += str("\n\n... ", differences.size() - _max_to_display, " more.")
51 |
52 | return to_return
53 |
54 |
55 | func get_max_to_display():
56 | return _max_to_display
57 |
58 |
59 | func set_max_to_display(max_to_display):
60 | _max_to_display = max_to_display
61 | if(_max_to_display == UNLIMITED):
62 | _max_to_display = ABSOLUTE_MAX_DISPLAYED
63 |
64 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/inner_class_registry.gd:
--------------------------------------------------------------------------------
1 | var _registry = {}
2 |
3 |
4 | func _create_reg_entry(base_path, subpath):
5 | var to_return = {
6 | "base_path":base_path,
7 | "subpath":subpath,
8 | "base_resource":load(base_path),
9 | "full_path":str("'", base_path, "'", subpath)
10 | }
11 | return to_return
12 |
13 | func _register_inners(base_path, obj, prev_inner = ''):
14 | var const_map = obj.get_script_constant_map()
15 | var consts = const_map.keys()
16 | var const_idx = 0
17 |
18 | while(const_idx < consts.size()):
19 | var key = consts[const_idx]
20 | var thing = const_map[key]
21 |
22 | if(typeof(thing) == TYPE_OBJECT):
23 | var cur_inner = str(prev_inner, ".", key)
24 | _registry[thing] = _create_reg_entry(base_path, cur_inner)
25 | _register_inners(base_path, thing, cur_inner)
26 |
27 | const_idx += 1
28 |
29 |
30 | func register(base_script):
31 | var base_path = base_script.resource_path
32 | _register_inners(base_path, base_script)
33 |
34 |
35 | func get_extends_path(inner_class):
36 | if(_registry.has(inner_class)):
37 | return _registry[inner_class].full_path
38 | else:
39 | return null
40 |
41 | # returns the subpath for the inner class. This includes the leading "." in
42 | # the path.
43 | func get_subpath(inner_class):
44 | if(_registry.has(inner_class)):
45 | return _registry[inner_class].subpath
46 | else:
47 | return ''
48 |
49 | func get_base_path(inner_class):
50 | if(_registry.has(inner_class)):
51 | return _registry[inner_class].base_path
52 |
53 |
54 | func has(inner_class):
55 | return _registry.has(inner_class)
56 |
57 |
58 | func get_base_resource(inner_class):
59 | if(_registry.has(inner_class)):
60 | return _registry[inner_class].base_resource
61 |
62 |
63 | func to_s():
64 | var text = ""
65 | for key in _registry:
66 | text += str(key, ": ", _registry[key], "\n")
67 | return text
68 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/ShortcutButton.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://sfb1fw8j6ufu"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/ShortcutButton.gd" id="1"]
4 |
5 | [node name="ShortcutButton" type="Control"]
6 | custom_minimum_size = Vector2(210, 30)
7 | layout_mode = 3
8 | anchor_right = 0.123
9 | anchor_bottom = 0.04
10 | offset_right = 68.304
11 | offset_bottom = 6.08
12 | script = ExtResource("1")
13 |
14 | [node name="Layout" type="HBoxContainer" parent="."]
15 | layout_mode = 0
16 | anchor_right = 1.0
17 | anchor_bottom = 1.0
18 |
19 | [node name="lblShortcut" type="Label" parent="Layout"]
20 | layout_mode = 2
21 | size_flags_horizontal = 3
22 | size_flags_vertical = 7
23 | text = ""
24 | horizontal_alignment = 2
25 |
26 | [node name="CenterContainer" type="CenterContainer" parent="Layout"]
27 | custom_minimum_size = Vector2(10, 0)
28 | layout_mode = 2
29 |
30 | [node name="SetButton" type="Button" parent="Layout"]
31 | custom_minimum_size = Vector2(60, 0)
32 | layout_mode = 2
33 | text = "Set"
34 |
35 | [node name="SaveButton" type="Button" parent="Layout"]
36 | visible = false
37 | custom_minimum_size = Vector2(60, 0)
38 | layout_mode = 2
39 | text = "Save"
40 |
41 | [node name="CancelButton" type="Button" parent="Layout"]
42 | visible = false
43 | custom_minimum_size = Vector2(60, 0)
44 | layout_mode = 2
45 | text = "Cancel"
46 |
47 | [node name="ClearButton" type="Button" parent="Layout"]
48 | custom_minimum_size = Vector2(60, 0)
49 | layout_mode = 2
50 | text = "Clear"
51 |
52 | [connection signal="pressed" from="Layout/SetButton" to="." method="_on_SetButton_pressed"]
53 | [connection signal="pressed" from="Layout/SaveButton" to="." method="_on_SaveButton_pressed"]
54 | [connection signal="pressed" from="Layout/CancelButton" to="." method="_on_CancelButton_pressed"]
55 | [connection signal="pressed" from="Layout/ClearButton" to="." method="_on_ClearButton_pressed"]
56 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/editor_globals.gd:
--------------------------------------------------------------------------------
1 | @tool
2 |
3 | static var GutUserPreferences = load("res://addons/gut/gui/gut_user_preferences.gd")
4 | static var temp_directory = 'user://gut_temp_directory'
5 |
6 | static var editor_run_gut_config_path = 'gut_editor_config.json':
7 | # This avoids having to use path_join wherever we want to reference this
8 | # path. The value is not supposed to change. Could it be a constant
9 | # instead? Probably, but I didn't like repeating the directory part.
10 | # Do I like that this is a bit witty. Absolutely.
11 | get: return temp_directory.path_join(editor_run_gut_config_path)
12 | # Should this print a message or something instead? Probably, but then I'd
13 | # be repeating even more code than if this was just a constant. So I didn't,
14 | # even though I wanted to put make the message a easter eggish fun message.
15 | # I didn't, so this dumb comment will have to serve as the easter eggish fun.
16 | set(v): pass
17 |
18 |
19 | static var editor_run_bbcode_results_path = 'gut_editor.bbcode':
20 | get: return temp_directory.path_join(editor_run_bbcode_results_path)
21 | set(v): pass
22 |
23 |
24 | static var editor_run_json_results_path = 'gut_editor.json':
25 | get: return temp_directory.path_join(editor_run_json_results_path)
26 | set(v): pass
27 |
28 |
29 | static var editor_shortcuts_path = 'gut_editor_shortcuts.cfg' :
30 | get: return temp_directory.path_join(editor_shortcuts_path)
31 | set(v): pass
32 |
33 |
34 | static var _user_prefs = null
35 | static var user_prefs = _user_prefs :
36 | # workaround not being able to reference EditorInterface when not in
37 | # the editor. This shouldn't be referenced by anything not in the
38 | # editor.
39 | get:
40 | if(_user_prefs == null and Engine.is_editor_hint()):
41 | _user_prefs = GutUserPreferences.new(EditorInterface.get_editor_settings())
42 | return _user_prefs
43 |
44 |
45 | static func create_temp_directory():
46 | DirAccess.make_dir_recursive_absolute(temp_directory)
47 |
48 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gut_plugin.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorPlugin
3 |
4 | var _bottom_panel = null
5 |
6 | func _version_conversion():
7 | var EditorGlobals = load("res://addons/gut/gui/editor_globals.gd")
8 | EditorGlobals.create_temp_directory()
9 |
10 | var VersionConversion = load("res://addons/gut/version_conversion.gd")
11 | VersionConversion.convert()
12 |
13 | func _enter_tree():
14 | _version_conversion()
15 |
16 | _bottom_panel = preload('res://addons/gut/gui/GutBottomPanel.tscn').instantiate()
17 |
18 | var button = add_control_to_bottom_panel(_bottom_panel, 'GUT')
19 | button.shortcut_in_tooltip = true
20 |
21 | # ---------
22 | # I removed this delay because it was causing issues with the shortcut button.
23 | # The shortcut button wouldn't work right until load_shortcuts is called., but
24 | # the delay gave you 3 seconds to click it before they were loaded. This
25 | # await came with the conversion to 4 and probably isn't needed anymore.
26 | # I'm leaving it here becuase I don't know why it showed up to begin with
27 | # and if it's needed, it will be pretty hard to debug without seeing this.
28 | #
29 | # This should be deleted after the next release or two if not needed.
30 | # await get_tree().create_timer(3).timeout
31 | # ---
32 | _bottom_panel.set_interface(get_editor_interface())
33 | _bottom_panel.set_plugin(self)
34 | _bottom_panel.set_panel_button(button)
35 | _bottom_panel.load_shortcuts()
36 |
37 |
38 | func _exit_tree():
39 | # Clean-up of the plugin goes here
40 | # Always remember to remove_at it from the engine when deactivated
41 | remove_control_from_bottom_panel(_bottom_panel)
42 | _bottom_panel.free()
43 |
44 |
45 | # This seems like a good idea at first, but it deletes the settings for ALL
46 | # projects. If by chance you want to do that you can uncomment this, reload the
47 | # project and then disable GUT.
48 | # func _disable_plugin():
49 | # var GutEditorGlobals = load('res://addons/gut/gui/editor_globals.gd')
50 | # GutEditorGlobals.user_prefs.erase_all()
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/GutControl.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://4jb53yqktyfg"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/GutControl.gd" id="1_eprql"]
4 |
5 | [node name="GutControl" type="Control"]
6 | layout_mode = 3
7 | anchors_preset = 0
8 | offset_right = 295.0
9 | offset_bottom = 419.0
10 | script = ExtResource("1_eprql")
11 |
12 | [node name="Bg" type="ColorRect" parent="."]
13 | layout_mode = 1
14 | anchors_preset = 15
15 | anchor_right = 1.0
16 | anchor_bottom = 1.0
17 | grow_horizontal = 2
18 | grow_vertical = 2
19 | color = Color(0.36, 0.36, 0.36, 1)
20 |
21 | [node name="VBox" type="VBoxContainer" parent="."]
22 | layout_mode = 1
23 | anchors_preset = 15
24 | anchor_right = 1.0
25 | anchor_bottom = 1.0
26 | grow_horizontal = 2
27 | grow_vertical = 2
28 |
29 | [node name="Tabs" type="TabContainer" parent="VBox"]
30 | layout_mode = 2
31 | size_flags_vertical = 3
32 |
33 | [node name="Tests" type="Tree" parent="VBox/Tabs"]
34 | layout_mode = 2
35 | size_flags_vertical = 3
36 | hide_root = true
37 |
38 | [node name="SettingsScroll" type="ScrollContainer" parent="VBox/Tabs"]
39 | visible = false
40 | layout_mode = 2
41 | size_flags_vertical = 3
42 |
43 | [node name="Settings" type="VBoxContainer" parent="VBox/Tabs/SettingsScroll"]
44 | layout_mode = 2
45 | size_flags_horizontal = 3
46 | size_flags_vertical = 3
47 |
48 | [node name="Buttons" type="HBoxContainer" parent="VBox"]
49 | layout_mode = 2
50 |
51 | [node name="RunTests" type="Button" parent="VBox/Buttons"]
52 | layout_mode = 2
53 | size_flags_horizontal = 3
54 | text = "Run All"
55 |
56 | [node name="RunSelected" type="Button" parent="VBox/Buttons"]
57 | layout_mode = 2
58 | size_flags_horizontal = 3
59 | text = "Run Selected"
60 |
61 | [connection signal="item_activated" from="VBox/Tabs/Tests" to="." method="_on_tests_item_activated"]
62 | [connection signal="pressed" from="VBox/Buttons/RunTests" to="." method="_on_run_tests_pressed"]
63 | [connection signal="pressed" from="VBox/Buttons/RunSelected" to="." method="_on_run_selected_pressed"]
64 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/3d/camera/camera3d_move.gd:
--------------------------------------------------------------------------------
1 | class_name Camera3DMove
2 | extends Node
3 |
4 |
5 | @export_range(.1, 5) var move_speed: float = .1
6 | @export var mouse_sensitivity := 1.5
7 | @export var invert_mouse_y := false
8 | @export var forward_action_name := "ui_up"
9 | @export var back_action_name := "ui_down"
10 | @export var strafe_left_action_name := "ui_left"
11 | @export var strafe_right_action_name := "ui_right"
12 | @export var fly := false
13 | @export var up_action_name := "ui_page_up"
14 | @export var down_action_name := "ui_page_down"
15 |
16 |
17 | @onready var _camera: Camera3D = get_parent()
18 |
19 |
20 | func _ready():
21 | if !_camera:
22 | printerr("Camera3DMove: parent must be Camera3D")
23 | queue_free()
24 |
25 |
26 | func _input(event):
27 | if !event is InputEventMouseMotion:
28 | return
29 | var mm:InputEventMouseMotion = event
30 | var y_deg = rad_to_deg(_camera.rotation.y)
31 | y_deg -= mm.relative.x * mouse_sensitivity / 10.0
32 | #_camera.rotate_y(deg_to_rad(-mm.relative.x * mouse_sensitivity / 10.0))
33 | _camera.rotation.y = deg_to_rad(y_deg)
34 | var factor := 1.0 if invert_mouse_y else -1.0
35 | var x_deg = rad_to_deg(_camera.rotation.x)
36 | x_deg = clamp(x_deg + factor*mm.relative.y * mouse_sensitivity/10.0, -70.0, 70.0)
37 | _camera.rotation.x = deg_to_rad(x_deg)
38 | #_camera.rotate_z(deg_to_rad(x_deg) - _camera.rotation.z)
39 |
40 |
41 | func _physics_process(_delta):
42 | var h_rot = _camera.rotation.y
43 | var f_input = Input.get_action_strength(back_action_name) - Input.get_action_strength(forward_action_name)
44 | var h_input = Input.get_action_strength(strafe_right_action_name) - Input.get_action_strength(strafe_left_action_name)
45 | var v_input = Input.get_action_strength(up_action_name) - Input.get_action_strength(down_action_name)
46 | if f_input == 0 and h_input == 0 and v_input == 0:
47 | return
48 | var direction = Vector3(h_input, v_input, f_input).rotated(Vector3.UP, h_rot).normalized()
49 | _camera.global_translate(direction * move_speed)
50 |
51 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/util/mover_2d.gd:
--------------------------------------------------------------------------------
1 | ## This node moves it's parent node. It's meant for quick experiments and prototyping.
2 | ## If the parent is a CharacterBody2D, then the move_and_slide() method is used for movement.
3 | ## Otherwise the parent's position is updated directly.
4 | class_name Mover2D
5 | extends Node
6 |
7 | ## Movement speed in pixels/second.
8 | @export_range(.1, 10000.0) var movement_speed := 400.0
9 | ## Input action name to move up.
10 | @export var up_action_name := "ui_up"
11 | ## Input action name to move down.
12 | @export var down_action_name := "ui_down"
13 | ## Input action name to move left.
14 | @export var left_action_name := "ui_left"
15 | ## Input action name to move right.
16 | @export var right_action_name := "ui_right"
17 | ## Follow mouse position.
18 | @export var follow_mouse := false
19 |
20 | @onready var _node2d_parent: Node2D = get_parent()
21 |
22 |
23 | func _ready():
24 | if !_node2d_parent:
25 | printerr("Move2D: parent must be Node2D")
26 | queue_free()
27 |
28 |
29 | func _physics_process(delta):
30 | if follow_mouse:
31 | _node2d_parent.global_position = _node2d_parent.get_global_mouse_position()
32 | return
33 |
34 | var move_direction = _get_move_direction()
35 |
36 | if move_direction == Vector2.ZERO:
37 | return
38 |
39 | if _node2d_parent is CharacterBody2D:
40 | _node2d_parent.velocity = move_direction * movement_speed
41 | _node2d_parent.move_and_slide()
42 | else:
43 | _node2d_parent.global_position += move_direction * movement_speed * delta
44 |
45 |
46 | func _get_move_direction() -> Vector2:
47 | var move_direction = Vector2.ZERO
48 |
49 | if Input.is_action_pressed(up_action_name):
50 | move_direction += Vector2.UP
51 | if Input.is_action_pressed(down_action_name):
52 | move_direction += Vector2.DOWN
53 | if Input.is_action_pressed(left_action_name):
54 | move_direction += Vector2.LEFT
55 | if Input.is_action_pressed(right_action_name):
56 | move_direction += Vector2.RIGHT
57 |
58 | if move_direction.x != 0.0 and move_direction.y != 0.0:
59 | move_direction = move_direction.normalized()
60 |
61 | return move_direction
62 |
--------------------------------------------------------------------------------
/helper_pack_project/test/unit/core/test_globals.gd:
--------------------------------------------------------------------------------
1 | extends "res://addons/gut/test.gd"
2 |
3 | func after_each():
4 | Globals.clear()
5 |
6 |
7 | func get_rand_string(length: int = 20) -> String:
8 | return Crypto.new().generate_random_bytes(length).get_string_from_ascii()
9 |
10 |
11 | func test_set_once():
12 | var property_name = get_rand_string()
13 | var property_value = get_rand_string(int(randf_range(1.0, 100.0)))
14 | Globals.set_value(property_name, property_value)
15 | var value = Globals.get_value(property_name)
16 | assert_eq(value, property_value)
17 |
18 |
19 | func test_set_twice():
20 | var property_name = get_rand_string()
21 | var property_value = get_rand_string(int(randf_range(1.0, 100.0)))
22 | Globals.set_value(property_name, property_value)
23 | property_value = get_rand_string(int(randf_range(1.0, 100.0)))
24 | Globals.set_value(property_name, property_value)
25 | var value = Globals.get_value(property_name)
26 | assert_eq(value, property_value)
27 |
28 |
29 | func test_never_set_returns_null():
30 | var property_name = get_rand_string()
31 | var value = Globals.get_value(property_name)
32 | assert_null(value)
33 |
34 |
35 | func test_erase_actually_erases():
36 | var property_name = get_rand_string()
37 | var property_value = get_rand_string(int(randf_range(1.0, 100.0)))
38 | Globals.set_value(property_name, property_value)
39 | Globals.erase(property_name)
40 | var value = Globals.get_value(property_name)
41 | assert_null(value)
42 |
43 |
44 | func test_erase_handles_property_never_set():
45 | var property_name = get_rand_string()
46 | Globals.erase(property_name)
47 | var value = Globals.get_value(property_name)
48 | assert_null(value)
49 |
50 |
51 | func test_get_handles_property_never_set():
52 | var property_name = get_rand_string()
53 | var value = Globals.get_value(property_name)
54 | assert_null(value)
55 |
56 |
57 | func test_clear_clears_all():
58 | var property_name = get_rand_string()
59 | var property_value = get_rand_string(int(randf_range(1.0, 100.0)))
60 | Globals.set_value(property_name, property_value)
61 | assert_eq(Globals._properties.size(), 1)
62 | Globals.clear()
63 | assert_eq(Globals._properties.size(), 0)
64 |
65 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/2d/camera/behavior/camera_zoom.gd:
--------------------------------------------------------------------------------
1 | ## This node zooms its parent Camera2D. By default it does this by scrolling
2 | ## the mouse wheel up (zoom in) or down (zoom out), but you can give it
3 | ## action names to use different inputs or to add more.
4 | @tool
5 | extends Node
6 | class_name CameraZoom2D
7 |
8 |
9 | ## The amount of zoom applied to the parent Camera2D each time
10 | ## the mouse wheel is scrolled or the zoom actions are triggered.
11 | @export var zoom_speed = .25
12 | ## The minimum amount of zoom applied to the parent Camera2D.
13 | @export var min_camera_zoom: float = .25
14 | ## The maximum amount of zoom applied to the parent Camera2D.
15 | @export var max_camera_zoom: float = 10.0
16 | ## The name of the input action for zooming in the parent Camera2D.
17 | ## If blank, then scrolling the mouse wheel up will trigger the zoom in.
18 | @export var zoom_in_action_name := ""
19 | ## The name of the input action for zooming out the parent Camera2D.
20 | ## If blank, then scrolling the mouse wheel down will trigger the zoom out.
21 | @export var zoom_out_action_name := ""
22 |
23 |
24 | @onready var _camera: Camera2D = get_parent() if typeof(get_parent()) == typeof(Camera2D) else null
25 |
26 |
27 | func _ready() -> void:
28 | if Engine.is_editor_hint():
29 | set_process_input(false)
30 |
31 |
32 | func _get_configuration_warnings() -> PackedStringArray:
33 | var warnings = []
34 | if !get_parent() is Camera2D:
35 | warnings = ['CameraShake2D must be child of Camera2D']
36 | return warnings
37 |
38 |
39 | func _input(event):
40 | if !event is InputEventMouseButton || _camera == null:
41 | return
42 | var delta = 0
43 | if zoom_out_action_name:
44 | if event.is_action(zoom_out_action_name):
45 | delta = -zoom_speed
46 | elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
47 | delta = -zoom_speed
48 |
49 | if zoom_in_action_name:
50 | if event.is_action(zoom_in_action_name):
51 | delta = zoom_speed
52 | elif event.button_index == MOUSE_BUTTON_WHEEL_UP:
53 | delta = zoom_speed
54 |
55 | var zoom = _camera.zoom.x
56 | zoom = clamp( zoom + delta, min_camera_zoom, max_camera_zoom)
57 | _camera.zoom = Vector2(zoom, zoom)
58 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/godot_helper_pack/core/util/stats_util.gd:
--------------------------------------------------------------------------------
1 | class_name StatsUtil
2 | extends Object
3 |
4 | # Collection of statistic functions.
5 |
6 |
7 | class Line:
8 | var b: float
9 | var m: float
10 |
11 | static func sum(measures: Array, limit: int = -1) -> float:
12 | if measures.size() == 0:
13 | return INF
14 | var total := 0.0
15 | limit = limit if limit > 0 else measures.size()
16 | for i in range(limit):
17 | total += float(measures[i])
18 | return total
19 |
20 |
21 | static func mean(measures: Array, limit: int = -1) -> float:
22 | if measures.size() == 0:
23 | return -1.0
24 |
25 | var summation := sum(measures)
26 |
27 | limit = limit if limit > 0 else measures.size()
28 |
29 | return summation / float(limit)
30 |
31 |
32 | static func linear_regression_one_array(measures: Array, limit: int = -1) -> Line:
33 | if measures.size() == 0:
34 | return Line.new()
35 | var x_mean = float(measures.size() - 1) / 2.0
36 | var y_mean = mean(measures, limit)
37 |
38 | var x_minus_x_mean := []
39 | var y_minus_y_mean := []
40 |
41 | limit = limit if limit > 0 else measures.size()
42 | for i in range(limit):
43 | var temp = i - x_mean
44 | x_minus_x_mean.append(temp*temp)
45 | y_minus_y_mean.append(temp*(measures[i] - y_mean))
46 |
47 | var line = Line.new()
48 |
49 | line.m = sum(y_minus_y_mean) / sum(x_minus_x_mean)
50 |
51 | line.b = y_mean - line.m * x_mean
52 |
53 | return line
54 |
55 |
56 | static func linear_regression(x_measures: Array, y_measures: Array, limit: int = -1) -> Line:
57 | limit = limit if limit > 0 else min(x_measures.size(), y_measures.size())
58 | if x_measures.size() <= 1 or y_measures.size() <= 1:
59 | return Line.new()
60 | var x_mean = mean(x_measures)
61 | var y_mean = mean(y_measures, limit)
62 |
63 | var x_minus_x_mean := []
64 | var y_minus_y_mean := []
65 |
66 | for i in range(limit):
67 | var temp = x_measures[i] - x_mean
68 | x_minus_x_mean.append(temp*temp)
69 | y_minus_y_mean.append(temp*(y_measures[i] - y_mean))
70 |
71 | var line = Line.new()
72 |
73 | line.m = sum(y_minus_y_mean) / sum(x_minus_x_mean)
74 |
75 | line.b = y_mean - line.m * x_mean
76 |
77 | return line
78 |
79 |
80 |
--------------------------------------------------------------------------------
/helper_pack_project/addons/gut/gui/RunAtCursor.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://0yunjxtaa8iw"]
2 |
3 | [ext_resource type="Script" path="res://addons/gut/gui/RunAtCursor.gd" id="1"]
4 | [ext_resource type="Texture2D" uid="uid://cr6tvdv0ve6cv" path="res://addons/gut/gui/play.png" id="2"]
5 | [ext_resource type="Texture2D" uid="uid://6wra5rxmfsrl" path="res://addons/gut/gui/arrow.png" id="3"]
6 |
7 | [node name="RunAtCursor" type="Control"]
8 | layout_mode = 3
9 | anchors_preset = 15
10 | anchor_right = 1.0
11 | anchor_bottom = 1.0
12 | offset_right = 1.0
13 | offset_bottom = -527.0
14 | grow_horizontal = 2
15 | grow_vertical = 2
16 | size_flags_horizontal = 3
17 | size_flags_vertical = 3
18 | script = ExtResource("1")
19 |
20 | [node name="HBox" type="HBoxContainer" parent="."]
21 | layout_mode = 0
22 | anchor_right = 1.0
23 | anchor_bottom = 1.0
24 | size_flags_horizontal = 3
25 | size_flags_vertical = 3
26 |
27 | [node name="LblNoneSelected" type="Label" parent="HBox"]
28 | layout_mode = 2
29 | text = ""
30 |
31 | [node name="BtnRunScript" type="Button" parent="HBox"]
32 | visible = false
33 | layout_mode = 2
34 | text = "