diff --git a/Themes/UI Theme.tres b/Themes/UI Theme.tres deleted file mode 100644 index 5faba1b..0000000 --- a/Themes/UI Theme.tres +++ /dev/null @@ -1,15 +0,0 @@ -[gd_resource type="Theme" load_steps=2 format=3 uid="uid://dm7ee4aqjr2dl"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l4fss"] -bg_color = Color(9.14484e-07, 0.446448, 0.577112, 1) -corner_radius_top_left = 8 -corner_radius_top_right = 8 -corner_radius_bottom_right = 8 -corner_radius_bottom_left = 8 - -[resource] -MarginContainer/constants/margin_bottom = 16 -MarginContainer/constants/margin_left = 16 -MarginContainer/constants/margin_right = 16 -MarginContainer/constants/margin_top = 16 -PanelContainer/styles/panel = SubResource("StyleBoxFlat_l4fss") diff --git a/scenes/Entities/TestNPC.tscn b/scenes/Entities/TestNPC.tscn index 94f6a58..9d5df45 100644 --- a/scenes/Entities/TestNPC.tscn +++ b/scenes/Entities/TestNPC.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=7 format=3 uid="uid://dr4b2pmsknuhc"] +[gd_scene load_steps=8 format=3 uid="uid://dr4b2pmsknuhc"] -[ext_resource type="Script" path="res://scripts/Entities/TestNPCController.gd" id="1_61g2d"] +[ext_resource type="Script" path="res://scripts/Entities/BasicNPCEntity.gd" id="1_1muh7"] [ext_resource type="Shader" path="res://shaders/NPC Shader.gdshader" id="1_xgcv1"] +[ext_resource type="Script" path="res://scripts/Cutscene/TestCutscene.gd" id="2_jwvuu"] [ext_resource type="Texture2D" uid="uid://boa4hvwyoslv0" path="res://textures/characters/base_male.png" id="3_20w6p"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dw1sy"] @@ -18,7 +19,9 @@ shader_parameter/direction = 1 shader_parameter/npcTexture = ExtResource("3_20w6p") [node name="TestNpc" type="CharacterBody3D"] -script = ExtResource("1_61g2d") +script = ExtResource("1_1muh7") +interactType = 1 +interactCutscene = ExtResource("2_jwvuu") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.126485) diff --git a/scenes/MainMenu.tscn b/scenes/MainMenu.tscn index 83163fa..5df1622 100644 --- a/scenes/MainMenu.tscn +++ b/scenes/MainMenu.tscn @@ -1,8 +1,3 @@ -[gd_scene load_steps=2 format=3 uid="uid://w1q5eoiejmy3"] - -[ext_resource type="PackedScene" uid="uid://yhtpoum3eek7" path="res://scenes/Entities/Rosa.tscn" id="1_0sbv6"] +[gd_scene format=3 uid="uid://w1q5eoiejmy3"] [node name="MainMenu" type="Node3D"] - -[node name="Rosa" parent="." instance=ExtResource("1_0sbv6")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.837138, 0, 0.904558) diff --git a/scenes/Maps/SomeMap.tscn b/scenes/Maps/SomeMap.tscn index c4545dd..50d0504 100644 --- a/scenes/Maps/SomeMap.tscn +++ b/scenes/Maps/SomeMap.tscn @@ -1,7 +1,37 @@ -[gd_scene load_steps=2 format=3 uid="uid://dx6fv8n4jl5ku"] +[gd_scene load_steps=7 format=3 uid="uid://dx6fv8n4jl5ku"] [ext_resource type="PackedScene" uid="uid://mr2ako4ox2gq" path="res://models/maps/SomeMap/SomeMapModel.tscn" id="1_sbtr5"] +[ext_resource type="PackedScene" uid="uid://yhtpoum3eek7" path="res://scenes/Entities/Rosa.tscn" id="2_2h4bv"] +[ext_resource type="PackedScene" uid="uid://dr4b2pmsknuhc" path="res://scenes/Entities/TestNPC.tscn" id="3_q0pj2"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_e1h75"] +sky_horizon_color = Color(0.59625, 0.6135, 0.6375, 1) +sky_energy_multiplier = 0.0 +ground_bottom_color = Color(0, 0, 0, 1) +ground_horizon_color = Color(0.59625, 0.6135, 0.6375, 1) + +[sub_resource type="Sky" id="Sky_weucl"] +sky_material = SubResource("ProceduralSkyMaterial_e1h75") + +[sub_resource type="Environment" id="Environment_nyivo"] +sky = SubResource("Sky_weucl") +ambient_light_source = 1 [node name="Some-map" type="Node3D"] [node name="some map" parent="." instance=ExtResource("1_sbtr5")] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_nyivo") + +[node name="Rosa" parent="." instance=ExtResource("2_2h4bv")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.651853, 0.684572, -0.0593004) + +[node name="TestNpc" parent="." instance=ExtResource("3_q0pj2")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.68747, 0.459578, -0.399262) +direction = 1 + +[node name="OmniLight3D" type="OmniLight3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -38.1432, 54.7591, -25.7675) +light_energy = 15.315 +omni_range = 281.646 diff --git a/scenes/Meta/Overworld.tscn b/scenes/Meta/Overworld.tscn index 4b16439..7e9a659 100644 --- a/scenes/Meta/Overworld.tscn +++ b/scenes/Meta/Overworld.tscn @@ -1,38 +1,9 @@ -[gd_scene load_steps=8 format=3 uid="uid://tmbx2kit0jyq"] +[gd_scene load_steps=3 format=3 uid="uid://tmbx2kit0jyq"] -[ext_resource type="PackedScene" uid="uid://yhtpoum3eek7" path="res://scenes/Entities/Rosa.tscn" id="1_xny00"] [ext_resource type="Script" path="res://scripts/Scenes/OverworldScene.gd" id="1_yv6j0"] -[ext_resource type="PackedScene" uid="uid://dr4b2pmsknuhc" path="res://scenes/Entities/TestNPC.tscn" id="2_p8bk2"] [ext_resource type="PackedScene" uid="uid://dx6fv8n4jl5ku" path="res://scenes/Maps/SomeMap.tscn" id="4_8dvtu"] -[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_asdol"] -sky_horizon_color = Color(0.59625, 0.6135, 0.6375, 1) -sky_energy_multiplier = 0.0 -ground_bottom_color = Color(0, 0, 0, 1) -ground_horizon_color = Color(0.59625, 0.6135, 0.6375, 1) - -[sub_resource type="Sky" id="Sky_weucl"] -sky_material = SubResource("ProceduralSkyMaterial_asdol") - -[sub_resource type="Environment" id="Environment_pyuof"] -sky = SubResource("Sky_weucl") -ambient_light_source = 1 - [node name="Overworld" type="Node3D"] script = ExtResource("1_yv6j0") -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource("Environment_pyuof") - -[node name="Rosa" parent="." instance=ExtResource("1_xny00")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.651853, 0.684572, -0.0593004) - -[node name="TestNpc" parent="." instance=ExtResource("2_p8bk2")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.68747, 0.459578, -0.399262) - -[node name="OmniLight3D" type="OmniLight3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -38.1432, 54.7591, -25.7675) -light_energy = 15.315 -omni_range = 281.646 - [node name="Some-map" parent="." instance=ExtResource("4_8dvtu")] diff --git a/scenes/Meta/RootScene.tscn b/scenes/Meta/RootScene.tscn index 33bef81..4dab95e 100644 --- a/scenes/Meta/RootScene.tscn +++ b/scenes/Meta/RootScene.tscn @@ -10,5 +10,3 @@ script = ExtResource("1_xu06r") [node name="Systems" parent="." instance=ExtResource("2_et43v")] [node name="UI" parent="." instance=ExtResource("3_fwr0j")] -offset_right = -1152.0 -offset_bottom = -648.0 diff --git a/scenes/Meta/UI.tscn b/scenes/Meta/UI.tscn index 0c72566..89ab090 100644 --- a/scenes/Meta/UI.tscn +++ b/scenes/Meta/UI.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://dfwwtbs3ywcyq"] -[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://Themes/UI Theme.tres" id="1_3b1y4"] +[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://ui/UI Theme.tres" id="1_3b1y4"] [ext_resource type="Script" path="res://scripts/Scenes/UIScene.gd" id="2_5efuf"] [ext_resource type="PackedScene" uid="uid://bkx3l0kckf4a8" path="res://scenes/UI/VNTextbox.tscn" id="2_x0c4l"] @@ -15,6 +15,5 @@ theme = ExtResource("1_3b1y4") script = ExtResource("2_5efuf") [node name="VNTextbox" parent="." instance=ExtResource("2_x0c4l")] -visible = false layout_mode = 1 offset_top = -133.0 diff --git a/scenes/UI/VNTextbox.tscn b/scenes/UI/VNTextbox.tscn index e6468d9..5c5bf2f 100644 --- a/scenes/UI/VNTextbox.tscn +++ b/scenes/UI/VNTextbox.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://bkx3l0kckf4a8"] -[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://Themes/UI Theme.tres" id="1_wx4lp"] +[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://ui/UI Theme.tres" id="1_wx4lp"] [ext_resource type="Script" path="res://scripts/UI/VNTextbox.gd" id="2_uo1gm"] [node name="VNTextbox" type="PanelContainer"] @@ -8,7 +8,7 @@ anchors_preset = 12 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = -134.0 +offset_top = -140.0 grow_horizontal = 2 grow_vertical = 0 theme = ExtResource("1_wx4lp") @@ -24,4 +24,5 @@ theme = ExtResource("1_wx4lp") bbcode_enabled = true text = "test test +test test" diff --git a/scripts/Entities/BasicNPCEntity.gd b/scripts/Entities/BasicNPCEntity.gd new file mode 100644 index 0000000..3428849 --- /dev/null +++ b/scripts/Entities/BasicNPCEntity.gd @@ -0,0 +1,26 @@ +class_name BasicNPCEntity extends "res://scripts/Entities/OverworldEntity.gd" +const Cutscene = preload("res://scripts/Cutscene/Cutscene.gd") + +enum BasicNPCInteractType { + NONE, + CUTSCENE +}; + +@export var interactType:BasicNPCInteractType = BasicNPCInteractType.NONE; +@export var interactCutscene:Resource; + +func interact(interactor:OverworldEntity) -> void: + if interactType == BasicNPCInteractType.NONE: + return + + if interactType == BasicNPCInteractType.CUTSCENE: + # Cutscene in this manner must take two entities + # (self, speaker, and interactor, player) + var instance:Cutscene = interactCutscene.new(self, interactor); + getSystems().CUTSCENE.setCurrentCutscene(instance); + return + + pass + +func updateMovement(delta:float) -> void: + pass diff --git a/scripts/Entities/OverworldEntity.gd b/scripts/Entities/OverworldEntity.gd index 26f6efc..6cb7dd9 100644 --- a/scripts/Entities/OverworldEntity.gd +++ b/scripts/Entities/OverworldEntity.gd @@ -1,5 +1,4 @@ -extends CharacterBody3D -class_name OverworldEntity +class_name OverworldEntity extends CharacterBody3D const PauseSystem = preload("res://scripts/System/PauseSystem.gd") @@ -14,7 +13,11 @@ var speed:float = 150; var friction:float = 8.5; var gravity:float = 30; -var direction = Direction.SOUTH; +@export var direction = Direction.SOUTH: + set(newDirection): + direction = newDirection; + _updateMaterial(); + var meshInstance:MeshInstance3D; var underFootTile:int = -1; var underFootPosition:Vector3; @@ -22,6 +25,14 @@ var underFootPosition:Vector3; var withinMapBounds:MapBounds; var withinBoundsLastFrame:bool = true; +func _updateMaterial(): + if !meshInstance: + return + var material:ShaderMaterial = meshInstance.get_surface_override_material(0) + if !material: + return + material.set_shader_parameter("direction", direction) + func getSystems() -> Systems: return get_tree().current_scene.get_node("Systems") as Systems; @@ -128,6 +139,7 @@ func _updateTileData() -> void: func _ready() -> void: meshInstance = get_node("MeshInstance3D") _updateTileData(); + _updateMaterial(); pass func _process(delta:float) -> void: @@ -144,10 +156,6 @@ func _process(delta:float) -> void: # Update logic updateOverworldLogic(delta) - - # Set shader direction. - var material:ShaderMaterial = meshInstance.get_surface_override_material(0) - material.set_shader_parameter("direction", direction) func _physics_process(delta: float) -> void: if isPaused(): diff --git a/scripts/Entities/TestNPCController.gd b/scripts/Entities/TestNPCController.gd deleted file mode 100644 index 84cd155..0000000 --- a/scripts/Entities/TestNPCController.gd +++ /dev/null @@ -1,15 +0,0 @@ -class_name TestNPCController extends "res://scripts/Entities/OverworldEntity.gd" -const TestCutscene = preload("res://scripts/Cutscene/TestCutscene.gd") - -func interact(interactor:OverworldEntity) -> void: - # var battle = Battle.new(); - # getSystems().BATTLE.startBattle(battle); - - # var game = CookingGame.new(VerticalSlice.new()); - # getSystems().COOKING.setCookingGame(game); - - getSystems().CUTSCENE.setCurrentCutscene(TestCutscene.new(interactor, self)); - pass - -func updateMovement(delta:float) -> void: - pass diff --git a/scripts/Scenes/UIScene.gd b/scripts/Scenes/UIScene.gd index 9d05b37..4334283 100644 --- a/scripts/Scenes/UIScene.gd +++ b/scripts/Scenes/UIScene.gd @@ -1 +1 @@ -class_name UIScene extends Control \ No newline at end of file +class_name UIScene extends Control diff --git a/textures/ui/ui_frame.png b/textures/ui/ui_frame.png new file mode 100644 index 0000000..7f7ff25 Binary files /dev/null and b/textures/ui/ui_frame.png differ diff --git a/textures/ui/ui_frame.png.import b/textures/ui/ui_frame.png.import new file mode 100644 index 0000000..52deeb9 --- /dev/null +++ b/textures/ui/ui_frame.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://63qoqwcwjrdr" +path="res://.godot/imported/ui_frame.png-30b876d1de3012af765e0e33ed431a25.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/ui/ui_frame.png" +dest_files=["res://.godot/imported/ui_frame.png-30b876d1de3012af765e0e33ed431a25.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/textures/ui/ui_split.png b/textures/ui/ui_split.png new file mode 100644 index 0000000..fb9f11a Binary files /dev/null and b/textures/ui/ui_split.png differ diff --git a/textures/ui/ui_split.png.import b/textures/ui/ui_split.png.import new file mode 100644 index 0000000..fd9bce0 --- /dev/null +++ b/textures/ui/ui_split.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddwqq0mthg8e7" +path="res://.godot/imported/ui_split.png-404d87f656179f2ebbb5cf9344e99106.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/ui/ui_split.png" +dest_files=["res://.godot/imported/ui_split.png-404d87f656179f2ebbb5cf9344e99106.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/textures/ui/ui_split.txt b/textures/ui/ui_split.txt new file mode 100644 index 0000000..f35b931 --- /dev/null +++ b/textures/ui/ui_split.txt @@ -0,0 +1 @@ +https://opengameart.org/content/golden-ui diff --git a/ui/UI Theme.tres b/ui/UI Theme.tres new file mode 100644 index 0000000..4a24d4d --- /dev/null +++ b/ui/UI Theme.tres @@ -0,0 +1,19 @@ +[gd_resource type="Theme" load_steps=3 format=3 uid="uid://dm7ee4aqjr2dl"] + +[ext_resource type="Texture2D" uid="uid://63qoqwcwjrdr" path="res://textures/ui/ui_frame.png" id="1_wss1l"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_linbi"] +texture = ExtResource("1_wss1l") +texture_margin_left = 14.0 +texture_margin_top = 14.0 +texture_margin_right = 14.0 +texture_margin_bottom = 14.0 +axis_stretch_horizontal = 1 +axis_stretch_vertical = 1 + +[resource] +MarginContainer/constants/margin_bottom = 8 +MarginContainer/constants/margin_left = 8 +MarginContainer/constants/margin_right = 8 +MarginContainer/constants/margin_top = 8 +PanelContainer/styles/panel = SubResource("StyleBoxTexture_linbi")