Discord RPC cleanup
- Loading Discord RPC is now handled by `load/rpc.lua` - Removed `presence` global, call `DiscordRPC:update()` directly with what needs updating - Game doesn't crash anymore if the Discord RPC fails to load - Added RPC variables in the gamemode superclass to let each gamemode handle its special case
This commit is contained in:
@@ -5,13 +5,10 @@ function GameScene:new(game_mode, ruleset)
|
||||
self.game = game_mode()
|
||||
self.ruleset = ruleset()
|
||||
self.game:initialize(self.ruleset)
|
||||
if game_mode.name == "Demon Mode" and math.random(1, 7) == 7 then
|
||||
presence.details = "Suffering"
|
||||
else
|
||||
presence.details = "In game"
|
||||
end
|
||||
presence.state = game_mode.name
|
||||
discordRPC.updatePresence(presence)
|
||||
DiscordRPC:update({
|
||||
details = self.game.rpc_details,
|
||||
state = self.game.name,
|
||||
})
|
||||
end
|
||||
|
||||
function GameScene:update()
|
||||
|
||||
Reference in New Issue
Block a user