Skip to content

Commit

Permalink
Chinese Translation
Browse files Browse the repository at this point in the history
  • Loading branch information
IronShears committed Mar 18, 2024
1 parent a2b54b6 commit 35219b1
Show file tree
Hide file tree
Showing 28 changed files with 6,817 additions and 2,036 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="06d7ce4a5366de5fd22380d86c2a057e"
dest_md5="b7a56000bfce70fa35935c0585c0a73f"

Binary file not shown.
72 changes: 46 additions & 26 deletions Commandprompt.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ var objectName = "Room"
var colorName = "Blue"
var styleName = "Cool"

func _ready():
if UniversalFunctions.language !="":
var counter = 1
for i in UniversalFunctions.languageOptionPosition[UniversalFunctions.language]:
get_tree().get_root().get_node_or_null("/root/world/Commandprompt/Options/Option"+str(counter)).rect_position.y = i
counter +=1


func _play_dialog():
$Options.visible = false
Expand Down Expand Up @@ -219,49 +226,62 @@ func _on_Timer_timeout():
else:
pitch = rng.randf_range(1.00, 1.10)
$Voice.pitch_scale = pitch
if currentChar == "a":
$Voice.stream = a
elif currentChar == "e":
$Voice.stream = e
elif currentChar == "i":
$Voice.stream = i
elif currentChar == "o":
$Voice.stream = o
elif currentChar == "u":
$Voice.stream = u
else:
if nextChar == "a":
if UniversalFunctions.language != "_CN":
if currentChar == "a":
$Voice.stream = a
elif nextChar == "e":
elif currentChar == "e":
$Voice.stream = e
elif nextChar == "i":
elif currentChar == "i":
$Voice.stream = i
elif nextChar == "o":
elif currentChar == "o":
$Voice.stream = o
elif nextChar == "u":
elif currentChar == "u":
$Voice.stream = u
else:
if thirdChar == "a":
if nextChar == "a":
$Voice.stream = a
elif thirdChar == "e":
elif nextChar == "e":
$Voice.stream = e
elif thirdChar == "i":
elif nextChar == "i":
$Voice.stream = i
elif thirdChar == "o":
elif nextChar == "o":
$Voice.stream = o
elif thirdChar == "u":
elif nextChar == "u":
$Voice.stream = u
else:
if currentChar in ["b","c","d","f"]:
if thirdChar == "a":
$Voice.stream = a
elif currentChar in ["g","h","j","k"]:
elif thirdChar == "e":
$Voice.stream = e
elif currentChar in ["l","m","n","p",]:
elif thirdChar == "i":
$Voice.stream = i
elif currentChar in ["q","r","s","t"]:
elif thirdChar == "o":
$Voice.stream = o
elif currentChar in ["v","w","x","y","z"]:
elif thirdChar == "u":
$Voice.stream = u
else:
if currentChar in ["b","c","d","f"]:
$Voice.stream = a
elif currentChar in ["g","h","j","k"]:
$Voice.stream = e
elif currentChar in ["l","m","n","p",]:
$Voice.stream = i
elif currentChar in ["q","r","s","t"]:
$Voice.stream = o
elif currentChar in ["v","w","x","y","z"]:
$Voice.stream = u
else:
var randomNum = rng.randi_range(1, 5)
if randomNum == 1:
$Voice.stream = a
elif randomNum == 2:
$Voice.stream = e
elif randomNum == 3:
$Voice.stream = i
elif randomNum == 4:
$Voice.stream = o
elif randomNum == 5:
$Voice.stream = u
if currentChar != " " and currentChar !="." and currentChar !="?" and currentChar !="!":
$Voice.play()

Expand Down
4 changes: 0 additions & 4 deletions Commandprompt.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ __meta__ = {
}

[node name="Options" type="Control" parent="."]
visible = false
margin_left = -45.0
margin_top = -60.0
margin_right = 270.0
Expand All @@ -50,7 +49,6 @@ __meta__ = {
}

[node name="Option3" type="Button" parent="Options"]
visible = false
margin_left = 7.0
margin_top = 40.0
margin_right = 33.0
Expand All @@ -66,7 +64,6 @@ __meta__ = {
}

[node name="Option2" type="Button" parent="Options"]
visible = false
margin_left = 7.0
margin_top = 50.0
margin_right = 33.0
Expand All @@ -82,7 +79,6 @@ __meta__ = {
}

[node name="Option1" type="Button" parent="Options"]
visible = false
margin_left = 7.0
margin_top = 59.0
margin_right = 33.0
Expand Down
6 changes: 6 additions & 0 deletions FileSystem.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ func set_up():
#Sets all nodes to invisible
for i in nodes:
i.visible = false

#Makes correct folders visible
for i in visibleFolders:
get_tree().get_root().get_node_or_null("/root/world/FileSystem/VBoxContainer/"+i).visible = true
get_tree().get_root().get_node_or_null("/root/world/FileSystem/VBoxContainer/"+i+"/Label").text = UniversalFunctions.dialogueJson[i]
if UniversalFunctions.language !="":
get_tree().get_root().get_node_or_null("/root/world/FileSystem/VBoxContainer/"+i+"/Label").add_font_override("font", load("res://Resources/GUIpieces/AltFonts/ShellFont"+UniversalFunctions.language+".tres"))
#Makes correct items visible
for i in allItems[currentFolder]:
get_tree().get_root().get_node_or_null("/root/world/FileSystem/StorageFile"+str(counter)).visible = true
Expand All @@ -50,6 +53,9 @@ func set_up():
get_tree().get_root().get_node_or_null("/root/world/FileSystem/StorageFile"+str(counter)).play("text")
else:
get_tree().get_root().get_node_or_null("/root/world/FileSystem/StorageFile"+str(counter)).play("folder")
if UniversalFunctions.language !="":
get_tree().get_root().get_node_or_null("/root/world/FileSystem/StorageFile"+str(counter)+"/Label").add_font_override("font", load("res://Resources/GUIpieces/AltFonts/ShellFont"+UniversalFunctions.language+".tres"))
get_tree().get_root().get_node_or_null("/root/world/FileSystem/StorageFile"+str(counter)+"/Label").rect_position.x = UniversalFunctions.languageOptionPosition[UniversalFunctions.language+"FileSystem"]
counter+=1

func _process(_delta):
Expand Down
13 changes: 13 additions & 0 deletions Languages.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends Node2D


func _on_English_pressed():
UniversalFunctions.language = ""
UniversalFunctions.set_text()
UniversalFunctions.change_scenes_reset("res://login.tscn")


func _on_Chinese_pressed():
UniversalFunctions.language = "_CN"
UniversalFunctions.set_text()
UniversalFunctions.change_scenes_reset("res://login.tscn")
170 changes: 170 additions & 0 deletions Languages.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
[gd_scene load_steps=28 format=2]

[ext_resource path="res://Resources/GUIpieces/PersephoneOS.tres" type="Theme" id=1]
[ext_resource path="res://Resources/GUIpieces/generatebuttonunpressed.png" type="Texture" id=2]
[ext_resource path="res://Resources/GUIpieces/ShellFont.tres" type="DynamicFont" id=3]
[ext_resource path="res://Resources/GUIpieces/AltFonts/ShellFont_CN.tres" type="DynamicFont" id=4]
[ext_resource path="res://Resources/GUIpieces/generatebutton.png" type="Texture" id=5]
[ext_resource path="res://Languages.gd" type="Script" id=6]
[ext_resource path="res://Resources/GUIpieces/LoginBG.png" type="Texture" id=7]
[ext_resource path="res://cursor.gd" type="Script" id=8]
[ext_resource path="res://Resources/GUIpieces/cursoribar.png" type="Texture" id=9]
[ext_resource path="res://Resources/GUIpieces/cursorload.png" type="Texture" id=10]
[ext_resource path="res://Resources/GUIpieces/cursorLocked.png" type="Texture" id=11]
[ext_resource path="res://Resources/GUIpieces/cursor.png" type="Texture" id=12]

[sub_resource type="AtlasTexture" id=47]
atlas = ExtResource( 10 )
region = Rect2( 0, 0, 7, 9 )

