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
|
extends PanelContainer
|
||||||
class_name GameEntry
|
class_name GameEntry
|
||||||
|
|
||||||
|
const PROMOTE_ALERT_SCENE = preload("res://UI/Shoutouts/promote.tscn")
|
||||||
enum Type {STEAM, ITCHIO}
|
enum Type {STEAM, ITCHIO}
|
||||||
var type: Type
|
var type: Type
|
||||||
|
|
||||||
var steam_app_id: int
|
var steam_app_id: int
|
||||||
var itchio_app_url: String
|
var itchio_app_url: String
|
||||||
|
|
||||||
|
var chatter: Chatter
|
||||||
|
|
||||||
var steam_data: SteamAppData
|
var steam_data: SteamAppData
|
||||||
var itchio_data: ItchIOAppData
|
var itchio_data: ItchIOAppData
|
||||||
|
|
||||||
|
|
@ -63,18 +66,21 @@ func _promote_game() -> void:
|
||||||
var developer: String
|
var developer: String
|
||||||
var description: String
|
var description: String
|
||||||
var link: String
|
var link: String
|
||||||
|
var inst: Alert = PROMOTE_ALERT_SCENE.instantiate()
|
||||||
|
inst.chatter = chatter
|
||||||
match type:
|
match type:
|
||||||
Type.STEAM:
|
Type.STEAM:
|
||||||
title = steam_data.name
|
title = steam_data.name
|
||||||
developer = steam_data.developers.front()
|
developer = steam_data.developers.front()
|
||||||
description = steam_data.short_description
|
description = steam_data.short_description
|
||||||
link = steam_data.s_team_url
|
link = steam_data.s_team_url
|
||||||
pass
|
inst.steam = steam_data
|
||||||
Type.ITCHIO:
|
Type.ITCHIO:
|
||||||
title = itchio_data.title
|
title = itchio_data.title
|
||||||
developer = itchio_data.authors.front()["name"]
|
developer = itchio_data.authors.front()["name"]
|
||||||
description = itchio_data.description.left(200) + "..."
|
description = itchio_data.description.left(200) + "..."
|
||||||
link = itchio_data.url
|
link = itchio_data.url
|
||||||
|
inst.itch = itchio_data
|
||||||
msg = msg.format({
|
msg = msg.format({
|
||||||
"title": title,
|
"title": title,
|
||||||
"developer": developer,
|
"developer": developer,
|
||||||
|
|
@ -82,6 +88,7 @@ func _promote_game() -> void:
|
||||||
"link": link
|
"link": link
|
||||||
})
|
})
|
||||||
Globals.twitcher.send_message(msg)
|
Globals.twitcher.send_message(msg)
|
||||||
|
EventManager.add_alert(inst)
|
||||||
|
|
||||||
func _launch_game_site() -> void:
|
func _launch_game_site() -> void:
|
||||||
var link: String
|
var link: String
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue