Beispiel #1
0
static void draw_xp_skills(cDialog& me,xp_dlog_state& save) {
	short i;
	// TODO: Wouldn't it make more sense for it to be red when you can't buy the skill rather than red when you can?
	for(i = 0; i < 19; i++) {
		cControl& cur = me[skill_ids[i]];
		eSkill skill = eSkill(i);
		if(can_change_skill(skill, save, true))
			cur.setColour(sf::Color::Red);
		else cur.setColour(me.getDefTextClr());
		cur.setTextToNum(save.skills[skill]);
	}
	
	cControl& sp = me["sp"];
	cControl& hp = me["hp"];
	if(can_change_skill(eSkill::MAX_HP, save, true))
		hp.setColour(sf::Color::Red);
	else hp.setColour(me.getDefTextClr());
	hp.setTextToNum(save.hp);
	if(can_change_skill(eSkill::MAX_SP, save, true))
		sp.setColour(sf::Color::Red);
	else sp.setColour(me.getDefTextClr());
	sp.setTextToNum(save.sp);
}
Beispiel #2
0
static bool spend_xp_navigate_filter(cDialog& me, std::string item_hit,xp_dlog_state& save) {
	if(item_hit == "cancel") {
		// TODO: Um, I'm pretty sure this can never happen.
		if(save.mode == 0 && univ.party[save.who].main_status < eMainStatus::ABSENT)
			univ.party[save.who].main_status = eMainStatus::ABSENT;
		me.setResult(false);
		me.toast(false);
	} else if(item_hit == "help") {
		give_help(210,11,me);
	} else if(item_hit == "keep") {
		do_xp_keep(save);
		me.setResult(true);
		me.toast(true);
	} else if(item_hit == "left") {
		// TODO: Try not forcing a commit when using the arrows?
		if(save.mode != 0) {
			do_xp_keep(save);
			do {
				save.who = (save.who == 0) ? 5 : save.who - 1;
			} while(univ.party[save.who].main_status != eMainStatus::ALIVE);
			do_xp_draw(me,save);
		} else
			beep(); // TODO: This is a game event, so it should have a game sound, not a system alert.
	} else if(item_hit == "right") {
		// TODO: If they don't work in mode 0, why are they visible?
		if(save.mode != 0) {
			do_xp_keep(save);
			do {
				save.who = (save.who == 5) ? 0 : save.who + 1;
			} while(univ.party[save.who].main_status != eMainStatus::ALIVE);
			do_xp_draw(me,save);
		} else
			beep(); // TODO: This is a game event, so it should have a game sound, not a system alert.
	}
	return true;
}
Beispiel #3
0
static bool display_pc_event_filter(cDialog& me, std::string item_hit, const short trait_mode) {
	short pc_num;
	
	pc_num = which_pc_displayed;
	if(item_hit == "done") {
		me.toast(true);
	} else if(item_hit == "left") {
		do {
			pc_num = (pc_num == 0) ? 5 : pc_num - 1;
		} while(univ.party[pc_num].main_status == eMainStatus::ABSENT);
		which_pc_displayed = pc_num;
		put_pc_spells(me, trait_mode);
	} else if(item_hit == "right") {
		do {
			pc_num = (pc_num == 5) ? 0 : pc_num + 1;
		} while(univ.party[pc_num].main_status == eMainStatus::ABSENT);
		which_pc_displayed = pc_num;
		put_pc_spells(me, trait_mode);
	}
	return true;
}
Beispiel #4
0
cButton::cButton(cDialog& parent) :
	cControl(CTRL_BTN,parent),
	wrapLabel(false),
	type(BTN_REG),
	textClr(parent.getDefTextClr()),
	fromList("none") {}
Beispiel #5
0
static bool get_num_event_filter(cDialog& me, std::string id, eKeyMod) {
	me.toast(id == "okay");
	me.setResult<long long>(me["number"].getTextAsNum());
	return true;
}