示例#1
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);
    }
}
示例#2
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);
}
示例#3
0
/**
 *
 *  rct2: 0x006CF8CD
 */
static void window_track_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
{
	rct_string_id stringId, stringId2;
	int i, x, y, colour;
	utf8 *trackDesignItem, *trackDesignList = RCT2_ADDRESS(RCT2_ADDRESS_TRACK_LIST, utf8);

	colour = ColourMapA[w->colours[0]].mid_light;
	colour = (colour << 24) | (colour << 16) | (colour << 8) | colour;
	gfx_clear(dpi, colour);

	i = 0;
	x = 0;
	y = 0;

	trackDesignItem = trackDesignList;
	if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) {
		if (*trackDesignItem == 0) {
			// No track designs
			gfx_draw_string_left(dpi, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE, NULL, 0, x, y - 1);
			return;
		}
	} else {
		// Build custom track item
		if (i == w->track_list.var_482) {
			// Highlight
			gfx_fill_rect(dpi, x, y, w->width, y + 9, 0x2000000 | 49);
			stringId = 1193;
		} else {
			stringId = 1191;
		}

		stringId2 = STR_BUILD_CUSTOM_DESIGN;
		gfx_draw_string_left(dpi, stringId, &stringId2, 0, x, y - 1);
		y += 10;
		i++;
	}

	while (*trackDesignItem != 0) {
		if (y + 10 >= dpi->y && y < dpi->y + dpi->height) {
			if (i == w->track_list.var_482) {
				// Highlight
				gfx_fill_rect(dpi, x, y, w->width, y + 9, 0x2000000 | 49);
				stringId = 1193;
			} else {
				stringId = 1191;
			}

			// Draw track name
			window_track_list_format_name((char *)language_get_string(3165), trackDesignItem, 0, 1);
			stringId2 = 3165;
			gfx_draw_string_left(dpi, stringId, &stringId2, 0, x, y - 1);
		}
		y += 10;
		i++;
		trackDesignItem += 128;
	}
}
示例#4
0
/**
 *
 *  rct2: 0x006CF8CD
 */
static void window_track_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
{
    uint8 paletteIndex = ColourMapA[w->colours[0]].mid_light;
    gfx_clear(dpi, paletteIndex);

    sint32 x = 0;
    sint32 y = 0;
    size_t listIndex = 0;
    if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
        if (_trackDesignsCount == 0) {
            // No track designs
            gfx_draw_string_left(dpi, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE, NULL, COLOUR_BLACK, x, y - 1);
            return;
        }
    } else {
        // Build custom track item
        rct_string_id stringId;
        if (listIndex == (size_t)w->selected_list_item) {
            // Highlight
            gfx_filter_rect(dpi, x, y, w->width, y + 9, PALETTE_DARKEN_1);
            stringId = STR_WINDOW_COLOUR_2_STRINGID;
        } else {
            stringId = STR_BLACK_STRING;
        }

        rct_string_id stringId2 = STR_BUILD_CUSTOM_DESIGN;
        gfx_draw_string_left(dpi, stringId, &stringId2, COLOUR_BLACK, x, y - 1);
        y += 10;
        listIndex++;
    }

    for (size_t i = 0; i < _trackDesignsCount; i++, listIndex++) {
        if (y + 10 >= dpi->y && y < dpi->y + dpi->height) {
            rct_string_id stringId;
            if (listIndex == (size_t)w->selected_list_item) {
                // Highlight
                gfx_filter_rect(dpi, x, y, w->width, y + 9, PALETTE_DARKEN_1);
                stringId = STR_WINDOW_COLOUR_2_STRINGID;
            } else {
                stringId = STR_BLACK_STRING;
            }

            // Draw track name
            set_format_arg(0, rct_string_id, STR_TRACK_LIST_NAME_FORMAT);
            set_format_arg(2, utf8*, _trackDesigns[i].name);
            gfx_draw_string_left(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, x, y - 1);
        }
        y += 10;
    }
示例#5
0
static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
    sint32 x, y;

    set_format_arg(0, sint32, 100);

    window_draw_widgets(w, dpi);

    x = w->x + 10;
    y = w->y + 30;

    gfx_draw_string_left(dpi, STR_RATE, nullptr, w->colours[1], x, y);

    sint32 baseExchange = CurrencyDescriptors[CURRENCY_POUNDS].rate;
    set_format_arg(0, sint32, baseExchange);
    gfx_draw_string_left(dpi, STR_CUSTOM_CURRENCY_EQUIVALENCY, gCommonFormatArgs, w->colours[1], x + 200, y);

    y += 20;

    gfx_draw_string_left(dpi, STR_CURRENCY_SYMBOL_TEXT, nullptr, w->colours[1], x, y);

    gfx_draw_string(
        dpi,
        CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode,
        w->colours[1],
        w->x + window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1,
        w->y + window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top);

    if(CurrencyDescriptors[CURRENCY_CUSTOM].affix_unicode == CURRENCY_PREFIX) {
        gfx_draw_string_left(
            dpi,
            STR_PREFIX,
            w,
            w->colours[1],
            w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
            w->y + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top
        );
    } else {
        gfx_draw_string_left(
            dpi,
            STR_SUFFIX,
            w,
            w->colours[1],
            w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
            w->y + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top
        );
    }
}
/**
 *
 *  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);
	}
}
示例#7
0
void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dpi, int baseWidgetIndex)
{
    baseWidgetIndex = baseWidgetIndex - WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP;

    int x = w->x + 10;
    int y = w->y + w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + baseWidgetIndex].top + 12;
    rct_string_id stringId;

    if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) == RESEARCH_STAGE_FINISHED_ALL) {
        stringId = STR_RESEARCH_UNKNOWN;
        gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
        y += 25;

        // Progress
        stringId = 2680;
        gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
        y += 15;

        RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = STR_UNKNOWN;
        gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
    } else {
        // Research type
        stringId = STR_RESEARCH_UNKNOWN;
        if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != RESEARCH_STAGE_INITIAL_RESEARCH) {
            stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
            if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != RESEARCH_STAGE_DESIGNING) {
                uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
                if (typeId >= 0x10000) {
                    rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
                    stringId = (rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) ?
                               rideEntry->name :
                               ((typeId >> 8) & 0xFF) + 2;
                } else {
示例#8
0
/**
 * 
*  rct2: 0x006EBAD9
*/
static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
{
	rct_widget* widget;
	int l, t, b;
	uint8 colour;

	// Get the widget
	widget = &w->widgets[widgetIndex];

	// Resolve the absolute ltb
	l = w->x + widget->left;
	t = w->y + widget->top;
	b = w->y + widget->bottom;

	// Get the colour
	colour = w->colours[widget->colour];

	// checkbox
	gfx_fill_rect_inset(dpi, l, t, l + 9, b - 1, colour, 0x60);

	// fill it when checkbox is pressed
	if (widget_is_pressed(w, widgetIndex)) {
		RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
		gfx_draw_string(dpi, (char*)0x009DED72, colour & 0x7F, l, t);
	}

	// draw the text
	if (widget->image == -1)
		return;

	if (widget_is_disabled(w, widgetIndex)) {
		colour |= 0x40;
	}
	gfx_draw_string_left(dpi, widget->image, (char*)0x013CE952, colour, l + 14, t);
}
示例#9
0
/**
 * 
 *  rct2: 0x006EBD52
 */
static void widget_text(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
{
	rct_widget* widget;
	int l, t, r, b;
	uint8 colour;

	// Get the widget
	widget = &w->widgets[widgetIndex];

	// Get the colour
	colour = w->colours[widget->colour];

	// Resolve the absolute ltrb
	l = w->x + widget->left;
	t = w->y + widget->top;
	r = w->x + widget->right;
	b = w->y + widget->bottom;

	if (widget->image == (uint32)-2 || widget->image == (uint32)-1)
		return;

	if (widget_is_disabled(w, widgetIndex))
		colour |= 0x40;
	gfx_draw_string_left(dpi, widget->image, (void*)0x013CE952, colour, l + 1, t);
}
示例#10
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;
    }
}
示例#11
0
static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
{
	int i, y;
	rct_string_id stringId, templateStringId = 3165;
	char *templateString;

	gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);

	templateString = (char*)language_get_string(templateStringId);
	for (i = 0; i < w->no_list_items; i++) {
		y = i * 10;
		if (y > dpi->y + dpi->height)
			break;

		if (y + 10 < dpi->y)
			continue;

		stringId = STR_BLACK_STRING;
		if (i == w->selected_list_item) {
			stringId = STR_WINDOW_COLOUR_2_STRING;
			gfx_fill_rect(dpi, 0, y, 800, y + 9, 0x2000031);
		}

		strcpy(templateString, _listItems[i].name);
		gfx_draw_string_left(dpi, stringId, &templateStringId, 0, 0, y - 1);
	}
}
示例#12
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);
    }
}
示例#13
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);
		}
	}
}
示例#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);
}
示例#15
0
/**
*
*  rct2: 0x006BD785
*/
void window_themes_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
{
    sint32 y;

    if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES)
        return;

    if ((w->colours[1] & 0x80) == 0)
        //gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
        gfx_clear(dpi, ColourMapA[w->colours[1]].mid_light);
    y = 0;
    for (sint32 i = 0; i < get_colour_scheme_tab_count(); i++) {
        if (y > dpi->y + dpi->height) {
            break;
        }
        if (y + _row_height >= dpi->y) {
            if (i + 1 < get_colour_scheme_tab_count()) {
                sint32 colour = w->colours[1];
                if (colour & COLOUR_FLAG_TRANSLUCENT) {
                    translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)];

                    gfx_filter_rect(dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2, windowPalette.highlight);
                    gfx_filter_rect(dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1, windowPalette.shadow);
                }
                else {
                    colour = ColourMapA[w->colours[1]].mid_dark;
                    gfx_fill_rect(dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2, colour);
                    colour = ColourMapA[w->colours[1]].lightest;
                    gfx_fill_rect(dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1, colour);
                }
            }

            rct_windowclass wc = get_window_class_tab_index(i);
            sint32 numColours = theme_desc_get_num_colours(wc);
            for (uint8 j = 0; j < numColours; j++) {
                gfx_draw_string_left(dpi, theme_desc_get_name(wc), NULL, w->colours[1], 2, y + 4);

                uint8 colour = theme_get_colour(wc, j);
                uint32 image = SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
                if (i == _colour_index_1 && j == _colour_index_2) {
                    image = SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN_PRESSED;
                }
                gfx_draw_sprite(dpi, image, _button_offset_x + 12 * j, y + _button_offset_y, 0);

                gfx_fill_rect_inset(dpi, _button_offset_x + 12 * j, y + _check_offset_y, _button_offset_x + 12 * j + 9, y + _check_offset_y + 10, w->colours[1], INSET_RECT_F_E0);
                if (colour & COLOUR_FLAG_TRANSLUCENT) {
                    gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM_DARK;
                    gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1] & 0x7F, _button_offset_x + 12 * j, y + _check_offset_y);
                }

            }
        }

        y += _row_height;
    }
}
示例#16
0
/**
 *
 *  rct2: 0x006853D9
 */
static void window_editor_inventions_list_drag_paint(rct_window* w, rct_drawpixelinfo* dpi)
{
    rct_string_id drawString;
    int32_t x, y;

    x = w->x;
    y = w->y + 2;
    drawString = window_editor_inventions_list_prepare_name(_editorInventionsListDraggedItem, true);
    gfx_draw_string_left(dpi, drawString, gCommonFormatArgs, COLOUR_BLACK | COLOUR_FLAG_OUTLINE, x, y);
}
/**
 *
 *  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);
}
示例#18
0
/**
 * 
 *  rct2: 0x006EB535
 */
static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
{
	rct_widget* widget;
	int l, t, r, b, textRight;
	uint8 colour;

	// Get the widget
	widget = &w->widgets[widgetIndex];

	// Resolve the absolute ltrb
	l = w->x + widget->left + 5;
	t = w->y + widget->top;
	r = w->x + widget->right;
	b = w->y + widget->bottom;
	textRight = l;

	// Text
	if (widget->image != (uint32)-1) {
		colour = w->colours[widget->colour] & 0x7F;
		if (widget_is_disabled(w, widgetIndex))
			colour |= 0x40;
		gfx_draw_string_left(dpi, widget->image, (void*)0x013CE952, colour, l, t);
		textRight = gLastDrawStringX + 1;
	}

	// Border
	// Resolve the absolute ltrb
	l = w->x + widget->left;
	t = w->y + widget->top + 4;
	r = w->x + widget->right;
	b = w->y + widget->bottom;

	// Get the colour
	colour = w->colours[widget->colour] & 0x7F;

	// Border left of text
	gfx_fill_rect(dpi, l, t, l + 4, t, RCT2_ADDRESS(0x0141FC47, uint8)[colour * 8]);
	gfx_fill_rect(dpi, l + 1, t + 1, l + 4, t + 1, RCT2_ADDRESS(0x0141FC4B, uint8)[colour * 8]);

	// Border right of text
	gfx_fill_rect(dpi, textRight, t, r - 1, t, RCT2_ADDRESS(0x0141FC47, uint8)[colour * 8]);
	gfx_fill_rect(dpi, textRight, t + 1, r - 2, t + 1, RCT2_ADDRESS(0x0141FC4B, uint8)[colour * 8]);

	// Border right
	gfx_fill_rect(dpi, r - 1, t + 1, r - 1, b - 1, RCT2_ADDRESS(0x0141FC47, uint8)[colour * 8]);
	gfx_fill_rect(dpi, r, t, r, b, RCT2_ADDRESS(0x0141FC4B, uint8)[colour * 8]);

	// Border bottom
	gfx_fill_rect(dpi, l, b - 1, r - 2, b - 1, RCT2_ADDRESS(0x0141FC47, uint8)[colour * 8]);
	gfx_fill_rect(dpi, l, b, r - 1, b, RCT2_ADDRESS(0x0141FC4B, uint8)[colour * 8]);

	// Border left
	gfx_fill_rect(dpi, l, t + 1, l, b - 2, RCT2_ADDRESS(0x0141FC47, uint8)[colour * 8]);
	gfx_fill_rect(dpi, l + 1, t + 2, l + 1, b - 2, RCT2_ADDRESS(0x0141FC4B, uint8)[colour * 8]);
}
示例#19
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);
}
示例#20
0
void window_player_statistics_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;
	}

	int x = w->x + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4;
	int y = w->y + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4;

	RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = network_get_player_commands_ran(player);
	gfx_draw_string_left(dpi, STR_COMMANDS_RAN, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0,x, y);

	y += 10;
	
	RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = network_get_player_money_spent(player);
	gfx_draw_string_left(dpi, STR_MONEY_SPENT, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0,x, y);
}
示例#21
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);
	}
}
/**
 *
 *  rct2: 0x00670338
 */
static void window_editor_scenario_options_financial_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	int x, y;

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

	if (w->widgets[WIDX_INITIAL_CASH].type != WWT_EMPTY) {
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_INITIAL_CASH].top;
		gfx_draw_string_left(dpi, 3240, NULL, 0, x, y);

		x = w->x + w->widgets[WIDX_INITIAL_CASH].left + 1;
		y = w->y + w->widgets[WIDX_INITIAL_CASH].top;
		gfx_draw_string_left(dpi, 3246, &RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32), 0, x, y);
	}

	if (w->widgets[WIDX_INITIAL_LOAN].type != WWT_EMPTY) {
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_INITIAL_LOAN].top;
		gfx_draw_string_left(dpi, 3241, NULL, 0, x, y);

		x = w->x + w->widgets[WIDX_INITIAL_LOAN].left + 1;
		y = w->y + w->widgets[WIDX_INITIAL_LOAN].top;
		gfx_draw_string_left(dpi, 3246, &RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32), 0, x, y);
	}

	if (w->widgets[WIDX_MAXIMUM_LOAN].type != WWT_EMPTY) {
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_MAXIMUM_LOAN].top;
		gfx_draw_string_left(dpi, 3242, NULL, 0, x, y);

		x = w->x + w->widgets[WIDX_MAXIMUM_LOAN].left + 1;
		y = w->y + w->widgets[WIDX_MAXIMUM_LOAN].top;
		gfx_draw_string_left(dpi, 3246, &RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32), 0, x, y);
	}

	if (w->widgets[WIDX_INTEREST_RATE].type != WWT_EMPTY) {
		x = w->x + 8;
		y = w->y + w->widgets[WIDX_INTEREST_RATE].top;
		gfx_draw_string_left(dpi, 3243, NULL, 0, x, y);

		x = w->x + w->widgets[WIDX_INTEREST_RATE].left + 1;
		y = w->y + w->widgets[WIDX_INTEREST_RATE].top;

		money16 interestRate = (money16)clamp(INT16_MIN, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32), INT16_MAX);
		gfx_draw_string_left(dpi, 3247, &interestRate, 0, x, y);
	}
}
示例#23
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);
	}
}
示例#24
0
/**
 *
 *  rct2: 0x006EB535
 */
static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex)
{
    // Get the widget
    rct_widget *widget = &w->widgets[widgetIndex];

    // Resolve the absolute ltrb
    sint32 l = w->x + widget->left + 5;
    sint32 t = w->y + widget->top;
    sint32 r = w->x + widget->right;
    sint32 b = w->y + widget->bottom;
    sint32 textRight = l;

    // Text
    if (widget->text != STR_NONE) {
        uint8 colour = w->colours[widget->colour] & 0x7F;
        if (widget_is_disabled(w, widgetIndex))
            colour |= 0x40;
        gfx_draw_string_left(dpi, widget->text, gCommonFormatArgs, colour, l, t);
        textRight = l + gfx_get_string_width(gCommonStringFormatBuffer) + 1;
    }

    // Border
    // Resolve the absolute ltrb
    l = w->x + widget->left;
    t = w->y + widget->top + 4;
    r = w->x + widget->right;
    b = w->y + widget->bottom;

    // Get the colour
    uint8 colour = w->colours[widget->colour] & 0x7F;

    // Border left of text
    gfx_fill_rect(dpi, l, t, l + 4, t, ColourMapA[colour].mid_dark);
    gfx_fill_rect(dpi, l + 1, t + 1, l + 4, t + 1, ColourMapA[colour].lighter);

    // Border right of text
    gfx_fill_rect(dpi, textRight, t, r - 1, t, ColourMapA[colour].mid_dark);
    gfx_fill_rect(dpi, textRight, t + 1, r - 2, t + 1, ColourMapA[colour].lighter);

    // Border right
    gfx_fill_rect(dpi, r - 1, t + 1, r - 1, b - 1, ColourMapA[colour].mid_dark);
    gfx_fill_rect(dpi, r, t, r, b, ColourMapA[colour].lighter);

    // Border bottom
    gfx_fill_rect(dpi, l, b - 1, r - 2, b - 1, ColourMapA[colour].mid_dark);
    gfx_fill_rect(dpi, l, b, r - 1, b, ColourMapA[colour].lighter);

    // Border left
    gfx_fill_rect(dpi, l, t + 1, l, b - 2, ColourMapA[colour].mid_dark);
    gfx_fill_rect(dpi, l + 1, t + 2, l + 1, b - 2, ColourMapA[colour].lighter);
}
示例#25
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);
}
示例#26
0
static void window_title_editor_scrollpaint_saves(rct_window * w, rct_drawpixelinfo * dpi)
{
    sint32 currentSaveIndex = -1;
    // ITitleSequencePlayer * player = window_title_editor_get_player();
    // sint32 position = title_sequence_player_get_current_position(player);
    // const TitleCommand * command = &_editingTitleSequence->Commands[position];

    sint32 x = 0;
    sint32 y = 0;
    if (_editingTitleSequence == nullptr)
        return;

    for (sint32 i = 0; i < (sint32)_editingTitleSequence->NumSaves; i++, y += SCROLLABLE_ROW_HEIGHT)
    {
        bool selected = false;
        bool hover = false;
        if (i == w->selected_list_item)
        {
            selected = true;
            gfx_fill_rect(dpi, x, y, x + SCROLL_WIDTH + 100, y + SCROLLABLE_ROW_HEIGHT - 1, ColourMapA[w->colours[1]].dark);
        }
        else if (i == _window_title_editor_highlighted_index || i == currentSaveIndex)
        {
            hover = true;
            gfx_fill_rect(dpi, x, y, x + SCROLL_WIDTH + 100, y + SCROLLABLE_ROW_HEIGHT - 1, ColourMapA[w->colours[1]].mid_dark);
        }
        else if (i & 1)
        {
            gfx_fill_rect(dpi, x, y, x + SCROLL_WIDTH + 100, y + SCROLLABLE_ROW_HEIGHT - 1, ColourMapA[w->colours[1]].lighter | 0x1000000);
        }

        char buffer[256];
        set_format_arg(0, uintptr_t, _editingTitleSequence->Saves[i]);
        if (selected || hover)
        {
            format_string(buffer, 256, STR_STRING, gCommonFormatArgs);
        }
        else
        {
            format_string(buffer + 1, 255, STR_STRING, gCommonFormatArgs);
            buffer[0] = (utf8)(uint8)FORMAT_BLACK;
        }
        set_format_arg(0, uintptr_t, &buffer);
        gfx_draw_string_left(dpi, STR_STRING, gCommonFormatArgs, w->colours[1], x + 5, y);
    }
}
示例#27
0
static void window_tile_inspector_paint()
{
	int x, y;
	rct_window *w;
	rct_drawpixelinfo *dpi;
	char buffer[256];

	window_paint_get_registers(w, dpi);

	window_draw_widgets(w, dpi);

	x = w->x + 20;
	y = w->y + 25;

	if (window_tile_inspector_tile_x == -1) {

		// No tile selected
		gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_CHOOSE_MSG, NULL, 12, x, y);

	} else {

		sprintf(
			buffer,
			"X: %d, Y: %d",
			window_tile_inspector_tile_x,
			window_tile_inspector_tile_y
		);

		gfx_draw_string(dpi, buffer, 12, x, y);

	}

	y += 25;

	draw_string_left_underline(dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, NULL, 12, x, y);
	draw_string_left_underline(dpi, STR_TILE_INSPECTOR_BASE_HEIGHT, NULL, 12, x + 200, y);
	draw_string_left_underline(dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT, NULL, 12, x + 280, y);
	draw_string_left_underline(dpi, STR_TILE_INSPECTOR_FLAGS, NULL, 12, x + 390, y);
	
}
示例#28
0
static void window_mapgen_base_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, STR_MAP_SIZE, 0, 0, w->x + 4, w->y + w->widgets[WIDX_MAP_SIZE].top + 1);
	gfx_draw_string_left(dpi, 2691, 0, 0, w->x + 4, w->y + w->widgets[WIDX_BASE_HEIGHT].top + 1);
	gfx_draw_string_left(dpi, 2692, 0, 0, w->x + 4, w->y + w->widgets[WIDX_WATER_LEVEL].top + 1);
	gfx_draw_string_left(dpi, 2693, 0, 0, w->x + 4, w->y + w->widgets[WIDX_FLOOR_TEXTURE].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_MAP_SIZE].left + 1, w->y + w->widgets[WIDX_MAP_SIZE].top + 1);

	arg = (_baseHeight - 12) / 2;
	gfx_draw_string_left(dpi, 1737, &arg, w->colours[1], w->x + w->widgets[WIDX_BASE_HEIGHT].left + 1, w->y + w->widgets[WIDX_BASE_HEIGHT].top + 1);

	arg = (_waterLevel - 12) / 2;
	gfx_draw_string_left(dpi, 1737, &arg, w->colours[1], w->x + w->widgets[WIDX_WATER_LEVEL].left + 1, w->y + w->widgets[WIDX_WATER_LEVEL].top + 1);
}
示例#29
0
/**
 *
 *  rct2: 0x006CF387
 */
