game-dev #8

Merged
leon merged 9 commits from game-dev into dev/game 2023-09-24 13:32:16 +02:00
4 changed files with 64 additions and 83 deletions
Showing only changes of commit b44bcb8758 - Show all commits

View File

@ -1,12 +1,12 @@
using Godot;
using System;
public partial class Hauptmenü : Node2D
public partial class MainMenu : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var node = this.GetNode<CanvasLayer>("HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame");
var node = this.GetTree().Root.GetNode<CanvasLayer>("Root/Ingame/IngameCanvas");
node.SetProcess(false);
node.Hide();
}

View File

@ -13,26 +13,26 @@ public partial class Playbutton : Button
llmApiRequest = GetNode<LLMApiRequest>("/root/Node2D/HTTPRequests");
}
public override void _Pressed()
{
// llmApiRequest.RequestCompleted += OnRequestCompleted;
// llmApiRequest.Request("https://api.github.com/repos/godotengine/godot/releases/latest");
llmApiRequest?.PostToApi(OnRequestCompleted);
public override void _Pressed()
{
// llmApiRequest.RequestCompleted += OnRequestCompleted;
// llmApiRequest.Request("https://api.github.com/repos/godotengine/godot/releases/latest");
llmApiRequest?.PostToApi(OnRequestCompleted);
GD.Print("a");
var node = this.GetNode<CanvasLayer>("Ingame/Ingame");
var node = this.GetTree().Root.GetNode<CanvasLayer>("Root/Ingame/IngameCanvas");
node.SetProcess(true);
node.Show();
var GParent = this.GetTree().Root.GetNode<CanvasLayer>("Root/Hauptmenü/HauptMenü");
var GParent = this.GetTree().Root.GetNode<CanvasLayer>("Root/MainMenu/MainMenuCanvas");
GParent.Hide();
}
}
private void OnRequestCompleted(long result, long responseCode, string[] headers, byte[] body)
{
// Godot.Collections.Dictionary json = Json.ParseString(System.Text.Encoding.UTF8.GetString(body)).AsGodotDictionary();
// GD.Print(json["name"]);
private void OnRequestCompleted(long result, long responseCode, string[] headers, byte[] body)
{
// Godot.Collections.Dictionary json = Json.ParseString(System.Text.Encoding.UTF8.GetString(body)).AsGodotDictionary();
// GD.Print(json["name"]);
// GD.Print(Json.ParseString(System.Text.Encoding.UTF8.GetString(body)).AsGodotDictionary());
GD.Print(System.Text.Encoding.UTF8.GetString(body));
}
}
}

View File

@ -1,16 +0,0 @@
using Godot;
using System;
public partial class TextEdit : Godot.TextEdit
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}

View File

