Exemplo n.º 1
0
/**
 *
 *  rct2: 0x006E6ACF
 */
static void window_water_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    sint32 x, y;

    x = w->x + (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2;
    y = w->y + (window_water_widgets[WIDX_PREVIEW].top + window_water_widgets[WIDX_PREVIEW].bottom) / 2;

    window_draw_widgets(w, dpi);
    // Draw number for tool sizes bigger than 7
    if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) {
        gfx_draw_string_centred(dpi, STR_LAND_TOOL_SIZE_VALUE, x, y - 2, COLOUR_BLACK, &gLandToolSize);
    }

    // Draw raise cost amount
    x = (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2 + w->x;
    y = window_water_widgets[WIDX_PREVIEW].bottom + w->y + 5;
    if (gWaterToolRaiseCost != MONEY32_UNDEFINED && gWaterToolRaiseCost != 0)
        gfx_draw_string_centred(dpi, STR_RAISE_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolRaiseCost);
    y += 10;

    // Draw lower cost amount
    if (gWaterToolLowerCost != MONEY32_UNDEFINED && gWaterToolLowerCost != 0)
        gfx_draw_string_centred(dpi, STR_LOWER_COST_AMOUNT, x, y, COLOUR_BLACK, &gWaterToolLowerCost);


}
Exemplo n.º 2
0
static void window_title_editor_paint(rct_window * w, rct_drawpixelinfo * dpi)
{
    // Widgets
    window_draw_widgets(w, dpi);
    window_title_editor_draw_tab_images(dpi, w);

    // Draw strings
    switch (w->selected_tab)
    {
    case WINDOW_TITLE_EDITOR_TAB_PRESETS:
        set_format_arg(0, uintptr_t, _sequenceName);
        gfx_draw_string_left(dpi, STR_TITLE_SEQUENCE, nullptr, w->colours[1], w->x + 10, w->y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top + 1);
        gfx_draw_string_left_clipped(
            dpi,
            STR_STRING,
            gCommonFormatArgs,
            w->colours[1],
            w->x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
            w->y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top,
            w->x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS_DROPDOWN].left - window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left - 4);
        break;
    case WINDOW_TITLE_EDITOR_TAB_SAVES:
        break;
    case WINDOW_TITLE_EDITOR_TAB_SCRIPT:
        break;
    }
}
Exemplo n.º 3
0
static void window_about_openrct2_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);
    window_about_openrct2_common_paint(w, dpi);

    sint32 x, y, width;
    rct_size16 logoSize;

    x = w->x + (w->width / 2);
    y = w->y + w->widgets[WIDX_PAGE_BACKGROUND].top + 10;
    width = w->width - 20;
    
    utf8 buffer[256];
    utf8 *ch = buffer;
    openrct2_write_full_version_info(ch, sizeof(buffer) - (ch - buffer));

    y += gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION, w->colours[2]) + 10;

    logoSize = gfx_get_sprite_size(SPR_G2_LOGO);
    gfx_draw_sprite(dpi, SPR_G2_LOGO, x - (logoSize.width / 2), y, 0);
    y += logoSize.height + 20;

    y += gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION_2, w->colours[2]) + 15;
    gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION_3, w->colours[2]);

    gfx_draw_string_centred_wrapped(dpi, &ch, x, w->y + WH - 25, width, STR_STRING, w->colours[2]);

}
Exemplo n.º 4
0
void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);
    window_player_draw_tab_images(dpi, w);

    sint32 player = network_get_player_index((uint8)w->number);
    if (player == -1) {
        return;
    }

    // Draw current group
    sint32 groupindex = network_get_group_index(network_get_player_group(player));
    if (groupindex != -1) {
        rct_widget* widget = &window_player_overview_widgets[WIDX_GROUP];
        char buffer[300];
        char* lineCh;
        lineCh = buffer;
        lineCh = utf8_write_codepoint(lineCh, FORMAT_WINDOW_COLOUR_2);
        safe_strcpy(lineCh, network_get_group_name(groupindex), 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
        );
    }
Exemplo n.º 5
0
static void window_mapgen_simplex_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	uint16 arg;

	window_draw_widgets(w, dpi);
	window_mapgen_draw_tab_images(dpi, w);

	gfx_draw_string_left(dpi, 2686, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
	gfx_draw_string_left(dpi, 2687, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
	gfx_draw_string_left(dpi, 2688, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
	gfx_draw_string_left(dpi, 2689, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);
	gfx_draw_string_left(dpi, STR_MAP_SIZE, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1);
	gfx_draw_string_left(dpi, 2692, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1);

	gfx_draw_string_left(dpi, 1737, &_simplex_low, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
	gfx_draw_string_left(dpi, 1737, &_simplex_high, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
	gfx_draw_string_left(dpi, 3311, &_simplex_base_freq, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
	gfx_draw_string_left(dpi, 1737, &_simplex_octaves, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);

	// The practical map size is 2 lower than the technical map size
	uint16 mapSizeArgs[2] = { _mapSize - 2, _mapSize - 2 };
	gfx_draw_string_left(dpi, 839, mapSizeArgs, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1, w->y + w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1);

	arg = (_waterLevel - 12) / 2;
	gfx_draw_string_left(dpi, 1737, &arg, w->colours[1], w->x + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->y + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1);
}
Exemplo n.º 6
0
static void window_loadsave_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);

	if (_shortenedDirectory[0] == '\0') {
		shorten_path(_shortenedDirectory, sizeof(_shortenedDirectory), _directory, w->width - 8);
	}

	utf8 buffer[256];

	// Format text
	utf8 *ch = buffer;
	ch = utf8_write_codepoint(ch, FORMAT_MEDIUMFONT);
	ch = utf8_write_codepoint(ch, FORMAT_BLACK);
	safe_strcpy(ch, _shortenedDirectory, sizeof(buffer) - (ch - buffer));

	// Draw shadow
	gfx_draw_string(dpi, buffer, 0, w->x + 4, w->y + 20);
	rct_string_id id = STR_NONE;
	// Name button text
	if (gConfigGeneral.load_save_sort == SORT_NAME_ASCENDING)
		id = STR_UP;
	else if (gConfigGeneral.load_save_sort == SORT_NAME_DESCENDING)
		id = STR_DOWN;
	gfx_draw_string_centred_clipped(dpi, STR_NAME, &id, 1, w->x + 4 + (w->width - 8) / 4, w->y + 50, (w->width - 8) / 2);
	// Date button text
	if (gConfigGeneral.load_save_sort == SORT_DATE_ASCENDING)
		id = STR_UP;
	else if (gConfigGeneral.load_save_sort == SORT_DATE_DESCENDING)
		id = STR_DOWN;
	else
		id = STR_NONE;
	gfx_draw_string_centred_clipped(dpi, STR_DATE, &id, 1, w->x + 4 + (w->width - 8) * 3 / 4, w->y + 50, (w->width - 8) / 2);
}
Exemplo n.º 7
0
void window_themes_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    // Widgets
    window_draw_widgets(w, dpi);
    window_themes_draw_tab_images(dpi, w);

    if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) {
        size_t activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
        const utf8 * activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
        set_format_arg(0, uintptr_t, (uintptr_t)activeThemeName);
        gfx_draw_string_left(dpi, STR_THEMES_LABEL_CURRENT_THEME, NULL, w->colours[1], w->x + 10, w->y + window_themes_widgets[WIDX_THEMES_PRESETS].top + 1);
        gfx_draw_string_left_clipped(
            dpi,
            STR_STRING,
            gCommonFormatArgs,
            w->colours[1],
            w->x + window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
            w->y + window_themes_widgets[WIDX_THEMES_PRESETS].top,
            w->x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left - window_themes_widgets[WIDX_THEMES_PRESETS].left - 4
        );
    }
    else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) {

    }
    else {
        gfx_draw_string_left(dpi, STR_THEMES_HEADER_WINDOW, w, w->colours[1], w->x + 6, 58 - 12 + w->y + 1);
        gfx_draw_string_left(dpi, STR_THEMES_HEADER_PALETTE, w, w->colours[1], w->x + 220, 58 - 12 + w->y + 1);
    }
}
Exemplo n.º 8
0
/**
 *
 *  rct2: 0x006B689B
 */
static void window_research_development_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);
    window_research_draw_tab_images(dpi, w);

    window_research_development_page_paint(w, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
}
Exemplo n.º 9
0
/**
 *
 *  rct2: 0x006995CC
 */
static void window_guest_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
{
    int32_t i, x, y;
    rct_string_id format;

    // Widgets
    window_draw_widgets(w, dpi);
    // Tab 1 image
    i = (_window_guest_list_selected_tab == 0 ? w->list_information_type & 0x0FFFFFFFC : 0);
    i += g_peep_animation_entries[PEEP_SPRITE_TYPE_NORMAL].sprite_animation->base_image + 1;
    i |= 0xA1600000;
    gfx_draw_sprite(
        dpi, i, (window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x,
        window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y, 0);

    // Tab 2 image
    i = (_window_guest_list_selected_tab == 1 ? w->list_information_type / 4 : 0);
    gfx_draw_sprite(
        dpi, SPR_TAB_GUESTS_0 + i, window_guest_list_widgets[WIDX_TAB_2].left + w->x,
        window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0);

    // Filter description
    x = w->x + 6;
    y = w->y + window_guest_list_widgets[WIDX_TAB_CONTENT_PANEL].top + 3;
    if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL)
    {
        if (_window_guest_list_selected_filter != -1)
        {
            if (_window_guest_list_filter_arguments[0] != 0xFFFF)
            {
                format = filterNames[_window_guest_list_selected_filter]; // Not sure whether the index will ever be 2
            }
            else
            {
                format = STR_GUESTS_FILTER_THINKING_ABOUT;
            }
        }
        else
        {
            format = STR_ALL_GUESTS;
        }
    }
    else
    {
        format = STR_ALL_GUESTS_SUMMARISED;
    }
    gfx_draw_string_left_clipped(dpi, format, _window_guest_list_filter_arguments, COLOUR_BLACK, x, y, 310);

    // Number of guests (list items)
    if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL)
    {
        x = w->x + 4;
        y = w->y + window_guest_list_widgets[WIDX_GUEST_LIST].bottom + 2;
        set_format_arg(0, int16_t, w->var_492);
        gfx_draw_string_left(
            dpi, (w->var_492 == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), gCommonFormatArgs,
            COLOUR_BLACK, x, y);
    }
}
Exemplo n.º 10
0
static void window_player_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	gfx_draw_string_left(dpi, STR_PLAYER, w, w->colours[2], w->x + 6, 58 - 12 + w->y + 1);
	gfx_draw_string_left(dpi, STR_PING, w, w->colours[2], w->x + 246, 58 - 12 + w->y + 1);

	gfx_draw_sprite(dpi, SPR_TAB_GUESTS_0, w->x + w->widgets[WIDX_TAB1].left, w->y + w->widgets[WIDX_TAB1].top, 0);
}
Exemplo n.º 11
0
/**
 *
 *  rct2: 0x00670E5B
 */
static void window_editor_scenario_options_park_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int x, y, arg;
	rct_string_id stringId;

	window_draw_widgets(w, dpi);
	window_editor_scenario_options_draw_tab_images(w, dpi);

	if (w->widgets[WIDX_LAND_COST].type != WWT_EMPTY) {
		// Cost to buy land label
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_LAND_COST].top;
		gfx_draw_string_left(dpi, 3277, NULL, 0, x, y);

		// Cost to buy land value
		x = w->x + w->widgets[WIDX_LAND_COST].left + 1;
		y = w->y + w->widgets[WIDX_LAND_COST].top;
		arg = RCT2_GLOBAL(RCT2_ADDRESS_LAND_COST, money16);
		gfx_draw_string_left(dpi, 3246, &arg, 0, x, y);
	}

	if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WWT_EMPTY) {
		// Cost to buy construction rights label
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top;
		gfx_draw_string_left(dpi, 3278, NULL, 0, x, y);

		// Cost to buy construction rights value
		x = w->x + w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1;
		y = w->y + w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top;
		arg = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCTION_RIGHTS_COST, money16);
		gfx_draw_string_left(dpi, 3246, &arg, 0, x, y);
	}

	if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WWT_EMPTY) {
		// Pay for park or rides label
		x = w->x + w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].left + 1;
		y = w->y + w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].top;
		gfx_draw_string_left(dpi, 3279, NULL, 0, x, y);

		// Pay for park or rides value
		stringId = RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_PARK_FREE_ENTRY ? 3279 : 3280;
		gfx_draw_string_left(dpi, 1193, &stringId, 0, x, y);
	}

	if (w->widgets[WIDX_ENTRY_PRICE].type != WWT_EMPTY) {
		// Entry price label
		x = w->x + w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].right + 8;
		y = w->y + w->widgets[WIDX_ENTRY_PRICE].top;
		gfx_draw_string_left(dpi, 3281, NULL, 0, x, y);

		// Entry price value
		x = w->x + w->widgets[WIDX_ENTRY_PRICE].left + 1;
		y = w->y + w->widgets[WIDX_ENTRY_PRICE].top;
		arg = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16);
		gfx_draw_string_left(dpi, 3246, &arg, 0, x, y);
	}
}
Exemplo n.º 12
0
/**
 *
 *  rct2: 0x006D3523
 */
static void window_track_manage_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);
}
Exemplo n.º 13
0
/* rct2: 0x006BA4C5 */
static void window_banner_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);

	// Draw viewport
	if (w->viewport != NULL) {
		window_draw_viewport(dpi, w);
	}
}
Exemplo n.º 14
0
/**
 * 
 *  rct2: 0x0066D321
 */
static void window_about_paint()
{
	int x, y;
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);

	x = w->x + 200;
	y = w->y + 17;

	// Version
	RCT2_GLOBAL(0x009C383C, uint8) = 49;
	gfx_draw_string_centred(dpi, STR_VERSION_X, x, y, 0, (void*)0x009E2D28);
	
	// Credits
	RCT2_GLOBAL(0x009C383C, uint8) = 48;
	y += 10;
	gfx_draw_string_centred(dpi, STR_COPYRIGHT_CS, x, y, 0, (void*)0x009E2D28);
	y += 79;
	gfx_draw_string_centred(dpi, STR_DESIGNED_AND_PROGRAMMED_BY_CS, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_GRAPHICS_BY_SF, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_SOUND_AND_MUSIC_BY_AB, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, x, y, 0, (void*)0x009E2D28);
	y += 13;
	gfx_draw_string_centred(dpi, STR_REPRESENTATION_BY_JL, x, y, 0, (void*)0x009E2D28);
	y += 25;
	gfx_draw_string_centred(dpi, STR_THANKS_TO, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_THANKS_TO_PEOPLE, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_1, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_2, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_3, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_4, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_5, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_6, x, y, 0, (void*)0x009E2D28);
	y += 10;
	gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_7, x, y, 0, (void*)0x009E2D28);

	// Images
	gfx_draw_sprite(dpi, SPR_CREDITS_CHRIS_SAWYER_SMALL, w->x + 92, w->y + 40, 0);
	gfx_draw_sprite(dpi, SPR_CREDITS_INFOGRAMES, w->x + 50, w->y + 247, 0);

	// Licence
	gfx_draw_string_left(dpi, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, 0, 0, w->x + 157, w->y + 257);
}
Exemplo n.º 15
0
static void window_changelog_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);
}
Exemplo n.º 16
0
static void window_save_prompt_paint()
{
    rct_window *w;
    rct_drawpixelinfo *dpi;

    window_paint_get_registers(w, dpi);

    window_draw_widgets(w, dpi);
}
Exemplo n.º 17
0
/**
*
*  rct2: 0x0066F9D1
*/
static void window_editor_top_toolbar_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);
}
Exemplo n.º 18
0
static void window_title_options_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);
}
Exemplo n.º 19
0
/**
 *
 *  rct2: 0x006B689B
 */