static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
	rct_widget *widget;
	rct_track_design *trackDesign = NULL;
	uint8 *image;
	utf8 *trackDesignList = RCT2_ADDRESS(RCT2_ADDRESS_TRACK_LIST, utf8);
	uint16 holes, speed, drops, dropHeight, inversions;
	fixed32_2dp rating;
	int trackIndex, x, y, colour, gForces, airTime;
	rct_g1_element tmpElement, *substituteElement;

	window_draw_widgets(w, dpi);

	trackIndex = w->track_list.var_482;
	if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) {
		if (*trackDesignList == 0 || trackIndex == -1)
			return;
	} else if (trackIndex-- == 0) {
		return;
	}

	// Track preview
	widget = &window_track_list_widgets[WIDX_TRACK_PREVIEW];
	x = w->x + widget->left + 1;
	y = w->y + widget->top + 1;
	colour = ColourMapA[w->colours[0]].darkest;
	gfx_fill_rect(dpi, x, y, x + 369, y + 216, colour);

	trackDesign = track_get_info(trackIndex, &image);
	if (trackDesign == NULL)
		return;

	rct_track_td6* track_td6 = &trackDesign->track_td6;

	substituteElement = &g1Elements[0];
	tmpElement = *substituteElement;
	substituteElement->offset = image;
	substituteElement->width = 370;
	substituteElement->height = 217;
	substituteElement->x_offset = 0;
	substituteElement->y_offset = 0;
	substituteElement->flags = G1_FLAG_BMP;
	gfx_draw_sprite(dpi, 0, x, y, 0);
	*substituteElement = tmpElement;

	x = w->x + (widget->left + widget->right) / 2;
	y = w->y + widget->bottom - 12;

	RCT2_GLOBAL(0x00F44153, uint8) = 0;
	// Warnings
	if ((track_td6->track_flags & 4) && !(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER)) {
		// Vehicle design not available
		gfx_draw_string_centred_clipped(dpi, STR_VEHICLE_DESIGN_UNAVAILABLE, NULL, 0, x, y, 368);
		y -= 10;
	}

	if (track_td6->track_flags & 1) {
		RCT2_GLOBAL(0x00F44153, uint8) = 1;
		if (RCT2_GLOBAL(RCT2_ADDRESS_TRACK_DESIGN_SCENERY_TOGGLE, uint8) == 0) {
			// Scenery not available
			gfx_draw_string_centred_clipped(dpi, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, NULL, 0, x, y, 368);
			y -= 10;
		}
	}

	// Track design name
	window_track_list_format_name((char*)0x009BC677, trackDesignList + (trackIndex * 128), FORMAT_WINDOW_COLOUR_1, 1);
	gfx_draw_string_centred_clipped(dpi, 3165, NULL, 0, x, y, 368);

	// Information
	x = w->x + widget->left + 1;
	y = w->y + widget->bottom + 2;

	// Stats
	rating = track_td6->excitement * 10;
	gfx_draw_string_left(dpi, STR_TRACK_LIST_EXCITEMENT_RATING, &rating, 0, x, y);
	y += 10;

	rating = track_td6->intensity * 10;
	gfx_draw_string_left(dpi, STR_TRACK_LIST_INTENSITY_RATING, &rating, 0, x, y);
	y += 10;

	rating = track_td6->nausea * 10;
	gfx_draw_string_left(dpi, STR_TRACK_LIST_NAUSEA_RATING, &rating, 0, x, y);
	y += 14;

	if (track_td6->type != RIDE_TYPE_MAZE) {
		if (track_td6->type == RIDE_TYPE_MINI_GOLF) {
			// Holes
			holes = track_td6->holes & 0x1F;
			gfx_draw_string_left(dpi, STR_HOLES, &holes, 0, x, y);
			y += 10;
		} else {
			// Maximum speed
			speed = ((track_td6->max_speed << 16) * 9) >> 18;
			gfx_draw_string_left(dpi, STR_MAX_SPEED, &speed, 0, x, y);
			y += 10;

			// Average speed
			speed = ((track_td6->average_speed << 16) * 9) >> 18;
			gfx_draw_string_left(dpi, STR_AVERAGE_SPEED, &speed, 0, x, y);
			y += 10;
		}

		// Ride length
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 1345;
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = track_td6->ride_length;
		gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y, 214);
		y += 10;
	}

	if (ride_type_has_flag(track_td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES)) {
		// Maximum positive vertical Gs
		gForces = track_td6->max_positive_vertical_g * 32;
		gfx_draw_string_left(dpi, STR_MAX_POSITIVE_VERTICAL_G, &gForces, 0, x, y);
		y += 10;

		// Maximum negative verical Gs
		gForces = track_td6->max_negative_vertical_g * 32;
		gfx_draw_string_left(dpi, STR_MAX_NEGATIVE_VERTICAL_G, &gForces, 0, x, y);
		y += 10;

		// Maximum lateral Gs
		gForces = track_td6->max_lateral_g * 32;
		gfx_draw_string_left(dpi, STR_MAX_LATERAL_G, &gForces, 0, x, y);
		y += 10;

		// If .TD6
		if (track_td6->version_and_colour_scheme / 4 >= 2) {
			if (track_td6->total_air_time != 0) {
				// Total air time
				airTime = track_td6->total_air_time * 25;
				gfx_draw_string_left(dpi, STR_TOTAL_AIR_TIME, &airTime, 0, x, y);
				y += 10;
			}
		}
	}

	if (ride_type_has_flag(track_td6->type, RIDE_TYPE_FLAG_HAS_DROPS)) {
		// Drops
		drops = track_td6->drops & 0x3F;
		gfx_draw_string_left(dpi, STR_DROPS, &drops, 0, x, y);
		y += 10;

		// Drop height is multiplied by 0.75
		dropHeight = (track_td6->highest_drop_height + (track_td6->highest_drop_height / 2)) / 2;
		gfx_draw_string_left(dpi, STR_HIGHEST_DROP_HEIGHT, &drops, 0, x, y);
		y += 10;
	}

	if (track_td6->type != RIDE_TYPE_MINI_GOLF) {
		inversions = track_td6->inversions & 0x1F;
		if (inversions != 0) {
			// Inversions
			gfx_draw_string_left(dpi, STR_INVERSIONS, &inversions, 0, x, y);
			y += 10;
		}
	}
	y += 4;

	if (track_td6->space_required_x != 0xFF) {
		// Space required
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = track_td6->space_required_x;
		RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint16) = track_td6->space_required_y;
		gfx_draw_string_left(dpi, STR_TRACK_LIST_SPACE_REQUIRED, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS, 0, x, y);
		y += 10;
	}

	if (track_td6->cost != 0) {
		gfx_draw_string_left(dpi, STR_TRACK_LIST_COST_AROUND, &track_td6->cost, 0, x, y);
		y += 14;
	}
}
示例#30
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);
}