supports dialogue portrait and scene changes

master
chimchooree 2 years ago
commit fb2a7f3c6f

@ -0,0 +1,3 @@
source_md5="b3ee3b197af6bdf6b469f88bc97a2b5b"
dest_md5="5cc453001da2def085d615be60a0b9c4"

@ -0,0 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"

@ -0,0 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"

@ -0,0 +1,3 @@
source_md5="19b355c80268c5d7c75dff312b074ff8"
dest_md5="87f91c20fc1ab88382f1694bb73ee383"

@ -0,0 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"

@ -0,0 +1,3 @@
source_md5="a80a4eca82257e5caf101b46a44a706d"
dest_md5="f4b6d6e295f23a7b879197fb4533668d"

@ -0,0 +1,3 @@
source_md5="a80a4eca82257e5caf101b46a44a706d"
dest_md5="f4b6d6e295f23a7b879197fb4533668d"

@ -0,0 +1,3 @@
source_md5="3b678839fd9858a1e3ecfa688323aa96"
dest_md5="99a47f1452107ec15cdd4d018d20c3aa"

@ -0,0 +1,3 @@
source_md5="1328947e40ee142d94c959e23115cb47"
dest_md5="95d3b77f2203708d501bc63562ec950a"

@ -0,0 +1,3 @@
source_md5="1328947e40ee142d94c959e23115cb47"
dest_md5="95d3b77f2203708d501bc63562ec950a"

@ -0,0 +1,3 @@
source_md5="0a5095f858f5fae1384f44394fe89436"
dest_md5="2e9d8553b0796ebe91a939db4cc595fb"

@ -0,0 +1,47 @@
extends Node
# Lemonland View
onready var ui = $UI
export var websocket_url = "ws://127.0.0.1:8080"
var _client = WebSocketClient.new()
func _ready():
_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': "View test packet"}).to_utf8())
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'] == "view":
ui.change_view(packet)
elif packet['type'] == "portrait":
ui.change_portrait(packet)
func _process(_delta):
_client.poll()

@ -0,0 +1,37 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Lemon.gd" type="Script" id=1]
[ext_resource path="res://UI.gd" type="Script" id=2]
[ext_resource path="res://Res/Img/Portrait/yellow.png" type="Texture" id=3]
[ext_resource path="res://Res/Img/Scene/pinkland.png" type="Texture" id=4]
[node name="Lemon" type="Node"]
script = ExtResource( 1 )
[node name="UI" type="Control" parent="."]
margin_right = 14.0
margin_bottom = 14.0
script = ExtResource( 2 )
[node name="View" type="TextureRect" parent="UI"]
margin_right = 375.0
margin_bottom = 335.0
rect_min_size = Vector2( 375, 335 )
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 4 )
expand = true
__meta__ = {
"_edit_lock_": true
}
[node name="Portrait" type="TextureRect" parent="UI"]
margin_top = 271.0
margin_right = 71.0
margin_bottom = 335.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 3 )
__meta__ = {
"_edit_lock_": true
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/blue.png-e0f5f5b5c4b775bd8c0818e2c803259e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Portrait/blue.png"
dest_files=[ "res://.import/blue.png-e0f5f5b5c4b775bd8c0818e2c803259e.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pink.png-302a63cdc099d1943080b420b9d78bc1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Portrait/pink.png"
dest_files=[ "res://.import/pink.png-302a63cdc099d1943080b420b9d78bc1.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/yellow.png-02c26865a4bfcfe629729004bad7f963.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Portrait/yellow.png"
dest_files=[ "res://.import/yellow.png-02c26865a4bfcfe629729004bad7f963.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/blueland.png-f478fe8d87e2af2735e01bc75579867e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Scene/blueland.png"
dest_files=[ "res://.import/blueland.png-f478fe8d87e2af2735e01bc75579867e.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pinkland.png-89aa9c0ad4bde8be0c3d0c4cbdc3a29b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Scene/pinkland.png"
dest_files=[ "res://.import/pinkland.png-89aa9c0ad4bde8be0c3d0c4cbdc3a29b.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/yellowland.png-0bbad559ac24095d2d168e5b71163eb9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Res/Img/Scene/yellowland.png"
dest_files=[ "res://.import/yellowland.png-0bbad559ac24095d2d168e5b71163eb9.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

10
UI.gd

@ -0,0 +1,10 @@
extends Control
onready var view = $View
onready var portrait = $Portrait
func change_view(packet):
view.texture = load("res://Res/Img/Scene/" + packet["loc"] + ".png")
func change_portrait(packet):
portrait.texture = load("res://Res/Img/Portrait/" + packet["npc"] + ".png")

@ -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 )

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -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

@ -0,0 +1,36 @@
; 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="LemonView"
run/main_scene="res://LemonView.tscn"
config/icon="res://icon.png"
[display]
window/size/width=375
window/size/height=335
[gui]
common/drop_mouse_on_gui_input_disabled=true
[locale]
translations=PoolStringArray( )
[physics]
common/enable_pause_aware_picking=true
[rendering]
environment/default_environment="res://default_env.tres"
Loading…
Cancel
Save