mrowww
This commit is contained in:
parent
80991aac9c
commit
ce2c867603
8 changed files with 143 additions and 14 deletions
|
|
@ -17,8 +17,8 @@ const TWITCH_CHATTERS_URL = "https://api.twitch.tv/helix/chat/chatters"
|
|||
var auth_server: VSTAuthServer
|
||||
|
||||
var _scopes: PackedStringArray
|
||||
var _client_id: String
|
||||
var _user: VSTChannel
|
||||
static var _client_id: String
|
||||
static var _user: VSTChannel
|
||||
|
||||
func initiate_twitch_auth():
|
||||
_scopes = VSTSettings.get_setting(VSTSettings.settings.scopes)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
[gd_resource type="Resource" script_class="Save" load_steps=4 format=3]
|
||||
[gd_resource type="Resource" script_class="Save" load_steps=4 format=3 uid="uid://domukcgxqbc77"]
|
||||
|
||||
[ext_resource type="Script" path="res://twitch/player_data.gd" id="1_yphdo"]
|
||||
[ext_resource type="Script" path="res://twitch/saveFile.gd" id="2_o22i5"]
|
||||
[ext_resource type="Script" uid="uid://dgn8nnp7mtgdm" path="res://twitch/player_data.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://dx5cdskh1njoa" path="res://twitch/saveFile.gd" id="2"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hxy0q"]
|
||||
script = ExtResource("1_yphdo")
|
||||
money = 95
|
||||
script = ExtResource("1")
|
||||
money = 205
|
||||
user_id = "144628425"
|
||||
username = "tabbyCatNya"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_o22i5")
|
||||
player_database = Array[ExtResource("1_yphdo")]([SubResource("Resource_hxy0q")])
|
||||
script = ExtResource("2")
|
||||
player_database = Array[ExtResource("1")]([SubResource("Resource_hxy0q")])
|
||||
|
|
|
|||
66
export_presets.cfg
Normal file
66
export_presets.cfg
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
[preset.0]
|
||||
|
||||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../Exports/ShineRunners/shineRunners.exe"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
codesign/enable=false
|
||||
codesign/timestamp=true
|
||||
codesign/timestamp_server_url=""
|
||||
codesign/digest_algorithm=1
|
||||
codesign/description=""
|
||||
codesign/custom_options=PackedStringArray()
|
||||
application/modify_resources=true
|
||||
application/icon=""
|
||||
application/console_wrapper_icon=""
|
||||
application/icon_interpolation=4
|
||||
application/file_version=""
|
||||
application/product_version=""
|
||||
application/company_name=""
|
||||
application/product_name=""
|
||||
application/file_description=""
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
application/export_angle=0
|
||||
application/export_d3d12=0
|
||||
application/d3d12_agility_sdk_multiarch=true
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
|
||||
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
|
||||
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
|
||||
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
|
||||
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
|
||||
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
|
||||
Start-ScheduledTask -TaskName godot_remote_debug
|
||||
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
|
||||
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||
18
game.tscn
18
game.tscn
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=22 format=3 uid="uid://jo1lu66y1gx6"]
|
||||
[gd_scene load_steps=23 format=3 uid="uid://jo1lu66y1gx6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://i348o6hqw2dn" path="res://sprites/44389.png" id="1_e2o6t"]
|
||||
[ext_resource type="Script" uid="uid://5qnvkmmtxsw2" path="res://gameManager.gd" id="1_feb5d"]
|
||||
|
|
@ -45,12 +45,14 @@ size = Vector2(3, 22)
|
|||
[sub_resource type="LabelSettings" id="LabelSettings_feb5d"]
|
||||
font_color = Color(0.481789, 0.481789, 0.481789, 1)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_j5wjh"]
|
||||
font_size = 9
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_7jktm"]
|
||||
radius = 3.0
|
||||
|
||||
[node name="Game" type="Node2D" node_paths=PackedStringArray("player_spawns_nodes", "starting_shine_nodes", "shine_nodes", "scorecard_container", "elim_timer_label", "game_timer_label", "chime_player", "music_player", "win_player", "flyover_player", "intro_player", "start_button", "user_cards")]
|
||||
[node name="Game" type="Node2D" node_paths=PackedStringArray("player_spawns_nodes", "starting_shine_nodes", "shine_nodes", "scorecard_container", "elim_timer_label", "game_timer_label", "chime_player", "music_player", "win_player", "flyover_player", "intro_player", "start_button", "user_cards", "instructions")]
|
||||
script = ExtResource("1_feb5d")
|
||||
autoplay_mode = true
|
||||
max_shinies = 100
|
||||
player_spawns_nodes = NodePath("PlayerSpawns")
|
||||
starting_shine_nodes = NodePath("StartingShineLocations")
|
||||
|
|
@ -65,6 +67,7 @@ flyover_player = NodePath("Flyover")
|
|||
intro_player = NodePath("IntroPlayer")
|
||||
start_button = NodePath("GameUI/StartButton")
|
||||
user_cards = NodePath("GameUI/Users/userCards")
|
||||
instructions = NodePath("GameUI/how to bet")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
|
|
@ -373,6 +376,15 @@ layout_mode = 2
|
|||
[node name="User5" parent="GameUI/Users/userCards" instance=ExtResource("3_j5wjh")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="how to bet" type="Label" parent="GameUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 115.0
|
||||
offset_top = 87.0
|
||||
offset_right = 229.0
|
||||
offset_bottom = 100.0
|
||||
text = "!bet <money> <character>"
|
||||
label_settings = SubResource("LabelSettings_j5wjh")
|
||||
|
||||
[node name="PlayerSpawns" type="Node2D" parent="."]
|
||||
|
||||
[node name="Point" type="CollisionShape2D" parent="PlayerSpawns"]
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var bets_closed : bool = false
|
|||
@export var intro_player : AudioStreamPlayer
|
||||
@export var start_button : Button
|
||||
@export var user_cards : VBoxContainer
|
||||
@export var instructions : Label
|
||||
|
||||
var state : State = State.prep
|
||||
var game_timer : float = 0
|
||||
|
|
@ -175,6 +176,7 @@ func _on_intro_player_finished() -> void:
|
|||
for player in players:
|
||||
player.lifetime = 0
|
||||
player.start_engine()
|
||||
instructions.text = "Bets closed!"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,13 @@ var alive : bool = true
|
|||
@export var back : TextureRect
|
||||
@export var alive_texture : Texture
|
||||
@export var dead_texture : Texture
|
||||
@export var command_label : Label
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
command_label.text = "!bet ___ " + str(id)
|
||||
|
||||
command_label.visible = Twitch.game_node.state == Twitch.game_node.State.prep
|
||||
|
||||
if alive:
|
||||
back.texture = alive_texture
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cp2t5xc2yk3q4"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cp2t5xc2yk3q4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ddafqftfujtry" path="res://scorecard.gd" id="1_hcikf"]
|
||||
[ext_resource type="Texture2D" uid="uid://77quibtjcvca" path="res://sprites/scorecard.png" id="1_l1cy6"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://c7ceeyn5e3kgr" path="res://playerSprites.tres" id="3_hcikf"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4ffkmx1xbr7e" path="res://sprites/scorecard - white.png" id="3_lb3t7"]
|
||||
|
||||
[node name="Scorecard" type="Control" node_paths=PackedStringArray("score_label", "sprite", "back")]
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_lb3t7"]
|
||||
font_size = 8
|
||||
|
||||
[node name="Scorecard" type="Control" node_paths=PackedStringArray("score_label", "sprite", "back", "command_label")]
|
||||
self_modulate = Color(0.879205, 0.000618961, 0.879199, 1)
|
||||
custom_minimum_size = Vector2(0, 23)
|
||||
layout_mode = 3
|
||||
|
|
@ -22,6 +25,7 @@ sprite = NodePath("PlayerSprite")
|
|||
back = NodePath("Back")
|
||||
alive_texture = ExtResource("1_l1cy6")
|
||||
dead_texture = ExtResource("3_lb3t7")
|
||||
command_label = NodePath("command")
|
||||
|
||||
[node name="Back" type="TextureRect" parent="."]
|
||||
show_behind_parent = true
|
||||
|
|
@ -41,3 +45,12 @@ offset_right = 56.0
|
|||
offset_bottom = 23.0
|
||||
text = "00"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="command" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 61.0
|
||||
offset_top = 5.0
|
||||
offset_right = 97.0
|
||||
offset_bottom = 18.0
|
||||
text = "!bet ___ ?"
|
||||
label_settings = SubResource("LabelSettings_lb3t7")
|
||||
|
|
|
|||
32
twitch.gd
32
twitch.gd
|
|
@ -9,6 +9,7 @@ func _ready() -> void:
|
|||
VerySimpleTwitch.get_token_and_login_chat()
|
||||
VerySimpleTwitch.chat_message_received.connect(handle_message)
|
||||
game_node = get_node("/root/Game")
|
||||
get_user_id("tabbyCatNya")
|
||||
#test_save()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
|
@ -16,10 +17,12 @@ func _process(delta: float) -> void:
|
|||
|
||||
func handle_message(chatter: VSTChatter):
|
||||
print("Message received from %s: %s" % [chatter.tags.display_name, chatter.message])
|
||||
print(chatter.tags.user_id)
|
||||
var found_player : bool = false
|
||||
for player in save.player_database:
|
||||
if(chatter.tags.user_id == player.user_id):
|
||||
found_player = true
|
||||
print("found " + player.username)
|
||||
# do whatever we want for a found player
|
||||
player.playing = true
|
||||
var splits : PackedStringArray = chatter.message.split(" ")
|
||||
|
|
@ -37,6 +40,7 @@ func handle_message(chatter: VSTChatter):
|
|||
game_node.load_userboard()
|
||||
|
||||
func create_new_player(id : String, name : String) -> PlayerData:
|
||||
print("creating a new player: " + name)
|
||||
var player : PlayerData = PlayerData.new()
|
||||
player.user_id = id
|
||||
player.username = name
|
||||
|
|
@ -95,3 +99,31 @@ func test_save():
|
|||
player3.money = 300
|
||||
save.player_database.append(player3)
|
||||
ResourceSaver.save(save, save_path)
|
||||
|
||||
#func get_user_id(username : String, on_success : Callable):
|
||||
#var body = {
|
||||
#data = {
|
||||
#login = username
|
||||
#},
|
||||
#}
|
||||
#var vst = VSTNetwork_Call.new()
|
||||
#vst.to("https://api.twitch.tv/helix/users")
|
||||
##vst.add_all_get_params({
|
||||
##'broadcaster_id': _user.id,
|
||||
##'moderator_id': _user.id
|
||||
##}).\
|
||||
#vst.with(body)
|
||||
#vst.verb(HTTPClient.METHOD_POST)
|
||||
#vst.add_all_headers({
|
||||
#'Client-Id: ' : VSTAPI._client_id,
|
||||
#'Authorization': 'Bearer ' + VSTAPI._user.token,
|
||||
#'Content-Type': 'application/json'
|
||||
#})
|
||||
#vst.set_on_call_success(on_success)
|
||||
#vst.launch_request(self)
|
||||
#
|
||||
#func on_user_id_received(response : VSTNetwork_Call):
|
||||
#print(response.body)
|
||||
|
||||
func get_user_id(username : String):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue