예제 #1
0
void Window_Item::Refresh() {
	std::vector<int> party_items;

	data.clear();
	Main_Data::game_party->GetItems(party_items);

	for (size_t i = 0; i < party_items.size(); ++i) {
		if (this->CheckInclude(party_items[i])) {
			data.push_back(party_items[i]);
		}
	}

	if (CheckInclude(0)) {
		data.push_back(0);
	}

	item_max = data.size();

	CreateContents();
	
	if (index > 0 && index >= item_max) {
		--index;
	} 

	contents->Clear();

	for (int i = 0; i < item_max; ++i) {
		DrawItem(i);
	}
}
예제 #2
0
bool ppInclude::Check(int token, const std::string &args)
{
    if (!current || !current->Check(token, args, current->GetErrorLine()))
        if (!CheckInclude(token, args))
            if (!CheckLine(token, args))
                return false;
    return true;
}
예제 #3
0
void CFile::FindIncbins()
{
    char stringChar = 0;

    while (m_pos < m_size)
    {
        if (stringChar)
        {
            if (m_buffer[m_pos] == stringChar)
            {
                m_pos++;
                stringChar = 0;
            }
            else if (m_buffer[m_pos] == '\\' && m_buffer[m_pos + 1] == stringChar)
            {
                m_pos += 2;
            }
            else
            {
                if (m_buffer[m_pos] == '\n')
                    m_lineNum++;
                m_pos++;
            }
        }
        else
        {
            SkipWhitespace();
            CheckInclude();
            CheckIncbin();

            if (m_pos >= m_size)
                break;

            char c = m_buffer[m_pos++];

            if (c == '\n')
                m_lineNum++;
            else if (c == '"')
                stringChar = '"';
            else if (c == '\'')
                stringChar = '\'';
            else if (c == 0)
                FATAL_INPUT_ERROR("unexpected null character");
        }
    }
}
예제 #4
0
void Window_Skill::Refresh() {
	data.clear();

	const std::vector<int16_t>& skills = Game_Actors::GetActor(actor_id)->GetSkills();
	for (size_t i = 0; i < skills.size(); ++i) {
		if (CheckInclude(skills[i]))
			data.push_back(skills[i]);
	}

	CreateContents();

	contents->Clear();

	if (data.size() == 0) {
		data.push_back(0);
	}

	item_max = data.size();

	for (int i = 0; i < item_max; ++i) {
		DrawItem(i);
	}
}