Files
Bubberstation/code/datums/minigames_menu.dm
John Willard 2b844dab93 Mafia notes are no longer automatically written for you & new UI (#74819)
## About The Pull Request

Notes in Mafia are no longer written for you, you instead write it
yourself and save.
Also adds a button to automatically say out your notes for other
players.

Hides the judgment buttons when it's not time to judge
Makes the UI autoupdate and makes use of ui_data / ui_static_data

Video of it in action: https://www.youtube.com/watch?v=NDUSuIUqQv8

## Why It's Good For The Game

A downside to notes currently is that it's very easy to confirm yourself
as a role against players who don't code-dive to know exactly how notes
should be formatted for any role, this makes it easier, as everyone will
type out their own notes, and can send it directly to chat when needed.

## Changelog

🆑
balance: [Mafia] Notes are no longer written out for you.
qol: [Mafia] You can now send your notes to chat whenever.
qol: [Mafia] Roundend has changed. Solos will win over others in a 1v1,
but a HoP can keep a round going in case they can solo lynch.
/🆑
2023-04-25 08:43:36 -07:00

58 lines
1.2 KiB
Plaintext

/datum/minigames_menu
var/mob/dead/observer/owner
/datum/minigames_menu/New(mob/dead/observer/new_owner)
if(!istype(new_owner))
qdel(src)
owner = new_owner
/datum/minigames_menu/Destroy()
owner = null
return ..()
/datum/minigames_menu/ui_state(mob/user)
return GLOB.observer_state
/datum/minigames_menu/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "MinigamesMenu")
ui.open()
/datum/minigames_menu/ui_act(action, params, datum/tgui/ui)
. = ..()
if(.)
return
switch(action)
if("mafia")
ui.close()
mafia()
return TRUE
if("ctf")
ui.close()
ctf()
return TRUE
if("basketball")
ui.close()
basketball()
return TRUE
/datum/minigames_menu/proc/mafia()
var/datum/mafia_controller/game = GLOB.mafia_game //this needs to change if you want multiple mafia games up at once.
if(!game)
game = create_mafia_game()
game.ui_interact(usr)
/datum/minigames_menu/proc/ctf()
var/datum/ctf_panel/ctf_panel
if(!ctf_panel)
ctf_panel = new(src)
ctf_panel.ui_interact(usr)
/datum/minigames_menu/proc/basketball()
var/datum/basketball_controller/game = GLOB.basketball_game
if(!game)
game = create_basketball_game()
game.ui_interact(usr)