commit a5cce3cba7f0fc670bf322234175e89c5e8c16f6 Author: chimchooree Date: Sat Mar 4 16:57:31 2023 -0600 shoutbox with new users and message display diff --git a/.import/.gdignore b/.import/.gdignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.import/.gdignore @@ -0,0 +1 @@ + diff --git a/.import/Text.csv-faa6f290f79c1ee2595317848795c782.md5 b/.import/Text.csv-faa6f290f79c1ee2595317848795c782.md5 new file mode 100644 index 0000000..878331d --- /dev/null +++ b/.import/Text.csv-faa6f290f79c1ee2595317848795c782.md5 @@ -0,0 +1,3 @@ +source_md5="b3ee3b197af6bdf6b469f88bc97a2b5b" +dest_md5="5cc453001da2def085d615be60a0b9c4" + diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 new file mode 100644 index 0000000..5328bc7 --- /dev/null +++ b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 @@ -0,0 +1,3 @@ +source_md5="47313fa4c47a9963fddd764e1ec6e4a8" +dest_md5="26ea799ea0a3da9e753b3ebe822e0570" + diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex new file mode 100644 index 0000000..71f6913 Binary files /dev/null and b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex differ diff --git a/Lemon.gd b/Lemon.gd new file mode 100644 index 0000000..2d60905 --- /dev/null +++ b/Lemon.gd @@ -0,0 +1,60 @@ +extends Node + +# Lemonland Shoutbox Client + +onready var ui = $UI +export var websocket_url = "ws://127.0.0.1:8080" +var _client = WebSocketClient.new() +var chat_name + +func join_chat(username): + chat_name = username + _client.get_peer(1).put_packet(JSON.print({'type': "user_joined", 'name': username}).to_utf8()) + +func send_message(message): + _client.get_peer(1).put_packet(JSON.print({'type': 'shout', 'name': chat_name, 'message': message}).to_utf8()) + +sync func receive_message(packet): + ui.display_message(packet) + +func _ready(): + TranslationServer.set_locale("en") + for text in get_tree().get_nodes_in_group("translate"): + text.translate() + + _client.connect("connection_closed", self, "_closed") + _client.connect("connection_error", self, "_error") + _client.connect("connection_established", self, "_connected") + _client.connect("data_received", self, "_on_data_received") + + var err = _client.connect_to_url(websocket_url) + if err != OK: + print_debug("Unable to connect") + set_process(false) + +func _error(was_clean = false): + print_debug("Error, clean: ", was_clean) + set_process(false) + +func _closed(was_clean = false): + print_debug("Closed, clean: ", was_clean) + set_process(false) + +func _connected(protocol = ""): + print_debug("Connected with protocol: ", protocol) + _client.get_peer(1).put_packet(JSON.print({'type': 'test', 'message': "Client test packet"}).to_utf8()) + ui.join_button.show() + ui.username.show() + +func _on_data_received(): + var json = JSON.parse(_client.get_peer(1).get_packet().get_string_from_utf8()) + var packet = json.result + if typeof(packet) != 18: + push_error("%s is not a dictionary" % [packet]) + get_tree().quit() + print_debug("Got data from server: ", packet) + if packet['type'] == "shout" or packet['type'] == "server_message": + receive_message(packet) + +func _process(_delta): + _client.poll() diff --git a/Lemon.tscn b/Lemon.tscn new file mode 100644 index 0000000..595c83c --- /dev/null +++ b/Lemon.tscn @@ -0,0 +1,91 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://Lemon.gd" type="Script" id=1] +[ext_resource path="res://UI/LineEdit.gd" type="Script" id=2] +[ext_resource path="res://UI/Button.gd" type="Script" id=3] +[ext_resource path="res://UI/Label.gd" type="Script" id=4] +[ext_resource path="res://UI/Shoutbox/Shoutbox.gd" type="Script" id=5] + +[node name="LemonChat" type="Node"] +script = ExtResource( 1 ) + +[node name="UI" type="PanelContainer" parent="."] +margin_right = 170.0 +margin_bottom = 600.0 +rect_min_size = Vector2( 170, 0 ) +size_flags_horizontal = 0 +size_flags_vertical = 3 +script = ExtResource( 5 ) + +[node name="VBox" type="VBoxContainer" parent="UI"] +margin_left = 7.0 +margin_top = 7.0 +margin_right = 163.0 +margin_bottom = 593.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="UI/VBox"] +margin_right = 156.0 +margin_bottom = 14.0 +size_flags_horizontal = 3 +align = 1 +script = ExtResource( 4 ) +tl = "sbshou" + +[node name="ChatDisplay" type="TextEdit" parent="UI/VBox"] +margin_top = 18.0 +margin_right = 156.0 +margin_bottom = 582.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +readonly = true +show_line_numbers = true +wrap_enabled = true + +[node name="ChatInput" type="LineEdit" parent="UI/VBox"] +visible = false +margin_top = 520.0 +margin_right = 270.0 +margin_bottom = 544.0 +size_flags_horizontal = 3 +script = ExtResource( 2 ) +tl = "sbchin" + +[node name="VBox" type="VBoxContainer" parent="UI/VBox"] +margin_top = 586.0 +margin_right = 156.0 +margin_bottom = 586.0 +size_flags_horizontal = 3 + +[node name="HBox" type="HBoxContainer" parent="UI/VBox/VBox"] +margin_right = 156.0 +size_flags_horizontal = 3 + +[node name="Name" type="LineEdit" parent="UI/VBox/VBox/HBox"] +visible = false +margin_right = 270.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +expand_to_text_length = true +placeholder_text = "Username" + +[node name="JoinButton" type="Button" parent="UI/VBox/VBox/HBox"] +visible = false +margin_left = 137.0 +margin_right = 270.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +text = "join" +script = ExtResource( 3 ) +tl = "sbjoin" + +[node name="LeaveButton" type="Button" parent="UI/VBox/VBox/HBox"] +visible = false +margin_left = 118.0 +margin_right = 645.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +text = "Leave" +script = ExtResource( 3 ) +tl = "sbleav" diff --git a/Res/Text/Text.csv b/Res/Text/Text.csv new file mode 100644 index 0000000..c243953 --- /dev/null +++ b/Res/Text/Text.csv @@ -0,0 +1,69 @@ +id,pr,en +sbshou,,shoutbox +sbchin,,shout something… +sbjoin,,join +sbhost,,host +sbleav,,leave +sbusna,,username +stwe01,,"Yet another immigrant. So you want in, too, huh? Hmmm. \nWhat, are you just going to stand there? Come over. Let me look at you." +stwe02,,"Well, you look like a slacker. I don’t know – the boss might be mad." +stwe03,,"You look like a good kid. I want to help you get here, but the boss would get mad." +stwe04,,"You must have come a long way, tho’, so I would hate to see you turned away." +stwe05,,… +stwe06,,Mmmm – here. Just fill out these forms real quick. /n The boss could return any minute. +acwe01,,take forms +foifna,,Name +foifdo,,Date of Birth +foifge,,Gender +foifbo,,Boy +foifgi,,Girl +foifal,,Alien +foifpa,,Password +foifap,,Password Again +foifse,,"You must pick either an email OR a Security Q&A, so you can retrieve your documentation when you inevitably lose it." +foifem,,Email +foifsq,,Security Question +foifsa,,Security Answer +foifrp,,Pets! +foifrc,,Collecting! +foifrg,,Playing games! +foifrf,,Making friends! +foifri,,I don’t know! +foifre,,Exploring! +foifbs,,Submit Form +foifb1,,Fill these forms real quick. The boss will be here any minute. +foifb2,,I've never seen a name like that. How...exotic. Can you spell it out in English characters to make it more...normal? +tijanu,,January +tifebu,,February +timarc,,March +tiapri,,April +timaya,,May +tijune,,June +tijuly,,July +tiaugu,,August +tiocto,,October +tinove,,November +tidece,,December +tisept,,September +tiun13,,Under 13 years old +tiov13,,13 years old or older +foifb3,,"Whoa, is that really your name? Um, keep in mind we potentially have younger citizens. Of course, if that name is not offensive in your culture, I get it, happens all the time. Just understand the leaders of the land will have you rename yourself if they find it too offensive." +ru0001,,"Avoid being offensive. Keep cussing to a respectful minimum. If you keep it PG-13 and are not mean-spirited, you are probably fine. Violaters with offensive names will either have to rename or be renamed." +ru0002,,"Do not share your account information with anyone, even staff. Keep your username, email, password, security questions, etc secret." +ru0003,,"Do not share personally identifiable information or photos. If you do, your content may be redacted to protect your privacy." +ru0004,,"Do not trade in-game assets for real world currency, goods, or services." +ru0005,,Targeted harassment is not allowed. Make no attempts to evade chat filters or blocklists. +ru0006,,"These are not rules. They are guidelines. If I feel you are harming other members, the site, or the economy, but in a way that is not addressed by the rules, I reserve the right to moderate you." +ru0007,,No spamming. Do not obstruct chat or gameplay for others. +ru0008,,"Do not take advantage of bugs or glitches. If you find any, you will be rewarded a bounty instead. Report typos for a smaller bounty." +foifb4,,I already know a {name}. Having two would just be awkward. Can you use a nickname instead or choose a totally different name? +foifb5,,"Oh, sorry…we can’t accept unacccompanied minors. Come back when you are 13, kid. The adult responsible for you can fill out the form on your behalf, so long as they keep an eye on you while in Lemonland. You...did bring an adult with you, right?" +foifb6,,"Are you aware your password is in the top 10 most common passwords? Sorry. I just can’t in good conscious let you use this. Instead, try a string of four memorable words like “correcthorsebatterystaple.""" +foifb7,,Your passwords don’t match. +foifb8,,Your email isn’t valid. Fix it or use a security Q&A instead. Or both! +foifb9,,You must use at least one: an email OR a security Q&A. +foif10,,You forgot your name. +foif11,,You forgot to write your password. +acwe02,,Begin the immigration process +acwe03,,Why join Lemonland? +acwe04,,View laws of the land diff --git a/Res/Text/Text.csv.import b/Res/Text/Text.csv.import new file mode 100644 index 0000000..d83d200 --- /dev/null +++ b/Res/Text/Text.csv.import @@ -0,0 +1,16 @@ +[remap] + +importer="csv_translation" +type="Translation" + +[deps] + +files=[ "res://Res/Text/Text.pr.translation", "res://Res/Text/Text.en.translation" ] + +source_file="res://Res/Text/Text.csv" +dest_files=[ "res://Res/Text/Text.pr.translation", "res://Res/Text/Text.en.translation" ] + +[params] + +compress=true +delimiter=0 diff --git a/Res/Text/Text.en.translation b/Res/Text/Text.en.translation new file mode 100644 index 0000000..f238094 Binary files /dev/null and b/Res/Text/Text.en.translation differ diff --git a/Res/Text/Text.pr.translation b/Res/Text/Text.pr.translation new file mode 100644 index 0000000..78fdd78 Binary files /dev/null and b/Res/Text/Text.pr.translation differ diff --git a/Res/Text/censor.txt b/Res/Text/censor.txt new file mode 100644 index 0000000..b59ad2a --- /dev/null +++ b/Res/Text/censor.txt @@ -0,0 +1,144 @@ +abortion +anal +antifa +anus +areola +ass +bastard +bdsm +beaner +beastiality +bicurious +bisexual +bitch +blowjob +blueball +boob +breast +bunghole +butt +chink +clit +cock +coitus +commie +communist +condom +crackpipe +crap +crotch +cuck +cum +cunt +damn +darkie +darky +deadname +deepthroat +dick +dildo +drug +dyke +erection +faeces +fag +fart +feces +femboy +femoid +fister +fisting +foreskin +fornicate +fuck +gasm +gay +gender +genital +goldenshower +gook +goy +gyp +heroin +hitler +homo +horny +hump +hymen +incest +intercourse +jackoff +jerkoff +jew +jizz +kink +kkk +kike +lactate +lesbian +lesbo +lezbo +lsd +lube +marijuana +masturbate +menstral +meth +molest +muff +nazi +negroid +nig +nipple +orgy +pedo +penis +pimp +piss +poop +porn +prostitute +pubic +pussy +queef +queer +racial +racist +rapist +rimjob +roastie +schizo +scrotum +semen +sex +shit +skank +slanteye +slut +sodom +spastic +spaz +sucker +swastika +syphilis +tarbaby +tard +testicle +tits +titty +titties +tranny +trans +twat +urinary +urinate +uterus +vagina +vestite +vibrator +virgin +vulva +wank +weed +whore +zipperhead diff --git a/Singletons/Server.gd b/Singletons/Server.gd new file mode 100644 index 0000000..963c9fd --- /dev/null +++ b/Singletons/Server.gd @@ -0,0 +1,21 @@ +extends Node + +var network = NetworkedMultiplayerENet.new() +var ip = "127.0.0.1" +var port = 3000 + +func connect_to_server(): + network.create_client(ip, port) + get_tree().set_network_peer(network) + network.connect("connection_failed", self, "_connection_failed") + network.connect("connection_succeeded", self, "_connection_succeeded") + +func _connection_failed(): + print_debug("Failed to connect") + +func _connection_succeeded(): + print_debug("Connected") + +func _ready(): + connect_to_server() + diff --git a/Story/Story.gd b/Story/Story.gd new file mode 100644 index 0000000..72b69e4 --- /dev/null +++ b/Story/Story.gd @@ -0,0 +1,12 @@ +extends Node + +var action_box +var dialog_box + +func setup(): + dialog_box.update_dialog({'portrait': '', 'name': '', 'line': "stwe01"}) + action_box.update_actions({'actions': ['acwe02','acwe03','acwe04']}) + +func _ready(): + add_to_group("setup") + add_to_group("storyteller") diff --git a/UI/Action.gd b/UI/Action.gd new file mode 100644 index 0000000..9ea5850 --- /dev/null +++ b/UI/Action.gd @@ -0,0 +1,12 @@ +extends GridContainer + +var storyteller + +func update_actions(dict): + for a in dict['actions']: + var b = Button.new() + b.set_text(tr(a)) + add_child(b) + +func _ready(): + add_to_group("action_box") diff --git a/UI/Button.gd b/UI/Button.gd new file mode 100644 index 0000000..97102bd --- /dev/null +++ b/UI/Button.gd @@ -0,0 +1,9 @@ +extends Button + +export(String) var tl + +func translate(): + set_text(tr(tl)) + +func _ready(): + add_to_group("translate") diff --git a/UI/DialogBox.gd b/UI/DialogBox.gd new file mode 100644 index 0000000..43dbd9d --- /dev/null +++ b/UI/DialogBox.gd @@ -0,0 +1,9 @@ +extends RichTextLabel + +var storyteller + +func update_dialog(dict): + set_text(tr(dict['line'])) + +func _ready(): + add_to_group("dialog_box") diff --git a/UI/Form.gd b/UI/Form.gd new file mode 100644 index 0000000..0a02320 --- /dev/null +++ b/UI/Form.gd @@ -0,0 +1,94 @@ +extends VBoxContainer + +onready var legal_name = $Questions/Col1/HBox/Name +onready var day = $Questions/Col1/HBox2/Day +onready var month = $Questions/Col1/HBox2/Month +onready var year = $Questions/Col1/HBox2/Year +onready var gender = $Questions/Col1/HBox3/Gender +onready var password = $Questions/Col1/HBox4/Password +onready var password2 = $Questions/Col1/HBox5/Password2 +onready var email = $Questions/Col2/HBox/Email +onready var secq = $Questions/Col2/HBox2/SecurityQ +onready var seca = $Questions/Col2/HBox3/SecurityA +onready var reason = $HBox/Reason +onready var etc = $HBox2/Etc +onready var submit = $Submit +onready var message = $HBox3/VBox/Message +onready var action = $HBox3/VBox/Action +onready var censor = 'res://Res/Text/censor.txt' + +func check(): + var form = collect_answers() + # Check Name is filled + if !form['name']: + message.set_text(tr("foif10")) + return false + # Check Name has special characters + for c in ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '{', + '}', '\'', '\"', ':', ';']: + if c in form['name']: + message.set_text(tr("foifb2")) + return false + # Check Name is offensive + var file = File.new() + file.open(censor, file.READ) + var line_counter = 0 + while not file.eof_reached(): + line_counter+=1 + if file.get_line() in form['name']: + message.set_text(tr("foifb3")) + file.close() + return false + file.close() + # Check Name is taken +# message.set_text(tr("foifb4")) + # Check if >= 13 + if form['age'] < 1: + message.set_text(tr("foifb5")) + return false + # Check Password is filled + if !form['password'] or !form['password2']: + message.set_text(tr("foif11")) + return false + # Check Password in top passwords + for p in ["123456","123456789","qwerty","password","12345","qwerty123","1q2w3e","12345678","111111","1234567890"]: + if form['password'] == p: + message.set_text(tr("foifb6")) + return false + # Check Passwords match + if form['password'] != form['password2']: + message.set_text(tr("foifb7")) + return false + # Check Email is valid + if !form['email']: + message.set_text(tr("foifb8")) + return false + # Check Account Recovery filled out + if !form['email'] and !form['secq'] and !form['seca']: + message.set_text(tr("foifb8")) + return false + # Also no name, etc + return true + +func collect_answers(): + return { + 'name': legal_name.get_text(), + 'dob': str(month.get_selected_id() + 1) + "/" + str(day.get_selected_id() + 1), + 'age': year.get_selected_id(), + 'gender': gender.get_selected_id(), + 'password': password.get_text(), + 'password2': password2.get_text(), + 'email': email.get_text(), + 'secq': secq.get_text(), + 'seca': seca.get_text(), + 'reason': reason.get_selected_id(), + 'etc': etc.get_text() + } + +func create_account(): + if !check(): + return + get_parent().get_parent().queue_free() + +func _ready(): + submit.connect("button_up", self, "create_account") diff --git a/UI/Form/Immigration/Day.gd b/UI/Form/Immigration/Day.gd new file mode 100644 index 0000000..5ff105d --- /dev/null +++ b/UI/Form/Immigration/Day.gd @@ -0,0 +1,7 @@ +extends OptionButton + +func _ready(): + var x = 1 + while x < 32: + add_item(str(x)) + x += 1 diff --git a/UI/Form/Immigration/Gender.gd b/UI/Form/Immigration/Gender.gd new file mode 100644 index 0000000..c5ca22f --- /dev/null +++ b/UI/Form/Immigration/Gender.gd @@ -0,0 +1,7 @@ +extends OptionButton + +var keys = ["foifal","foifbo","foifgi"] + +func _ready(): + for k in keys: + add_item(tr(k)) diff --git a/UI/Form/Immigration/Immigration.tscn b/UI/Form/Immigration/Immigration.tscn new file mode 100644 index 0000000..f5b10e7 --- /dev/null +++ b/UI/Form/Immigration/Immigration.tscn @@ -0,0 +1,370 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://UI/Form/Immigration/Gender.gd" type="Script" id=1] +[ext_resource path="res://UI/Form.gd" type="Script" id=2] +[ext_resource path="res://UI/Form/Immigration/Day.gd" type="Script" id=3] +[ext_resource path="res://UI/Button.gd" type="Script" id=4] +[ext_resource path="res://icon.png" type="Texture" id=5] +[ext_resource path="res://UI/Form/Immigration/Month.gd" type="Script" id=6] +[ext_resource path="res://UI/Form/Immigration/Reason.gd" type="Script" id=7] +[ext_resource path="res://UI/Form/Immigration/Year.gd" type="Script" id=8] + +[node name="CharCreate" type="PanelContainer"] +margin_left = 7.0 +margin_top = 7.0 +margin_right = 605.0 +margin_bottom = 579.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 7.0 +margin_top = 7.0 +margin_right = 591.0 +margin_bottom = 565.0 + +[node name="Form" type="VBoxContainer" parent="VBoxContainer"] +margin_right = 584.0 +margin_bottom = 464.0 +script = ExtResource( 2 ) + +[node name="Title" type="Label" parent="VBoxContainer/Form"] +margin_right = 584.0 +margin_bottom = 14.0 +text = "Immigration Forms" + +[node name="Desc" type="Label" parent="VBoxContainer/Form"] +margin_top = 18.0 +margin_right = 584.0 +margin_bottom = 32.0 +text = "Fill out the following questions." + +[node name="HSeparator" type="HSeparator" parent="VBoxContainer/Form"] +margin_top = 36.0 +margin_right = 584.0 +margin_bottom = 40.0 + +[node name="Questions" type="HBoxContainer" parent="VBoxContainer/Form"] +margin_top = 44.0 +margin_right = 584.0 +margin_bottom = 192.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Col1" type="VBoxContainer" parent="VBoxContainer/Form/Questions"] +margin_right = 290.0 +margin_bottom = 148.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="HBox" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col1"] +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col1/HBox"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Name:" + +[node name="Name" type="LineEdit" parent="VBoxContainer/Form/Questions/Col1/HBox"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="HBox2" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col1"] +margin_top = 28.0 +margin_right = 290.0 +margin_bottom = 48.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col1/HBox2"] +margin_top = 3.0 +margin_right = 191.0 +margin_bottom = 17.0 +size_flags_horizontal = 3 +text = "Date of Birth:" + +[node name="Day" type="OptionButton" parent="VBoxContainer/Form/Questions/Col1/HBox2"] +margin_left = 195.0 +margin_right = 224.0 +margin_bottom = 20.0 +script = ExtResource( 3 ) + +[node name="Month" type="OptionButton" parent="VBoxContainer/Form/Questions/Col1/HBox2"] +margin_left = 228.0 +margin_right = 257.0 +margin_bottom = 20.0 +script = ExtResource( 6 ) + +[node name="Year" type="OptionButton" parent="VBoxContainer/Form/Questions/Col1/HBox2"] +margin_left = 261.0 +margin_right = 290.0 +margin_bottom = 20.0 +script = ExtResource( 8 ) + +[node name="HBox3" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col1"] +margin_top = 52.0 +margin_right = 290.0 +margin_bottom = 72.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col1/HBox3"] +margin_top = 3.0 +margin_right = 143.0 +margin_bottom = 17.0 +size_flags_horizontal = 3 +text = "Gender:" + +[node name="Gender" type="OptionButton" parent="VBoxContainer/Form/Questions/Col1/HBox3"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 20.0 +size_flags_horizontal = 3 +script = ExtResource( 1 ) + +[node name="HBox4" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col1"] +margin_top = 76.0 +margin_right = 290.0 +margin_bottom = 100.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col1/HBox4"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Password:" + +[node name="Password" type="LineEdit" parent="VBoxContainer/Form/Questions/Col1/HBox4"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="HBox5" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col1"] +margin_top = 104.0 +margin_right = 290.0 +margin_bottom = 128.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col1/HBox5"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Password Again:" + +[node name="Password2" type="LineEdit" parent="VBoxContainer/Form/Questions/Col1/HBox5"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="Col2" type="VBoxContainer" parent="VBoxContainer/Form/Questions"] +margin_left = 294.0 +margin_right = 584.0 +margin_bottom = 148.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col2"] +margin_right = 290.0 +margin_bottom = 48.0 +text = "You must pick either an email OR a Security Q&A, so you can retrieve your documentation when you inevitably lose it." +autowrap = true + +[node name="HSeparator" type="HSeparator" parent="VBoxContainer/Form/Questions/Col2"] +margin_top = 52.0 +margin_right = 290.0 +margin_bottom = 56.0 + +[node name="HBox" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col2"] +margin_top = 60.0 +margin_right = 290.0 +margin_bottom = 84.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col2/HBox"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "email:" + +[node name="Email" type="LineEdit" parent="VBoxContainer/Form/Questions/Col2/HBox"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/Form/Questions/Col2"] +margin_top = 88.0 +margin_right = 290.0 +margin_bottom = 92.0 + +[node name="HBox2" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col2"] +margin_top = 96.0 +margin_right = 290.0 +margin_bottom = 120.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col2/HBox2"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Security Question:" + +[node name="SecurityQ" type="LineEdit" parent="VBoxContainer/Form/Questions/Col2/HBox2"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="HBox3" type="HBoxContainer" parent="VBoxContainer/Form/Questions/Col2"] +margin_top = 124.0 +margin_right = 290.0 +margin_bottom = 148.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/Questions/Col2/HBox3"] +margin_top = 5.0 +margin_right = 143.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Security Answer:" + +[node name="SecurityA" type="LineEdit" parent="VBoxContainer/Form/Questions/Col2/HBox3"] +margin_left = 147.0 +margin_right = 290.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/Form"] +margin_top = 196.0 +margin_right = 584.0 +margin_bottom = 200.0 + +[node name="HBox" type="HBoxContainer" parent="VBoxContainer/Form"] +margin_top = 204.0 +margin_right = 584.0 +margin_bottom = 224.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/HBox"] +margin_top = 3.0 +margin_right = 290.0 +margin_bottom = 17.0 +size_flags_horizontal = 3 +text = "Reason for Immigrating:" + +[node name="Reason" type="OptionButton" parent="VBoxContainer/Form/HBox"] +margin_left = 294.0 +margin_right = 584.0 +margin_bottom = 20.0 +size_flags_horizontal = 3 +script = ExtResource( 7 ) + +[node name="HBox2" type="HBoxContainer" parent="VBoxContainer/Form"] +margin_top = 228.0 +margin_right = 584.0 +margin_bottom = 252.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/Form/HBox2"] +margin_top = 5.0 +margin_right = 290.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Additional Comments:" + +[node name="Etc" type="LineEdit" parent="VBoxContainer/Form/HBox2"] +margin_left = 294.0 +margin_right = 584.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +text = "ajsdfrjosdijfosdiajfoisdjfoai hahaha" + +[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/Form"] +margin_top = 256.0 +margin_right = 584.0 +margin_bottom = 260.0 + +[node name="Submit" type="Button" parent="VBoxContainer/Form"] +margin_top = 264.0 +margin_right = 584.0 +margin_bottom = 284.0 +script = ExtResource( 4 ) +tl = "foifbs" + +[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/Form"] +margin_top = 288.0 +margin_right = 584.0 +margin_bottom = 292.0 + +[node name="HBox3" type="HBoxContainer" parent="VBoxContainer/Form"] +margin_top = 296.0 +margin_right = 584.0 +margin_bottom = 464.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 2 + +[node name="VBox2" type="VBoxContainer" parent="VBoxContainer/Form/HBox3"] +margin_right = 150.0 +margin_bottom = 168.0 +alignment = 2 + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/Form/HBox3/VBox2"] +margin_right = 150.0 +margin_bottom = 150.0 +rect_min_size = Vector2( 150, 150 ) +texture = ExtResource( 5 ) +expand = true + +[node name="Label" type="Label" parent="VBoxContainer/Form/HBox3/VBox2"] +margin_top = 154.0 +margin_right = 150.0 +margin_bottom = 168.0 +size_flags_horizontal = 3 +size_flags_vertical = 1 +text = "Bless the Child" +align = 1 + +[node name="VBox" type="VBoxContainer" parent="VBoxContainer/Form/HBox3"] +margin_left = 154.0 +margin_right = 584.0 +margin_bottom = 168.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 2 + +[node name="Message" type="RichTextLabel" parent="VBoxContainer/Form/HBox3/VBox"] +margin_top = 129.0 +margin_right = 430.0 +margin_bottom = 144.0 +size_flags_horizontal = 3 +text = "\"Fill these forms real quick. The boss will be here any minute.\"" +fit_content_height = true + +[node name="Action" type="GridContainer" parent="VBoxContainer/Form/HBox3/VBox"] +margin_top = 148.0 +margin_right = 430.0 +margin_bottom = 168.0 +size_flags_horizontal = 3 +columns = 3 + +[node name="Button2" type="Button" parent="VBoxContainer/Form/HBox3/VBox/Action"] +margin_right = 248.0 +margin_bottom = 20.0 +text = "why not let me in without the forms?" + +[node name="Button3" type="Button" parent="VBoxContainer/Form/HBox3/VBox/Action"] +margin_left = 252.0 +margin_right = 426.0 +margin_bottom = 20.0 +text = "how do you use this info?" diff --git a/UI/Form/Immigration/Month.gd b/UI/Form/Immigration/Month.gd new file mode 100644 index 0000000..2c718cd --- /dev/null +++ b/UI/Form/Immigration/Month.gd @@ -0,0 +1,7 @@ +extends OptionButton + +var keys = ["tijanu", "tifebu", "timarc", "tiapri", "timaya", "tijune", "tijuly", "tiaugu", "tisept", "tiocto", "tinove", "tidece"] + +func _ready(): + for k in keys: + add_item(tr(k)) diff --git a/UI/Form/Immigration/Reason.gd b/UI/Form/Immigration/Reason.gd new file mode 100644 index 0000000..b778aba --- /dev/null +++ b/UI/Form/Immigration/Reason.gd @@ -0,0 +1,7 @@ +extends OptionButton + +var keys = ["foifri", "foifrp", "foifrc", "foifrg", "foifrf", "foifre"] + +func _ready(): + for k in keys: + add_item(tr(k)) diff --git a/UI/Form/Immigration/Year.gd b/UI/Form/Immigration/Year.gd new file mode 100644 index 0000000..2bc795a --- /dev/null +++ b/UI/Form/Immigration/Year.gd @@ -0,0 +1,7 @@ +extends OptionButton + +var keys = ["tiun13", "tiov13"] + +func _ready(): + for k in keys: + add_item(tr(k)) diff --git a/UI/Form/Question.gd b/UI/Form/Question.gd new file mode 100644 index 0000000..59e04b4 --- /dev/null +++ b/UI/Form/Question.gd @@ -0,0 +1,13 @@ +extends "res://UI/Label.gd" + +export(String) var tl_tooltip + +func show_tooltip(): + var label = Label.new() + label.set_text(tr(tl_tooltip)) + label.set_global_position(get_global_position()) + add_child(label) + +func _ready(): + tl = "?" + connect("mouse_entered", self, "show_tooltip") diff --git a/UI/Label.gd b/UI/Label.gd new file mode 100644 index 0000000..0f37d4d --- /dev/null +++ b/UI/Label.gd @@ -0,0 +1,9 @@ +extends Label + +export(String) var tl + +func translate(): + set_text(tr(tl)) + +func _ready(): + add_to_group("translate") diff --git a/UI/LineEdit.gd b/UI/LineEdit.gd new file mode 100644 index 0000000..327f474 --- /dev/null +++ b/UI/LineEdit.gd @@ -0,0 +1,9 @@ +extends LineEdit + +export(String) var tl + +func translate(): + placeholder_text = tr(tl) + +func _ready(): + add_to_group("translate") diff --git a/UI/Room/CustomsOffice-NoAccount.tscn b/UI/Room/CustomsOffice-NoAccount.tscn new file mode 100644 index 0000000..2b79417 --- /dev/null +++ b/UI/Room/CustomsOffice-NoAccount.tscn @@ -0,0 +1,99 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://icon.png" type="Texture" id=1] +[ext_resource path="res://UI/DialogBox.gd" type="Script" id=2] +[ext_resource path="res://UI/Action.gd" type="Script" id=3] + +[sub_resource type="Theme" id=1] + +[sub_resource type="StyleBoxTexture" id=2] +texture = ExtResource( 1 ) +region_rect = Rect2( 0, 0, 64, 64 ) + +[node name="Game" type="PanelContainer"] +margin_right = 172.0 +margin_bottom = 40.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="VBox" type="VBoxContainer" parent="."] +margin_left = 7.0 +margin_top = 7.0 +margin_right = 315.0 +margin_bottom = 500.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="HBox" type="HBoxContainer" parent="VBox"] +margin_right = 308.0 +margin_bottom = 335.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="View" type="TextureRect" parent="VBox/HBox"] +margin_right = 99.0 +margin_bottom = 335.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource( 1 ) +expand = true + +[node name="PDA" type="PanelContainer" parent="VBox/HBox"] +margin_left = 103.0 +margin_right = 308.0 +margin_bottom = 335.0 +rect_min_size = Vector2( 205, 335 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = SubResource( 1 ) +custom_styles/panel = SubResource( 2 ) + +[node name="Messages" type="RichTextLabel" parent="VBox"] +margin_top = 339.0 +margin_right = 308.0 +margin_bottom = 339.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "You are in the Customs Office. +WARNING: You have no light source. +Dan is hungry. You should feed him soon." +script = ExtResource( 2 ) + +[node name="HBox2" type="HBoxContainer" parent="VBox"] +margin_top = 343.0 +margin_right = 308.0 +margin_bottom = 493.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="VBox" type="VBoxContainer" parent="VBox/HBox2"] +margin_right = 154.0 +margin_bottom = 150.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="WhatNow" type="Label" parent="VBox/HBox2/VBox"] +margin_right = 154.0 +margin_bottom = 73.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "What will you do now...?" + +[node name="Action" type="GridContainer" parent="VBox/HBox2/VBox"] +margin_top = 77.0 +margin_right = 154.0 +margin_bottom = 150.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +columns = 2 +script = ExtResource( 3 ) + +[node name="Partner" type="TextureRect" parent="VBox/HBox2"] +margin_left = 158.0 +margin_right = 308.0 +margin_bottom = 150.0 +rect_min_size = Vector2( 150, 150 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource( 1 ) +expand = true diff --git a/UI/Shoutbox/Shoutbox.gd b/UI/Shoutbox/Shoutbox.gd new file mode 100644 index 0000000..4c18606 --- /dev/null +++ b/UI/Shoutbox/Shoutbox.gd @@ -0,0 +1,33 @@ +extends Control + +# Lemonland Shoutbox UI + +onready var chat_display = $VBox/ChatDisplay +onready var chat_input = $VBox/ChatInput +onready var leave_button = $VBox/VBox/HBox/LeaveButton +onready var join_button = $VBox/VBox/HBox/JoinButton +onready var username = $VBox/VBox/HBox/Name + +func display_message(packet): # shout, alert, server_message, user_joined, user_left + if packet['type'] == "shout": + chat_display.text += packet['name'] + ": " + packet['message'] + "\n" + else: + chat_display.text += packet['message'] + "\n" + +func join_chat(): + if !username.text: + display_message({'type': "alert", "message": "!!! Enter your username before joining chat."}) + else: + get_parent().join_chat(username.text) + chat_input.show() + join_button.hide() + username.hide() + +func _input(event): + if event is InputEventKey and get_parent().chat_name: + if event.pressed and event.scancode == KEY_ENTER: + get_parent().send_message(chat_input.text) + chat_input.text = "" + +func _ready(): + join_button.connect("button_up", self, "join_chat") diff --git a/UI/Shoutbox/Shoutbox.tscn b/UI/Shoutbox/Shoutbox.tscn new file mode 100644 index 0000000..2e17936 --- /dev/null +++ b/UI/Shoutbox/Shoutbox.tscn @@ -0,0 +1,87 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://UI/Shoutbox/Shoutbox.gd" type="Script" id=1] +[ext_resource path="res://UI/Label.gd" type="Script" id=2] +[ext_resource path="res://UI/Button.gd" type="Script" id=3] +[ext_resource path="res://UI/LineEdit.gd" type="Script" id=4] + +[node name="Shoutbox" type="PanelContainer"] +margin_left = 502.0 +margin_right = 786.0 +margin_bottom = 586.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 1 ) + +[node name="VBox" type="VBoxContainer" parent="."] +margin_left = 7.0 +margin_top = 7.0 +margin_right = 277.0 +margin_bottom = 579.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="VBox"] +margin_right = 270.0 +margin_bottom = 14.0 +size_flags_horizontal = 3 +align = 1 +script = ExtResource( 2 ) +tl = "sbshou" + +[node name="ChatDisplay" type="TextEdit" parent="VBox"] +margin_top = 18.0 +margin_right = 270.0 +margin_bottom = 568.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +readonly = true +show_line_numbers = true +wrap_enabled = true + +[node name="ChatInput" type="LineEdit" parent="VBox"] +visible = false +margin_top = 520.0 +margin_right = 270.0 +margin_bottom = 544.0 +size_flags_horizontal = 3 +script = ExtResource( 4 ) +tl = "sbchin" + +[node name="VBox" type="VBoxContainer" parent="VBox"] +margin_top = 572.0 +margin_right = 270.0 +margin_bottom = 572.0 +size_flags_horizontal = 3 + +[node name="HBox" type="HBoxContainer" parent="VBox/VBox"] +margin_right = 270.0 +size_flags_horizontal = 3 + +[node name="Name" type="LineEdit" parent="VBox/VBox/HBox"] +visible = false +margin_right = 270.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +expand_to_text_length = true +placeholder_text = "Username" + +[node name="JoinButton" type="Button" parent="VBox/VBox/HBox"] +visible = false +margin_left = 137.0 +margin_right = 270.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +text = "join" +script = ExtResource( 3 ) +tl = "sbjoin" + +[node name="LeaveButton" type="Button" parent="VBox/VBox/HBox"] +visible = false +margin_left = 118.0 +margin_right = 645.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +text = "Leave" +script = ExtResource( 3 ) +tl = "sbleav" diff --git a/default_env.tres b/default_env.tres new file mode 100644 index 0000000..20207a4 --- /dev/null +++ b/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..3403b1d --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,24 @@ +[preset.0] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Exports/Lemonland/Lemonland.x86_64" +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..c98fbb6 Binary files /dev/null and b/icon.png differ diff --git a/icon.png.import b/icon.png.import new file mode 100644 index 0000000..a4c02e6 --- /dev/null +++ b/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..3b727ed --- /dev/null +++ b/project.godot @@ -0,0 +1,35 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +[application] + +config/name="Shoutbox" +run/main_scene="res://Lemon.tscn" +config/icon="res://icon.png" + +[display] + +window/size/width=170 + +[gui] + +common/drop_mouse_on_gui_input_disabled=true + +[locale] + +translations=PoolStringArray( "res://Res/Text/Text.en.translation", "res://Res/Text/Text.pr.translation" ) + +[physics] + +common/enable_pause_aware_picking=true + +[rendering] + +environment/default_environment="res://default_env.tres"