Updated GameEntry
Implemented logic to show Promote alert when promoting a game.
This commit is contained in:
parent
221c31389e
commit
4f5b58e3d2
1 changed files with 8 additions and 1 deletions
|
|
@ -1,12 +1,15 @@
|
|||
extends PanelContainer
|
||||
class_name GameEntry
|
||||
|
||||
const PROMOTE_ALERT_SCENE = preload("res://UI/Shoutouts/promote.tscn")
|
||||
enum Type {STEAM, ITCHIO}
|
||||
var type: Type
|
||||
|
||||
var steam_app_id: int
|
||||
var itchio_app_url: String
|
||||
|
||||
var chatter: Chatter
|
||||
|
||||
var steam_data: SteamAppData
|
||||
var itchio_data: ItchIOAppData
|
||||
|
||||
|
|
@ -63,18 +66,21 @@ func _promote_game() -> void:
|
|||
var developer: String
|
||||
var description: String
|
||||
var link: String
|
||||
var inst: Alert = PROMOTE_ALERT_SCENE.instantiate()
|
||||
inst.chatter = chatter
|
||||
match type:
|
||||
Type.STEAM:
|
||||
title = steam_data.name
|
||||
developer = steam_data.developers.front()
|
||||
description = steam_data.short_description
|
||||
link = steam_data.s_team_url
|
||||
pass
|
||||
inst.steam = steam_data
|
||||
Type.ITCHIO:
|
||||
title = itchio_data.title
|
||||
developer = itchio_data.authors.front()["name"]
|
||||
description = itchio_data.description.left(200) + "..."
|
||||
link = itchio_data.url
|
||||
inst.itch = itchio_data
|
||||
msg = msg.format({
|
||||
"title": title,
|
||||
"developer": developer,
|
||||
|
|
@ -82,6 +88,7 @@ func _promote_game() -> void:
|
|||
"link": link
|
||||
})
|
||||
Globals.twitcher.send_message(msg)
|
||||
EventManager.add_alert(inst)
|
||||
|
||||
func _launch_game_site() -> void:
|
||||
var link: String
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue