-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
name="GodotGoogleSheet" | ||
description="" | ||
author="Deflinhec" | ||
version="1.0.0" | ||
version="1.0.1" | ||
script="plugin.gd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
extends CanvasLayer | ||
|
||
var GSheet = preload("res://addons/google_sheet/src/gsheet.gd") | ||
|
||
var gsheet = GSheet.new() | ||
|
||
var datas: Dictionary = {} | ||
|
||
func _ready(): | ||
gsheet.connect("allset", self, "_on_allset") | ||
gsheet.connect("complete", self, "_on_complete") | ||
gsheet.connect("total_bytes_changed", self, "_on_total_bytes_changed") | ||
gsheet.connect("downloaded_bytes_changed", self, "_on_downloaded_bytes_changed") | ||
gsheet.connect("total_files_changed", self, "_on_total_files_changed") | ||
gsheet.connect("loaded_files_changed", self, "_on_loaded_files_changed") | ||
gsheet.queue("res://datas/test.json", | ||
"1-DGS8kSiBrPOxvyM1ISCxtdqWt-I7u1Vmcp-XksQ1M4", 1) | ||
gsheet.start() | ||
|
||
|
||
func _on_total_bytes_changed(bytes: int): | ||
$Status.set_text("Downloading...") | ||
$ProgressBar.max_value = bytes | ||
|
||
|
||
func _on_downloaded_bytes_changed(bytes: int): | ||
$ProgressBar.value = bytes | ||
|
||
|
||
func _on_total_files_changed(count: int): | ||
$Status.set_text("Loading...") | ||
$ProgressBar.max_value = count | ||
|
||
|
||
func _on_loaded_files_changed(count: int): | ||
$ProgressBar.value = count | ||
|
||
|
||
func _on_complete(path: String, data: Dictionary): | ||
datas[path] = data | ||
|
||
|
||
func _on_allset(): | ||
$Status.set_text("All set") | ||
|
||
|
||
func _on_Button_pressed(): | ||
gsheet.download() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://demo/main.gd" type="Script" id=1] | ||
|
||
[node name="CanvasLayer" type="CanvasLayer"] | ||
script = ExtResource( 1 ) | ||
|
||
[node name="ProgressBar" type="ProgressBar" parent="."] | ||
anchor_left = 0.444 | ||
anchor_top = 0.488 | ||
anchor_right = 0.556 | ||
anchor_bottom = 0.512 | ||
margin_left = 0.343964 | ||
margin_top = 0.199982 | ||
margin_right = -0.344055 | ||
margin_bottom = -0.200012 | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Button" type="Button" parent="."] | ||
anchor_left = 0.445 | ||
anchor_top = 0.528 | ||
anchor_right = 0.555 | ||
anchor_bottom = 0.562 | ||
margin_left = 0.319977 | ||
margin_top = 0.200012 | ||
margin_right = -0.320007 | ||
margin_bottom = -0.200012 | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Status" type="Label" parent="."] | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
margin_left = -40.0 | ||
margin_top = -28.6667 | ||
margin_right = 40.0 | ||
margin_bottom = -14.6667 | ||
align = 1 | ||
valign = 1 | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters