Beispiel #1
0
static void window_multiplayer_groups_show_group_dropdown(rct_window *w, rct_widget *widget)
{
	rct_widget *dropdownWidget;
	sint32 numItems, i;

	dropdownWidget = widget - 1;

	numItems = network_get_num_groups();

	window_dropdown_show_text_custom_width(
		w->x + dropdownWidget->left,
		w->y + dropdownWidget->top,
		dropdownWidget->bottom - dropdownWidget->top + 1,
		w->colours[1],
		0,
		numItems,
		widget->right - dropdownWidget->left
	);

	for (i = 0; i < network_get_num_groups(); i++) {
		gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
		gDropdownItemsArgs[i] = (uintptr_t)network_get_group_name(i);
	}
	if (widget == &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP_DROPDOWN]) {
		dropdown_set_checked(network_get_group_index(network_get_default_group()), true);
	} else
	if (widget == &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP_DROPDOWN]) {
		dropdown_set_checked(network_get_group_index(_selectedGroup), true);
	}
}
Beispiel #2
0
static void window_player_overview_show_group_dropdown(rct_window *w, rct_widget *widget)
{
    rct_widget *dropdownWidget;
    sint32 numItems, i;
    sint32 player = network_get_player_index((uint8)w->number);
    if (player == -1) {
        return;
    }

    dropdownWidget = widget - 1;

    numItems = network_get_num_groups();

    window_dropdown_show_text_custom_width(
        w->x + dropdownWidget->left,
        w->y + dropdownWidget->top,
        dropdownWidget->bottom - dropdownWidget->top + 1,
        w->colours[1],
        0,
        0,
        numItems,
        widget->right - dropdownWidget->left
    );

    for (i = 0; i < network_get_num_groups(); i++) {
        gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
        gDropdownItemsArgs[i] = (uintptr_t)network_get_group_name(i);
    }

    dropdown_set_checked(network_get_group_index(network_get_player_group(player)), true);
}
Beispiel #3
0
void window_player_overview_show_group_dropdown(rct_window *w, rct_widget *widget)
{
	rct_widget *dropdownWidget;
	int numItems, i;
	int player = network_get_player_index((uint8)w->number);
	if (player == -1) {
		return;
	}

	dropdownWidget = widget - 1;

	numItems = network_get_num_groups();

	window_dropdown_show_text_custom_width(
		w->x + dropdownWidget->left,
		w->y + dropdownWidget->top,
		dropdownWidget->bottom - dropdownWidget->top + 1,
		w->colours[1],
		0,
		numItems,
		widget->right - dropdownWidget->left
	);

	for (i = 0; i < network_get_num_groups(); i++) {
		gDropdownItemsFormat[i] = 1142;
		gDropdownItemsArgs[i] = network_get_group_name_string_id(i);
	}

	dropdown_set_checked(network_get_group_index(network_get_player_group(player)), true);
}