示例#1
0
MenuVendor::MenuVendor(SDL_Surface *_screen, InputState *_inp, FontEngine *_font, ItemDatabase *_items, StatBlock *_stats, MessageEngine *_msg) {
	screen = _screen;
	inp = _inp;
	font = _font;
	items = _items;
	stats = _stats;
	msg = _msg;

	int offset_y = (VIEW_H - 416)/2;

	slots_area.x = 32;
	slots_area.y = offset_y + 64;
	slots_area.w = 256;
	slots_area.h = 320;

	stock.init( VENDOR_SLOTS, items, screen, font, slots_area, ICON_SIZE_32, 8);

	visible = false;
	loadGraphics();

	closeButton = new WidgetButton(screen, font, inp, "images/menus/buttons/button_x.png");
	closeButton->pos.x = 294;
	closeButton->pos.y = (VIEW_H - 480)/2 + 34;

	loadMerchant("");
}
示例#2
0
MenuVendor::MenuVendor(SDL_Surface *_screen, FontEngine *_font, ItemDatabase *_items, StatBlock *_stats) {
	screen = _screen;
	font = _font;
	items = _items;
	stats = _stats;
	
	int offset_y = (VIEW_H - 416)/2;
	
	slots_area.x = 32;
	slots_area.y = offset_y + 64;
	slots_area.w = 256;
	slots_area.h = 320;
	
	stock.init( VENDOR_SLOTS, items, screen, font, slots_area, ICON_SIZE_32, 8);

	visible = false;
	loadGraphics();
	loadMerchant("");
}