1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-08 06:14:48 -04:00

"Shell" interface

- Created a new hidden "shell" interface. This was initially created for testing the new localization settings but can easily be extended for other purposes.
This commit is contained in:
Anthony Wilcox 2019-01-01 09:51:46 -05:00
parent 7216c18d57
commit 6a806cc55a
4 changed files with 150 additions and 13 deletions

View file

@ -1,17 +1,21 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://assets/dress up bg.png" type="Texture" id=1]
[ext_resource path="res://assets/zack.png" type="Texture" id=2]
[ext_resource path="res://assets/lights.png" type="Texture" id=3]
[ext_resource path="res://Clothes.tscn" type="PackedScene" id=4]
[ext_resource path="res://Interface.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/GameScreen.gd" type="Script" id=1]
[ext_resource path="res://assets/dress up bg.png" type="Texture" id=2]
[ext_resource path="res://assets/zack.png" type="Texture" id=3]
[ext_resource path="res://assets/lights.png" type="Texture" id=4]
[ext_resource path="res://Clothes.tscn" type="PackedScene" id=5]
[ext_resource path="res://Shell.tscn" type="PackedScene" id=6]
[ext_resource path="res://Interface.tscn" type="PackedScene" id=7]
[node name="MainScreen" type="Node2D" index="0"]
[node name="GameScreen" type="Node2D" index="0"]
script = ExtResource( 1 )
[node name="Background" type="Sprite" parent="." index="0"]
position = Vector2( 400, 277 )
texture = ExtResource( 1 )
texture = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true
}
@ -19,7 +23,7 @@ __meta__ = {
[node name="Zack" type="Sprite" parent="." index="1"]
position = Vector2( 85, 352 )
texture = ExtResource( 2 )
texture = ExtResource( 3 )
__meta__ = {
"_edit_lock_": true
}
@ -27,14 +31,18 @@ __meta__ = {
[node name="Lights" type="Sprite" parent="." index="2"]
position = Vector2( 477.823, 100.811 )
texture = ExtResource( 3 )
texture = ExtResource( 4 )
_sections_unfolded = [ "Z Index" ]
__meta__ = {
"_edit_lock_": true
}
[node name="Clothes" parent="." index="3" instance=ExtResource( 4 )]
[node name="Clothes" parent="." index="3" instance=ExtResource( 5 )]
[node name="Interface" parent="." index="4" instance=ExtResource( 5 )]
[node name="Shell" parent="." index="4" instance=ExtResource( 6 )]
visible = false
[node name="Interface" parent="." index="5" instance=ExtResource( 7 )]

103
project/Shell.tscn Normal file
View file

@ -0,0 +1,103 @@
[gd_scene format=2]
[node name="Shell" type="Control"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
[node name="RefRect" type="ReferenceRect" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 498.0
margin_top = 6.0
margin_right = 791.0
margin_bottom = 42.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
[node name="HSplit" type="HSplitContainer" parent="RefRect" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 6.0
margin_top = 6.0
margin_right = 288.0
margin_bottom = 30.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
split_offset = 165
collapsed = false
dragger_visibility = 0
[node name="CmdLine" type="LineEdit" parent="RefRect/HSplit" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 223.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 1
size_flags_vertical = 1
max_length = 30
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Caret" ]
[node name="ExitBtn" type="Button" parent="RefRect/HSplit" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 235.0
margin_right = 282.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Close"
flat = false
align = 1

View file

@ -11,9 +11,10 @@ config_version=3
[application]
config/name="Zack's Dress Up 1½"
run/main_scene="res://MainScreen.tscn"
run/main_scene="res://GameScreen.tscn"
boot_splash/image="res://assets/game splash.png"
config/icon="res://icon.png"
name_sv="Zacks klä upp 1½"
[display]
@ -21,6 +22,11 @@ window/size/width=800
window/size/height=554
window/size/resizable=false
[input]
ui_test=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":16777255,"unicode":0,"echo":false,"script":null)
]
[locale]
locale_filter=[ 1, [ "en", "sv" ] ]

20
project/src/GameScreen.gd Normal file
View file

@ -0,0 +1,20 @@
extends Node2D
onready var shell = $Shell
onready var cmdl = $Shell/RefRect/HSplit/CmdLine
onready var cmdl_exit_btn = $Shell/RefRect/HSplit/ExitBtn
func _process(delta):
cmd_interface()
func cmd_interface():
if Input.is_action_pressed("ui_test"):
shell.show()
if cmdl_exit_btn.pressed:
shell.hide()
if cmdl.text == "lang sv" and Input.is_key_pressed(KEY_ENTER):
TranslationServer.set_locale("sv")
elif cmdl.text == "lang en" and Input.is_key_pressed(KEY_ENTER):
TranslationServer.set_locale("en")