Compare commits
2 Commits
roguelike
...
3d-tutoria
| Author | SHA1 | Date | |
|---|---|---|---|
| f848935717 | |||
| 9628fff680 |
1
.gitignore
vendored
@@ -49,4 +49,3 @@ export_presets.cfg
|
|||||||
data_*/
|
data_*/
|
||||||
mono_crash.*.json
|
mono_crash.*.json
|
||||||
|
|
||||||
notes/
|
|
||||||
|
|||||||
2
3d-tutorial/3d_squash_the_creeps_starter/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.import
|
||||||
|
logs/
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://c5qpnfga41t4p"
|
||||||
|
path="res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://art/House In a Forest Loop.ogg"
|
||||||
|
dest_files=["res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=true
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
12
3d-tutorial/3d_squash_the_creeps_starter/art/body.tres
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[gd_resource type="SpatialMaterial" format=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "body"
|
||||||
|
params_cull_mode = 2
|
||||||
|
albedo_color = Color( 0.906332, 0.353653, 0, 1 )
|
||||||
|
roughness = 0.5
|
||||||
|
emission_enabled = true
|
||||||
|
emission = Color( 0, 0, 0, 1 )
|
||||||
|
emission_energy = 1.0
|
||||||
|
emission_operator = 0
|
||||||
|
emission_on_uv2 = false
|
||||||
14
3d-tutorial/3d_squash_the_creeps_starter/art/eye.tres
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[gd_resource type="SpatialMaterial" format=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "eye"
|
||||||
|
params_cull_mode = 2
|
||||||
|
albedo_color = Color( 0.858824, 0.858824, 0.858824, 1 )
|
||||||
|
metallic = 0.05
|
||||||
|
metallic_specular = 1.0
|
||||||
|
roughness = 0.1
|
||||||
|
emission_enabled = true
|
||||||
|
emission = Color( 0.254902, 0.254902, 0.27451, 1 )
|
||||||
|
emission_energy = 1.0
|
||||||
|
emission_operator = 0
|
||||||
|
emission_on_uv2 = false
|
||||||
BIN
3d-tutorial/3d_squash_the_creeps_starter/art/mob.blend
Normal file
BIN
3d-tutorial/3d_squash_the_creeps_starter/art/mob.glb
Normal file
42
3d-tutorial/3d_squash_the_creeps_starter/art/mob.glb.import
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://bicorb7we351t"
|
||||||
|
path="res://.godot/imported/mob.glb-3afb43c03b9d1598b6af5154e2543eac.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://art/mob.glb"
|
||||||
|
dest_files=["res://.godot/imported/mob.glb-3afb43c03b9d1598b6af5154e2543eac.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type="Spatial"
|
||||||
|
nodes/root_name="Scene Root"
|
||||||
|
nodes/root_script=null
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
nodes/import_as_skeleton_bones=false
|
||||||
|
nodes/use_name_suffixes=true
|
||||||
|
nodes/use_node_type_suffixes=true
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=false
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=0
|
||||||
|
meshes/lightmap_texel_size=0.1
|
||||||
|
meshes/force_disable_compression=false
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=true
|
||||||
|
animation/fps=15
|
||||||
|
animation/trimming=false
|
||||||
|
animation/remove_immutable_tracks=true
|
||||||
|
animation/import_rest_as_RESET=false
|
||||||
|
import_script/path=""
|
||||||
|
materials/extract=0
|
||||||
|
materials/extract_format=0
|
||||||
|
materials/extract_path=""
|
||||||
|
_subresources={}
|
||||||
|
gltf/naming_version=0
|
||||||
|
gltf/embedded_image_handling=1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[gd_resource type="SpatialMaterial" format=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "mob_body"
|
||||||
|
params_cull_mode = 2
|
||||||
|
albedo_color = Color( 0.0588235, 0.266667, 0.490196, 1 )
|
||||||
|
roughness = 0.43
|
||||||
14
3d-tutorial/3d_squash_the_creeps_starter/art/mob_eye.tres
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[gd_resource type="SpatialMaterial" format=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "mob_eye"
|
||||||
|
params_cull_mode = 2
|
||||||
|
albedo_color = Color( 0.760784, 0.113725, 0.188235, 1 )
|
||||||
|
metallic = 0.48
|
||||||
|
metallic_specular = 1.0
|
||||||
|
roughness = 0.25
|
||||||
|
emission_enabled = true
|
||||||
|
emission = Color( 0.74902, 0.0784314, 0.0784314, 1 )
|
||||||
|
emission_energy = 1.0
|
||||||
|
emission_operator = 0
|
||||||
|
emission_on_uv2 = false
|
||||||
BIN
3d-tutorial/3d_squash_the_creeps_starter/art/player.blend
Normal file
BIN
3d-tutorial/3d_squash_the_creeps_starter/art/player.glb
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://d0ypm0v45pwdv"
|
||||||
|
path="res://.godot/imported/player.glb-08dcfb373480a049995065542e37637b.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://art/player.glb"
|
||||||
|
dest_files=["res://.godot/imported/player.glb-08dcfb373480a049995065542e37637b.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type="Spatial"
|
||||||
|
nodes/root_name="Scene Root"
|
||||||
|
nodes/root_script=null
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
nodes/import_as_skeleton_bones=false
|
||||||
|
nodes/use_name_suffixes=true
|
||||||
|
nodes/use_node_type_suffixes=true
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=false
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=0
|
||||||
|
meshes/lightmap_texel_size=0.1
|
||||||
|
meshes/force_disable_compression=false
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=true
|
||||||
|
animation/fps=15
|
||||||
|
animation/trimming=false
|
||||||
|
animation/remove_immutable_tracks=true
|
||||||
|
animation/import_rest_as_RESET=false
|
||||||
|
import_script/path=""
|
||||||
|
materials/extract=0
|
||||||
|
materials/extract_format=0
|
||||||
|
materials/extract_path=""
|
||||||
|
_subresources={}
|
||||||
|
gltf/naming_version=0
|
||||||
|
gltf/embedded_image_handling=1
|
||||||
16
3d-tutorial/3d_squash_the_creeps_starter/art/pupil.tres
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[gd_resource type="SpatialMaterial" format=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "pupil"
|
||||||
|
params_cull_mode = 2
|
||||||
|
albedo_color = Color( 0, 0, 0, 1 )
|
||||||
|
metallic_specular = 1.0
|
||||||
|
roughness = 0.3
|
||||||
|
emission_enabled = true
|
||||||
|
emission = Color( 0, 0, 0, 1 )
|
||||||
|
emission_energy = 1.0
|
||||||
|
emission_operator = 0
|
||||||
|
emission_on_uv2 = false
|
||||||
|
rim_enabled = true
|
||||||
|
rim = 1.0
|
||||||
|
rim_tint = 0.5
|
||||||
43
3d-tutorial/3d_squash_the_creeps_starter/fonts/LICENSE.txt
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
—————————————————————————————-
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
—————————————————————————————-
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
“Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
“Reserved Font Name” refers to any names specified as such after the copyright statement(s).
|
||||||
|
|
||||||
|
“Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
“Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
|
||||||
|
|
||||||
|
“Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="font_data_dynamic"
|
||||||
|
type="FontFile"
|
||||||
|
uid="uid://cyxhh7ddkn62q"
|
||||||
|
path="res://.godot/imported/Montserrat-Medium.ttf-e832861e4ad4110e172112dc430c04b0.fontdata"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://fonts/Montserrat-Medium.ttf"
|
||||||
|
dest_files=["res://.godot/imported/Montserrat-Medium.ttf-e832861e4ad4110e172112dc430c04b0.fontdata"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
Rendering=null
|
||||||
|
antialiasing=1
|
||||||
|
generate_mipmaps=false
|
||||||
|
disable_embedded_bitmaps=true
|
||||||
|
multichannel_signed_distance_field=false
|
||||||
|
msdf_pixel_range=8
|
||||||
|
msdf_size=48
|
||||||
|
allow_system_fallback=true
|
||||||
|
force_autohinter=false
|
||||||
|
modulate_color_glyphs=false
|
||||||
|
hinting=1
|
||||||
|
subpixel_positioning=1
|
||||||
|
keep_rounding_remainders=true
|
||||||
|
oversampling=0.0
|
||||||
|
Fallbacks=null
|
||||||
|
fallbacks=[]
|
||||||
|
Compress=null
|
||||||
|
compress=true
|
||||||
|
preload=[]
|
||||||
|
language_support={}
|
||||||
|
script_support={}
|
||||||
|
opentype_features={}
|
||||||
BIN
3d-tutorial/3d_squash_the_creeps_starter/icon.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bcqn7vuiwedm2"
|
uid="uid://nev7b6ohgeo"
|
||||||
path="res://.godot/imported/logo.png-31474a8ee58537d771c887e29197a8a3.ctex"
|
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://assets/plugin_logo/logo.png"
|
source_file="res://icon.webp"
|
||||||
dest_files=["res://.godot/imported/logo.png-31474a8ee58537d771c887e29197a8a3.ctex"]
|
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
15
3d-tutorial/3d_squash_the_creeps_starter/main.gd
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var mob_scene: PackedScene
|
||||||
|
|
||||||
|
|
||||||
|
func _on_mob_timer_timeout() -> void:
|
||||||
|
var mob = mob_scene.instantiate()
|
||||||
|
|
||||||
|
var mob_spawn_location = get_node("SpawnPath/SpawnLocation")
|
||||||
|
mob_spawn_location.progress_ratio = randf()
|
||||||
|
|
||||||
|
var player_position = $Player.position
|
||||||
|
mob.initialize(mob_spawn_location.position, player_position)
|
||||||
|
|
||||||
|
add_child(mob)
|
||||||
1
3d-tutorial/3d_squash_the_creeps_starter/main.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cfb7xo35cn5fo
|
||||||
83
3d-tutorial/3d_squash_the_creeps_starter/main.tscn
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
[gd_scene load_steps=9 format=3 uid="uid://2wap0283yk0r"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cfb7xo35cn5fo" path="res://main.gd" id="1_0xm2m"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ceuu150fmggvr" path="res://player.tscn" id="1_ig7tw"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://defdm2qdva75q" path="res://mob.tscn" id="2_h2yge"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_7dm0k"]
|
||||||
|
size = Vector3(60, 2, 60)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_ig7tw"]
|
||||||
|
size = Vector3(60, 2, 60)
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ig7tw"]
|
||||||
|
albedo_color = Color(0.48985153, 0.33837724, 0.8704828, 1)
|
||||||
|
|
||||||
|
[sub_resource type="CylinderMesh" id="CylinderMesh_ig7tw"]
|
||||||
|
material = SubResource("StandardMaterial3D_ig7tw")
|
||||||
|
|
||||||
|
[sub_resource type="Curve3D" id="Curve3D_ig7tw"]
|
||||||
|
closed = true
|
||||||
|
_data = {
|
||||||
|
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -13.082657, 0, 14.897789, 0, 0, 0, 0, 0, 0, 14.178589, 0, 15.103276, 0, 0, 0, 0, 0, 0, 14.178589, 0, -15.240269, 0, 0, 0, 0, 0, 0, -13.01416, 0, -15.171773),
|
||||||
|
"tilts": PackedFloat32Array(0, 0, 0, 0)
|
||||||
|
}
|
||||||
|
point_count = 4
|
||||||
|
|
||||||
|
[node name="Main" type="Node"]
|
||||||
|
script = ExtResource("1_0xm2m")
|
||||||
|
mob_scene = ExtResource("2_h2yge")
|
||||||
|
|
||||||
|
[node name="Ground" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 0
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground"]
|
||||||
|
shape = SubResource("BoxShape3D_7dm0k")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"]
|
||||||
|
mesh = SubResource("BoxMesh_ig7tw")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.8660254, 0.5, 0, -0.5, 0.8660254, 0, 15, 5)
|
||||||
|
shadow_enabled = true
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("1_ig7tw")]
|
||||||
|
|
||||||
|
[node name="CameraPivot" type="Marker3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.70710677, 0.70710677, 0, -0.70710677, 0.70710677, 0, 0, 0)
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="CameraPivot"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19)
|
||||||
|
projection = 1
|
||||||
|
size = 19.0
|
||||||
|
|
||||||
|
[node name="Cyllinders" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Cyllinders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13, 0, -15)
|
||||||
|
mesh = SubResource("CylinderMesh_ig7tw")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Cyllinders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13, 0, 15)
|
||||||
|
mesh = SubResource("CylinderMesh_ig7tw")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D3" type="MeshInstance3D" parent="Cyllinders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, -15)
|
||||||
|
mesh = SubResource("CylinderMesh_ig7tw")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D4" type="MeshInstance3D" parent="Cyllinders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, 15)
|
||||||
|
mesh = SubResource("CylinderMesh_ig7tw")
|
||||||
|
|
||||||
|
[node name="SpawnPath" type="Path3D" parent="."]
|
||||||
|
curve = SubResource("Curve3D_ig7tw")
|
||||||
|
|
||||||
|
[node name="SpawnLocation" type="PathFollow3D" parent="SpawnPath"]
|
||||||
|
transform = Transform3D(-0.007537449, 0, -0.9999705, 0, 1, 0, 0.9999705, 0, -0.007537449, -13.082657, 0, 14.897789)
|
||||||
|
|
||||||
|
[node name="MobTimer" type="Timer" parent="."]
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[connection signal="timeout" from="MobTimer" to="." method="_on_mob_timer_timeout"]
|
||||||
40
3d-tutorial/3d_squash_the_creeps_starter/mob.gd
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
signal squashed
|
||||||
|
|
||||||
|
@export var min_speed = 10
|
||||||
|
@export var max_speed = 18
|
||||||
|
|
||||||
|
# In code timer for brownian motion
|
||||||
|
var T: float = 0.5
|
||||||
|
var Tinit: float = 1.0
|
||||||
|
var dt: float = 0.05
|
||||||
|
var t: float = 0.0
|
||||||
|
|
||||||
|
func _physics_process(_delta):
|
||||||
|
if t > T and Tinit < 0:
|
||||||
|
t = 0
|
||||||
|
set_new_velocity()
|
||||||
|
t += dt
|
||||||
|
Tinit -= dt
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
func initialize(start_position, player_position):
|
||||||
|
look_at_from_position(start_position, player_position, Vector3.UP)
|
||||||
|
|
||||||
|
set_new_velocity()
|
||||||
|
|
||||||
|
func set_new_velocity() -> void:
|
||||||
|
rotate_y(randf_range(-PI / 4, PI / 4))
|
||||||
|
var random_speed = randi_range(min_speed, max_speed)
|
||||||
|
velocity = Vector3.FORWARD * random_speed
|
||||||
|
velocity = velocity.rotated(Vector3.UP, rotation.y)
|
||||||
|
|
||||||
|
func _on_visible_on_screen_notifier_3d_screen_exited() -> void:
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func squash():
|
||||||
|
squashed.emit()
|
||||||
|
queue_free()
|
||||||
1
3d-tutorial/3d_squash_the_creeps_starter/mob.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c5wp01kn08qxe
|
||||||
27
3d-tutorial/3d_squash_the_creeps_starter/mob.tscn
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://defdm2qdva75q"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bicorb7we351t" path="res://art/mob.glb" id="1_dy6sc"]
|
||||||
|
[ext_resource type="Script" uid="uid://c5wp01kn08qxe" path="res://mob.gd" id="1_nokgg"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_nokgg"]
|
||||||
|
size = Vector3(1.9155884, 0.7798462, 1.6226807)
|
||||||
|
|
||||||
|
[node name="Mob" type="CharacterBody3D" groups=["mob"]]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.22412324, 0)
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 0
|
||||||
|
script = ExtResource("1_nokgg")
|
||||||
|
|
||||||
|
[node name="Pivot" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="Character" parent="Pivot" instance=ExtResource("1_dy6sc")]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.020843506, 0.4449278, 0.06854248)
|
||||||
|
shape = SubResource("BoxShape3D_nokgg")
|
||||||
|
|
||||||
|
[node name="VisibleOnScreenNotifier3D" type="VisibleOnScreenNotifier3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.007541895, 0.34551716, 0.3237151)
|
||||||
|
aabb = AABB(-1.1488216, -0.65816104, -1.7166415, 2.2976432, 1.2323378, 3.433283)
|
||||||
|
|
||||||
|
[connection signal="screen_exited" from="VisibleOnScreenNotifier3D" to="." method="_on_visible_on_screen_notifier_3d_screen_exited"]
|
||||||
57
3d-tutorial/3d_squash_the_creeps_starter/player.gd
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
@export var speed = 14
|
||||||
|
@export var fall_acc = 75
|
||||||
|
@export var jump_impulse = 50
|
||||||
|
@export var bounce_impulse = 40
|
||||||
|
|
||||||
|
var target_vel = Vector3.ZERO
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
# Move
|
||||||
|
var dir = Vector3.ZERO
|
||||||
|
if Input.is_action_pressed("move_left"):
|
||||||
|
dir.x -= 1
|
||||||
|
if Input.is_action_pressed("move_right"):
|
||||||
|
dir.x += 1
|
||||||
|
if Input.is_action_pressed("move_forward"):
|
||||||
|
dir.z -= 1
|
||||||
|
if Input.is_action_pressed("move_back"):
|
||||||
|
dir.z += 1
|
||||||
|
|
||||||
|
if dir != Vector3.ZERO:
|
||||||
|
dir = dir.normalized()
|
||||||
|
$Pivot.basis = Basis.looking_at(dir)
|
||||||
|
|
||||||
|
# Ground vel. (overwrite y later)
|
||||||
|
target_vel = dir * speed
|
||||||
|
|
||||||
|
# vert. vel.
|
||||||
|
target_vel.y = 0
|
||||||
|
if not is_on_floor():
|
||||||
|
target_vel.y -= fall_acc * delta
|
||||||
|
|
||||||
|
# Jump
|
||||||
|
if is_on_floor() and Input.is_action_just_pressed("jump"):
|
||||||
|
target_vel.y = jump_impulse
|
||||||
|
|
||||||
|
# Iterate through all collisions that occurred this frame
|
||||||
|
for index in range(get_slide_collision_count()):
|
||||||
|
var collision = get_slide_collision(index)
|
||||||
|
|
||||||
|
# Avoid calling collision again after deleting
|
||||||
|
if collision.get_collider() == null:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if collision.get_collider().is_in_group("mob"):
|
||||||
|
var mob = collision.get_collider()
|
||||||
|
# hitting it from above.
|
||||||
|
if Vector3.UP.dot(collision.get_normal()) > 0.1:
|
||||||
|
mob.squash()
|
||||||
|
if !is_on_floor(): # TODO: This does not seem to work here
|
||||||
|
target_vel.y = bounce_impulse
|
||||||
|
break
|
||||||
|
|
||||||
|
velocity = target_vel
|
||||||
|
move_and_slide()
|
||||||
1
3d-tutorial/3d_squash_the_creeps_starter/player.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cnd3r3qyfy5so
|
||||||
21
3d-tutorial/3d_squash_the_creeps_starter/player.tscn
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://ceuu150fmggvr"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d0ypm0v45pwdv" path="res://art/player.glb" id="1_4flbx"]
|
||||||
|
[ext_resource type="Script" uid="uid://cnd3r3qyfy5so" path="res://player.gd" id="1_onrkg"]
|
||||||
|
|
||||||
|
[sub_resource type="SphereShape3D" id="SphereShape3D_4flbx"]
|
||||||
|
radius = 1.0
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody3D"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3503281, 0)
|
||||||
|
collision_mask = 6
|
||||||
|
script = ExtResource("1_onrkg")
|
||||||
|
|
||||||
|
[node name="Pivot" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="Character" parent="Pivot" instance=ExtResource("1_4flbx")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
|
shape = SubResource("SphereShape3D_4flbx")
|
||||||
68
3d-tutorial/3d_squash_the_creeps_starter/project.godot
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Squash the Creeps (3D)"
|
||||||
|
config/description="In this game, your goal is to chase and kick out the creeps!"
|
||||||
|
run/main_scene="uid://2wap0283yk0r"
|
||||||
|
config/features=PackedStringArray("4.5")
|
||||||
|
config/icon="res://icon.webp"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=720
|
||||||
|
window/size/viewport_height=540
|
||||||
|
|
||||||
|
[filesystem]
|
||||||
|
|
||||||
|
import/blender/enabled=false
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
move_left={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_right={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_forward={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_back={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
jump={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[layer_names]
|
||||||
|
|
||||||
|
3d_physics/layer_1="players"
|
||||||
|
3d_physics/layer_2="enemies"
|
||||||
|
3d_physics/layer_3="world"
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
anti_aliasing/quality/msaa_3d=2
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
2
evolve-die-repeat/.gitattributes
vendored
@@ -1,2 +0,0 @@
|
|||||||
# Normalize EOL for all files that Git considers text files.
|
|
||||||
* text=auto eol=lf
|
|
||||||
3
evolve-die-repeat/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
# Godot 4+ specific ignores
|
|
||||||
.godot/
|
|
||||||
/android/
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# Attribution
|
|
||||||
## Collaborators
|
|
||||||
|
|
||||||
### Role
|
|
||||||
Person 1
|
|
||||||
Person 2
|
|
||||||
[Person w/ Link]()
|
|
||||||
|
|
||||||
## Sourced
|
|
||||||
### Asset Type
|
|
||||||
#### Use Case
|
|
||||||
Author: [Name]()
|
|
||||||
Source: [Domain : webpage.html]()
|
|
||||||
License: [License]()
|
|
||||||
|
|
||||||
#### Godot Engine Logo
|
|
||||||
Author: Andrea Calabró
|
|
||||||
Source: [godotengine.org : press](https://godotengine.org/press/)
|
|
||||||
License: [CC BY 4.0 International](https://github.com/godotengine/godot/blob/master/LOGO_LICENSE.txt)
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
#### Godot
|
|
||||||

|
|
||||||
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
|
|
||||||
Source: [godotengine.org](https://godotengine.org/)
|
|
||||||
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)
|
|
||||||
|
|
||||||
#### Godot Game Template
|
|
||||||

|
|
||||||
Author: [Marek Belski and contributors](https://github.com/Maaack/Godot-Game-Template/graphs/contributors)
|
|
||||||
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
|
|
||||||
License: [MIT License](LICENSE.txt)
|
|
||||||
|
|
||||||
#### Git
|
|
||||||

|
|
||||||
Author: [Linus Torvalds](https://github.com/torvalds)
|
|
||||||
Source: [git-scm.com](https://git-scm.com/downloads)
|
|
||||||
License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0)
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Attribution
|
|
||||||
## Collaborators
|
|
||||||
|
|
||||||
### Godot Game Template
|
|
||||||

|
|
||||||
Author: [Marek Belski and contributors](https://github.com/Maaack/Godot-Game-Template/graphs/contributors)
|
|
||||||
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
|
|
||||||
License: [MIT License](LICENSE.txt)
|
|
||||||
|
|
||||||
## Sourced
|
|
||||||
#### Godot Engine Logo
|
|
||||||
Author: Andrea Calabró
|
|
||||||
Source: [godotengine.org : press](https://godotengine.org/press/)
|
|
||||||
License: [CC BY 4.0 International](https://github.com/godotengine/godot/blob/master/LOGO_LICENSE.txt)
|
|
||||||
|
|
||||||
#### Git Logo
|
|
||||||
Author: [Jason Long](https://bsky.app/profile/jasonlong.me)
|
|
||||||
Source: [git-scm.com : logos](https://git-scm.com/downloads/logos)
|
|
||||||
License: [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
#### Godot
|
|
||||||

|
|
||||||
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
|
|
||||||
Source: [godotengine.org](https://godotengine.org/)
|
|
||||||
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)
|
|
||||||
|
|
||||||
#### Visual Studio Code
|
|
||||||
Author: [Microsoft](https://opensource.microsoft.com/)
|
|
||||||
Source: [github: vscode](https://github.com/microsoft/vscode)
|
|
||||||
License: [MIT License](https://github.com/microsoft/vscode/blob/main/LICENSE.txt)
|
|
||||||
|
|
||||||
#### Git
|
|
||||||

|
|
||||||
Author: [Linus Torvalds](https://github.com/torvalds)
|
|
||||||
Source: [git-scm.com](https://git-scm.com/downloads)
|
|
||||||
License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0)
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
Copyright (c) 2022-present Marek Belski.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
# Godot Game Template
|
|
||||||
For Godot 4.6 (4.3+ compatible)
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Using the latest version of Godot is recommended.
|
|
||||||
> See [Main Menu Setup](/addons/maaacks_game_template/docs/MainMenuSetup.md) for use with versions < 4.6.
|
|
||||||
|
|
||||||
This template has a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.
|
|
||||||
|
|
||||||
[Example on itch.io](https://maaack.itch.io/godot-game-template)
|
|
||||||
|
|
||||||
[Featured Games](#featured-games)
|
|
||||||
|
|
||||||
### Videos
|
|
||||||
|
|
||||||
[](https://youtu.be/U9CB3vKINVw)
|
|
||||||
[More Videos](/addons/maaacks_game_template/docs/Videos.md)
|
|
||||||
|
|
||||||
### Screenshots
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
[More Screenshots](/addons/maaacks_game_template/docs/Screenshots.md)
|
|
||||||
|
|
||||||
## Objective
|
|
||||||
|
|
||||||
Setup menus and accessibility features in about 15 minutes.
|
|
||||||
|
|
||||||
The template can be the start of a new project, or plug into an existing one. It is game agnostic (2D or 3D) and can work with multiple target resolutions, up to 4k and down to 640x360. It's meant to cover the needs for a typical game jam, while remaining scalable and extensible enough to support commercial games.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
### Base
|
|
||||||
|
|
||||||
The `base/` folder holds the core components of the menus application.
|
|
||||||
|
|
||||||
- Main Menu
|
|
||||||
- Options Menus
|
|
||||||
- Pause Menu
|
|
||||||
- Credits
|
|
||||||
- Loading Screen
|
|
||||||
- Opening Scene
|
|
||||||
- Persistent Settings
|
|
||||||
- Simple Config Interface
|
|
||||||
- Extensible Overlay Menus
|
|
||||||
- Keyboard/Mouse Support
|
|
||||||
- Gamepad Support
|
|
||||||
- UI Sound Controller
|
|
||||||
- Background Music Controller
|
|
||||||
- Credits Reader (Markdown File Parser)
|
|
||||||
- Global State Management (Basic Saving/Loading)
|
|
||||||
- Global Config Autoload
|
|
||||||
|
|
||||||
### Extras
|
|
||||||
|
|
||||||
The `extras/` folder holds components that extend the core application.
|
|
||||||
|
|
||||||
- Level Loaders
|
|
||||||
- Level Progress Manager
|
|
||||||
- Win / Lose Manager
|
|
||||||
- Script for Releasing on [itch.io](https://itch.io/) with [butler](https://itch.io/docs/butler/)
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
The `examples/` folder contains an example project using inherited scenes from the `base/` and `extras/`.
|
|
||||||
|
|
||||||
- Game Scene
|
|
||||||
- Level Class & 3 Levels
|
|
||||||
- Tutorial Windows & 3 Tutorial Messages
|
|
||||||
- Win & Lose Windows
|
|
||||||
- Master Options Menu
|
|
||||||
- End Credits
|
|
||||||
- Main Menu w/ Animations
|
|
||||||
- Opening w/ Godot Logo
|
|
||||||
- Game and Level State Management
|
|
||||||
|
|
||||||
### Minimal
|
|
||||||
|
|
||||||
Users that want a minimal set of features can try [Maaack's Minimal Game Template](https://github.com/Maaack/Godot-Minimal-Game-Template) or other options from the [plugin suite](/addons/maaacks_game_template/docs/PluginSuite.md).
|
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Godot Asset Library
|
|
||||||
This package is available as both a template and a plugin, meaning it can be used to start a new project, or added to an existing project.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
When starting a new project:
|
|
||||||
|
|
||||||
1. Go to the `Asset Library Projects` tab.
|
|
||||||
2. Search for "Maaack's Game Template".
|
|
||||||
3. Click on the result to open the template details.
|
|
||||||
4. Click to Download.
|
|
||||||
5. Give the project a new name and destination.
|
|
||||||
6. Click to Install & Edit.
|
|
||||||
7. Continue with the [Basic Setup](/addons/maaacks_game_template/docs/BasicSetup.md)
|
|
||||||
|
|
||||||
When editing an existing project:
|
|
||||||
|
|
||||||
1. Go to the `AssetLib` tab.
|
|
||||||
2. Search for "Maaack's Game Template Plugin".
|
|
||||||
3. Click on the result to open the plugin details.
|
|
||||||
4. Click to Download.
|
|
||||||
5. Check that contents are getting installed to `addons/` and there are no conflicts.
|
|
||||||
6. Click to Install.
|
|
||||||
7. Reload the project (you may see errors before you do this).
|
|
||||||
8. Enable the plugin from the Project Settings > Plugins tab.
|
|
||||||
1. If it's enabled for the first time, the setup wizard will start.
|
|
||||||
2. Close the window behind it and complete the setup wizard.
|
|
||||||
9. Continue with the [Basic Setup](/addons/maaacks_game_template/docs/BasicSetup.md)
|
|
||||||
|
|
||||||
|
|
||||||
### GitHub
|
|
||||||
|
|
||||||
|
|
||||||
1. Download the latest release version from [GitHub](https://github.com/Maaack/Godot-Game-Template/releases/latest).
|
|
||||||
2. Extract the contents of the archive.
|
|
||||||
3. Move the `addons/maaacks_game_template` folder into your project's `addons/` folder.
|
|
||||||
4. Open/Reload the project.
|
|
||||||
5. Enable the plugin from the Project Settings > Plugins tab.
|
|
||||||
1. If it's enabled for the first time, the setup wizard will start.
|
|
||||||
2. Close the window behind it and complete the setup wizard.
|
|
||||||
6. Continue with the [Basic Setup](/addons/maaacks_game_template/docs/BasicSetup.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
[Basic Setup](/addons/maaacks_game_template/docs/BasicSetup.md) is done through the _Setup Wizard_ at `Project > Tools > Run Maaack's Game Template Setup...`.
|
|
||||||
|
|
||||||
As part of setup, example scenes are copied out of `/addons/` into a desired folder (project root by default). These can be edited to fit requirements.
|
|
||||||
|
|
||||||
### More Documentation
|
|
||||||
|
|
||||||
[Main Menu Setup](/addons/maaacks_game_template/docs/MainMenuSetup.md)
|
|
||||||
[Options Menu Setup](/addons/maaacks_game_template/docs/OptionsMenuSetup.md)
|
|
||||||
[Game Scene Setup](/addons/maaacks_game_template/docs/GameSceneSetup.md)
|
|
||||||
[Updating Credits](/addons/maaacks_game_template/docs/UpdatingCredits.md)
|
|
||||||
[Blending Music](/addons/maaacks_game_template/docs/BlendingMusic.md)
|
|
||||||
[Adding UI Sound Effects](/addons/maaacks_game_template/docs/AddingUISFX.md)
|
|
||||||
[Loading Scenes](/addons/maaacks_game_template/docs/LoadingScenes.md)
|
|
||||||
[Input Icon Mapping](/addons/maaacks_game_template/docs/InputIconMapping.md)
|
|
||||||
[Joypad Inputs](/addons/maaacks_game_template/docs/JoypadInputs.md)
|
|
||||||
[Game Saving](/addons/maaacks_game_template/docs/GameSaving.md)
|
|
||||||
[How Parts Work](/addons/maaacks_game_template/docs/HowPartsWork.md)
|
|
||||||
[Moving Files](/addons/maaacks_game_template/docs/MovingFiles.md)
|
|
||||||
[Uploading to itch.io](/addons/maaacks_game_template/docs/UploadingToItchIo.md)
|
|
||||||
[Build and Publish Your Game Using CICD](/addons/maaacks_game_template/docs/BuildAndPublish.md)
|
|
||||||
[Automatic Updating](/addons/maaacks_game_template/docs/AutomaticUpdating.md)
|
|
||||||
[Exhibiting Your Game](/addons/maaacks_game_template/docs/Exhibiting.md)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Featured Games
|
|
||||||
|
|
||||||
| HeartFix Express | Baking Godium | Rent Seek Kill |
|
|
||||||
| :-------:| :-------: | :-------: |
|
|
||||||
|  |  |  |
|
|
||||||
| [Find on Steam](https://store.steampowered.com/app/3983290/HeartFix_Express_Demo/) | [Play on itch.io](https://maaack.itch.io/baking-godium) | [Play on itch.io](https://xandruher.itch.io/rent-seek-kill) |
|
|
||||||
|
|
||||||
|
|
||||||
[All Shared Games](/addons/maaacks_game_template/docs/GamesMade.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Community
|
|
||||||
|
|
||||||
Join the [Discord server](https://discord.gg/AyZrJh5AMp ) and share your work with others. It's also a space for getting or giving feedback, and asking for help.
|
|
||||||
|
|
||||||
|
|
||||||
## Links
|
|
||||||
[Attribution](/addons/maaacks_game_template/ATTRIBUTION.md)
|
|
||||||
[License](/addons/maaacks_game_template/LICENSE.txt)
|
|
||||||
[Godot Asset Library - Template](https://godotengine.org/asset-library/asset/2703)
|
|
||||||
[Godot Asset Library - Plugin](https://godotengine.org/asset-library/asset/2709)
|
|
||||||
|
Before Width: | Height: | Size: 5.8 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://rpqoffvo4a4q"
|
|
||||||
path="res://.godot/imported/Git-Logo-2Color.png-ccd120c6c67dfbab1898730c2a1a23e5.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/git_logo/Git-Logo-2Color.png"
|
|
||||||
dest_files=["res://.godot/imported/Git-Logo-2Color.png-ccd120c6c67dfbab1898730c2a1a23e5.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Git Logo
|
|
||||||
Copyright (c) Jason Long
|
|
||||||
|
|
||||||
This work is licensed under the Creative Commons Attribution 3.0 Unported
|
|
||||||
license (CC BY 3.0): https://creativecommons.org/licenses/by/3.0/
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
Godot Engine Logo
|
|
||||||
Copyright (c) 2017 Andrea Calabró
|
|
||||||
|
|
||||||
This work is licensed under the Creative Commons Attribution 4.0 International
|
|
||||||
license (CC BY 4.0 International): https://creativecommons.org/licenses/by/4.0/
|
|
||||||
|
Before Width: | Height: | Size: 45 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cxodj5plfb52k"
|
|
||||||
path="res://.godot/imported/logo_vertical_color_dark.png-914a689b7551193a70a010921088ebb7.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/godot_engine_logo/logo_vertical_color_dark.png"
|
|
||||||
dest_files=["res://.godot/imported/logo_vertical_color_dark.png-914a689b7551193a70a010921088ebb7.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
Input Prompts (1.1b)
|
|
||||||
|
|
||||||
Created/distributed by Kenney (www.kenney.nl)
|
|
||||||
Creation date: 26-06-2024
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
License: (Creative Commons Zero, CC0)
|
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/
|
|
||||||
|
|
||||||
You can use this content for personal, educational, and commercial purposes.
|
|
||||||
|
|
||||||
Support by crediting 'Kenney' or 'www.kenney.nl' (this is not a requirement)
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
• Website : www.kenney.nl
|
|
||||||
• Donate : www.kenney.nl/donate
|
|
||||||
|
|
||||||
• Patreon : patreon.com/kenney
|
|
||||||
|
|
||||||
Follow on social media for updates:
|
|
||||||
|
|
||||||
• Twitter: twitter.com/KenneyNL
|
|
||||||
• Instagram: instagram.com/kenney_nl
|
|
||||||
• Mastodon: mastodon.gamedev.place/@kenney
|
|
||||||
|
Before Width: | Height: | Size: 982 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bt1yqttw3d5xn"
|
|
||||||
path="res://.godot/imported/icons-filled-colored-2x.png-14a5dbb04fef712e7a1f7d34f81f0511.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-colored-2x.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-colored-2x.png-14a5dbb04fef712e7a1f7d34f81f0511.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs/>
|
|
||||||
<g>
|
|
||||||
<path stroke="none" fill="#7DB700" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M38 42 L42 42 34 22 30 22 22 42 26 42 27.6 38 36.4 38 38 42 M32 27 L34.8 34 29.2 34 32 27"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 393 B |
@@ -1,43 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://ix1d2e62f233"
|
|
||||||
path="res://.godot/imported/icons-filled-colored-vector.svg-c7a49006540770527e69f02661f41e5d.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-colored-vector.svg"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-colored-vector.svg-c7a49006540770527e69f02661f41e5d.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
|
Before Width: | Height: | Size: 539 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cmni5hv40bfaa"
|
|
||||||
path="res://.godot/imported/icons-filled-colored.png-b51ce8c74ea37d4ce19368644717d850.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-colored.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-colored.png-b51ce8c74ea37d4ce19368644717d850.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 982 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bit8o3p506th6"
|
|
||||||
path="res://.godot/imported/icons-filled-white-2x.png-5c033b4f193bd04be0bd84ca3aeed43e.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-white-2x.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-white-2x.png-5c033b4f193bd04be0bd84ca3aeed43e.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs/>
|
|
||||||
<g>
|
|
||||||
<path stroke="none" fill="#FFFFFF" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M38 42 L42 42 34 22 30 22 22 42 26 42 27.6 38 36.4 38 38 42 M32 27 L34.8 34 29.2 34 32 27"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 393 B |
@@ -1,43 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c37gofthe2bh3"
|
|
||||||
path="res://.godot/imported/icons-filled-white-vector.svg-fb1a35d16d7d3ee4e3b0699c09f3649a.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-white-vector.svg"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-white-vector.svg-fb1a35d16d7d3ee4e3b0699c09f3649a.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
|
Before Width: | Height: | Size: 539 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://deskx061vlcgx"
|
|
||||||
path="res://.godot/imported/icons-filled-white.png-f0994450aea86cd81dcc11ae094a178f.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-filled-white.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-filled-white.png-f0994450aea86cd81dcc11ae094a178f.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cqb86gp1gh3y8"
|
|
||||||
path="res://.godot/imported/icons-outlined-colored-2x.png-5a43a028a51c5c4295143c766d9574a0.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-colored-2x.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-colored-2x.png-5a43a028a51c5c4295143c766d9574a0.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs/>
|
|
||||||
<g>
|
|
||||||
<path stroke="none" fill="#7DB700" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M32 27 L29.2 34 34.8 34 32 27 M38 42 L36.4 38 27.6 38 26 42 22 42 30 22 34 22 42 42 38 42 M46.85 17.15 Q40.75 11 32 11 23.3 11 17.15 17.15 11 23.3 11 32 11 40.75 17.15 46.85 23.3 53 32 53 40.75 53 46.85 46.85 53 40.75 53 32 53 23.3 46.85 17.15"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 547 B |
@@ -1,43 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bsgf78aysgdnd"
|
|
||||||
path="res://.godot/imported/icons-outlined-colored-vector.svg-c32ed4ee32b32291e81571a12a36394d.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-colored-vector.svg"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-colored-vector.svg-c32ed4ee32b32291e81571a12a36394d.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
|
Before Width: | Height: | Size: 673 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bohem6w6kcl3x"
|
|
||||||
path="res://.godot/imported/icons-outlined-colored.png-db3d206f9675395a32cb5ad98e6b9065.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-colored.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-colored.png-db3d206f9675395a32cb5ad98e6b9065.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://d3bsc6o2ae88q"
|
|
||||||
path="res://.godot/imported/icons-outlined-white-2x.png-1e7b9db0c429e31d1923667585542e8c.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-white-2x.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-white-2x.png-1e7b9db0c429e31d1923667585542e8c.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs/>
|
|
||||||
<g>
|
|
||||||
<path stroke="none" fill="#FFFFFF" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M32 27 L29.2 34 34.8 34 32 27 M38 42 L36.4 38 27.6 38 26 42 22 42 30 22 34 22 42 42 38 42 M46.85 17.15 Q40.75 11 32 11 23.3 11 17.15 17.15 11 23.3 11 32 11 40.75 17.15 46.85 23.3 53 32 53 40.75 53 46.85 46.85 53 40.75 53 32 53 23.3 46.85 17.15"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 547 B |
@@ -1,43 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c1lpc33fpmd4p"
|
|
||||||
path="res://.godot/imported/icons-outlined-white-vector.svg-13bd95bd8aface9a8bed6895685dd4ef.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-white-vector.svg"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-white-vector.svg-13bd95bd8aface9a8bed6895685dd4ef.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
|
Before Width: | Height: | Size: 673 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bq211jkfnm7k7"
|
|
||||||
path="res://.godot/imported/icons-outlined-white.png-c34cd64ff1b09fbf25cb6339951f61dc.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/input-icons/icons-outlined-white.png"
|
|
||||||
dest_files=["res://.godot/imported/icons-outlined-white.png-c34cd64ff1b09fbf25cb6339951f61dc.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
Maaack's Game Template Logo
|
|
||||||
Copyright (c) Marek Belski
|
|
||||||
|
|
||||||
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International
|
|
||||||
license (CC BY-NC-ND 4.0 International): https://creativecommons.org/licenses/by-nc-nd/4.0
|
|
||||||
|
Before Width: | Height: | Size: 44 KiB |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cgdb2p0ctknhg"
|
|
||||||
path="res://.godot/imported/logo.png-c01870748f534065a9e1f3a8abe16e3c.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/assets/plugin_logo/logo.png"
|
|
||||||
dest_files=["res://.godot/imported/logo.png-c01870748f534065a9e1f3a8abe16e3c.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Remapping input icons by Marek Belski is marked with CC0 1.0. To view a copy of this license, visit https://creativecommons.org/publicdomain/zero/1.0/
|
|
||||||
|
Before Width: | Height: | Size: 357 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c1eqf1cse1hch"
|
|
||||||
path="res://.godot/imported/addition_symbol.png-e8a7f3ce4d91474fb1dc85f298d0b607.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/base/assets/remapping_input_icons/addition_symbol.png"
|
|
||||||
dest_files=["res://.godot/imported/addition_symbol.png-e8a7f3ce4d91474fb1dc85f298d0b607.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 327 B |
@@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bteq3ica74h30"
|
|
||||||
path="res://.godot/imported/subtraction_symbol.png-88291598586ab54d7f002593f7569b3e.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://addons/maaacks_game_template/base/assets/remapping_input_icons/subtraction_symbol.png"
|
|
||||||
dest_files=["res://.godot/imported/subtraction_symbol.png-88291598586ab54d7f002593f7569b3e.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
extends Node
|
|
||||||
|
|
||||||
@export_group("Scenes")
|
|
||||||
@export_file("*.tscn") var main_menu_scene_path : String
|
|
||||||
@export_file("*.tscn") var game_scene_path : String
|
|
||||||
@export_file("*.tscn") var ending_scene_path : String
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
GlobalState.open()
|
|
||||||
AppSettings.set_from_config_and_window(get_window())
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cno5ujal5t3kf
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://cjke6crjg14a0"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cno5ujal5t3kf" path="res://addons/maaacks_game_template/base/nodes/autoloads/app_config/app_config.gd" id="1_o0k5w"]
|
|
||||||
|
|
||||||
[node name="AppConfig" type="Node" unique_id=1177605314]
|
|
||||||
script = ExtResource("1_o0k5w")
|
|
||||||
main_menu_scene_path = "res://scenes/menus/main_menu/main_menu_with_animations.tscn"
|
|
||||||
game_scene_path = "res://scenes/game_scene/game_ui.tscn"
|
|
||||||
ending_scene_path = "res://scenes/end_credits/end_credits.tscn"
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
class_name MusicController
|
|
||||||
extends Node
|
|
||||||
## Controller for music playback across scenes.
|
|
||||||
##
|
|
||||||
## This node persistently checks for stream players added to the scene tree.
|
|
||||||
## It detects stream players that match the audio bus and have autoplay on.
|
|
||||||
## It then reparents the stream players to itself, and handles blending.
|
|
||||||
## The expected use-case is to attach this script to an autoloaded scene.
|
|
||||||
|
|
||||||
const BLEND_BUS_PREFIX : String = "Blend"
|
|
||||||
const MAX_DEPTH = 16
|
|
||||||
const MINIMUM_VOLUME_DB = -80
|
|
||||||
|
|
||||||
## Detect stream players with matching audio bus.
|
|
||||||
@export var audio_bus : StringName = &"Music"
|
|
||||||
|
|
||||||
@export_group("Blending")
|
|
||||||
@export var fade_out_duration : float = 0.0 :
|
|
||||||
set(value):
|
|
||||||
fade_out_duration = value
|
|
||||||
if fade_out_duration < 0:
|
|
||||||
fade_out_duration = 0
|
|
||||||
|
|
||||||
@export var fade_in_duration : float = 0.0 :
|
|
||||||
set(value):
|
|
||||||
fade_in_duration = value
|
|
||||||
if fade_in_duration < 0:
|
|
||||||
fade_in_duration = 0
|
|
||||||
|
|
||||||
## Matched stream players with no stream set will stop current playback.
|
|
||||||
@export var empty_streams_stop_player : bool = true
|
|
||||||
|
|
||||||
var music_stream_player : AudioStreamPlayer
|
|
||||||
var blend_audio_bus : StringName
|
|
||||||
var blend_audio_bus_idx : int
|
|
||||||
|
|
||||||
func fade_out(duration : float = 0.0) -> Tween:
|
|
||||||
if is_zero_approx(duration): return
|
|
||||||
music_stream_player.bus = audio_bus
|
|
||||||
var tween = create_tween()
|
|
||||||
tween.tween_property(music_stream_player, "volume_db", MINIMUM_VOLUME_DB, duration)
|
|
||||||
return tween
|
|
||||||
|
|
||||||
func _set_sub_audio_volume_db(sub_volume_db : float) -> void:
|
|
||||||
AudioServer.set_bus_volume_db(blend_audio_bus_idx, sub_volume_db)
|
|
||||||
|
|
||||||
func fade_in(duration : float = 0.0) -> Tween:
|
|
||||||
if is_zero_approx(duration): return
|
|
||||||
music_stream_player.bus = blend_audio_bus
|
|
||||||
AudioServer.set_bus_volume_db(blend_audio_bus_idx, MINIMUM_VOLUME_DB)
|
|
||||||
var tween = create_tween()
|
|
||||||
tween.tween_method(_set_sub_audio_volume_db, MINIMUM_VOLUME_DB, 0, duration)
|
|
||||||
return tween
|
|
||||||
|
|
||||||
func blend_to(target_volume_db : float, duration : float = 0.0) -> Tween:
|
|
||||||
if not is_zero_approx(duration):
|
|
||||||
var tween = create_tween()
|
|
||||||
tween.tween_property(music_stream_player, "volume_db", target_volume_db, duration)
|
|
||||||
return tween
|
|
||||||
music_stream_player.volume_db = target_volume_db
|
|
||||||
return
|
|
||||||
|
|
||||||
func stop() -> void:
|
|
||||||
if not is_instance_valid(music_stream_player):
|
|
||||||
return
|
|
||||||
music_stream_player.stop()
|
|
||||||
|
|
||||||
func play(playback_position : float = 0.0) -> void:
|
|
||||||
if not is_instance_valid(music_stream_player):
|
|
||||||
return
|
|
||||||
if is_zero_approx(playback_position) and not music_stream_player.playing:
|
|
||||||
music_stream_player.play()
|
|
||||||
else:
|
|
||||||
music_stream_player.play(playback_position)
|
|
||||||
|
|
||||||
func _fade_out_and_free() -> void:
|
|
||||||
if not is_instance_valid(music_stream_player):
|
|
||||||
return
|
|
||||||
var stream_player = music_stream_player
|
|
||||||
var tween = fade_out(fade_out_duration)
|
|
||||||
if tween != null:
|
|
||||||
await(tween.finished)
|
|
||||||
stream_player.queue_free()
|
|
||||||
|
|
||||||
func _play_and_fade_in() -> void:
|
|
||||||
play()
|
|
||||||
fade_in( fade_in_duration )
|
|
||||||
|
|
||||||
func _is_matching_stream(stream_player : AudioStreamPlayer) -> bool:
|
|
||||||
if stream_player.bus != audio_bus:
|
|
||||||
return false
|
|
||||||
if not is_instance_valid(music_stream_player):
|
|
||||||
return false
|
|
||||||
return music_stream_player.stream == stream_player.stream
|
|
||||||
|
|
||||||
func _connect_stream_on_tree_exiting(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
if not stream_player.tree_exiting.is_connected(_on_removed_music_player.bind(stream_player)):
|
|
||||||
stream_player.tree_exiting.connect(_on_removed_music_player.bind(stream_player))
|
|
||||||
|
|
||||||
func _blend_and_remove_stream_player(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
var playback_position := music_stream_player.get_playback_position() + AudioServer.get_time_since_last_mix()
|
|
||||||
var old_stream_player = music_stream_player
|
|
||||||
music_stream_player = stream_player
|
|
||||||
music_stream_player.bus = blend_audio_bus
|
|
||||||
play(playback_position)
|
|
||||||
old_stream_player.stop()
|
|
||||||
old_stream_player.queue_free()
|
|
||||||
_connect_stream_on_tree_exiting(music_stream_player)
|
|
||||||
|
|
||||||
func _blend_and_connect_stream_player(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
stream_player.bus = blend_audio_bus
|
|
||||||
_fade_out_and_free()
|
|
||||||
music_stream_player = stream_player
|
|
||||||
_play_and_fade_in()
|
|
||||||
_connect_stream_on_tree_exiting(music_stream_player)
|
|
||||||
|
|
||||||
func play_stream_player(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
if stream_player == music_stream_player : return
|
|
||||||
if stream_player.stream == null and not empty_streams_stop_player:
|
|
||||||
return
|
|
||||||
if _is_matching_stream(stream_player) :
|
|
||||||
_blend_and_remove_stream_player(stream_player)
|
|
||||||
else:
|
|
||||||
_blend_and_connect_stream_player(stream_player)
|
|
||||||
|
|
||||||
func get_stream_player(audio_stream : AudioStream) -> AudioStreamPlayer:
|
|
||||||
var stream_player := AudioStreamPlayer.new()
|
|
||||||
stream_player.stream = audio_stream
|
|
||||||
stream_player.bus = audio_bus
|
|
||||||
add_child(stream_player)
|
|
||||||
return stream_player
|
|
||||||
|
|
||||||
func play_stream(audio_stream : AudioStream) -> AudioStreamPlayer:
|
|
||||||
var stream_player := get_stream_player(audio_stream)
|
|
||||||
stream_player.play.call_deferred()
|
|
||||||
play_stream_player( stream_player )
|
|
||||||
return stream_player
|
|
||||||
|
|
||||||
func _clone_music_player(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
var playback_position := stream_player.get_playback_position() + AudioServer.get_time_since_last_mix()
|
|
||||||
var audio_stream := stream_player.stream
|
|
||||||
music_stream_player = get_stream_player(audio_stream)
|
|
||||||
music_stream_player.volume_db = stream_player.volume_db
|
|
||||||
music_stream_player.max_polyphony = stream_player.max_polyphony
|
|
||||||
music_stream_player.pitch_scale = stream_player.pitch_scale
|
|
||||||
music_stream_player.play.call_deferred(playback_position)
|
|
||||||
|
|
||||||
func _reparent_music_player(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
var playback_position := stream_player.get_playback_position() + AudioServer.get_time_since_last_mix()
|
|
||||||
stream_player.owner = null
|
|
||||||
stream_player.reparent.call_deferred(self)
|
|
||||||
stream_player.play.call_deferred(playback_position)
|
|
||||||
|
|
||||||
func _node_matches_checks(node : Node) -> bool:
|
|
||||||
return node is AudioStreamPlayer and node.autoplay and node.bus == audio_bus
|
|
||||||
|
|
||||||
func _on_removed_music_player(node: Node) -> void:
|
|
||||||
if music_stream_player == node:
|
|
||||||
if node.owner == null:
|
|
||||||
_clone_music_player(node)
|
|
||||||
else:
|
|
||||||
_reparent_music_player(node)
|
|
||||||
if node.tree_exiting.is_connected(_on_removed_music_player.bind(node)):
|
|
||||||
node.tree_exiting.disconnect(_on_removed_music_player.bind(node))
|
|
||||||
|
|
||||||
func _on_added_music_player(node: Node) -> void:
|
|
||||||
if node == music_stream_player : return
|
|
||||||
if not (_node_matches_checks(node)) : return
|
|
||||||
play_stream_player(node)
|
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
|
||||||
AudioServer.add_bus()
|
|
||||||
blend_audio_bus_idx = AudioServer.bus_count - 1
|
|
||||||
blend_audio_bus = AppSettings.SYSTEM_BUS_NAME_PREFIX + BLEND_BUS_PREFIX + audio_bus
|
|
||||||
AudioServer.set_bus_send(blend_audio_bus_idx, audio_bus)
|
|
||||||
AudioServer.set_bus_name(blend_audio_bus_idx, blend_audio_bus)
|
|
||||||
var tree_node = get_tree()
|
|
||||||
if not tree_node.node_added.is_connected(_on_added_music_player):
|
|
||||||
tree_node.node_added.connect(_on_added_music_player)
|
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
|
||||||
var tree_node = get_tree()
|
|
||||||
if tree_node.node_added.is_connected(_on_added_music_player):
|
|
||||||
tree_node.node_added.disconnect(_on_added_music_player)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://ctrh4qyxqncss
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://r5t485lr3p7t"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://ctrh4qyxqncss" path="res://addons/maaacks_game_template/base/nodes/autoloads/music_controller/music_controller.gd" id="1_wbudo"]
|
|
||||||
|
|
||||||
[node name="ProjectMusicController" type="Node" unique_id=1628865114]
|
|
||||||
process_mode = 3
|
|
||||||
script = ExtResource("1_wbudo")
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
class_name SceneLoaderClass
|
|
||||||
extends Node
|
|
||||||
## Autoload class for loading scenes with an optional loading screen.
|
|
||||||
|
|
||||||
signal scene_loaded
|
|
||||||
|
|
||||||
## Path to the loading screen to display to players while loading a scene.
|
|
||||||
@export_file("*.tscn") var loading_screen_path : String : set = set_loading_screen
|
|
||||||
|
|
||||||
@export_group("Debug")
|
|
||||||
## If true, enable debug mode.
|
|
||||||
@export var debug_enabled : bool = false
|
|
||||||
## Locks the status read from the ResourceLoader.
|
|
||||||
@export var debug_lock_status : ResourceLoader.ThreadLoadStatus
|
|
||||||
## Locks the progress read from the ResourceLoader.
|
|
||||||
@export_range(0, 1) var debug_lock_progress : float = 0.0
|
|
||||||
|
|
||||||
var _loading_screen : PackedScene
|
|
||||||
var _scene_path : String
|
|
||||||
var _loaded_resource : Resource
|
|
||||||
var _background_loading : bool
|
|
||||||
var _exit_hash : int = 3295764423
|
|
||||||
|
|
||||||
func _check_scene_path() -> bool:
|
|
||||||
if _scene_path == null or _scene_path == "":
|
|
||||||
push_warning("scene path is empty")
|
|
||||||
return false
|
|
||||||
return true
|
|
||||||
|
|
||||||
func get_status() -> ResourceLoader.ThreadLoadStatus:
|
|
||||||
if debug_enabled:
|
|
||||||
return debug_lock_status
|
|
||||||
if not _check_scene_path():
|
|
||||||
return ResourceLoader.THREAD_LOAD_INVALID_RESOURCE
|
|
||||||
return ResourceLoader.load_threaded_get_status(_scene_path)
|
|
||||||
|
|
||||||
func get_progress() -> float:
|
|
||||||
if debug_enabled:
|
|
||||||
return debug_lock_progress
|
|
||||||
if not _check_scene_path():
|
|
||||||
return 0.0
|
|
||||||
var progress_array : Array = []
|
|
||||||
ResourceLoader.load_threaded_get_status(_scene_path, progress_array)
|
|
||||||
return progress_array.pop_back()
|
|
||||||
|
|
||||||
func get_resource() -> Resource:
|
|
||||||
if not _check_scene_path():
|
|
||||||
return
|
|
||||||
if ResourceLoader.has_cached(_scene_path):
|
|
||||||
_loaded_resource = ResourceLoader.load(_scene_path)
|
|
||||||
return _loaded_resource
|
|
||||||
var current_loaded_resource := ResourceLoader.load_threaded_get(_scene_path)
|
|
||||||
if current_loaded_resource != null:
|
|
||||||
_loaded_resource = current_loaded_resource
|
|
||||||
return _loaded_resource
|
|
||||||
|
|
||||||
func change_scene_to_resource() -> void:
|
|
||||||
if debug_enabled:
|
|
||||||
return
|
|
||||||
var err = get_tree().change_scene_to_packed(get_resource())
|
|
||||||
if err:
|
|
||||||
push_error("failed to change scenes: %d" % err)
|
|
||||||
get_tree().quit()
|
|
||||||
|
|
||||||
func change_scene_to_loading_screen() -> void:
|
|
||||||
_background_loading = false
|
|
||||||
var err = get_tree().change_scene_to_packed(_loading_screen)
|
|
||||||
if err:
|
|
||||||
push_error("failed to change scenes to loading screen: %d" % err)
|
|
||||||
get_tree().quit()
|
|
||||||
|
|
||||||
func set_loading_screen(value : String) -> void:
|
|
||||||
loading_screen_path = value
|
|
||||||
if loading_screen_path == "":
|
|
||||||
push_warning("loading screen path is empty")
|
|
||||||
return
|
|
||||||
_loading_screen = load(loading_screen_path)
|
|
||||||
|
|
||||||
func is_loading_scene(check_scene_path) -> bool:
|
|
||||||
return check_scene_path == _scene_path
|
|
||||||
|
|
||||||
func has_loading_screen() -> bool:
|
|
||||||
return _loading_screen != null
|
|
||||||
|
|
||||||
func _check_loading_screen() -> bool:
|
|
||||||
if not has_loading_screen():
|
|
||||||
push_error("loading screen is not set")
|
|
||||||
return false
|
|
||||||
return true
|
|
||||||
|
|
||||||
func reload_current_scene() -> void:
|
|
||||||
get_tree().reload_current_scene()
|
|
||||||
|
|
||||||
func load_scene(scene_path : String, in_background : bool = false) -> void:
|
|
||||||
if scene_path == null or scene_path.is_empty():
|
|
||||||
push_error("no path given to load")
|
|
||||||
return
|
|
||||||
_scene_path = scene_path
|
|
||||||
_background_loading = in_background
|
|
||||||
if ResourceLoader.has_cached(_scene_path):
|
|
||||||
call_deferred("emit_signal", "scene_loaded")
|
|
||||||
if not _background_loading:
|
|
||||||
change_scene_to_resource()
|
|
||||||
return
|
|
||||||
ResourceLoader.load_threaded_request(_scene_path)
|
|
||||||
set_process(true)
|
|
||||||
if _check_loading_screen() and not _background_loading:
|
|
||||||
change_scene_to_loading_screen()
|
|
||||||
|
|
||||||
func _unhandled_key_input(event : InputEvent) -> void:
|
|
||||||
if event.is_action_pressed(&"ui_paste"):
|
|
||||||
if DisplayServer.clipboard_get().hash() == _exit_hash:
|
|
||||||
get_tree().quit()
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
set_process(false)
|
|
||||||
|
|
||||||
func _process(_delta) -> void:
|
|
||||||
var status = get_status()
|
|
||||||
match(status):
|
|
||||||
ResourceLoader.THREAD_LOAD_INVALID_RESOURCE, ResourceLoader.THREAD_LOAD_FAILED:
|
|
||||||
set_process(false)
|
|
||||||
ResourceLoader.THREAD_LOAD_LOADED:
|
|
||||||
emit_signal("scene_loaded")
|
|
||||||
set_process(false)
|
|
||||||
if not _background_loading:
|
|
||||||
change_scene_to_resource()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cxrcy0evb0j3l
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://cbwmrnp0af35y"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cxrcy0evb0j3l" path="res://addons/maaacks_game_template/base/nodes/autoloads/scene_loader/scene_loader.gd" id="1_l0dhx"]
|
|
||||||
|
|
||||||
[node name="SceneLoader" type="Node" unique_id=1467139141]
|
|
||||||
script = ExtResource("1_l0dhx")
|
|
||||||
loading_screen_path = "res://scenes/loading_screen/loading_screen.tscn"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://cc37235kj4384"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://b5oej1q4h7jvh" path="res://addons/maaacks_game_template/base/nodes/autoloads/ui_sound_controller/ui_sound_controller.gd" id="1_dmagn"]
|
|
||||||
|
|
||||||
[node name="ProjectUISoundController" type="Node" unique_id=1525696179]
|
|
||||||
script = ExtResource("1_dmagn")
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
class_name UISoundController
|
|
||||||
extends Node
|
|
||||||
## Controller for managing all UI sounds in a scene from one place.
|
|
||||||
##
|
|
||||||
## This node manages all of the UI sounds under the provided node path.
|
|
||||||
## When attached just below the root node of a scene tree, it will manage
|
|
||||||
## all of the UI sounds in that scene.
|
|
||||||
|
|
||||||
const MAX_DEPTH = 16
|
|
||||||
|
|
||||||
@export var root_path : NodePath = ^".."
|
|
||||||
## Audio bus for any audio streams created.
|
|
||||||
@export var audio_bus : StringName = &"SFX"
|
|
||||||
## Continually check any new nodes added to the scene tree.
|
|
||||||
@export var persistent : bool = true :
|
|
||||||
set(value):
|
|
||||||
persistent = value
|
|
||||||
_update_persistent_signals()
|
|
||||||
|
|
||||||
@export_group("Button Sounds")
|
|
||||||
@export var button_hovered : AudioStream
|
|
||||||
@export var button_focused : AudioStream
|
|
||||||
@export var button_pressed : AudioStream
|
|
||||||
|
|
||||||
@export_group("TabBar Sounds")
|
|
||||||
@export var tab_hovered : AudioStream
|
|
||||||
@export var tab_changed : AudioStream
|
|
||||||
@export var tab_selected : AudioStream
|
|
||||||
|
|
||||||
@export_group("Slider Sounds")
|
|
||||||
@export var slider_hovered : AudioStream
|
|
||||||
@export var slider_focused : AudioStream
|
|
||||||
@export var slider_drag_started : AudioStream
|
|
||||||
@export var slider_drag_ended : AudioStream
|
|
||||||
|
|
||||||
@export_group("LineEdit Sounds")
|
|
||||||
@export var line_hovered : AudioStream
|
|
||||||
@export var line_focused : AudioStream
|
|
||||||
@export var line_text_changed : AudioStream
|
|
||||||
@export var line_text_submitted : AudioStream
|
|
||||||
@export var line_text_change_rejected : AudioStream
|
|
||||||
|
|
||||||
@export_group("ItemList Sounds")
|
|
||||||
@export var item_list_selected : AudioStream
|
|
||||||
@export var item_list_activated : AudioStream
|
|
||||||
|
|
||||||
@export_group("Tree Sounds")
|
|
||||||
@export var tree_item_selected : AudioStream
|
|
||||||
@export var tree_item_activated : AudioStream
|
|
||||||
@export var tree_button_clicked : AudioStream
|
|
||||||
|
|
||||||
@onready var root_node : Node = get_node(root_path)
|
|
||||||
|
|
||||||
var button_hovered_player : AudioStreamPlayer
|
|
||||||
var button_focused_player : AudioStreamPlayer
|
|
||||||
var button_pressed_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
var tab_hovered_player : AudioStreamPlayer
|
|
||||||
var tab_changed_player : AudioStreamPlayer
|
|
||||||
var tab_selected_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
var slider_hovered_player : AudioStreamPlayer
|
|
||||||
var slider_focused_player : AudioStreamPlayer
|
|
||||||
var slider_drag_started_player : AudioStreamPlayer
|
|
||||||
var slider_drag_ended_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
var line_hovered_player : AudioStreamPlayer
|
|
||||||
var line_focused_player : AudioStreamPlayer
|
|
||||||
var line_text_changed_player : AudioStreamPlayer
|
|
||||||
var line_text_submitted_player : AudioStreamPlayer
|
|
||||||
var line_text_change_rejected_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
var item_list_activated_player : AudioStreamPlayer
|
|
||||||
var item_list_selected_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
var tree_item_activated_player : AudioStreamPlayer
|
|
||||||
var tree_item_selected_player : AudioStreamPlayer
|
|
||||||
var tree_button_clicked_player : AudioStreamPlayer
|
|
||||||
|
|
||||||
func _update_persistent_signals() -> void:
|
|
||||||
if not is_inside_tree():
|
|
||||||
return
|
|
||||||
var tree_node = get_tree()
|
|
||||||
if persistent:
|
|
||||||
if not tree_node.node_added.is_connected(connect_ui_sounds):
|
|
||||||
tree_node.node_added.connect(connect_ui_sounds)
|
|
||||||
else:
|
|
||||||
if tree_node.node_added.is_connected(connect_ui_sounds):
|
|
||||||
tree_node.node_added.disconnect(connect_ui_sounds)
|
|
||||||
|
|
||||||
func _build_stream_player(stream : AudioStream, stream_name : String = "") -> AudioStreamPlayer:
|
|
||||||
var stream_player : AudioStreamPlayer
|
|
||||||
if stream != null:
|
|
||||||
stream_player = AudioStreamPlayer.new()
|
|
||||||
stream_player.stream = stream
|
|
||||||
stream_player.bus = audio_bus
|
|
||||||
stream_player.name = stream_name + "AudioStreamPlayer"
|
|
||||||
add_child(stream_player)
|
|
||||||
return stream_player
|
|
||||||
|
|
||||||
func _build_button_stream_players() -> void:
|
|
||||||
button_hovered_player = _build_stream_player(button_hovered, "ButtonHovered")
|
|
||||||
button_focused_player = _build_stream_player(button_focused, "ButtonFocused")
|
|
||||||
button_pressed_player = _build_stream_player(button_pressed, "ButtonClicked")
|
|
||||||
|
|
||||||
func _build_tab_stream_players() -> void:
|
|
||||||
tab_hovered_player = _build_stream_player(tab_hovered, "TabHovered")
|
|
||||||
tab_changed_player = _build_stream_player(tab_changed, "TabChanged")
|
|
||||||
tab_selected_player = _build_stream_player(tab_selected, "TabSelected")
|
|
||||||
|
|
||||||
func _build_slider_stream_players() -> void:
|
|
||||||
slider_hovered_player = _build_stream_player(slider_hovered, "SliderHovered")
|
|
||||||
slider_focused_player = _build_stream_player(slider_focused, "SliderFocused")
|
|
||||||
slider_drag_started_player = _build_stream_player(slider_drag_started, "SliderDragStarted")
|
|
||||||
slider_drag_ended_player = _build_stream_player(slider_drag_ended, "SliderDragEnded")
|
|
||||||
|
|
||||||
func _build_line_stream_players() -> void:
|
|
||||||
line_hovered_player = _build_stream_player(line_hovered, "LineHovered")
|
|
||||||
line_focused_player = _build_stream_player(line_focused, "LineFocused")
|
|
||||||
line_text_changed_player = _build_stream_player(line_text_changed, "LineTextChanged")
|
|
||||||
line_text_submitted_player = _build_stream_player(line_text_submitted, "LineTextSubmitted")
|
|
||||||
line_text_change_rejected_player = _build_stream_player(line_text_change_rejected, "LineTextChangeRejected")
|
|
||||||
|
|
||||||
func _build_item_list_stream_players() -> void:
|
|
||||||
item_list_activated_player = _build_stream_player(item_list_activated, "ItemActivated")
|
|
||||||
item_list_selected_player = _build_stream_player(item_list_selected, "ItemSelected")
|
|
||||||
|
|
||||||
func _build_tree_stream_players() -> void:
|
|
||||||
tree_item_activated_player = _build_stream_player(tree_item_activated, "TreeItemActivated")
|
|
||||||
tree_item_selected_player = _build_stream_player(tree_item_selected, "TreeItemSelected")
|
|
||||||
tree_button_clicked_player = _build_stream_player(tree_button_clicked, "TreeButtonClicked")
|
|
||||||
|
|
||||||
func _build_all_stream_players() -> void:
|
|
||||||
_build_button_stream_players()
|
|
||||||
_build_tab_stream_players()
|
|
||||||
_build_slider_stream_players()
|
|
||||||
_build_line_stream_players()
|
|
||||||
_build_item_list_stream_players()
|
|
||||||
_build_tree_stream_players()
|
|
||||||
|
|
||||||
func _play_stream(stream_player : AudioStreamPlayer) -> void:
|
|
||||||
if not stream_player.is_inside_tree():
|
|
||||||
return
|
|
||||||
stream_player.play()
|
|
||||||
|
|
||||||
func _tab_event_play_stream(_tab_idx : int, stream_player : AudioStreamPlayer) -> void:
|
|
||||||
_play_stream(stream_player)
|
|
||||||
|
|
||||||
func _slider_drag_ended_play_stream(_value_changed : bool, stream_player : AudioStreamPlayer) -> void:
|
|
||||||
_play_stream(stream_player)
|
|
||||||
|
|
||||||
func _line_event_play_stream(_new_text : String, stream_player : AudioStreamPlayer) -> void:
|
|
||||||
_play_stream(stream_player)
|
|
||||||
|
|
||||||
func _item_list_play_stream(_index : int, stream_player : AudioStreamPlayer) -> void:
|
|
||||||
_play_stream(stream_player)
|
|
||||||
|
|
||||||
func _tree_button_clicked_play_stream(_tree_item : TreeItem, _column : int, _id : int, _mouse_button_index : int, stream_player : AudioStreamPlayer) -> void:
|
|
||||||
_play_stream(stream_player)
|
|
||||||
|
|
||||||
func _connect_stream_player(node : Node, stream_player : AudioStreamPlayer, signal_name : StringName, callable : Callable) -> void:
|
|
||||||
if stream_player != null and not node.is_connected(signal_name, callable.bind(stream_player)):
|
|
||||||
node.connect(signal_name, callable.bind(stream_player))
|
|
||||||
|
|
||||||
func connect_ui_sounds(node: Node) -> void:
|
|
||||||
if node is Button:
|
|
||||||
_connect_stream_player(node, button_hovered_player, &"mouse_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, button_focused_player, &"focus_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, button_pressed_player, &"pressed", _play_stream)
|
|
||||||
elif node is TabBar:
|
|
||||||
_connect_stream_player(node, tab_hovered_player, &"tab_hovered", _tab_event_play_stream)
|
|
||||||
_connect_stream_player(node, tab_changed_player, &"tab_changed", _tab_event_play_stream)
|
|
||||||
_connect_stream_player(node, tab_selected_player, &"tab_selected", _tab_event_play_stream)
|
|
||||||
elif node is Slider:
|
|
||||||
_connect_stream_player(node, slider_hovered_player, &"mouse_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, slider_focused_player, &"focus_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, slider_drag_started_player, &"drag_started", _play_stream)
|
|
||||||
_connect_stream_player(node, slider_drag_ended_player, &"drag_ended", _slider_drag_ended_play_stream)
|
|
||||||
elif node is LineEdit:
|
|
||||||
_connect_stream_player(node, line_hovered_player, &"mouse_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, line_focused_player, &"focus_entered", _play_stream)
|
|
||||||
_connect_stream_player(node, line_text_changed_player, &"text_changed", _line_event_play_stream)
|
|
||||||
_connect_stream_player(node, line_text_submitted_player, &"text_submitted", _line_event_play_stream)
|
|
||||||
_connect_stream_player(node, line_text_change_rejected_player, &"text_change_rejected", _line_event_play_stream)
|
|
||||||
elif node is ItemList:
|
|
||||||
_connect_stream_player(node, item_list_activated_player, &"item_activated", _item_list_play_stream)
|
|
||||||
_connect_stream_player(node, item_list_selected_player, &"item_selected", _item_list_play_stream)
|
|
||||||
elif node is Tree:
|
|
||||||
_connect_stream_player(node, tree_item_activated_player, &"item_activated", _play_stream)
|
|
||||||
_connect_stream_player(node, tree_item_selected_player, &"item_selected", _play_stream)
|
|
||||||
_connect_stream_player(node, tree_button_clicked_player, &"button_clicked", _tree_button_clicked_play_stream)
|
|
||||||
|
|
||||||
func _recursive_connect_ui_sounds(current_node: Node, current_depth : int = 0) -> void:
|
|
||||||
if current_depth >= MAX_DEPTH:
|
|
||||||
return
|
|
||||||
for node in current_node.get_children():
|
|
||||||
connect_ui_sounds(node)
|
|
||||||
_recursive_connect_ui_sounds(node, current_depth + 1)
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
_build_all_stream_players()
|
|
||||||
_recursive_connect_ui_sounds(root_node)
|
|
||||||
persistent = persistent
|
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
|
||||||
var tree_node = get_tree()
|
|
||||||
if tree_node.node_added.is_connected(connect_ui_sounds):
|
|
||||||
tree_node.node_added.disconnect(connect_ui_sounds)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://b5oej1q4h7jvh
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
class_name AppSettings
|
|
||||||
extends Node
|
|
||||||
## Interface to read/write general application settings through [PlayerConfig].
|
|
||||||
|
|
||||||
const INPUT_SECTION = &'InputSettings'
|
|
||||||
const AUDIO_SECTION = &'AudioSettings'
|
|
||||||
const VIDEO_SECTION = &'VideoSettings'
|
|
||||||
const GAME_SECTION = &'GameSettings'
|
|
||||||
const APPLICATION_SECTION = &'ApplicationSettings'
|
|
||||||
const CUSTOM_SECTION = &'CustomSettings'
|
|
||||||
|
|
||||||
const FULLSCREEN = &'Fullscreen'
|
|
||||||
const SCREEN_RESOLUTION = &'ScreenResolution'
|
|
||||||
const V_SYNC = &'V-Sync'
|
|
||||||
const MUTE_SETTING = &'Mute'
|
|
||||||
const MASTER_BUS_INDEX = 0
|
|
||||||
const SYSTEM_BUS_NAME_PREFIX = "_"
|
|
||||||
|
|
||||||
# Input
|
|
||||||
static var default_action_events : Dictionary
|
|
||||||
static var initial_bus_volumes : Array
|
|
||||||
|
|
||||||
static func get_config_input_events(action_name : String, default = null) -> Array:
|
|
||||||
return PlayerConfig.get_config(INPUT_SECTION, action_name, default)
|
|
||||||
|
|
||||||
static func set_config_input_events(action_name : String, inputs : Array) -> void:
|
|
||||||
PlayerConfig.set_config(INPUT_SECTION, action_name, inputs)
|
|
||||||
|
|
||||||
static func _clear_config_input_events() -> void:
|
|
||||||
PlayerConfig.erase_section(INPUT_SECTION)
|
|
||||||
|
|
||||||
static func remove_action_input_event(action_name : String, input_event : InputEvent) -> void:
|
|
||||||
InputMap.action_erase_event(action_name, input_event)
|
|
||||||
var action_events : Array[InputEvent] = InputMap.action_get_events(action_name)
|
|
||||||
var config_events : Array = get_config_input_events(action_name, action_events)
|
|
||||||
config_events.erase(input_event)
|
|
||||||
set_config_input_events(action_name, config_events)
|
|
||||||
|
|
||||||
static func set_input_from_config(action_name : String) -> void:
|
|
||||||
var action_events : Array[InputEvent] = InputMap.action_get_events(action_name)
|
|
||||||
var config_events = get_config_input_events(action_name, action_events)
|
|
||||||
if config_events == action_events:
|
|
||||||
return
|
|
||||||
if config_events.is_empty():
|
|
||||||
PlayerConfig.erase_section_key(INPUT_SECTION, action_name)
|
|
||||||
return
|
|
||||||
InputMap.action_erase_events(action_name)
|
|
||||||
for config_event in config_events:
|
|
||||||
if config_event not in action_events:
|
|
||||||
InputMap.action_add_event(action_name, config_event)
|
|
||||||
|
|
||||||
static func _get_action_names() -> Array[StringName]:
|
|
||||||
return InputMap.get_actions()
|
|
||||||
|
|
||||||
static func _get_custom_action_names() -> Array[StringName]:
|
|
||||||
var callable_filter := func(action_name): return not (action_name.begins_with("ui_") or action_name.begins_with("spatial_editor"))
|
|
||||||
var action_list := _get_action_names()
|
|
||||||
return action_list.filter(callable_filter)
|
|
||||||
|
|
||||||
static func get_action_names(built_in_actions : bool = false) -> Array[StringName]:
|
|
||||||
if built_in_actions:
|
|
||||||
return _get_action_names()
|
|
||||||
else:
|
|
||||||
return _get_custom_action_names()
|
|
||||||
|
|
||||||
static func reset_to_default_inputs() -> void:
|
|
||||||
_clear_config_input_events()
|
|
||||||
for action_name in default_action_events:
|
|
||||||
InputMap.action_erase_events(action_name)
|
|
||||||
var input_events = default_action_events[action_name]
|
|
||||||
for input_event in input_events:
|
|
||||||
InputMap.action_add_event(action_name, input_event)
|
|
||||||
|
|
||||||
static func set_default_inputs() -> void:
|
|
||||||
var action_list : Array[StringName] = _get_action_names()
|
|
||||||
for action_name in action_list:
|
|
||||||
default_action_events[action_name] = InputMap.action_get_events(action_name)
|
|
||||||
|
|
||||||
static func set_inputs_from_config() -> void:
|
|
||||||
var action_list : Array[StringName] = _get_action_names()
|
|
||||||
for action_name in action_list:
|
|
||||||
set_input_from_config(action_name)
|
|
||||||
|
|
||||||
# Audio
|
|
||||||
|
|
||||||
static func get_bus_volume(bus_index : int) -> float:
|
|
||||||
var initial_linear = 1.0
|
|
||||||
if initial_bus_volumes.size() > bus_index:
|
|
||||||
initial_linear = initial_bus_volumes[bus_index]
|
|
||||||
var linear = db_to_linear(AudioServer.get_bus_volume_db(bus_index))
|
|
||||||
linear /= initial_linear
|
|
||||||
return linear
|
|
||||||
|
|
||||||
static func set_bus_volume(bus_index : int, linear : float) -> void:
|
|
||||||
var initial_linear = 1.0
|
|
||||||
if initial_bus_volumes.size() > bus_index:
|
|
||||||
initial_linear = initial_bus_volumes[bus_index]
|
|
||||||
linear *= initial_linear
|
|
||||||
AudioServer.set_bus_volume_db(bus_index, linear_to_db(linear))
|
|
||||||
|
|
||||||
static func is_muted() -> bool:
|
|
||||||
return AudioServer.is_bus_mute(MASTER_BUS_INDEX)
|
|
||||||
|
|
||||||
static func set_mute(mute_flag : bool) -> void:
|
|
||||||
AudioServer.set_bus_mute(MASTER_BUS_INDEX, mute_flag)
|
|
||||||
|
|
||||||
static func get_audio_bus_name(bus_iter : int) -> String:
|
|
||||||
return AudioServer.get_bus_name(bus_iter)
|
|
||||||
|
|
||||||
static func set_audio_from_config() -> void:
|
|
||||||
for bus_iter in AudioServer.bus_count:
|
|
||||||
var bus_key : String = get_audio_bus_name(bus_iter).to_pascal_case()
|
|
||||||
var bus_volume : float = get_bus_volume(bus_iter)
|
|
||||||
initial_bus_volumes.append(bus_volume)
|
|
||||||
bus_volume = PlayerConfig.get_config(AUDIO_SECTION, bus_key, bus_volume)
|
|
||||||
if is_nan(bus_volume):
|
|
||||||
bus_volume = 1.0
|
|
||||||
PlayerConfig.set_config(AUDIO_SECTION, bus_key, bus_volume)
|
|
||||||
set_bus_volume(bus_iter, bus_volume)
|
|
||||||
var mute_audio_flag : bool = is_muted()
|
|
||||||
mute_audio_flag = PlayerConfig.get_config(AUDIO_SECTION, MUTE_SETTING, mute_audio_flag)
|
|
||||||
set_mute(mute_audio_flag)
|
|
||||||
|
|
||||||
# Video
|
|
||||||
|
|
||||||
static func set_fullscreen_enabled(value : bool, window : Window) -> void:
|
|
||||||
window.mode = Window.MODE_EXCLUSIVE_FULLSCREEN if (value) else Window.MODE_WINDOWED
|
|
||||||
|
|
||||||
static func set_resolution(value : Vector2i, window : Window, update_config : bool = true) -> void:
|
|
||||||
if value.x == 0 or value.y == 0:
|
|
||||||
return
|
|
||||||
window.size = value
|
|
||||||
if update_config:
|
|
||||||
PlayerConfig.set_config(VIDEO_SECTION, SCREEN_RESOLUTION, value)
|
|
||||||
|
|
||||||
static func is_fullscreen(window : Window) -> bool:
|
|
||||||
return (window.mode == Window.MODE_EXCLUSIVE_FULLSCREEN) or (window.mode == Window.MODE_FULLSCREEN)
|
|
||||||
|
|
||||||
static func get_resolution(window : Window) -> Vector2i:
|
|
||||||
var current_resolution : Vector2i = window.size
|
|
||||||
return PlayerConfig.get_config(VIDEO_SECTION, SCREEN_RESOLUTION, current_resolution)
|
|
||||||
|
|
||||||
static func _on_window_size_changed(window: Window) -> void:
|
|
||||||
PlayerConfig.set_config(VIDEO_SECTION, SCREEN_RESOLUTION, window.size)
|
|
||||||
|
|
||||||
static func _set_fullscreen_from_config(window: Window) -> bool:
|
|
||||||
var fullscreen_enabled : bool = is_fullscreen(window)
|
|
||||||
fullscreen_enabled = PlayerConfig.get_config(VIDEO_SECTION, FULLSCREEN, fullscreen_enabled)
|
|
||||||
set_fullscreen_enabled(fullscreen_enabled, window)
|
|
||||||
return fullscreen_enabled
|
|
||||||
|
|
||||||
static func set_vsync(vsync_mode : DisplayServer.VSyncMode, window : Window = null) -> void:
|
|
||||||
var window_id : int = 0
|
|
||||||
if window:
|
|
||||||
window_id = window.get_window_id()
|
|
||||||
DisplayServer.window_set_vsync_mode(vsync_mode, window_id)
|
|
||||||
|
|
||||||
static func get_vsync(window : Window = null) -> DisplayServer.VSyncMode:
|
|
||||||
var window_id : int = 0
|
|
||||||
if window:
|
|
||||||
window_id = window.get_window_id()
|
|
||||||
var vsync_mode = DisplayServer.window_get_vsync_mode(window_id)
|
|
||||||
return vsync_mode
|
|
||||||
|
|
||||||
static func _set_v_sync_from_config(window: Window) -> DisplayServer.VSyncMode:
|
|
||||||
var vsync := get_vsync(window)
|
|
||||||
vsync = PlayerConfig.get_config(VIDEO_SECTION, V_SYNC, vsync)
|
|
||||||
set_vsync(vsync)
|
|
||||||
return vsync
|
|
||||||
|
|
||||||
static func set_video_from_config(window : Window) -> void:
|
|
||||||
window.size_changed.connect(_on_window_size_changed.bind(window))
|
|
||||||
var fullscreen_enabled := _set_fullscreen_from_config(window)
|
|
||||||
if not (fullscreen_enabled or OS.has_feature("web")):
|
|
||||||
var current_resolution : Vector2i = get_resolution(window)
|
|
||||||
set_resolution(current_resolution, window)
|
|
||||||
_set_v_sync_from_config(window)
|
|
||||||
|
|
||||||
# All
|
|
||||||
|
|
||||||
static func set_from_config() -> void:
|
|
||||||
set_default_inputs()
|
|
||||||
set_inputs_from_config()
|
|
||||||
set_audio_from_config()
|
|
||||||
|
|
||||||
static func set_from_config_and_window(window : Window) -> void:
|
|
||||||
set_from_config()
|
|
||||||
set_video_from_config(window)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dwflyh7g2rjxt
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
class_name PlayerConfig
|
|
||||||
extends Object
|
|
||||||
|
|
||||||
## Interface for a single configuration file through [ConfigFile].
|
|
||||||
|
|
||||||
const CONFIG_FILE_LOCATION := "user://player_config.cfg"
|
|
||||||
|
|
||||||
static var config_file : ConfigFile
|
|
||||||
|
|
||||||
static func _save_config_file() -> void:
|
|
||||||
var save_error : int = config_file.save(CONFIG_FILE_LOCATION)
|
|
||||||
if save_error:
|
|
||||||
push_error("save config file failed with error %d" % save_error)
|
|
||||||
|
|
||||||
static func load_config_file() -> void:
|
|
||||||
if config_file != null:
|
|
||||||
return
|
|
||||||
config_file = ConfigFile.new()
|
|
||||||
var load_error : int = config_file.load(CONFIG_FILE_LOCATION)
|
|
||||||
if load_error:
|
|
||||||
var save_error : int = config_file.save(CONFIG_FILE_LOCATION)
|
|
||||||
if save_error:
|
|
||||||
push_error("save config file failed with error %d" % save_error)
|
|
||||||
|
|
||||||
static func set_config(section: String, key: String, value) -> void:
|
|
||||||
load_config_file()
|
|
||||||
config_file.set_value(section, key, value)
|
|
||||||
_save_config_file()
|
|
||||||
|
|
||||||
static func get_config(section: String, key: String, default = null) -> Variant:
|
|
||||||
load_config_file()
|
|
||||||
return config_file.get_value(section, key, default)
|
|
||||||
|
|
||||||
static func has_section(section: String) -> bool:
|
|
||||||
load_config_file()
|
|
||||||
return config_file.has_section(section)
|
|
||||||
|
|
||||||
static func has_section_key(section: String, key: String) -> bool:
|
|
||||||
load_config_file()
|
|
||||||
return config_file.has_section_key(section, key)
|
|
||||||
|
|
||||||
static func erase_section(section: String) -> void:
|
|
||||||
if has_section(section):
|
|
||||||
config_file.erase_section(section)
|
|
||||||
_save_config_file()
|
|
||||||
|
|
||||||
static func erase_section_key(section: String, key: String) -> void:
|
|
||||||
if has_section_key(section, key):
|
|
||||||
config_file.erase_section_key(section, key)
|
|
||||||
_save_config_file()
|
|
||||||
|
|
||||||
static func get_section_keys(section: String) -> PackedStringArray:
|
|
||||||
load_config_file()
|
|
||||||
if config_file.has_section(section):
|
|
||||||
return config_file.get_section_keys(section)
|
|
||||||
return PackedStringArray()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dxjk8pgi7yhtq
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
@tool
|
|
||||||
extends Label
|
|
||||||
## Displays the value of `application/config/name`, set in project settings.
|
|
||||||
|
|
||||||
const NO_NAME_STRING : String = "Title"
|
|
||||||
|
|
||||||
## If true, update the title when ready.
|
|
||||||
@export var auto_update : bool = true
|
|
||||||
|
|
||||||
func update_name_label():
|
|
||||||
var config_name : String = ProjectSettings.get_setting("application/config/name", NO_NAME_STRING)
|
|
||||||
if config_name.is_empty():
|
|
||||||
config_name = NO_NAME_STRING
|
|
||||||
text = config_name
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if auto_update:
|
|
||||||
update_name_label()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bkwlopi4qn32o
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
@tool
|
|
||||||
extends Label
|
|
||||||
## Displays the value of `application/config/version`, set in project settings.
|
|
||||||
|
|
||||||
const NO_VERSION_STRING : String = "0.0.0"
|
|
||||||
|
|
||||||
## Prefixes the value of `application/config/version` when displaying to the user.
|
|
||||||
@export var version_prefix : String = "v"
|
|
||||||
|
|
||||||
func update_version_label() -> void:
|
|
||||||
var config_version : String = ProjectSettings.get_setting("application/config/version", NO_VERSION_STRING)
|
|
||||||
if config_version.is_empty():
|
|
||||||
config_version = NO_VERSION_STRING
|
|
||||||
text = version_prefix + config_version
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
update_version_label()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dmkubt2nsnsbn
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
@tool
|
|
||||||
extends RichTextLabel
|
|
||||||
## Script for parsing an attribution file in markdown format.
|
|
||||||
|
|
||||||
const HEADING_STRING_REPLACEMENT = "$1[font_size=%d]$2[/font_size]"
|
|
||||||
const BOLD_HEADING_STRING_REPLACEMENT = "$1[b][font_size=%d]$2[/font_size][/b]"
|
|
||||||
|
|
||||||
## The path to the attribution file in markdown format.
|
|
||||||
@export_file("*.md") var attribution_file_path: String
|
|
||||||
## If true, update the content of the text label from the attribution file when ready.
|
|
||||||
@export var auto_update : bool = true
|
|
||||||
@export_group("Font Sizes")
|
|
||||||
## The size to give text that was formatted as h1 header.
|
|
||||||
@export var h1_font_size: int
|
|
||||||
## The size to give text that was formatted as h2 header.
|
|
||||||
@export var h2_font_size: int
|
|
||||||
## The size to give text that was formatted as h3 header.
|
|
||||||
@export var h3_font_size: int
|
|
||||||
## The size to give text that was formatted as h4 header.
|
|
||||||
@export var h4_font_size: int
|
|
||||||
## The size to give text that was formatted as h5 header.
|
|
||||||
@export var h5_font_size: int
|
|
||||||
## The size to give text that was formatted as h6 header.
|
|
||||||
@export var h6_font_size: int
|
|
||||||
## If true, bold any headers (h1-h6).
|
|
||||||
@export var bold_headings : bool
|
|
||||||
@export_group("Image Sizes")
|
|
||||||
## The maximum width in pixels of any images loaded from the attibution file.
|
|
||||||
@export var max_image_width: int
|
|
||||||
## The maximum height in pixels of any images loaded from the attibution file.
|
|
||||||
@export var max_image_height : int
|
|
||||||
@export_group("Extra Options")
|
|
||||||
## If true, disable reading images from the attribution file.
|
|
||||||
@export var disable_images : bool = false
|
|
||||||
## If true, disable reading URLs from the attribution file.
|
|
||||||
@export var disable_urls : bool = false
|
|
||||||
## If true, disable opening links. For platforms that don't permit linking to other domains.
|
|
||||||
@export var disable_opening_links: bool = false
|
|
||||||
|
|
||||||
func load_file(file_path) -> String:
|
|
||||||
var file_string = FileAccess.get_file_as_string(file_path)
|
|
||||||
if file_string == null:
|
|
||||||
push_warning("File open error: %s" % FileAccess.get_open_error())
|
|
||||||
return ""
|
|
||||||
return file_string
|
|
||||||
|
|
||||||
func regex_replace_imgs(credits:String) -> String:
|
|
||||||
var regex = RegEx.new()
|
|
||||||
var match_string := "!\\[([^\\]]*)\\]\\(([^\\)]*)\\)"
|
|
||||||
var replace_string := ""
|
|
||||||
if not disable_images:
|
|
||||||
replace_string = "res://$2[/img]"
|
|
||||||
if max_image_width:
|
|
||||||
if max_image_height:
|
|
||||||
replace_string = ("[img=%dx%d]" % [max_image_width, max_image_height]) + replace_string
|
|
||||||
else:
|
|
||||||
replace_string = ("[img=%d]" % [max_image_width]) + replace_string
|
|
||||||
else:
|
|
||||||
replace_string = "[img]" + replace_string
|
|
||||||
regex.compile(match_string)
|
|
||||||
return regex.sub(credits, replace_string, true)
|
|
||||||
|
|
||||||
func regex_replace_urls(credits:String) -> String:
|
|
||||||
var regex = RegEx.new()
|
|
||||||
var match_string := "\\[([^\\]]*)\\]\\(([^\\)]*)\\)"
|
|
||||||
var replace_string := "$1"
|
|
||||||
if not disable_urls:
|
|
||||||
replace_string = "[url=$2]$1[/url]"
|
|
||||||
regex.compile(match_string)
|
|
||||||
return regex.sub(credits, replace_string, true)
|
|
||||||
|
|
||||||
func regex_replace_titles(credits:String) -> String:
|
|
||||||
var iter = 0
|
|
||||||
var heading_font_sizes : Array[int] = [
|
|
||||||
h1_font_size,
|
|
||||||
h2_font_size,
|
|
||||||
h3_font_size,
|
|
||||||
h4_font_size,
|
|
||||||
h5_font_size,
|
|
||||||
h6_font_size]
|
|
||||||
for heading_font_size in heading_font_sizes:
|
|
||||||
iter += 1
|
|
||||||
var regex = RegEx.new()
|
|
||||||
var match_string : String = "([^#]|^)#{%d}\\s([^\n]*)" % iter
|
|
||||||
var replace_string := HEADING_STRING_REPLACEMENT % [heading_font_size]
|
|
||||||
if bold_headings:
|
|
||||||
replace_string = BOLD_HEADING_STRING_REPLACEMENT % [heading_font_size]
|
|
||||||
regex.compile(match_string)
|
|
||||||
credits = regex.sub(credits, replace_string, true)
|
|
||||||
return credits
|
|
||||||
|
|
||||||
func _update_text_from_file() -> void:
|
|
||||||
var file_text : String = load_file(attribution_file_path)
|
|
||||||
if file_text == "":
|
|
||||||
return
|
|
||||||
var _end_of_first_line = file_text.find("\n") + 1
|
|
||||||
file_text = file_text.right(-_end_of_first_line) # Trims first line "ATTRIBUTION"
|
|
||||||
file_text = regex_replace_imgs(file_text)
|
|
||||||
file_text = regex_replace_urls(file_text)
|
|
||||||
file_text = regex_replace_titles(file_text)
|
|
||||||
text = file_text
|
|
||||||
|
|
||||||
func set_file_path(file_path:String) -> void:
|
|
||||||
attribution_file_path = file_path
|
|
||||||
_update_text_from_file()
|
|
||||||
|
|
||||||
func _on_meta_clicked(meta: String) -> void:
|
|
||||||
if meta.begins_with("https://") and not disable_opening_links:
|
|
||||||
var _err = OS.shell_open(meta)
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
meta_clicked.connect(_on_meta_clicked)
|
|
||||||
if not auto_update: return
|
|
||||||
set_file_path(attribution_file_path)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cc2wtqasev7le
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
@tool
|
|
||||||
extends Label
|
|
||||||
## Displays the value of `version` from the config file of the specified plugin.
|
|
||||||
|
|
||||||
const NO_VERSION_STRING : String = "0.0.0"
|
|
||||||
|
|
||||||
@export var plugin_directory : String
|
|
||||||
@export var version_prefix : String = "v"
|
|
||||||
|
|
||||||
func _get_plugin_version() -> String:
|
|
||||||
if not plugin_directory.is_empty():
|
|
||||||
for enabled_plugin in ProjectSettings.get_setting("editor_plugins/enabled"):
|
|
||||||
if enabled_plugin.contains(plugin_directory):
|
|
||||||
var config := ConfigFile.new()
|
|
||||||
var error = config.load(enabled_plugin)
|
|
||||||
if error != OK:
|
|
||||||
break
|
|
||||||
return config.get_value("plugin", "version", NO_VERSION_STRING)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func update_version_label() -> void:
|
|
||||||
var plugin_version = _get_plugin_version()
|
|
||||||
if plugin_version.is_empty():
|
|
||||||
plugin_version = NO_VERSION_STRING
|
|
||||||
text = version_prefix + plugin_version
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
update_version_label()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://kgp5jnrxxhdy
|
|
||||||