Import Character Screen

This commit is contained in:
bakhtaward
2022-05-15 14:29:03 -04:00
parent e1fc845256
commit ab0c2a962d
63 changed files with 1193 additions and 0 deletions

View File

@ -0,0 +1,87 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=1]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
[ext_resource path="res://screens/grabFocus.gd" type="Script" id=3]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 2.0
margin_bottom = 2.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="VBoxContainer2" instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 0.0
margin_right = 1024.0
margin_bottom = 66.0
text = "Import Character"
[node name="But_ChangeScene" parent="VBoxContainer2/Title" instance=ExtResource( 2 )]
margin_right = 106.0
margin_bottom = 51.0
text = "Back"
next_scene_path = "res://Screens/MenuScreen.tscn"
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2"]
margin_top = 70.0
margin_right = 1024.0
margin_bottom = 114.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="But_OpenFile" type="Button" parent="VBoxContainer2/VBoxContainer"]
margin_right = 1024.0
margin_bottom = 20.0
text = "Open Character File"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="FileDialog" type="FileDialog" parent="VBoxContainer2/VBoxContainer"]
margin_top = 24.0
margin_right = 800.0
margin_bottom = 374.0
window_title = "Open a File"
mode = 0
access = 2
current_dir = "/Users/BD/Documents/Godot/rpg"
current_path = "/Users/BD/Documents/Godot/rpg/"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="NameLabel" type="Label" parent="VBoxContainer2/VBoxContainer"]
visible = false
margin_top = 24.0
margin_right = 1024.0
margin_bottom = 38.0
[node name="LineEdit" type="LineEdit" parent="VBoxContainer2/VBoxContainer"]
visible = false
margin_top = 24.0
margin_right = 1024.0
margin_bottom = 48.0
[node name="Save_Button" type="Button" parent="VBoxContainer2/VBoxContainer"]
margin_top = 24.0
margin_right = 1024.0
margin_bottom = 44.0
text = "Save"
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/But_OpenFile" to="." method="_on_Button_pressed"]
[connection signal="file_selected" from="VBoxContainer2/VBoxContainer/FileDialog" to="." method="_on_FileDialog_file_selected"]

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=1]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
[ext_resource path="res://screens/grabFocus.gd" type="Script" id=3]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="." instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 0.0
margin_top = 0.0
margin_right = 0.0
margin_bottom = 0.0
text = "Multiplayer (temp)"
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
text = "Temp: back to menu"
next_scene_path = "res://Screens/MenuScreen.tscn"

View File

@ -0,0 +1,9 @@
#MENUSCREEN:
# Script purely to grab focus for tabbing control
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$VBoxContainer/But_NewGame.grab_focus()

View File

@ -0,0 +1,96 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=1]
[ext_resource path="res://Screens/MenuScreen.gd" type="Script" id=2]
[ext_resource path="res://assets/liberation_serif_40pt.tres" type="DynamicFont" id=3]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=5]
[ext_resource path="res://assets/ui_controlNode_dark_theme.tres" type="Theme" id=6]
[ext_resource path="res://UserInterface/But_Quit.tscn" type="PackedScene" id=10]
[node name="MenuScreen" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 6 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Background" type="Panel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="." instance=ExtResource( 5 )]
margin_top = 51.8676
margin_bottom = 117.868
theme = null
custom_fonts/font = ExtResource( 3 )
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -119.0
margin_top = -152.0
margin_right = 119.0
margin_bottom = 152.0
rect_scale = Vector2( 1.04675, 1.07389 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="But_NewGame" parent="VBoxContainer" instance=ExtResource( 1 )]
margin_right = 238.0
margin_bottom = 49.0
next_scene_path = "res://screens/NewGame.tscn"
[node name="But_LoadGame" parent="VBoxContainer" instance=ExtResource( 1 )]
margin_top = 53.0
margin_right = 238.0
margin_bottom = 103.0
text = "Load Game"
next_scene_path = "res://screens/LoadGame.tscn"
[node name="But_Multiplayer" parent="VBoxContainer" instance=ExtResource( 1 )]
margin_top = 107.0
margin_right = 238.0
margin_bottom = 156.0
text = "Multiplayer"
next_scene_path = "res://Screens/Multiplayer.tscn"
[node name="But_ImportChar" parent="VBoxContainer" instance=ExtResource( 1 )]
margin_top = 160.0
margin_right = 238.0
margin_bottom = 210.0
text = "Import Character"
next_scene_path = "res://Screens/ImportCharacter.tscn"
[node name="But_Settings" parent="VBoxContainer" instance=ExtResource( 1 )]
margin_top = 214.0
margin_right = 238.0
margin_bottom = 263.0
text = "Settings"
next_scene_path = "res://Screens/Settings.tscn"
[node name="But_Quit" parent="VBoxContainer" instance=ExtResource( 10 )]
margin_top = 267.0
margin_right = 238.0
margin_bottom = 303.0
[node name="Version" type="Label" parent="."]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -177.0
margin_top = -44.0
margin_right = -5.0
margin_bottom = -6.0
text = "Version: 0.0.0"
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=1]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
[ext_resource path="res://screens/grabFocus.gd" type="Script" id=3]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="." instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 0.0
margin_top = 0.0
margin_right = 0.0
margin_bottom = 0.0
text = "Multiplayer (temp)"
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
text = "Temp: back to menu"
next_scene_path = "res://Screens/MenuScreen.tscn"

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=1]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
[ext_resource path="res://screens/grabFocus.gd" type="Script" id=3]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="." instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 0.0
margin_top = 0.0
margin_right = 0.0
margin_bottom = 0.0
text = "Multiplayer (temp)"
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
text = "Temp: back to menu"
next_scene_path = "res://Screens/MenuScreen.tscn"

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://UserInterface/Title.tscn" type="PackedScene" id=1]
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
[ext_resource path="res://screens/grabFocus.gd" type="Script" id=3]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Title" parent="." instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 0.0
margin_top = 0.0
margin_right = 0.0
margin_bottom = 0.0
text = "Multiplayer (temp)"
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
text = "Temp: back to menu"
next_scene_path = "res://Screens/MenuScreen.tscn"

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Screens/MenuScreen.tscn" type="PackedScene" id=1]
[node name="MenuScreen" instance=ExtResource( 1 )]

View File

@ -0,0 +1,17 @@
extends Button
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
var tempToggle = 0
func _on_Button_button_up():
var controlNode = get_node("../../")
print(controlNode.name)
if(tempToggle == 0):
controlNode.theme=load("res://assets/ui_controlNode_dark_theme.tres")
tempToggle = 1
else:
controlNode.theme=load("res://assets/ui_controlNode_light_theme.tres")
tempToggle = 0

View File

@ -0,0 +1,35 @@
extends Control
var charFilePath
var a
#GRAB FOCUS: simple script for temp files to grab focus
func _ready() -> void:
$VBoxContainer2/Title/But_ChangeScene.grab_focus()
func _on_Button_pressed():
$VBoxContainer2/VBoxContainer/FileDialog.popup()
#this is going to take information from the file the player chose and put the individul parts into textboxes so it can be edited and then saved
func _on_FileDialog_file_selected(path):
var file = File.new()
#read the text in the file, save it in the variable a
file.open(path, File.READ)
# a = int(file.get_line())
a = file.get_as_text()
#split by the spaces so the individual pieces can be separated into textboxes
var b = a.split(" ")
# for i in b.size():
var i = 0
while i < b.size():
#make a new textbox for each piece of information
var textLine = Label.new()
$VBoxContainer2/VBoxContainer.add_child(textLine)
textLine.text = b[i]
i += 1
var textBox = LineEdit.new()
$VBoxContainer2/VBoxContainer.add_child(textBox)
textBox.text = b[i]
i += 1
file.close()