Beispiel #1
0
// Update Cursor Rect
void Window_Selectable::UpdateCursorRect() {
	int cursor_width = 0;
	int x = 0;
	if (index < 0) {
		SetCursorRect(Rect());
		return;
	}
	int row = index / column_max;
	if (row < GetTopRow()) {
		SetTopRow(row);
	} else if (row > GetTopRow() + (GetPageRowMax() - 1)) {
		SetTopRow(row - (GetPageRowMax() - 1));
	}

	if (column_max > 1){
		cursor_width = (width / column_max - 16) + 12;
		x = (index % column_max * cursor_width) - 4 ;
	}
	else{
		cursor_width = (width / column_max - 16) + 8;
		x = (index % column_max * (cursor_width + 16)) - 4;
	}

	int y = index / column_max * 16 - oy;
	SetCursorRect(Rect(x, y, cursor_width, 16));

}
void Window_BattleStatus::UpdateCursorRect() {
	if (Data::battlecommands.battle_type != RPG::BattleCommands::BattleType_traditional) {
		SetCursorRect(Rect());
		return;
	}

	if (index < 0)
		SetCursorRect(Rect());
	else
		SetCursorRect(Rect(0, index * 15, contents->GetWidth(), 16));
}
Beispiel #3
0
void Window_Shop::UpdateCursorRect() {
	Rect rect;
	switch (mode) {
		case Scene_Shop::BuySellLeave:
		case Scene_Shop::BuySellLeave2:
			rect = Rect(4, index * 16 + 2, contents->GetWidth() - 8, 16);
			break;
		default:
			rect = Rect();
			break;
	}

	SetCursorRect(rect);
}
void Window_ShopNumber::Refresh() {
	contents->Clear();

	int y = 34;
	DrawItemName(&Data::items[item_id - 1], 0, y);

	std::stringstream ss;
	ss << number;

	contents->TextDraw(132, y, Font::ColorDefault, "x");
	contents->TextDraw(132 + 30, y, Font::ColorDefault, ss.str(), Surface::TextAlignRight);
	SetCursorRect(Rect(132 + 14, y - 2, 20, 16));
	
	DrawCurrencyValue(GetTotal(), contents->GetWidth(), y + 32);
}
void Window_Keyboard::UpdateCursorRect() {
	Rect r = GetItemRect(row, col);
	r.y -= 2;
	SetCursorRect(r);
}
void Window_BattleCommand::UpdateCursorRect() {
	if (index >= 0)
		SetCursorRect(Rect(0, (index - top_row) * 16, contents->GetWidth(), 16));
	else
		SetCursorRect(Rect());
}
Beispiel #7
0
void Window_Name::Update() {
	Rect const name_size = Font::Default()->GetSize(name);
	SetCursorRect(Rect(name_size.width + 2, 0, 16, 16));
}
void Window_SaveFile::UpdateCursorRect() {
	SetCursorRect(GetActive() ? Rect(0, 0, 48, 16) : Rect());
}
Beispiel #9
0
void Window_BattleStatus::UpdateCursorRect() {
	if (index < 0)
		SetCursorRect(Rect());
	else
		SetCursorRect(Rect(0, index * 15, contents->GetWidth(), 16));
}