[sub_resource type="AtlasTexture" id=48]
atlas = ExtResource( 10 )
region = Rect2( 7, 0, 7, 9 )

[sub_resource type="AtlasTexture" id=49]
atlas = ExtResource( 10 )
region = Rect2( 0, 9, 7, 9 )

[sub_resource type="AtlasTexture" id=50]
atlas = ExtResource( 10 )
region = Rect2( 7, 9, 7, 9 )

[sub_resource type="AtlasTexture" id=51]
atlas = ExtResource( 10 )
region = Rect2( 0, 18, 7, 9 )

[sub_resource type="AtlasTexture" id=52]
atlas = ExtResource( 10 )
region = Rect2( 7, 18, 7, 9 )

[sub_resource type="AtlasTexture" id=53]
atlas = ExtResource( 10 )
region = Rect2( 0, 27, 7, 9 )

[sub_resource type="AtlasTexture" id=54]
atlas = ExtResource( 10 )
region = Rect2( 7, 27, 7, 9 )

[sub_resource type="AtlasTexture" id=55]
atlas = ExtResource( 10 )
region = Rect2( 0, 36, 7, 9 )

[sub_resource type="AtlasTexture" id=56]
atlas = ExtResource( 10 )
region = Rect2( 7, 36, 7, 9 )

[sub_resource type="AtlasTexture" id=57]
atlas = ExtResource( 10 )
region = Rect2( 0, 45, 7, 9 )

[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 10 )
region = Rect2( 7, 45, 7, 9 )

[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 10 )
region = Rect2( 0, 54, 7, 9 )

[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 10 )
region = Rect2( 7, 54, 7, 9 )

[sub_resource type="SpriteFrames" id=61]
animations = [ {
"frames": [ ExtResource( 12 ) ],
"loop": true,
"name": "default",
"speed": 5.0
}, {
"frames": [ SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ), SubResource( 60 ) ],
"loop": true,
"name": "loading",
"speed": 8.0
}, {
"frames": [ ExtResource( 11 ) ],
"loop": true,
"name": "locked",
"speed": 5.0
}, {
"frames": [ ExtResource( 9 ) ],
"loop": true,
"name": "ibar",
"speed": 5.0
} ]

[node name="world" type="Node2D"]
script = ExtResource( 6 )

[node name="Background" type="Sprite" parent="."]
texture = ExtResource( 7 )
centered = false

[node name="ColorRect" type="ColorRect" parent="."]
margin_left = 121.0
margin_top = 106.0
margin_right = 196.0
margin_bottom = 135.0
color = Color( 0.517647, 0.541176, 0.592157, 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="English" type="TextureButton" parent="."]
margin_left = 122.0
margin_top = 107.0
margin_right = 195.0
margin_bottom = 120.0
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Label" type="Label" parent="English"]
margin_left = 3.0
margin_top = -1.0
margin_right = 71.0
margin_bottom = 11.0
theme = ExtResource( 1 )
custom_fonts/font = ExtResource( 3 )
text = "English"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Chinese" type="TextureButton" parent="."]
margin_left = 122.0
margin_top = 121.0
margin_right = 195.0
margin_bottom = 134.0
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Label" type="Label" parent="Chinese"]
margin_left = 3.0
margin_right = 71.0
margin_bottom = 14.0
theme = ExtResource( 1 )
custom_fonts/font = ExtResource( 4 )
text = "中文"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="cursor" type="AnimatedSprite" parent="."]
position = Vector2( 226, 144 )
z_index = 6
frames = SubResource( 61 )
playing = true
centered = false
script = ExtResource( 8 )

[connection signal="pressed" from="English" to="." method="_on_English_pressed"]
[connection signal="pressed" from="Chinese" to="." method="_on_Chinese_pressed"]
7 changes: 7 additions & 0 deletions Resources/GUIpieces/AltFonts/BoldFont_CN.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]

[ext_resource path="res://Resources/GUIpieces/AltFonts/VonwaonBitmap-12px.ttf" type="DynamicFontData" id=1]

[resource]
size = 12
font_data = ExtResource( 1 )
Loading

0 comments on commit 35219b1

Please sign in to comment.