mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
fixed so the name of the player that calls the vote is in the chat. fixed so that the time remaining on the vote is displayed. reworked the vote box a bit so it's nicer
This commit is contained in:
parent
2f801d47cf
commit
6ffd661c78
|
@ -192,13 +192,25 @@ void HUD::render_voting()
|
|||
if(!gameclient.voting->is_voting())
|
||||
return;
|
||||
|
||||
gfx_text_color(1,1,1,1);
|
||||
gfx_text(0x0, 5, 60, 6, gameclient.voting->vote_description(), -1);
|
||||
gfx_texture_set(-1);
|
||||
gfx_quads_begin();
|
||||
gfx_setcolor(0,0,0,0.40f);
|
||||
draw_round_rect(-10, 60-2, 100+10+4+5, 28, 5.0f);
|
||||
gfx_quads_end();
|
||||
|
||||
RECT base = {5, 70, 119, 3};
|
||||
gameclient.voting->render_bars(base, false);
|
||||
gfx_text_color(1,1,1,1);
|
||||
|
||||
char buf[512];
|
||||
gfx_text(0x0, 5, 60, 6, gameclient.voting->vote_description(), -1);
|
||||
|
||||
str_format(buf, sizeof(buf), "%ds left", gameclient.voting->seconds_left());
|
||||
float tw = gfx_text_width(0x0, 6, buf, -1);
|
||||
gfx_text(0x0, 5+100-tw, 60, 6, buf, -1);
|
||||
|
||||
|
||||
RECT base = {5, 70, 100, 4};
|
||||
gameclient.voting->render_bars(base, false);
|
||||
|
||||
const char *yes_key = gameclient.binds->get_key("vote yes");
|
||||
const char *no_key = gameclient.binds->get_key("vote no");
|
||||
str_format(buf, sizeof(buf), "%s - Vote Yes", yes_key);
|
||||
|
|
|
@ -224,7 +224,7 @@ void mods_message(int msgtype, int client_id)
|
|||
{
|
||||
if(str_comp_nocase(msg->value, option->command) == 0)
|
||||
{
|
||||
str_format(chatmsg, sizeof(chatmsg), "Vote called to change server option '%s'", option->command);
|
||||
str_format(chatmsg, sizeof(chatmsg), "%s called vote to change server option '%s'", server_clientname(client_id), option->command);
|
||||
str_format(desc, sizeof(desc), "%s", option->command);
|
||||
str_format(cmd, sizeof(cmd), "%s", option->command);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue