diff --git a/code/datums/vote.dm b/code/datums/vote.dm index 8856cb51935..dc193540d32 100644 --- a/code/datums/vote.dm +++ b/code/datums/vote.dm @@ -5,3 +5,7 @@ var/mode = 0 // 0 = restart vote, 1 = mode vote // modes which can be voted for var/winner = null // the vote winner + + var/customname + var/choices = list() + var/enteringchoices = 0 \ No newline at end of file diff --git a/code/game/vote.dm b/code/game/vote.dm index 2c3b57034bc..cd627866172 100644 --- a/code/game/vote.dm +++ b/code/game/vote.dm @@ -58,7 +58,14 @@ calcwin() - if(mode) + if(mode == 2) + var/wintext = capitalize(winner) + world << "Result is [wintext]" + for(var/md in vote.choices) + vote.choices -= md + return + + else if(mode == 1) if(ticker.current_state == 1) if(!going) world << "The game will start soon." @@ -191,12 +198,38 @@ if(vote.voting) // vote in progress, do the current - text += "Vote to [vote.mode?"change mode":"restart round"] in progress.
" - text += "[vote.endwait()] until voting is closed.
" - var/list/votes = vote.getvotes() + if(vote.mode == 2) + text += "A custom vote is in progress.
" + text += "[vote.endwait()] until voting is closed.
" + text += "[vote.customname]" - if(vote.mode) // true if changing mode + for(var/md in vote.choices) + var/disp = capitalize(md) + if(md=="default") + disp = "No change" + + //world << "[md]|[disp]|[src.client.vote]|[votes[md]]" + + if(src.client.vote == md) + text += "
  • [disp]" + else + text += "
  • [disp]" + + text += "[votes[md]>0?" - [votes[md]] vote\s":null]
    " + + text += "" + + text +="

    Current winner: [vote.calcwin()]
    " + + text += footer + + usr << browse(text, "window=vote") + + else if(vote.mode == 1) // true if changing mode + + text += "Vote to change mode in progress.
    " + text += "[vote.endwait()] until voting is closed.
    " text += "Current game mode is: [master_mode].
    Select the mode to change to: