mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Change 2 for cleanup
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
#BUT_HISTORYPAGER:
|
||||
# Iterates the page number and calls HistoryViewer script to display
|
||||
# stored page and response fro the history array
|
||||
#
|
||||
|
||||
extends Button
|
||||
|
||||
onready var historyViewerScript = get_node("/root/HistoryViewer")
|
||||
|
||||
#DKM TEMP: this needs refactoring -- too much being calculated as needed/repeated
|
||||
func _on_But_HistoryPager_button_up() -> void:
|
||||
historyViewerScript.update_pager()
|
||||
|
@ -0,0 +1,22 @@
|
||||
#CHARACTER_ADD:
|
||||
# Script for adding a new character and both saving it to file and loading
|
||||
# it into the character object
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
$Title/But_SaveChar.grab_focus()
|
||||
|
||||
func _on_But_SaveChar_pressed() -> void:
|
||||
$Title/FileDialog.popup()
|
||||
|
||||
#DKM TEMP: just text for now from text edit
|
||||
func _on_FileDialog_file_selected(path: String) -> void:
|
||||
var pc = get_node("/root/PlayerCharacter")
|
||||
var newCharFile = File.new()
|
||||
newCharFile.open(path, 2)
|
||||
newCharFile.store_string($TextEdit.text)
|
||||
pc.playerCharacterSingleton.pcText = $TextEdit.text
|
@ -0,0 +1,172 @@
|
||||
[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/Character_Add.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="TextEdit" type="TextEdit" parent="."]
|
||||
margin_left = 215.0
|
||||
margin_top = 23.0
|
||||
margin_right = 997.0
|
||||
margin_bottom = 447.0
|
||||
|
||||
[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 = "Create Character (temp)"
|
||||
|
||||
[node name="But_SaveChar" type="Button" parent="Title"]
|
||||
margin_right = 12.0
|
||||
margin_bottom = 20.0
|
||||
text = "Save Character"
|
||||
|
||||
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
|
||||
margin_left = -1.0
|
||||
margin_top = 48.0
|
||||
margin_right = 142.0
|
||||
margin_bottom = 72.0
|
||||
text = "Temp: Main Menu"
|
||||
next_scene_path = "res://screens/MenuScreen.tscn"
|
||||
|
||||
[node name="But_StartNewGame" parent="Title" instance=ExtResource( 2 )]
|
||||
margin_top = 98.0
|
||||
margin_right = 159.0
|
||||
margin_bottom = 122.0
|
||||
text = "Temp: Start New Game"
|
||||
|
||||
[node name="FileDialog" type="FileDialog" parent="Title"]
|
||||
margin_left = 164.0
|
||||
margin_top = 35.0
|
||||
margin_right = 741.0
|
||||
margin_bottom = 426.0
|
||||
access = 1
|
||||
current_dir = "user://C:/ProgramData/CS_Working/RPGR/Godot_projects/bcirpg_mergedDemo_20220911A"
|
||||
current_path = "user://C:/ProgramData/CS_Working/RPGR/Godot_projects/bcirpg_mergedDemo_20220911A/"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Title"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -20.0
|
||||
margin_top = 50.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 140.0
|
||||
|
||||
[node name="LabelName" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_right = 81.0
|
||||
margin_bottom = 31.0
|
||||
text = "NAME
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelName"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelProfession" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 35.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 66.0
|
||||
text = "PROFESSION
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelProfession"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelStrength" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 70.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 101.0
|
||||
text = "STRENGTH
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelStrength"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelIntellect" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 105.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 136.0
|
||||
text = "INTELLECT
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelIntellect"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelWillpower" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 140.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 171.0
|
||||
text = "WILLPOWER
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelWillpower"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelCharm" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 175.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 189.0
|
||||
text = "CHARM"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelCharm"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelWeapon" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 193.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 224.0
|
||||
text = "WEAPON
|
||||
"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelWeapon"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelArmor" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 228.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 242.0
|
||||
text = "ARMOR"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelArmor"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="LabelQuote" type="Label" parent="Title/VBoxContainer"]
|
||||
margin_top = 246.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 260.0
|
||||
text = "QUOTE"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Title/VBoxContainer/LabelQuote"]
|
||||
margin_top = 15.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[connection signal="pressed" from="Title/But_SaveChar" to="." method="_on_But_SaveChar_pressed"]
|
||||
[connection signal="file_selected" from="Title/FileDialog" to="." method="_on_FileDialog_file_selected"]
|
@ -0,0 +1,24 @@
|
||||
#CHARACTER_LOAD:
|
||||
# Script for loading a character file into the character object from file
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
$Title/But_loadCharacter.grab_focus()
|
||||
|
||||
|
||||
func _on_But_loadCharacter_pressed() -> void:
|
||||
$LoadCharacter_FileDialog.popup()
|
||||
|
||||
|
||||
#DKM TEMP: we need to load the character item, not display to field
|
||||
func _on_LoadCharacter_FileDialog_file_selected(path: String) -> void:
|
||||
print(path)
|
||||
var charFile = File.new()
|
||||
charFile.open(path, 1)
|
||||
var pc = get_node("/root/PlayerCharacter")
|
||||
pc.playerCharacterSingleton.pcText = charFile.get_as_text()
|
||||
$TextEdit.text = pc.playerCharacterSingleton.pcText
|
@ -0,0 +1,72 @@
|
||||
[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/Character_Load.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="TextEdit" type="TextEdit" parent="."]
|
||||
margin_left = 189.0
|
||||
margin_top = 18.0
|
||||
margin_right = 989.0
|
||||
margin_bottom = 461.0
|
||||
readonly = true
|
||||
__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 = "Load Character (temp)"
|
||||
|
||||
[node name="But_loadCharacter" type="Button" parent="Title"]
|
||||
margin_left = 22.0
|
||||
margin_top = 34.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 54.0
|
||||
text = "Load Character File"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="But_StartNewGame" parent="Title" instance=ExtResource( 2 )]
|
||||
margin_left = 22.0
|
||||
margin_top = 71.0
|
||||
margin_right = 181.0
|
||||
margin_bottom = 95.0
|
||||
text = "Temp: Start New Game"
|
||||
|
||||
[node name="But_ChangeScene" parent="Title" instance=ExtResource( 2 )]
|
||||
margin_left = 21.0
|
||||
margin_top = 109.0
|
||||
margin_right = 164.0
|
||||
margin_bottom = 133.0
|
||||
text = "Temp: Main Menu "
|
||||
|
||||
[node name="LoadCharacter_FileDialog" type="FileDialog" parent="."]
|
||||
margin_left = 193.0
|
||||
margin_top = 33.0
|
||||
margin_right = 862.0
|
||||
margin_bottom = 409.0
|
||||
window_title = "Open a File"
|
||||
mode = 0
|
||||
access = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="Title/But_loadCharacter" to="." method="_on_But_loadCharacter_pressed"]
|
||||
[connection signal="file_selected" from="LoadCharacter_FileDialog" to="." method="_on_LoadCharacter_FileDialog_file_selected"]
|
@ -0,0 +1,49 @@
|
||||
#HISTORY_VIEWER:
|
||||
# Controls output space -- will display the appropriate history array page.
|
||||
# DKM TEMP: 5/15/22: what's here is replicated from the Game script for starting
|
||||
# purposes. I have this working in experimental version -- will add this back
|
||||
# next.
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
onready var history_source = get_node("/root/History").historyScreensSingleton
|
||||
onready var current_history = $Background/MarginContainer/Rows/GameInfo/CurrentHistory
|
||||
#For zero-indexed array position:
|
||||
onready var current_history_page_no = 0
|
||||
onready var page_displayer = $Background/MarginContainer/Rows/ItemList/Page_Display
|
||||
|
||||
#Abstract class we instance when wanted in game as child of HistoryReference
|
||||
const TextOutput = preload("res://UserInterface/Response.tscn")
|
||||
const InputResponse = preload("res://UserInterface/InputResponse.tscn")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
|
||||
print("Loaded history array size is: " + str(history_source.output_history_array.size()))
|
||||
update_pager()
|
||||
#DKM TEMP:
|
||||
# page_displayer.text = "1"
|
||||
# if(current_history.get_child_count() > 0):
|
||||
# current_history.remove_child(current_history.get_child(0))
|
||||
# var opening_res = history_source.output_history_array[0]
|
||||
# current_history.add_child(opening_res)
|
||||
|
||||
#Copies the response output to add to both current game output, and the
|
||||
# history array.
|
||||
func add_display_to_game(response: Control):
|
||||
if(current_history.get_child_count() > 0):
|
||||
current_history.remove_child(current_history.get_child(0))
|
||||
current_history.add_child(response)
|
||||
|
||||
func update_pager():
|
||||
if(current_history_page_no >= history_source.output_history_array.size()):
|
||||
current_history_page_no = 0
|
||||
print("Current page: " + str(current_history_page_no))
|
||||
add_display_to_game(history_source.output_history_array[current_history_page_no])
|
||||
current_history_page_no = current_history_page_no +1
|
||||
page_displayer.text = str(current_history_page_no)
|
||||
|
||||
|
||||
|
@ -0,0 +1,100 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://screens/HistoryViewer.gd" type="Script" id=1]
|
||||
[ext_resource path="res://userInterface/But_ChangeScene.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://assets/ui_controlNode_dark_theme.tres" type="Theme" id=3]
|
||||
[ext_resource path="res://screens/But_HistoryPager.gd" type="Script" id=4]
|
||||
|
||||
[node name="HistoryViewer" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 3 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Background" type="PanelContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Background"]
|
||||
margin_left = 1.0
|
||||
margin_top = 1.0
|
||||
margin_right = 1023.0
|
||||
margin_bottom = 599.0
|
||||
custom_constants/margin_right = 20
|
||||
custom_constants/margin_top = 10
|
||||
custom_constants/margin_left = 20
|
||||
custom_constants/margin_bottom = 20
|
||||
|
||||
[node name="Rows" type="VBoxContainer" parent="Background/MarginContainer"]
|
||||
margin_left = 20.0
|
||||
margin_top = 10.0
|
||||
margin_right = 1002.0
|
||||
margin_bottom = 578.0
|
||||
custom_constants/separation = 10
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="Background/MarginContainer/Rows"]
|
||||
margin_right = 982.0
|
||||
margin_bottom = 40.0
|
||||
rect_min_size = Vector2( 0, 40 )
|
||||
|
||||
[node name="But_ChangeScene" parent="Background/MarginContainer/Rows/ItemList" instance=ExtResource( 2 )]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 36.0
|
||||
text = "More Options"
|
||||
next_scene_path = "res://screens/MoreOptions.tscn"
|
||||
|
||||
[node name="But_HistoryPager" type="Button" parent="Background/MarginContainer/Rows/ItemList"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -84.0
|
||||
margin_right = 115.0
|
||||
margin_bottom = 36.0
|
||||
text = "History Pager"
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Background/MarginContainer/Rows/ItemList"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -194.94
|
||||
margin_top = -1.12247
|
||||
margin_right = -81.9397
|
||||
margin_bottom = 23.8775
|
||||
text = "History Page:"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Page_Display" type="Label" parent="Background/MarginContainer/Rows/ItemList"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -40.0
|
||||
margin_bottom = 25.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="GameInfo" type="PanelContainer" parent="Background/MarginContainer/Rows"]
|
||||
margin_top = 50.0
|
||||
margin_right = 982.0
|
||||
margin_bottom = 568.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="CurrentHistory" type="VBoxContainer" parent="Background/MarginContainer/Rows/GameInfo"]
|
||||
margin_left = 1.0
|
||||
margin_top = 1.0
|
||||
margin_right = 981.0
|
||||
margin_bottom = 517.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 20
|
||||
|
||||
[connection signal="button_up" from="Background/MarginContainer/Rows/ItemList/But_HistoryPager" to="Background/MarginContainer/Rows/ItemList/But_HistoryPager" method="_on_But_HistoryPager_button_up"]
|
@ -0,0 +1,92 @@
|
||||
#GRAB FOCUS: simple script for temp files to grab focus
|
||||
# Expanded for Import Character option
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
onready var pSingleton = get_node("/root/PlayerCharacter").pc
|
||||
|
||||
var charFilePath
|
||||
var a
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
|
||||
func _on_Button_pressed():
|
||||
$FileDialog.popup()
|
||||
|
||||
#Import character file
|
||||
func _charSetStat(statname: String, statvalue: int) -> void:
|
||||
if statname in pSingleton.viableCharStats:
|
||||
match statname:
|
||||
"AG":
|
||||
pSingleton.agility = statvalue
|
||||
"APP":
|
||||
pSingleton.appearance = statvalue
|
||||
"CO":
|
||||
pSingleton.constitution = statvalue
|
||||
"QU":
|
||||
pSingleton.quickness = statvalue
|
||||
"MD":
|
||||
pSingleton.manual_dexterity = statvalue
|
||||
"ST":
|
||||
pSingleton.strength = statvalue
|
||||
"CH":
|
||||
pSingleton.chutzpah = statvalue
|
||||
"EM":
|
||||
pSingleton.empathy = statvalue
|
||||
"IN":
|
||||
pSingleton.intuition = statvalue
|
||||
"ME":
|
||||
pSingleton.memory = statvalue
|
||||
"MX":
|
||||
pSingleton.moxie = statvalue
|
||||
"PR":
|
||||
pSingleton.presence = statvalue
|
||||
"RE":
|
||||
pSingleton.reasoning = statvalue
|
||||
"SD":
|
||||
pSingleton.self_discipline = statvalue
|
||||
else:
|
||||
return
|
||||
|
||||
#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)
|
||||
|
||||
#split by the spaces so the individual pieces can be separated into textboxes
|
||||
while file.eof_reached() == false:
|
||||
var csvStrArray = file.get_csv_line()
|
||||
var i = 0
|
||||
var isLabel = true
|
||||
var row_label = ""
|
||||
var row_value = ""
|
||||
while i < csvStrArray.size():
|
||||
var csvStr = csvStrArray[i]
|
||||
if(isLabel):
|
||||
#make a new textbox for each piece of information
|
||||
var textLine = Label.new()
|
||||
$ScrollContainer/VBoxContainer.add_child(textLine)
|
||||
textLine.text = csvStr.to_upper()
|
||||
row_label = csvStr.to_upper()
|
||||
isLabel = false
|
||||
#DKM TEMP: save this unformatted to the singleton text string
|
||||
pSingleton.pcText += csvStr.to_upper() + ": "
|
||||
else:
|
||||
row_value = csvStr
|
||||
if(typeof(int(row_value)) == TYPE_INT):
|
||||
_charSetStat(row_label, int(row_value))
|
||||
isLabel = true
|
||||
var textBox = LineEdit.new()
|
||||
$ScrollContainer/VBoxContainer.add_child(textBox)
|
||||
textBox.text = csvStr
|
||||
#DKM TEMP: save this unformatted to the singleton text string
|
||||
pSingleton.pcText += csvStr + "\n"
|
||||
i += 1
|
||||
file.close()
|
||||
#DKM TEMP:
|
||||
print("PRINTING set char tostring: ")
|
||||
print(pSingleton.toString())
|
@ -0,0 +1,126 @@
|
||||
[gd_scene load_steps=5 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/ImportCharacter.gd" type="Script" id=3]
|
||||
[ext_resource path="res://userInterface/But_PlayButton.gd" type="Script" id=4]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="PopupDialog" type="PopupDialog" parent="."]
|
||||
anchor_top = 0.5
|
||||
anchor_bottom = 0.5
|
||||
|
||||
[node name="WarnText" type="Label" parent="PopupDialog"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 14.0
|
||||
text = "Example"
|
||||
|
||||
[node name="Background" type="Panel" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileDialog" type="FileDialog" parent="."]
|
||||
margin_left = 113.0
|
||||
margin_top = 24.0
|
||||
margin_right = 886.0
|
||||
margin_bottom = 480.0
|
||||
window_title = "Open a File"
|
||||
mode = 0
|
||||
access = 2
|
||||
current_dir = "/ProgramData/CS_Working/RPGR/Godot_projects/bcirpg_mergedMaster_20220918A"
|
||||
current_path = "/ProgramData/CS_Working/RPGR/Godot_projects/bcirpg_mergedMaster_20220918A/"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Title" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = -164.0
|
||||
margin_top = 0.0
|
||||
margin_right = 164.0
|
||||
margin_bottom = 14.0
|
||||
text = "Import Character"
|
||||
|
||||
[node name="But_Play" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 1.0
|
||||
margin_top = 34.0
|
||||
margin_right = 152.0
|
||||
margin_bottom = 71.0
|
||||
text = "Start Game"
|
||||
script = ExtResource( 4 )
|
||||
next_scene_path = "res://gamePlay/Game.tscn"
|
||||
|
||||
[node name="But_Cancel" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 1.0
|
||||
margin_top = 78.0
|
||||
margin_right = 152.0
|
||||
margin_bottom = 115.0
|
||||
text = "Back"
|
||||
next_scene_path = "res://Screens/MenuScreen.tscn"
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
|
||||
anchor_left = 0.0634766
|
||||
anchor_top = 0.0583333
|
||||
anchor_right = 0.103516
|
||||
anchor_bottom = 0.0583333
|
||||
margin_left = 107.0
|
||||
margin_right = 435.0
|
||||
margin_bottom = 44.0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
|
||||
[node name="But_OpenFile" type="Button" parent="VBoxContainer2"]
|
||||
margin_right = 369.0
|
||||
margin_bottom = 20.0
|
||||
text = "Open Character File"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Save_Button" type="Button" parent="VBoxContainer2"]
|
||||
margin_top = 24.0
|
||||
margin_right = 369.0
|
||||
margin_bottom = 44.0
|
||||
text = "Save"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -341.0
|
||||
margin_top = -175.0
|
||||
margin_right = 427.0
|
||||
margin_bottom = 284.0
|
||||
follow_focus = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"]
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="NameLabel" type="Label" parent="ScrollContainer/VBoxContainer"]
|
||||
visible = false
|
||||
margin_bottom = 14.0
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="ScrollContainer/VBoxContainer"]
|
||||
visible = false
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[connection signal="file_selected" from="FileDialog" to="." method="_on_FileDialog_file_selected"]
|
||||
[connection signal="pressed" from="VBoxContainer2/But_OpenFile" to="." method="_on_Button_pressed"]
|
@ -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"
|
@ -0,0 +1,11 @@
|
||||
#MENUSCREEN:
|
||||
# Script purely to grab focus for tabbing control
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
$VBoxContainer/But_NewGame.grab_focus()
|
@ -0,0 +1,102 @@
|
||||
[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
|
||||
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 = 40.0
|
||||
next_scene_path = "res://screens/PlayerSelection.tscn"
|
||||
|
||||
[node name="But_LoadGame" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 44.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 85.0
|
||||
text = "Load Game"
|
||||
next_scene_path = "res://screens/LoadGame_temp.tscn"
|
||||
|
||||
[node name="But_Multiplayer" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 89.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 130.0
|
||||
text = "Multiplayer"
|
||||
next_scene_path = "res://Screens/Multiplayer_temp.tscn"
|
||||
|
||||
[node name="But_AddChar" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 134.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 174.0
|
||||
text = "Add Character"
|
||||
next_scene_path = "res://Screens/Character_Add.tscn"
|
||||
|
||||
[node name="But_ImportChar2" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 178.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 219.0
|
||||
text = "Import Character"
|
||||
next_scene_path = "res://Screens/ImportCharacter.tscn"
|
||||
|
||||
[node name="But_Settings" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 223.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 264.0
|
||||
text = "Settings"
|
||||
next_scene_path = "res://Screens/SettingsMenuControl.tscn"
|
||||
|
||||
[node name="But_Quit" parent="VBoxContainer" instance=ExtResource( 10 )]
|
||||
margin_top = 268.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 304.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
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
#MOREOPTIONS:
|
||||
# Script purely to grab focus for tabbing control
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
$VBoxContainer/But_ResumeGame.grab_focus()
|
@ -0,0 +1,82 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://screens/MoreOptions.gd" type="Script" id=2]
|
||||
[ext_resource path="res://userInterface/But_ResumeGame.gd" type="Script" id=3]
|
||||
[ext_resource path="res://assets/ui_controlNode_dark_theme.tres" type="Theme" id=6]
|
||||
|
||||
[node name="MoreOptions" 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="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_ResumeGame" type="Button" parent="VBoxContainer"]
|
||||
margin_right = 238.0
|
||||
margin_bottom = 36.0
|
||||
text = "Resume Game"
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="But_ShowHistory" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 40.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 125.0
|
||||
text = "Show History"
|
||||
next_scene_path = "res://screens/HistoryViewer.tscn"
|
||||
|
||||
[node name="But_Chat" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 129.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 214.0
|
||||
text = "Chat"
|
||||
next_scene_path = "res://screens/MenuScreen.tscn"
|
||||
|
||||
[node name="But_MainMenu" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 218.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 304.0
|
||||
text = "Main Menu"
|
||||
next_scene_path = "res://Screens/MenuScreen.tscn"
|
||||
|
||||
[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
|
||||
}
|
||||
|
||||
[connection signal="button_up" from="VBoxContainer/But_ResumeGame" to="VBoxContainer/But_ResumeGame" method="_on_But_ResumeGame_button_up"]
|
@ -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"
|
@ -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"
|
@ -0,0 +1,11 @@
|
||||
#PLAYERSELECTION:
|
||||
# Script purely to grab focus for tabbing control
|
||||
|
||||
extends Control
|
||||
|
||||
onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
theme=load(settings.themeFile)
|
||||
$VBoxContainer/But_ChoosePlayer.grab_focus()
|
@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://UserInterface/But_ChangeScene.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://screens/PlayerSelection.gd" type="Script" id=2]
|
||||
[ext_resource path="res://assets/ui_controlNode_dark_theme.tres" type="Theme" id=6]
|
||||
|
||||
[node name="PlayerSelection" 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="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_ChoosePlayer" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_right = 238.0
|
||||
margin_bottom = 98.0
|
||||
text = "Import Character"
|
||||
next_scene_path = "res://screens/ImportCharacter.tscn"
|
||||
|
||||
[node name="But_AddChar" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 102.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 201.0
|
||||
text = "Create Character"
|
||||
next_scene_path = "res://Screens/Character_Add.tscn"
|
||||
|
||||
[node name="But_MainMenu" parent="VBoxContainer" instance=ExtResource( 1 )]
|
||||
margin_top = 205.0
|
||||
margin_right = 238.0
|
||||
margin_bottom = 304.0
|
||||
text = "Main Menu"
|
||||
next_scene_path = "res://Screens/MenuScreen.tscn"
|
||||
|
||||
[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
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
extends Control
|
||||
|
||||
|
||||
# https://stackoverflow.com/a/65774028
|
||||
# Be Sure to make these Vars as OnReadys; you can read up on it here.
|
||||
|
||||
# Items to Fill the dropdown Lists
|
||||
onready var keyboardContents = ["Qwerty", "Dvorak", "Alphabetical"]
|
||||
|
||||
onready var themeContents = ["White on Black", "Black on White"]
|
||||
|
||||
onready var saveObject = get_node('/root/GlobalSaveInstance')
|
||||
|
||||
|
||||
#res://SettingsMenuControl.tscn
|
||||
|
||||
# Vars For UI Widgets
|
||||
onready var NameVar = get_node('Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/DisplayNameLineEdit')
|
||||
|
||||
onready var NRiskVar = get_node('Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/VBoxRiskFactor/RiskSlider')
|
||||
|
||||
onready var FontVar = get_node("Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox/FontSizeSlider")
|
||||
|
||||
onready var BrightnessVar = get_node('Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox/BrightnessSlider')
|
||||
|
||||
onready var VolumeVar = get_node("Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/VolumeSlider")
|
||||
|
||||
onready var ClosedCaptionsVar = get_node('Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxClosedCaptions/ClosedCaptionsCheckBox')
|
||||
|
||||
onready var ConsoleCommandVar = get_node('Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxDevConsole/DevConsoleCheckbox')
|
||||
|
||||
onready var saveButton = get_node("Panel/HBoxBottomRow/SaveButton")
|
||||
|
||||
onready var bKeyboardEnabled = get_node("Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/HBoxVirtualKeyboardEnabled/VisualKeyboardCheckBox")
|
||||
|
||||
onready var keyboardLayoutList = get_node('Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/LayoutItemList')
|
||||
|
||||
onready var themeChoiceList = get_node('Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/ThemeItemList')
|
||||
|
||||
|
||||
var iniFile = ConfigFile.new()
|
||||
|
||||
func saveToInstance():
|
||||
#Save to Singleton, so saveFile does not need to be constantly read
|
||||
saveObject.settingsInstance.inputName = NameVar.text
|
||||
saveObject.settingsInstance.riskFactor = NRiskVar.value
|
||||
saveObject.settingsInstance.fontSize = FontVar.value
|
||||
saveObject.settingsInstance.volume = VolumeVar.value
|
||||
saveObject.settingsInstance.bClosedCaptions = ClosedCaptionsVar.is_pressed()
|
||||
saveObject.settingsInstance.bdevConsole = ConsoleCommandVar.is_pressed()
|
||||
saveObject.settingsInstance.bVirtualKeyboard = bKeyboardEnabled.is_pressed()
|
||||
var savedKeyboardItems = keyboardLayoutList.get_selected_items()
|
||||
var keyboardSelection = savedKeyboardItems[0]
|
||||
saveObject.settingsInstance.visualKeyboardLayout = keyboardSelection
|
||||
var savedThemeItems = themeChoiceList.get_selected_items()
|
||||
var themeSelection = savedThemeItems[0]
|
||||
saveObject.settingsInstance.themeChoiceInt = themeSelection
|
||||
#Trigger re-load of the file name
|
||||
saveObject.load_settings_file()
|
||||
theme=load(saveObject.settingsInstance.themeFile)
|
||||
|
||||
|
||||
func saveFile():
|
||||
iniFile.set_value("player_preferences", "player_name", NameVar.text)
|
||||
iniFile.set_value("player_preferences", "risk_threshold", NRiskVar.value)
|
||||
iniFile.set_value("visual_controls", "font_size", FontVar.value)
|
||||
iniFile.set_value("visual_controls", "brightness", BrightnessVar.value)
|
||||
|
||||
iniFile.set_value("general_settings", "volume", VolumeVar.value)
|
||||
iniFile.set_value("general_settings", "closed_captions", ClosedCaptionsVar.is_pressed())
|
||||
iniFile.set_value("general_settings", "dev_console", ConsoleCommandVar.is_pressed())
|
||||
|
||||
print(keyboardLayoutList.get_selected_items())
|
||||
|
||||
var savedKeyboardItems = keyboardLayoutList.get_selected_items()
|
||||
|
||||
var keyboardSelection = savedKeyboardItems[0]
|
||||
|
||||
var savedThemeItems = themeChoiceList.get_selected_items()
|
||||
|
||||
var themeSelection = savedThemeItems[0]
|
||||
|
||||
print(typeof(keyboardSelection))
|
||||
|
||||
iniFile.set_value("virtual_keyboard", "keyboard_layout", keyboardSelection)
|
||||
|
||||
iniFile.set_value("theme", "theme_selection", themeSelection)
|
||||
|
||||
iniFile.save("res://_userFiles/PlayerPreferences.cfg")
|
||||
|
||||
#DKM TEMP: can this be done at singleton, initial load level instead of here?
|
||||
func loadFile():
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
if saveButton.pressed == true:
|
||||
if NameVar.text == "":
|
||||
print("Please input a name")
|
||||
|
||||
if NameVar.text != "":
|
||||
# Save to the template instance
|
||||
saveToInstance()
|
||||
|
||||
saveFile()
|
||||
print('saveFileRan')
|
||||
|
||||
func _ready():
|
||||
#Get the singleton's values for initial settings:
|
||||
NameVar.text = saveObject.settingsInstance.inputName
|
||||
NRiskVar.value = saveObject.settingsInstance.riskFactor
|
||||
FontVar.value = saveObject.settingsInstance.fontSize
|
||||
ClosedCaptionsVar.pressed = saveObject.settingsInstance.bClosedCaptions
|
||||
ConsoleCommandVar.pressed = saveObject.settingsInstance.bdevConsole
|
||||
bKeyboardEnabled.pressed = saveObject.settingsInstance.bVirtualKeyboard
|
||||
|
||||
print(NameVar.get_path())
|
||||
|
||||
# Init Keyboard Layout List
|
||||
for i in range(3):
|
||||
keyboardLayoutList.add_item(keyboardContents[i],null,true)
|
||||
|
||||
keyboardLayoutList.select(0,true)
|
||||
|
||||
# Init Theme Choice List
|
||||
|
||||
for i in range(2):
|
||||
themeChoiceList.add_item(themeContents[i],null,true)
|
||||
|
||||
keyboardLayoutList.select(saveObject.settingsInstance.visualKeyboardLayout,true)
|
||||
|
||||
themeChoiceList.select(saveObject.settingsInstance.themeChoiceInt,true)
|
||||
|
||||
#Load selected theme:
|
||||
theme=load(saveObject.settingsInstance.themeFile)
|
@ -0,0 +1,322 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://screens/SettingsMenuConfig.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/liberation_serif.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://userInterface/But_ChangeScene.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="Theme" id=1]
|
||||
default_font = ExtResource( 2 )
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -512.0
|
||||
margin_top = -300.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 300.0
|
||||
theme = SubResource( 1 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -512.0
|
||||
margin_top = -302.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 298.0
|
||||
rect_pivot_offset = Vector2( -276, 469 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -298.5
|
||||
margin_right = 298.5
|
||||
margin_bottom = 19.0
|
||||
custom_constants/separation = 60
|
||||
alignment = 1
|
||||
|
||||
[node name="RootVboxVisualControls" type="VBoxContainer" parent="Panel/HBoxContainer"]
|
||||
margin_right = 99.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="VisualControlsLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls"]
|
||||
margin_right = 99.0
|
||||
margin_bottom = 19.0
|
||||
text = "Visual Controls"
|
||||
|
||||
[node name="VisualControlsVBox" type="VBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -77.5
|
||||
margin_top = 30.0
|
||||
margin_right = 77.5
|
||||
margin_bottom = 52.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxFontSize" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox"]
|
||||
margin_right = 155.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="FontLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox/HBoxFontSize"]
|
||||
margin_right = 64.0
|
||||
margin_bottom = 19.0
|
||||
text = "Font Size:"
|
||||
|
||||
[node name="FontSizeSlider" type="HSlider" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox"]
|
||||
margin_top = 23.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 39.0
|
||||
min_value = 1.0
|
||||
max_value = 5.0
|
||||
value = 5.0
|
||||
rounded = true
|
||||
tick_count = 10
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="BrightnessLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox"]
|
||||
margin_top = 43.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 62.0
|
||||
text = "Brightness:"
|
||||
|
||||
[node name="BrightnessSlider" type="HSlider" parent="Panel/HBoxContainer/RootVboxVisualControls/VisualControlsLabel/VisualControlsVBox"]
|
||||
margin_top = 66.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 82.0
|
||||
min_value = 1.0
|
||||
max_value = 5.0
|
||||
value = 5.0
|
||||
rounded = true
|
||||
tick_count = 10
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="RootVboxPlayerPreferences" type="VBoxContainer" parent="Panel/HBoxContainer"]
|
||||
margin_left = 159.0
|
||||
margin_right = 276.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="Label" type="Label" parent="Panel/HBoxContainer/RootVboxPlayerPreferences"]
|
||||
margin_right = 117.0
|
||||
margin_bottom = 19.0
|
||||
text = "Player Preferances"
|
||||
|
||||
[node name="VBoxPlayerPreferances" type="VBoxContainer" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label"]
|
||||
margin_left = -18.5
|
||||
margin_top = 30.0
|
||||
margin_right = 126.5
|
||||
margin_bottom = 125.0
|
||||
|
||||
[node name="HBoxDisplayName" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances"]
|
||||
margin_right = 145.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="DisplayNameLabel" type="Label" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/HBoxDisplayName"]
|
||||
margin_right = 95.0
|
||||
margin_bottom = 19.0
|
||||
text = "Display Name:"
|
||||
|
||||
[node name="DisplayNameLineEdit" type="LineEdit" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances"]
|
||||
margin_top = 23.0
|
||||
margin_right = 145.0
|
||||
margin_bottom = 52.0
|
||||
|
||||
[node name="VBoxRiskFactor" type="VBoxContainer" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances"]
|
||||
margin_top = 56.0
|
||||
margin_right = 145.0
|
||||
margin_bottom = 95.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxRiskFactor" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/VBoxRiskFactor"]
|
||||
margin_right = 145.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="RiskFactorLabel" type="Label" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/VBoxRiskFactor/HBoxRiskFactor"]
|
||||
margin_right = 145.0
|
||||
margin_bottom = 19.0
|
||||
text = "Risk Factor Threshold:"
|
||||
|
||||
[node name="RiskSlider" type="HSlider" parent="Panel/HBoxContainer/RootVboxPlayerPreferences/Label/VBoxPlayerPreferances/VBoxRiskFactor"]
|
||||
margin_top = 23.0
|
||||
margin_right = 145.0
|
||||
margin_bottom = 39.0
|
||||
min_value = 1.0
|
||||
max_value = 5.0
|
||||
value = 5.0
|
||||
rounded = true
|
||||
tick_count = 10
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="RootVboxGeneralSettings" type="VBoxContainer" parent="Panel/HBoxContainer"]
|
||||
margin_left = 336.0
|
||||
margin_right = 440.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="GeneralSettingsLabel" type="Label" parent="Panel/HBoxContainer/RootVboxGeneralSettings"]
|
||||
margin_right = 104.0
|
||||
margin_bottom = 19.0
|
||||
text = "General Settings"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -77.5
|
||||
margin_top = 30.0
|
||||
margin_right = 77.5
|
||||
margin_bottom = 120.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer"]
|
||||
margin_right = 155.0
|
||||
margin_bottom = 19.0
|
||||
rect_pivot_offset = Vector2( 62, 14 )
|
||||
text = "Volume:"
|
||||
|
||||
[node name="VolumeSlider" type="HSlider" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer"]
|
||||
margin_top = 23.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 39.0
|
||||
max_value = 10.0
|
||||
rounded = true
|
||||
tick_count = 10
|
||||
ticks_on_borders = true
|
||||
|
||||
[node name="HBoxClosedCaptions" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer"]
|
||||
margin_top = 43.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 70.0
|
||||
|
||||
[node name="ClosedCaptionsLabel" type="Label" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxClosedCaptions"]
|
||||
margin_top = 4.0
|
||||
margin_right = 108.0
|
||||
margin_bottom = 23.0
|
||||
text = "Closed Captions:"
|
||||
|
||||
[node name="ClosedCaptionsCheckBox" type="CheckBox" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxClosedCaptions"]
|
||||
margin_left = 112.0
|
||||
margin_right = 136.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="HBoxDevConsole" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer"]
|
||||
margin_top = 74.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 101.0
|
||||
|
||||
[node name="DevConsoleLabel" type="Label" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxDevConsole"]
|
||||
margin_top = 4.0
|
||||
margin_right = 126.0
|
||||
margin_bottom = 23.0
|
||||
text = "Developer Console:"
|
||||
|
||||
[node name="DevConsoleCheckbox" type="CheckBox" parent="Panel/HBoxContainer/RootVboxGeneralSettings/GeneralSettingsLabel/VBoxContainer/HBoxDevConsole"]
|
||||
margin_left = 130.0
|
||||
margin_right = 154.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="RootVboxVisualControls2" type="VBoxContainer" parent="Panel/HBoxContainer"]
|
||||
margin_left = 500.0
|
||||
margin_right = 599.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="Label2" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls2"]
|
||||
margin_right = 99.0
|
||||
margin_bottom = 19.0
|
||||
text = "Visual Controls"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -77.5
|
||||
margin_top = 30.0
|
||||
margin_right = 77.5
|
||||
margin_bottom = 52.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxThemes" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer"]
|
||||
margin_right = 155.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="ThemesLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/HBoxThemes"]
|
||||
margin_right = 119.0
|
||||
margin_bottom = 19.0
|
||||
text = "Theme Preference:"
|
||||
|
||||
[node name="ThemeItemList" type="ItemList" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer"]
|
||||
margin_top = 23.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 32.0
|
||||
auto_height = true
|
||||
|
||||
[node name="HBoxVirtualKeyboardEnabled" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer"]
|
||||
margin_top = 36.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 63.0
|
||||
|
||||
[node name="VisualKeyBoardLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/HBoxVirtualKeyboardEnabled"]
|
||||
margin_top = 4.0
|
||||
margin_right = 111.0
|
||||
margin_bottom = 23.0
|
||||
text = "Virtual Keyboard"
|
||||
|
||||
[node name="VisualKeyboardCheckBox" type="CheckBox" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/HBoxVirtualKeyboardEnabled"]
|
||||
margin_left = 115.0
|
||||
margin_right = 139.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="HBoxKeyboardLayout" type="HBoxContainer" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer"]
|
||||
margin_top = 67.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 86.0
|
||||
|
||||
[node name="LayoutLabel" type="Label" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer/HBoxKeyboardLayout"]
|
||||
margin_right = 120.0
|
||||
margin_bottom = 19.0
|
||||
text = "Layout Preference:"
|
||||
|
||||
[node name="LayoutItemList" type="ItemList" parent="Panel/HBoxContainer/RootVboxVisualControls2/Label2/VBoxContainer"]
|
||||
margin_top = 90.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 99.0
|
||||
auto_height = true
|
||||
|
||||
[node name="HBoxBottomRow" type="HBoxContainer" parent="Panel"]
|
||||
anchor_left = 0.500488
|
||||
anchor_right = 0.595215
|
||||
margin_left = -48.5
|
||||
margin_top = 200.0
|
||||
margin_right = 48.5
|
||||
margin_bottom = 225.0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
|
||||
[node name="SaveButton" type="Button" parent="Panel/HBoxBottomRow"]
|
||||
margin_left = 24.0
|
||||
margin_right = 121.0
|
||||
margin_bottom = 25.0
|
||||
text = "Save Settings"
|
||||
|
||||
[node name="But_ChangeScene" parent="Panel/HBoxBottomRow" instance=ExtResource( 3 )]
|
||||
margin_left = 125.0
|
||||
margin_right = 170.0
|
||||
margin_bottom = 25.0
|
||||
text = "Back"
|
||||
next_scene_path = "res://screens/MenuScreen.tscn"
|
@ -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
|
@ -0,0 +1,7 @@
|
||||
extends Control
|
||||
|
||||
#GRAB FOCUS: simple script for temp files to grab focus
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$Title/But_ChangeScene.grab_focus()
|
Reference in New Issue
Block a user