@ -1,7 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://1gar30yhw8ay"]
[gd_scene load_steps=6 format=3 uid="uid://1gar30yhw8ay"]
[ext_resource type="Script" path="res://Hauptmenü.cs" id="1_4eu52"]
[ext_resource type="Script" path="res://TextEdit.cs" id="1_5gfrp"]
[ext_resource type="Script" path="res://MainMenu.cs" id="1_m0gay"]
[ext_resource type="Texture2D" uid="uid://vn2ficr8n4n5" path="res://GodofAi.jpg" id="2_m684j"]
[ext_resource type="Script" path="res://Playbutton.cs" id="3_ucfae"]
[ext_resource type="Script" path="res://LLMApiRequests.cs" id="5_pukni"]
@ -10,13 +9,13 @@
[node name="Root" type="Node2D"]
[node name="Hauptmenü" type="Node2D" parent="."]
[node name="MainMenu" type="Node2D" parent="."]
position = Vector2(320, 20)
script = ExtResource("1_4eu52")
script = ExtResource("1_m0gay")
[node name="HauptMenü" type="CanvasLayer" parent="Hauptmenü"]
[node name="MainMenuCanvas" type="CanvasLayer" parent="MainMenu"]
[node name="VBoxContainer" type="VBoxContainer" parent="Hauptmenü/HauptMenü"]
[node name="VBoxContainer" type="VBoxContainer" parent="MainMenu/MainMenuCanvas"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@ -30,12 +29,12 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 0
[node name="Titelbild" type="TextureRect" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Titelbild" type="TextureRect" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(0, 200)
layout_mode = 2
texture = ExtResource("2_m684j")
[node name="Pop up Menu Szenen" type="MenuButton" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Pop up Menu Szenen" type="MenuButton" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
@ -73,7 +72,7 @@ popup/item_10/id = 10
popup/item_11/text = "Krimi 2"
popup/item_11/id = 11
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 300)
layout_direction = 1
layout_mode = 2
@ -82,13 +81,13 @@ placeholder_text = "Enter a custom setting"
drag_and_drop_selection_enabled = false
middle_mouse_paste_enabled = false
[node name="Strength" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Strength" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="StrengthLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Strength"]
[node name="StrengthLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Strength"]
layout_mode = 2
size_flags_horizontal = 3
text = "Strength"
@ -101,19 +100,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Strength"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Strength"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Perception" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Perception" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="PerceptionLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Perception"]
[node name="PerceptionLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Perception"]
layout_mode = 2
size_flags_horizontal = 3
text = "Perception"
@ -126,19 +125,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Perception"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Perception"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Endurance" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Endurance" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="EnduranceLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Endurance"]
[node name="EnduranceLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Endurance"]
layout_mode = 2
size_flags_horizontal = 3
text = "Endurance"
@ -151,19 +150,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Endurance"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Endurance"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Charisma" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Charisma" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="CharismaLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Charisma"]
[node name="CharismaLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Charisma"]
layout_mode = 2
size_flags_horizontal = 3
text = "Charisma"
@ -176,19 +175,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Charisma"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Charisma"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Intelligence" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Intelligence" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="CharismaLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Intelligence"]
[node name="CharismaLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Intelligence"]
layout_mode = 2
size_flags_horizontal = 3
text = "Intelligence"
@ -201,19 +200,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Intelligence"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Intelligence"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Agillity" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Agillity" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="AgillityLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Agillity"]
[node name="AgillityLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Agillity"]
layout_mode = 2
size_flags_horizontal = 3
text = "Agillity"
@ -226,19 +225,19 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Agillity"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Agillity"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Luck" type="HBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Luck" type="HBoxContainer" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
custom_minimum_size = Vector2(520, 50)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 2
[node name="LuckLabel" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Luck"]
[node name="LuckLabel" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Luck"]
layout_mode = 2
size_flags_horizontal = 3
text = "Luck"
@ -251,25 +250,27 @@ drag_and_drop_selection_enabled = false
virtual_keyboard_enabled = false
middle_mouse_paste_enabled = false
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Luck"]
[node name="TextEdit" type="TextEdit" parent="MainMenu/MainMenuCanvas/VBoxContainer/Luck"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "0"
[node name="Playbutton" type="Button" parent="Hauptmenü/HauptMenü/VBoxContainer"]
[node name="Playbutton" type="Button" parent="MainMenu/MainMenuCanvas/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
text = " PLAY "
script = ExtResource("3_ucfae")
[node name="Ingame" type="Node2D" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton"]
position = Vector2(-699, -1003)
[node name="LLMApiRequests" type="HTTPRequest" parent="."]
script = ExtResource("5_pukni")
[node name="Ingame" type="CanvasLayer" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame"]
[node name="Ingame" type="Node2D" parent="."]
[node name="Eingabe" type="VBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame"]
[node name="IngameCanvas" type="CanvasLayer" parent="Ingame"]
[node name="Eingabe" type="VBoxContainer" parent="Ingame/IngameCanvas"]
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
@ -280,12 +281,11 @@ grow_horizontal = 2
grow_vertical = 0
size_flags_vertical = 0
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Eingabe"]
[node name="TextEdit" type="TextEdit" parent="Ingame/IngameCanvas/Eingabe"]
layout_mode = 2
size_flags_vertical = 3
script = ExtResource("1_5gfrp")
[node name="Story" type="VBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame"]
[node name="Story" type="VBoxContainer" parent="Ingame/IngameCanvas"]
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
@ -295,7 +295,7 @@ grow_horizontal = 0
grow_vertical = 2
size_flags_horizontal = 8
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Story"]
[node name="TextEdit" type="TextEdit" parent="Ingame/IngameCanvas/Story"]
layout_mode = 2
size_flags_vertical = 3
placeholder_text = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
@ -303,7 +303,7 @@ editable = false
context_menu_enabled = false
wrap_mode = 1
[node name="Stats" type="VBoxContainer" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame"]
[node name="Stats" type="VBoxContainer" parent="Ingame/IngameCanvas"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -313,7 +313,7 @@ offset_bottom = -360.0
grow_horizontal = 2
grow_vertical = 2
[node name="TextEdit" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
placeholder_text = "SampleStat = 1
@ -321,43 +321,43 @@ placeholder_text = "SampleStat = 1
editable = false
context_menu_enabled = false
[node name="TextEdit2" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit2" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="TextEdit3" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit3" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="TextEdit4" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit4" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="TextEdit5" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit5" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="TextEdit6" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit6" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="TextEdit7" type="TextEdit" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame/Stats"]
[node name="TextEdit7" type="TextEdit" parent="Ingame/IngameCanvas/Stats"]
layout_mode = 2
size_flags_vertical = 3
editable = false
context_menu_enabled = false
[node name="Szenerie" type="TextureRect" parent="Hauptmenü/HauptMenü/VBoxContainer/Playbutton/Ingame/Ingame"]
[node name="Szenerie" type="TextureRect" parent="Ingame/IngameCanvas"]
offset_left = -3.0
offset_top = -1.0
offset_right = 1277.0
@ -365,6 +365,3 @@ offset_bottom = 719.0
texture = SubResource("CompressedTexture2D_ncw85")
expand_mode = 1
stretch_mode = 1
[node name="LLMApiRequests" type="HTTPRequest" parent="."]
script = ExtResource("5_pukni")