Example #1
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]);

}
Example #2
0
static void window_about_openrct2_common_paint(rct_window * w, rct_drawpixelinfo * dpi)
{
    sint32 x1, x2, y;

    x1 = w->x + (&w->widgets[WIDX_TAB_ABOUT_OPENRCT2])->left + 45;
    x2 = w->x + (&w->widgets[WIDX_TAB_ABOUT_RCT2])->left + 45;
    y = w->y + (((&w->widgets[WIDX_TAB_ABOUT_OPENRCT2])->top + (&w->widgets[WIDX_TAB_ABOUT_OPENRCT2])->bottom) / 2) - 3;

    set_format_arg(0, rct_string_id, STR_TITLE_SEQUENCE_OPENRCT2);
    gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x1, y, 87, STR_WINDOW_COLOUR_2_STRINGID, COLOUR_AQUAMARINE);

    set_format_arg(0, rct_string_id, STR_TITLE_SEQUENCE_RCT2);
    gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x2, y, 87, STR_WINDOW_COLOUR_2_STRINGID, COLOUR_AQUAMARINE);
}
/**
*
*  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);
}
Example #4
0
/**
 *
 *  rct2: 0x006EE894
 */
static void window_map_tooltip_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	rct_string_id stringId;
	memcpy(&stringId, gMapTooltipFormatArgs, sizeof(rct_string_id));
	if (stringId == STR_NONE) {
		return;
	}

	gfx_draw_string_centred_wrapped(dpi, gMapTooltipFormatArgs, w->x + (w->width / 2), w->y + (w->height / 2), w->width, STR_MAP_TOOLTIP_STRINGID, COLOUR_BLACK);
}
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);
	}
Example #6
0
static void window_ride_refurbish_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);

    Ride* ride = get_ride(w->number);

    set_format_arg(0, rct_string_id, ride->name);
    set_format_arg(2, uint32, ride->name_arguments);
    set_format_arg(6, money32, _demolishRideCost / 2);

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

    if (gParkFlags & PARK_FLAGS_NO_MONEY)
    {
        gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, WW - 4, STR_REFURBISH_RIDE_ID_NO_MONEY, COLOUR_BLACK);
    }
    else
    {
        gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, WW - 4, STR_REFURBISH_RIDE_ID_MONEY, COLOUR_BLACK);
    }
}
/**
*
*  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);
}
Example #8
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);
}
/**
*
*  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));
}
/**
*
*  rct2: 0x006B48E5
*/
static void window_ride_demolish_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    window_draw_widgets(w, dpi);

    Ride* ride = get_ride(w->number);

    set_format_arg(0, rct_string_id, ride->name);
    set_format_arg(2, uint32, ride->name_arguments);

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

    gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, WW - 4, STR_DEMOLISH_RIDE_ID, COLOUR_BLACK);
}
Example #11
0
/**
 *
 *  rct2: 0x006D37EE
 */
static void window_track_delete_prompt_paint()
{
	rct_window *w;
	rct_drawpixelinfo *dpi;
	rct_string_id stringId;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);

	stringId = 3155;
	gfx_draw_string_centred_wrapped(
		dpi, &stringId, w->x + 125, w->y + 28, 246, STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, 0
	);
}
Example #12
0
/**
*
*  rct2: 0x006C0AF2
*/
static void window_staff_fire_paint(){
	rct_window *w;
	rct_drawpixelinfo *dpi;

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);

	rct_peep* peep = &g_sprite_list[w->number].peep;
	
	RCT2_GLOBAL(0x13CE952, uint16) = peep->name_string_idx;
	RCT2_GLOBAL(0x13CE954, uint32) = peep->id;
	
	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_FIRE_STAFF_ID, 0);
}
Example #13
0
static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int i, x, y, format;
	rct_widget *widget;
	const scenario_index_entry *scenario;

	window_draw_widgets(w, dpi);

	format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT) ? STR_SMALL_WINDOW_COLOUR_2_STRINGID : STR_WINDOW_COLOUR_2_STRINGID;

	// Text for each tab
	for (i = 0; i < 8; 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;

		if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN) {
			set_format_arg(0, rct_string_id, ScenarioOriginStringIds[i]);
		} else { // old-style
			set_format_arg(0, rct_string_id, ScenarioCategoryStringIds[i]);
		}
		gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, 87, format, COLOUR_AQUAMARINE);
	}

	// Return if no scenario highlighted
	scenario = w->highlighted_scenario;
	if (scenario == NULL) {
		if (_showLockedInformation) {
			// Show locked information
			x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
			y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5;
			gfx_draw_string_centred_clipped(dpi, STR_SCENARIO_LOCKED, NULL, COLOUR_BLACK, x + 85, y, 170);
			y += 15;
			y += gfx_draw_string_left_wrapped(dpi, NULL, x, y, 170, STR_SCENARIO_LOCKED_DESC, COLOUR_BLACK) + 5;
		}
		return;
	}

	// Scenario path
	if (gConfigGeneral.debugging_tools) {
		utf8 path[MAX_PATH];

		gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
		shorten_path(path, sizeof(path), scenario->path, w->width - 6);

		const utf8 *pathPtr = path;
		gfx_draw_string_left(dpi, STR_STRING, (void*)&pathPtr, w->colours[1], w->x + 3, w->y + w->height - 3 - 11);
	}

	// Scenario name
	x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
	y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5;
	set_format_arg(0, rct_string_id, STR_STRING);
	set_format_arg(2, const char *, scenario->name);
	gfx_draw_string_centred_clipped(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, x + 85, y, 170);
	y += 15;

	// Scenario details
	set_format_arg(0, rct_string_id, STR_STRING);
	set_format_arg(2, const char *, scenario->details);
	y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 170, STR_BLACK_STRING, COLOUR_BLACK) + 5;

	// Scenario objective
	set_format_arg(0, rct_string_id, ObjectiveNames[scenario->objective_type]);
	set_format_arg(2, short, scenario->objective_arg_3);
	set_format_arg(4, short, date_get_total_months(MONTH_OCTOBER, scenario->objective_arg_1));
	set_format_arg(6, int, scenario->objective_arg_2);
	y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 170, STR_OBJECTIVE, COLOUR_BLACK) + 5;

	// Scenario score
	if (scenario->highscore != NULL) {
		// TODO: Should probably be translateable
		const utf8 *completedByName = "???";
		if (!str_is_null_or_empty(scenario->highscore->name)) {
			completedByName = scenario->highscore->name;
		}
		set_format_arg(0, rct_string_id, STR_STRING);
		set_format_arg(2, const char *, completedByName);
		set_format_arg(2 + sizeof(const char *), money32, scenario->highscore->company_value);
		y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, COLOUR_BLACK);
	}
}