Example #1
0
static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    rct_string_id stringId;
    sint32 x, y;

    window_draw_widgets(w, dpi);
    window_multiplayer_draw_tab_images(w, dpi);

    // Number of players
    stringId = w->no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL;
    x = w->x + 4;
    y = w->y + w->widgets[WIDX_LIST].bottom + 2;
    gfx_draw_string_left(dpi, stringId, &w->no_list_items, w->colours[2], x, y);
}
Example #2
0
static void window_multiplayer_information_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	window_multiplayer_draw_tab_images(w, dpi);

	rct_drawpixelinfo clippedDPI;
	if (clip_drawpixelinfo(&clippedDPI, dpi, w->x, w->y, w->width, w->height)) {
		dpi = &clippedDPI;

		sint32 x = 3;
		sint32 y = 50;
		sint32 width = w->width - 6;

		const utf8 * name = network_get_server_name();
		{
			gfx_draw_string_left_wrapped(dpi, (void*)&name, x, y, width, STR_STRING, w->colours[1]);
			y += 11;
		}
		y += 3;

		const utf8 * description = network_get_server_description();
		if (!str_is_null_or_empty(description)) {
			gfx_draw_string_left_wrapped(dpi, (void*)&description, x, y, width, STR_STRING, w->colours[1]);
			y += 11;
		}
		y += 8;

		const utf8 * providerName = network_get_server_provider_name();
		if (!str_is_null_or_empty(providerName)) {
			gfx_draw_string_left(dpi, STR_PROVIDER_NAME, (void*)&providerName, COLOUR_BLACK, x, y);
			y += 11;
		}

		const utf8 * providerEmail = network_get_server_provider_email();
		if (!str_is_null_or_empty(providerEmail)) {
			gfx_draw_string_left(dpi, STR_PROVIDER_EMAIL, (void*)&providerEmail, COLOUR_BLACK, x, y);
			y += 11;
		}

		const utf8 * providerWebsite = network_get_server_provider_website();
		if (!str_is_null_or_empty(providerWebsite)) {
			gfx_draw_string_left(dpi, STR_PROVIDER_WEBSITE, (void*)&providerWebsite, COLOUR_BLACK, x, y);
		}
	}
}
Example #3
0
static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	rct_string_id stringId;
	sint32 x, y;

	window_draw_widgets(w, dpi);
	window_multiplayer_draw_tab_images(w, dpi);

	// Columns
	gfx_draw_string_left(dpi, STR_PLAYER, NULL, w->colours[2], w->x + 6, 58 - 12 + w->y + 1);
	gfx_draw_string_left(dpi, STR_GROUP, NULL, w->colours[2], w->x + 180, 58 - 12 + w->y + 1);
	gfx_draw_string_left(dpi, STR_LAST_ACTION, NULL, w->colours[2], w->x + 263, 58 - 12 + w->y + 1);
	gfx_draw_string_left(dpi, STR_PING, NULL, w->colours[2], w->x + 363, 58 - 12 + w->y + 1);

	// Number of players
	stringId = w->no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL;
	x = w->x + 4;
	y = w->y + w->widgets[WIDX_LIST].bottom + 2;
	gfx_draw_string_left(dpi, stringId, &w->no_list_items, w->colours[2], x, y);
}
Example #4
0
static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	window_multiplayer_draw_tab_images(w, dpi);

	rct_widget* widget = &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP];
	sint32 group = network_get_group_index(network_get_default_group());
	if (group != -1) {
		char buffer[300];
		char* lineCh;
		lineCh = buffer;
		lineCh = utf8_write_codepoint(lineCh, FORMAT_WINDOW_COLOUR_2);
		safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
		set_format_arg(0, const char *, buffer);
		gfx_draw_string_centred_clipped(
			dpi,
			STR_STRING,
			gCommonFormatArgs,
			COLOUR_BLACK,
			w->x + (widget->left + widget->right - 11) / 2,
			w->y + widget->top,
			widget->right - widget->left - 8
		);
	}