diff --git a/assets/graphics/_template_humanoid.png b/assets/graphics/_template_humanoid.png new file mode 100644 index 0000000..7de2830 Binary files /dev/null and b/assets/graphics/_template_humanoid.png differ diff --git a/assets/graphics/_template_humanoid.png.import b/assets/graphics/_template_humanoid.png.import new file mode 100644 index 0000000..7c1a4ca --- /dev/null +++ b/assets/graphics/_template_humanoid.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/_template_humanoid.png-8acdc4563ae3cf10090fe952ed7e4d60.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/rpgh_engine/assets/graphics/_template_humanoid.png" +dest_files=[ "res://.import/_template_humanoid.png-8acdc4563ae3cf10090fe952ed7e4d60.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/assets/graphics/template_humanoid.png b/assets/graphics/template_humanoid.png index 681a00b..7a347a5 100644 Binary files a/assets/graphics/template_humanoid.png and b/assets/graphics/template_humanoid.png differ diff --git a/nodes/event/event.gd b/nodes/event/event.gd index cac7e24..66659d1 100644 --- a/nodes/event/event.gd +++ b/nodes/event/event.gd @@ -107,7 +107,7 @@ func _get_state(): # Just a fast wrapper for "storable.gd". class RPGH_Storable: - extends "res://addons/rpgh_engine/data_management/storable.gd" + extends "res://addons/rpgh_engine/system/data_management/storable.gd" func _init(key: String, value = null, map = null, event = null).(key, value, map, event): pass func Storable(key: String, value = null) -> RPGH_Storable: return RPGH_Storable.new(name + key, value, map, self) diff --git a/nodes/map/map.gd b/nodes/map/map.gd index 97f15a4..019dea2 100644 --- a/nodes/map/map.gd +++ b/nodes/map/map.gd @@ -12,6 +12,11 @@ func _init(): func _ready(): + if get_parent() == get_tree().get_root(): + print("is correct") + get_parent().call_deferred("remove_child", self) + RPGH.MapManager.call_deferred("add_child", self) + if !Engine.editor_hint: var top_layer_sprite = Sprite.new() top_layer_sprite.name = "\\TopLayer" @@ -46,7 +51,7 @@ func _set_bottom_layer(new_bottom_layer): # Just a fast wrapper for "storable.gd". class RPGH_Storable: - extends "res://addons/rpgh_engine/data_management/storable.gd" + extends "res://addons/rpgh_engine/system/data_management/storable.gd" func _init(key: String, value = null, map = null, event = null).(key, value, map, event): pass func Storable(key: String, value = null) -> RPGH_Storable: return RPGH_Storable.new(key, value, self) diff --git a/rpgh_engine.tscn b/rpgh_engine.tscn index 73fefda..fbfcb68 100644 --- a/rpgh_engine.tscn +++ b/rpgh_engine.tscn @@ -1,15 +1,16 @@ -[gd_scene load_steps=23 format=2] +[gd_scene load_steps=24 format=2] -[ext_resource path="res://addons/rpgh_engine/data_management/data_manager.gd" type="Script" id=1] +[ext_resource path="res://addons/rpgh_engine/system/data_management/data_manager.gd" type="Script" id=1] [ext_resource path="res://addons/rpgh_engine/system/rpgh_engine.gd" type="Script" id=2] -[ext_resource path="res://addons/rpgh_engine/ingame/camera/ingame_display.material" type="Material" id=3] -[ext_resource path="res://addons/rpgh_engine/ingame/player/player.tscn" type="PackedScene" id=4] -[ext_resource path="res://addons/rpgh_engine/ui/textbox.gd" type="Script" id=5] -[ext_resource path="res://addons/rpgh_engine/ingame/camera/camera.gd" type="Script" id=6] +[ext_resource path="res://addons/rpgh_engine/system/ingame/camera/ingame_display.material" type="Material" id=3] +[ext_resource path="res://addons/rpgh_engine/system/ingame/player/player.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/rpgh_engine/system/ui/textbox.gd" type="Script" id=5] +[ext_resource path="res://addons/rpgh_engine/system/ingame/camera/camera.gd" type="Script" id=6] [ext_resource path="res://game/maps/hobby_room_corrupted/ako_shocked.png" type="Texture" id=7] -[ext_resource path="res://addons/rpgh_engine/ui/dialog.gd" type="Script" id=8] -[ext_resource path="res://addons/rpgh_engine/ui/pause.gd" type="Script" id=9] -[ext_resource path="res://addons/rpgh_engine/ingame/map_manager/map_manager.gd" type="Script" id=10] +[ext_resource path="res://addons/rpgh_engine/system/ui/dialog.gd" type="Script" id=8] +[ext_resource path="res://addons/rpgh_engine/system/ui/pause.gd" type="Script" id=9] +[ext_resource path="res://addons/rpgh_engine/system/ingame/map_manager/map_manager.gd" type="Script" id=10] +[ext_resource path="res://addons/rpgh_engine/system/data_management/command_system.gd" type="Script" id=11] [sub_resource type="ViewportTexture" id=1] flags = 4 @@ -344,6 +345,9 @@ script = ExtResource( 2 ) [node name="DataManager" type="Node" parent="."] script = ExtResource( 1 ) +[node name="CommandSystem" type="Node" parent="DataManager"] +script = ExtResource( 11 ) + [node name="Ingame" type="Node" parent="."] [node name="Viewport" type="Viewport" parent="Ingame"] diff --git a/system/data_management/command_system.gd b/system/data_management/command_system.gd new file mode 100644 index 0000000..1eccaec --- /dev/null +++ b/system/data_management/command_system.gd @@ -0,0 +1,16 @@ +extends Node + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/data_management/data_manager.gd b/system/data_management/data_manager.gd similarity index 100% rename from data_management/data_manager.gd rename to system/data_management/data_manager.gd diff --git a/data_management/storable.gd b/system/data_management/storable.gd similarity index 100% rename from data_management/storable.gd rename to system/data_management/storable.gd diff --git a/ingame/camera/camera.gd b/system/ingame/camera/camera.gd similarity index 100% rename from ingame/camera/camera.gd rename to system/ingame/camera/camera.gd diff --git a/ingame/camera/ingame_display.material b/system/ingame/camera/ingame_display.material similarity index 100% rename from ingame/camera/ingame_display.material rename to system/ingame/camera/ingame_display.material diff --git a/ingame/humanoid/animation_handler.gd b/system/ingame/humanoid/animation_handler.gd similarity index 100% rename from ingame/humanoid/animation_handler.gd rename to system/ingame/humanoid/animation_handler.gd diff --git a/ingame/humanoid/humanoid.gd b/system/ingame/humanoid/humanoid.gd similarity index 100% rename from ingame/humanoid/humanoid.gd rename to system/ingame/humanoid/humanoid.gd diff --git a/ingame/humanoid/humanoid.tscn b/system/ingame/humanoid/humanoid.tscn similarity index 76% rename from ingame/humanoid/humanoid.tscn rename to system/ingame/humanoid/humanoid.tscn index 97fe248..cbd7ac4 100644 --- a/ingame/humanoid/humanoid.tscn +++ b/system/ingame/humanoid/humanoid.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://addons/rpgh_engine/ingame/humanoid/humanoid.gd" type="Script" id=1] +[ext_resource path="res://addons/rpgh_engine/system/ingame/humanoid/humanoid.gd" type="Script" id=1] [ext_resource path="res://addons/rpgh_engine/assets/graphics/template_humanoid.png" type="Texture" id=2] -[ext_resource path="res://addons/rpgh_engine/ingame/humanoid/animation_handler.gd" type="Script" id=3] +[ext_resource path="res://addons/rpgh_engine/system/ingame/humanoid/animation_handler.gd" type="Script" id=3] [sub_resource type="RectangleShape2D" id=1] @@ -12,7 +12,7 @@ script = ExtResource( 1 ) [node name="Texture" type="Sprite" parent="."] texture = ExtResource( 2 ) centered = false -offset = Vector2( 0, -14 ) +offset = Vector2( -4, -18 ) hframes = 15 vframes = 8 frame = 60 diff --git a/ingame/map_manager/map_manager.gd b/system/ingame/map_manager/map_manager.gd similarity index 100% rename from ingame/map_manager/map_manager.gd rename to system/ingame/map_manager/map_manager.gd diff --git a/ingame/player/player.gd b/system/ingame/player/player.gd similarity index 100% rename from ingame/player/player.gd rename to system/ingame/player/player.gd diff --git a/ingame/player/player.tscn b/system/ingame/player/player.tscn similarity index 67% rename from ingame/player/player.tscn rename to system/ingame/player/player.tscn index 719788f..66cb248 100644 --- a/ingame/player/player.tscn +++ b/system/ingame/player/player.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://addons/rpgh_engine/ingame/humanoid/humanoid.tscn" type="PackedScene" id=1] -[ext_resource path="res://addons/rpgh_engine/ingame/player/player.gd" type="Script" id=2] +[ext_resource path="res://addons/rpgh_engine/system/ingame/humanoid/humanoid.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/rpgh_engine/system/ingame/player/player.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] diff --git a/system/rpgh_engine.gd b/system/rpgh_engine.gd index f2889f4..0d955db 100644 --- a/system/rpgh_engine.gd +++ b/system/rpgh_engine.gd @@ -2,12 +2,9 @@ extends Node const DEFAULT_SCREEN_SIZE = Vector2(640, 360) -var global_data := {} - onready var DataManager = get_node("DataManager") +onready var CommandSystem = get_node("DataManager/CommandSystem") onready var MapManager = get_node("Ingame/Viewport/MapManager") onready var Player = get_node("Ingame/Viewport/MapManager/Player") onready var Camera = get_node("Ingame/Viewport/MapManager/Camera") onready var Dialog = get_node("UI/Dialog") - - diff --git a/system/ui/bust.material b/system/ui/bust.material new file mode 100644 index 0000000..4af1689 Binary files /dev/null and b/system/ui/bust.material differ diff --git a/ui/bust_transition.png b/system/ui/bust_transition.png similarity index 100% rename from ui/bust_transition.png rename to system/ui/bust_transition.png diff --git a/ui/bust_transition.png.import b/system/ui/bust_transition.png.import similarity index 66% rename from ui/bust_transition.png.import rename to system/ui/bust_transition.png.import index 3cb2595..cad01f3 100644 --- a/ui/bust_transition.png.import +++ b/system/ui/bust_transition.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bust_transition.png-4f62a5e234bc14ba3bbb18d047ce1a4f.stex" +path="res://.import/bust_transition.png-5e2024717fbb10df8f29722c43b1b119.stex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/rpgh_engine/ui/bust_transition.png" -dest_files=[ "res://.import/bust_transition.png-4f62a5e234bc14ba3bbb18d047ce1a4f.stex" ] +source_file="res://addons/rpgh_engine/system/ui/bust_transition.png" +dest_files=[ "res://.import/bust_transition.png-5e2024717fbb10df8f29722c43b1b119.stex" ] [params] diff --git a/ui/dialog.gd b/system/ui/dialog.gd similarity index 100% rename from ui/dialog.gd rename to system/ui/dialog.gd diff --git a/ui/pause.gd b/system/ui/pause.gd similarity index 100% rename from ui/pause.gd rename to system/ui/pause.gd diff --git a/ui/textbox.gd b/system/ui/textbox.gd similarity index 100% rename from ui/textbox.gd rename to system/ui/textbox.gd diff --git a/ui/bust.material b/ui/bust.material deleted file mode 100644 index 76e7070..0000000 Binary files a/ui/bust.material and /dev/null differ