static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	window_new_ride_draw_tab_images(dpi, w);

	if (_windowNewRideCurrentTab != WINDOW_NEW_RIDE_PAGE_RESEARCH) {
		ride_list_item item = { .ride_type_and_entry = w->new_ride.highlighted_ride_id };
		if (item.type != 255 || item.entry_index != 255)
			window_new_ride_paint_ride_information(w, dpi, item, w->x + 3, w->y + w->height - 52, w->width - 6);
	} else {
Exemplo n.º 20
0
/**
 * 
 *  rct2: 0x0066E4E8
 */
static void window_news_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	__asm mov w, esi
	__asm mov dpi, edi

	window_draw_widgets(w, dpi);
}
Exemplo n.º 21
0
/**
*
*  rct2: 0x006E3A9F
*/
static void window_shortcut_change_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);

    sint32 x = w->x + 125;
    sint32 y = w->y + 30;

    set_format_arg(0, rct_string_id, ShortcutStringIds[gKeyboardShortcutChangeId]);
    gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, 242, STR_SHORTCUT_CHANGE_PROMPT, COLOUR_BLACK);
}
Exemplo n.º 22
0
static void window_cheats_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;

	__asm mov w, esi
	__asm mov dpi, edi

	window_draw_widgets(w, dpi);
	window_cheats_draw_tab_images(dpi, w);
}
static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int i, x, y, format;
	rct_widget *widget;
	rct_scenario_basic *scenario;

	window_draw_widgets(w, dpi);

	format = (theme_get_preset()->features.rct1_scenario_font) ? 5138 : 1193;

	// Text for each tab
	for (i = 0; i < 5; i++) {
		widget = &window_scenarioselect_widgets[WIDX_TAB1 + i];
		if (widget->type == WWT_EMPTY)
			continue;

		x = (widget->left + widget->right) / 2 + w->x;
		y = (widget->top + widget->bottom) / 2 + w->y - 3;
		RCT2_GLOBAL(0x013CE952 + 0, short) = STR_BEGINNER_PARKS + i;
		gfx_draw_string_centred_wrapped(dpi, (void*)0x013CE952, x, y, 87, format, 10);
	}

	// Return if no scenario highlighted
	scenario = (rct_scenario_basic*)w->var_494;
	if (scenario == NULL)
		return;

	// Scenario name
	x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
	y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5;
	safe_strncpy((char*)0x009BC677, scenario->name, 64);
	RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
	gfx_draw_string_centred_clipped(dpi, 1193, (void*)0x013CE952, 0, x + 85, y, 170);
	y += 15;

	// Scenario details
	safe_strncpy((char*)0x009BC677, scenario->details, 256);
	RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
	y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, 1191, 0) + 5;

	// Scenario objective
	RCT2_GLOBAL(0x013CE952 + 0, short) = scenario->objective_type + STR_OBJECTIVE_NONE;
	RCT2_GLOBAL(0x013CE952 + 2, short) = scenario->objective_arg_3;
	RCT2_GLOBAL(0x013CE952 + 4, short) = date_get_total_months(MONTH_OCTOBER, scenario->objective_arg_1);
	RCT2_GLOBAL(0x013CE952 + 6, int) = scenario->objective_arg_2;
	y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, STR_OBJECTIVE, 0) + 5;

	// Scenario score
	if (scenario->flags & SCENARIO_FLAGS_COMPLETED) {
		safe_strncpy((char*)0x009BC677, scenario->completed_by, 64);
		RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
		RCT2_GLOBAL(0x013CE952 + 2, int) = scenario->company_value;
		y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, 0);
	}
Exemplo n.º 24
0
/**
 *
 *  rct2: 0x006708C4
 */
static void window_editor_scenario_options_guests_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int x, y, arg;

	window_draw_widgets(w, dpi);
	window_editor_scenario_options_draw_tab_images(w, dpi);

	if (w->widgets[WIDX_CASH_PER_GUEST].type != WWT_EMPTY) {
		// Cash per guest label
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_CASH_PER_GUEST].top;
		gfx_draw_string_left(dpi, 3260, NULL, 0, x, y);

		// Cash per guest value
		x = w->x + w->widgets[WIDX_CASH_PER_GUEST].left + 1;
		y = w->y + w->widgets[WIDX_CASH_PER_GUEST].top;
		arg = RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_CASH, money16);
		gfx_draw_string_left(dpi, 3246, &arg, 0, x, y);
	}

	// Guest initial happiness label
	x = w->x + 8;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top;
	gfx_draw_string_left(dpi, 3261, NULL, 0, x, y);

	// Guest initial happiness value
	x = w->x + w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].left + 1;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top;
	arg = (RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HAPPINESS, uint8) * 100) / 255;
	gfx_draw_string_left(dpi, 3247, &arg, 0, x, y);

	// Guest initial hunger label
	x = w->x + 8;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_HUNGER].top;
	gfx_draw_string_left(dpi, 3262, NULL, 0, x, y);

	// Guest initial hunger value
	x = w->x + w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_HUNGER].top;
	arg = ((255 - RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8)) * 100) / 255;
	gfx_draw_string_left(dpi, 3247, &arg, 0, x, y);

	// Guest initial thirst label
	x = w->x + 8;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_THIRST].top;
	gfx_draw_string_left(dpi, 3263, NULL, 0, x, y);

	// Guest initial thirst value
	x = w->x + w->widgets[WIDX_GUEST_INITIAL_THIRST].left + 1;
	y = w->y + w->widgets[WIDX_GUEST_INITIAL_THIRST].top;
	arg = ((255 - RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_THIRST, uint8)) * 100) / 255;
	gfx_draw_string_left(dpi, 3247, &arg, 0, x, y);
}
Exemplo n.º 25
0
void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	window_player_draw_tab_images(dpi, w);

	int player = network_get_player_index((uint8)w->number);
	if (player == -1) {
		return;
	}

	// Draw current group
	int groupindex = network_get_group_index(network_get_player_group(player));
	if (groupindex != -1) {
		rct_widget* widget = &window_player_overview_widgets[WIDX_GROUP];
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = network_get_group_name_string_id(groupindex);

		gfx_draw_string_centred_clipped(
			dpi,
			1193,
			(void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS,
			0,
			w->x + (widget->left + widget->right - 11) / 2,
			w->y + widget->top,
			widget->right - widget->left - 8
		);
	}

	// Draw ping
	int x = w->x + 90;
	int y = w->y + 24;

	RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = STR_PING;
	gfx_draw_string_left(dpi, STR_WINDOW_COLOUR_2_STRING, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y);
	char ping[64];
	sprintf(ping, "%d ms", network_get_player_ping(player));
	gfx_draw_string(dpi, ping, w->colours[2], x + 30, y);
	
	// Draw last action
	x = w->x + (w->width / 2);
	y = w->y + w->height - 13;
	int width = w->width - 8;
	int lastaction = network_get_player_last_action(player, 0);
	RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = STR_ACTION_NA;
	if (lastaction != -999) {
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = network_get_action_name_string_id(lastaction);
	}
	gfx_draw_string_centred_clipped(dpi, STR_LAST_ACTION_RAN, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, width);

	if (w->viewport != NULL && w->var_492 != -1) {
		window_draw_viewport(dpi, w);
	}
}
Exemplo n.º 26
0
/**
 *
 *  rct2: 0x006995CC
 */
static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int i, x, y, format;

	// Widgets
	window_draw_widgets(w, dpi);
	// Tab 1 image
	i = (_window_guest_list_selected_tab == 0 ? w->list_information_type & 0x0FFFFFFFC : 0);
	i += RCT2_ADDRESS(RCT2_GLOBAL(0x00982708, int), int)[0] + 1;
	i |= 0xA1600000;
	gfx_draw_sprite(
		dpi,
		i,
		(window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x,
		window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y, 0
	);

	// Tab 2 image
	i = (_window_guest_list_selected_tab == 1 ? w->list_information_type / 4 : 0);
	gfx_draw_sprite(
		dpi,
		5568 + i,
		window_guest_list_widgets[WIDX_TAB_2].left + w->x,
		window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0
	);

	// Filter description
	x = w->x + 6;
	y = w->y + window_guest_list_widgets[WIDX_TAB_CONTENT_PANEL].top + 3;
	if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL) {
		if (_window_guest_list_selected_filter != -1) {
			if (RCT2_GLOBAL(0x00F1EDF6, sint16) != -1)
				format = STR_GUESTS_FILTER + _window_guest_list_selected_filter;
			else
				format = STR_GUESTS_FILTER_THINKING_ABOUT;
		} else {
			format = STR_ALL_GUESTS;
		}
	} else {
		format = STR_ALL_GUESTS_SUMMARISED;
	}
	gfx_draw_string_left_clipped(dpi, format, (void*)0x00F1EDF6, 0, x, y, 310);

	// Number of guests (list items)
	if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL) {
		x = w->x + 4;
		y = w->y + window_guest_list_widgets[WIDX_GUEST_LIST].bottom + 2;
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, sint16) = w->var_492;
		gfx_draw_string_left(dpi, (w->var_492 == 1 ? 1755 : 1754), (void*)0x013CE952, 0, x, y);
	}
}
Exemplo n.º 27
0
static void window_network_status_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);
	RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
	char buffer[sizeof(window_network_status_text) + 10];
	char* lineCh = buffer;
	lineCh = utf8_write_codepoint(lineCh, FORMAT_BLACK);
	strcpy(lineCh, window_network_status_text);
	gfx_clip_string(buffer, 230);
	int x = w->x + (w->width / 2);
	int y = w->y + (w->height / 2);
	x -= gfx_get_string_width(buffer) / 2;
	gfx_draw_string(dpi, buffer, 0, x, y);
}
Exemplo n.º 28
0
/**
*
*  rct2: 0x006E3A9F
*/
static void window_shortcut_change_paint(){
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);

	int x = w->x + 125;
	int y = w->y + 30;

	RCT2_GLOBAL(0x13CE952, uint16) = 2493 + RCT2_GLOBAL(0x9DE511, uint8);
	gfx_draw_string_centred_wrapped(dpi, (void*)0x13CE952, x, y, 242, 2785, RCT2_GLOBAL(0x9DEB8D, uint8));
}
Exemplo n.º 29
0
static void window_overwrite_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);

	rct_string_id templateStringId = 3165;
	char *templateString;

	templateString = (char*)language_get_string(templateStringId);
	strcpy(templateString, _window_overwrite_prompt_name);

	int x = w->x + w->width / 2;
	int y = w->y + (w->height / 2) - 3;
	gfx_draw_string_centred_wrapped(dpi, &templateStringId, x, y, w->width - 4, 2708, 0);
}
Exemplo n.º 30
0
/**
*
*  rct2: 0x006B48E5
*/
static void window_ride_demolish_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	window_draw_widgets(w, dpi);

	rct_ride* ride = GET_RIDE(w->number);

	RCT2_GLOBAL(0x13CE952, uint16) = ride->name;
	RCT2_GLOBAL(0x13CE954, uint32) = ride->name_arguments;

	int x = w->x + WW / 2;
	int y = w->y + (WH / 2) - 3;

	gfx_draw_string_centred_wrapped(dpi, (void*)0x13CE952, x, y, WW - 4, STR_DEMOLISH_RIDE_ID, 0);
}