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

In-game news straight from my website

This is new feature trying out JSON-RPC requests.
This commit is contained in:
Tony Bark 2021-05-31 16:56:52 -04:00
parent 9db6589717
commit ec79a57f96
15 changed files with 628 additions and 17 deletions

69
scenes/NewsWin.tscn Normal file
View file

@ -0,0 +1,69 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://sprites/symbols/sync.svg" type="Texture" id=1]
[ext_resource path="res://sprites/pawprint-logo.svg" type="Texture" id=2]
[ext_resource path="res://scripts/news_window.gd" type="Script" id=3]
[node name="NewsWin" type="WindowDialog"]
visible = true
anchor_left = 0.15375
anchor_top = 0.144
anchor_right = 0.84625
anchor_bottom = 0.856
rect_min_size = Vector2( 540, 340 )
window_title = "News"
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="News" type="ItemList" parent="."]
anchor_top = 0.179775
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -3.8147e-06
max_text_lines = 5
auto_height = true
same_column_width = true
icon_mode = 0
__meta__ = {
"_edit_use_anchors_": true
}
[node name="NewsBtns" type="HBoxContainer" parent="."]
anchor_top = 0.0280899
anchor_right = 1.0
anchor_bottom = 0.13764
margin_top = 0.748672
margin_bottom = 0.748837
custom_constants/separation = 30
alignment = 1
__meta__ = {
"_edit_use_anchors_": true
}
[node name="HTTPRequest" type="HTTPRequest" parent="NewsBtns"]
[node name="Logo" type="TextureRect" parent="NewsBtns"]
margin_left = 79.0
margin_right = 367.0
margin_bottom = 39.0
texture = ExtResource( 2 )
stretch_mode = 4
__meta__ = {
"_edit_use_anchors_": true
}
[node name="VSeparator" type="VSeparator" parent="NewsBtns"]
margin_left = 397.0
margin_right = 401.0
margin_bottom = 39.0
[node name="SyncBtn" type="Button" parent="NewsBtns"]
margin_left = 431.0
margin_right = 475.0
margin_bottom = 39.0
icon = ExtResource( 1 )
[connection signal="request_completed" from="NewsBtns/HTTPRequest" to="." method="_on_HTTPRequest_request_completed"]
[connection signal="pressed" from="NewsBtns/SyncBtn" to="." method="_on_SyncBtn_pressed"]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=15 format=2]
[gd_scene load_steps=18 format=2]
[ext_resource path="res://scenes/character_base.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/CharacterBase.tscn" type="PackedScene" id=1]
[ext_resource path="res://sprites/world/background.svg" type="Texture" id=2]
[ext_resource path="res://sprites/symbols/trash.svg" type="Texture" id=3]
[ext_resource path="res://scenes/wardrobe.tscn" type="PackedScene" id=4]
@ -14,6 +14,9 @@
[ext_resource path="res://sprites/symbols/spinner.svg" type="Texture" id=12]
[ext_resource path="res://scripts/spinner.gd" type="Script" id=13]
[ext_resource path="res://scripts/game.gd" type="Script" id=14]
[ext_resource path="res://sprites/symbols/newspaper.svg" type="Texture" id=15]
[ext_resource path="res://scenes/NewsWin.tscn" type="PackedScene" id=16]
[ext_resource path="res://sprites/symbols/newspaper-disabled.svg" type="Texture" id=17]
[node name="game" type="Node2D"]
script = ExtResource( 14 )
@ -74,39 +77,55 @@ __meta__ = {
wait_time = 2.0
[node name="CenterBtns" type="CenterContainer" parent="Controls/Container"]
anchor_left = 0.35875
anchor_top = 0.792
anchor_right = 0.99625
anchor_bottom = 0.886
anchor_left = 0.35125
anchor_top = 0.78
anchor_right = 0.9925
anchor_bottom = 0.874
__meta__ = {
"_edit_use_anchors_": true
}
[node name="ButtonCtr" type="HBoxContainer" parent="Controls/Container/CenterBtns"]
margin_left = 197.0
margin_left = 157.0
margin_top = 7.0
margin_right = 312.0
margin_right = 356.0
margin_bottom = 39.0
custom_constants/separation = 20
[node name="NewsBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_right = 40.0
margin_bottom = 32.0
hint_tooltip = "News"
texture_normal = ExtResource( 15 )
texture_disabled = ExtResource( 17 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="VSeparator" type="VSeparator" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_left = 60.0
margin_right = 64.0
margin_bottom = 32.0
[node name="ExportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_right = 25.0
margin_left = 84.0
margin_right = 109.0
margin_bottom = 32.0
hint_tooltip = "Export"
texture_normal = ExtResource( 7 )
texture_disabled = ExtResource( 10 )
[node name="ImportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_left = 45.0
margin_right = 70.0
margin_left = 129.0
margin_right = 154.0
margin_bottom = 32.0
hint_tooltip = "Import"
texture_normal = ExtResource( 9 )
texture_disabled = ExtResource( 11 )
[node name="ClearBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"]
margin_left = 90.0
margin_right = 115.0
margin_left = 174.0
margin_right = 199.0
margin_bottom = 32.0
hint_tooltip = "Clear"
texture_normal = ExtResource( 3 )
@ -123,7 +142,11 @@ __meta__ = {
"_edit_use_anchors_": true
}
[node name="NewsWin" parent="Controls/Container" instance=ExtResource( 16 )]
visible = false
[connection signal="timeout" from="Controls/Container/Spinner/Timer" to="Controls/Container/Spinner" method="_on_Timer_timeout"]
[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/NewsBtn" to="Controls/Container" method="_on_NewsBtn_pressed"]
[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ExportBtn" to="characterBase" method="_on_SaveBtn_pressed"]
[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ImportBtn" to="characterBase" method="_on_LoadBtn_pressed"]
[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ClearBtn" to="characterBase" method="_on_clearBtn_pressed"]