Fix/update the edit placed monster dialogs
- Also, edit monster dialog now shows default facial pic
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<field name='sides2' top='173' left='410' width='52' height='16'/>
|
||||
<field name='dice3' top='197' left='350' width='52' height='16'/>
|
||||
<field name='sides3' top='197' left='410' width='52' height='16'/>
|
||||
<field name='talk' top='276' left='168' width='77' height='16'/>
|
||||
<field name='talk' top='276' left='138' width='77' height='16'/>
|
||||
<field name='treas' top='273' left='513' width='55' height='16'/>
|
||||
<button name='okay' type='regular' top='367' left='600'>OK</button>
|
||||
<button name='cancel' type='regular' def-key='esc' top='367' left='527'>Cancel</button>
|
||||
@@ -57,9 +57,9 @@
|
||||
<text name='type2' top='174' left='470' width='120' height='14'/>
|
||||
<text name='type3' top='198' left='470' width='120' height='14'/>
|
||||
<text top='253' left='8' width='120' height='14'>Monster type:</text>
|
||||
<text top='278' left='8' width='152' height='14'>Default talking picture:</text>
|
||||
<!-- Note: This originally had width=202 -->
|
||||
<text top='301' left='8' width='302' height='14'>Default attitude:
|
||||
<text top='278' left='8' width='120' height='14'>Default talking picture:</text>
|
||||
<pict name='talkpic' type='talk' num='0' top='276' left='226'/>
|
||||
<text top='310' left='8' width='302' height='14'>Default attitude:
|
||||
(attitude creature has when you place it)
|
||||
</text>
|
||||
<text size='large' top='250' left='343' width='158' height='16'>Treasure:</text>
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
Number of town special node to call when creature is killed:
|
||||
(-1 for none)
|
||||
</text>
|
||||
<button name='editdeath' type='large' top='294' left='360'>Create/Edit</button>
|
||||
<text top='322' left='25' width='230' height='40'>
|
||||
Stuff done flag creature’s life is linked to:
|
||||
Stuff done flag creature's life is linked to:
|
||||
(0 - alive,
|
||||
1 - dead),
|
||||
if either is -1, this is ignored.
|
||||
@@ -33,34 +34,22 @@
|
||||
<text name='num' top='7' left='454' width='50' height='15'/>
|
||||
<text size='large' top='49' left='9' width='130' height='17'>Creature timing:</text>
|
||||
<group name='time'>
|
||||
<led name='time1' top='74' left='290' width='100'>Always here</led>
|
||||
<led name='time2' top='90' left='290' width='110'>Appear on given day</led>
|
||||
<led name='time3' top='106' left='290' width='100'>Disappear on day</led>
|
||||
<led name='time4' top='74' left='420' width='100'>Sometimes here A</led>
|
||||
<led name='time5' top='90' left='420' width='100'>Sometimes here B</led>
|
||||
<led name='time6' top='106' left='420' width='100'>Sometimes here C</led>
|
||||
<led name='time7' top='74' left='549' width='100'>Appear when event</led>
|
||||
<led name='time8' top='90' left='549' width='120'>Disappear when event</led>
|
||||
<led name='time9' top='106' left='549' width='120'>Appear after town dies</led>
|
||||
<led name='time1' top='74' left='150' width='100'>Always here</led>
|
||||
<led name='time2' top='90' left='150' width='110'>Appear on given day</led>
|
||||
<led name='time3' top='106' left='150' width='100'>Disappear on day</led>
|
||||
<led name='time4' top='74' left='280' width='100'>Sometimes here A</led>
|
||||
<led name='time5' top='90' left='280' width='100'>Sometimes here B</led>
|
||||
<led name='time6' top='106' left='280' width='100'>Sometimes here C</led>
|
||||
<led name='time7' top='74' left='409' width='100'>Appear when event</led>
|
||||
<led name='time8' top='90' left='409' width='120'>Disappear when event</led>
|
||||
<led name='time9' top='106' left='409' width='120'>Appear after town dies</led>
|
||||
</group>
|
||||
<group name='group'>
|
||||
<led name='group0' top='220' left='77'>None</led>
|
||||
<led name='group1' top='236' left='77'>1</led>
|
||||
<led name='group2' top='252' left='77'>2</led>
|
||||
<led name='group3' top='220' left='165'>3</led>
|
||||
<led name='group4' top='236' left='165'>4</led>
|
||||
<led name='group5' top='252' left='165'>5</led>
|
||||
<led name='group6' top='220' left='254'>6</led>
|
||||
<led name='group7' top='236' left='254'>7</led>
|
||||
<led name='group8' top='252' left='254'>8</led>
|
||||
<led name='group9' top='220' left='346'>9</led>
|
||||
<led name='group10' top='236' left='346'>10</led>
|
||||
</group>
|
||||
<text top='203' left='372' width='195' height='78'>
|
||||
A creature which is part of a special group does not exist until it’s created by a special encounter
|
||||
<field name='group' tab-order='3' type='uint' top='205' left='397' width='50' height='16'/>
|
||||
<text top='203' left='25' width='363' height='68'>
|
||||
What special encounter group is this creature a part of? (0 - none)<br/><br/>
|
||||
A creature which is part of a special group does not exist until it's created by a special encounter
|
||||
(like special node type One-Time Place Town Encounter).
|
||||
</text>
|
||||
<text top='203' left='25' width='343' height='15'>What special encounter group is this creature a part of?</text>
|
||||
<text top='133' left='301' width='222' height='44'>
|
||||
For an explanation on how event codes work,
|
||||
see the chapter in the instructions on the passing of time.
|
||||
|
||||
@@ -2,22 +2,23 @@
|
||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||
<dialog defbtn='okay' debug='true'>
|
||||
<field name='talk' top='189' left='149' width='67' height='16'/>
|
||||
<text name='picnum' top='189' left='341' width='71' height='16'/>
|
||||
<button name='talk-edit' type='regular' top='186' left='228'>Choose</button>
|
||||
<text name='picnum' top='189' left='375' width='40' height='16'/>
|
||||
<text size='large' top='71' left='51' width='115' height='15'>Creature type:</text>
|
||||
<text top='189' left='51' width='84' height='15'>Personality:</text>
|
||||
<button name='type-edit' type='regular' top='69' left='333'>Choose</button>
|
||||
<text name='type' framed='true' top='71' left='171' width='155' height='15'/>
|
||||
<text top='92' left='51' width='169' height='15'>Creature starting attitude:</text>
|
||||
<text top='128' left='51' width='130' height='15'>Creature can move?</text>
|
||||
<text top='189' left='230' width='100' height='15'>Facial graphic:</text>
|
||||
<text top='189' left='295' width='80' height='15'>Facial graphic:</text>
|
||||
<pict name='pic' type='talk' num='0' top='180' left='426'/>
|
||||
<button name='pict-edit' type='regular' top='186' left='471'>Choose</button>
|
||||
<text size='large' top='6' left='50' width='156' height='17'>Editing a townsperson/monster</text>
|
||||
<group name='attitude'>
|
||||
<led name='att1' top='97' left='342' width='100'>Friendly, Docile</led>
|
||||
<led name='att2' top='113' left='342' width='100'>Hostile, Type A</led>
|
||||
<led name='att3' top='97' left='477' width='100'>Friendly, Will Fight</led>
|
||||
<led name='att4' top='113' left='477' width='100'>Hostile, Type B</led>
|
||||
<led name='att1' top='97' left='242' width='100'>Friendly, Docile</led>
|
||||
<led name='att2' top='113' left='242' width='100'>Hostile, Type A</led>
|
||||
<led name='att3' top='97' left='377' width='100'>Friendly, Will Fight</led>
|
||||
<led name='att4' top='113' left='377' width='100'>Hostile, Type B</led>
|
||||
</group>
|
||||
<group name='mobility'>
|
||||
<led name='mob1' top='133' left='224'>No</led>
|
||||
@@ -27,13 +28,14 @@
|
||||
<button name='cancel' type='regular' top='224' left='405'>Cancel</button>
|
||||
<pict type='dlog' num='16' top='8' left='8'/>
|
||||
<text top='7' left='313' width='126' height='15'>Creature number:</text>
|
||||
<text name='num' top='7' left='250' width='50' height='15'/>
|
||||
<text name='num' top='7' left='450' width='50' height='15'/>
|
||||
<button name='more' type='large' top='224' left='51'>Advanced</button>
|
||||
<button name='del' type='regular' top='224' left='155'>Delete</button>
|
||||
<text top='24' left='50' width='476' height='40'>
|
||||
Enter the information for this monster/townsperson.
|
||||
You only need to worry about the talking section if this is not a hostile monster.
|
||||
To edit the more advanced traits for this monster, press the Advanced button.
|
||||
</text>
|
||||
<text size='large' top='160' left='51' width='256' height='17'>Talking to this creature:</text>
|
||||
<text top='205' left='230' width='101' height='26'>Leave at 0 for no pic.</text>
|
||||
<text top='205' left='295' width='101' height='26'>Leave at -1 for no pic.</text>
|
||||
</dialog>
|
||||
@@ -849,7 +849,7 @@ static void place_talk_face() {
|
||||
}
|
||||
else {
|
||||
short i = get_monst_picnum(store_monst_type);
|
||||
if(face_to_draw <= 0)
|
||||
if(face_to_draw == NO_PIC)
|
||||
cPict::drawAt(mainPtr, face_rect, i, get_monst_pictype(store_monst_type), false);
|
||||
else cPict::drawAt(mainPtr, face_rect, face_to_draw, PIC_TALK, false);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,8 @@ void cMonster::append(legacy::monster_record_type& old){
|
||||
default_attitude = old.default_attitude;
|
||||
summon_type = old.summon_type;
|
||||
default_facial_pic = old.default_facial_pic;
|
||||
if(default_facial_pic == 0)
|
||||
default_facial_pic = NO_PIC;
|
||||
picture_num = old.picture_num;
|
||||
if(picture_num == 122) picture_num = 119;
|
||||
see_spec = -1;
|
||||
@@ -443,6 +445,8 @@ void cTownperson::append(legacy::creature_start_type old){
|
||||
personality = old.personality;
|
||||
special_on_kill = old.special_on_kill;
|
||||
facial_pic = old.facial_pic;
|
||||
if(facial_pic == 0)
|
||||
facial_pic = NO_PIC;
|
||||
}
|
||||
|
||||
void cCreature::append(legacy::creature_data_type old){
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
extern sf::Texture bg_gworld;
|
||||
extern cCustomGraphics spec_scen_g;
|
||||
const pic_num_t cPict::BLANK = std::numeric_limits<pic_num_t>::max();
|
||||
const pic_num_t cPict::BLANK = -1;
|
||||
|
||||
void cPict::init(){
|
||||
drawPict()[PIC_TER] = &cPict::drawPresetTer;
|
||||
@@ -716,7 +716,6 @@ void cPict::drawPresetDlogLg(short num, rectangle to_rect){
|
||||
}
|
||||
|
||||
void cPict::drawPresetTalk(short num, rectangle to_rect){
|
||||
num--;
|
||||
to_rect.right = to_rect.left + 32;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
std::shared_ptr<sf::Texture> from_gw = getSheet(SHEET_TALK);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/// @file
|
||||
/// Constants to specify the type of an icon
|
||||
|
||||
typedef unsigned short pic_num_t; ///< An icon's unique number
|
||||
typedef signed short pic_num_t; ///< An icon's unique number
|
||||
|
||||
/// Specifies an icon type.
|
||||
enum ePicType {
|
||||
|
||||
@@ -466,6 +466,7 @@ static void put_monst_info_in_dlog(cDialog& me, cMonster& store_monst, mon_num_t
|
||||
}
|
||||
dynamic_cast<cPict&>(me["icon"]).setPict(store_monst.picture_num,type_g);
|
||||
}
|
||||
dynamic_cast<cPict&>(me["talkpic"]).setPict(store_monst.default_facial_pic, PIC_TALK);
|
||||
me["num"].setTextToNum(which_monst);
|
||||
me["name"].setText(store_monst.m_name);
|
||||
me["pic"].setTextToNum(store_monst.picture_num);
|
||||
@@ -487,7 +488,7 @@ static void put_monst_info_in_dlog(cDialog& me, cMonster& store_monst, mon_num_t
|
||||
me["sides2"].setTextToNum(store_monst.a[1].sides);
|
||||
me["dice3"].setTextToNum(store_monst.a[2].dice);
|
||||
me["sides3"].setTextToNum(store_monst.a[2].sides);
|
||||
me["talk"].setTextToNum(store_monst.default_facial_pic);
|
||||
me["talk"].setTextToNum(short(store_monst.default_facial_pic));
|
||||
me["treas"].setTextToNum(store_monst.treasure);
|
||||
|
||||
cLedGroup& attitude = dynamic_cast<cLedGroup&>(me["attitude"]);
|
||||
@@ -668,7 +669,7 @@ short edit_monst_type(short which_monst) {
|
||||
|
||||
cDialog monst_dlg("edit-monster");
|
||||
monst_dlg["pickicon"].attachClickHandler(std::bind(pick_monst_picture,_1));
|
||||
monst_dlg["picktalk"].attachClickHandler(std::bind(pick_picture,PIC_TALK,_1,"talk",""));
|
||||
monst_dlg["picktalk"].attachClickHandler(std::bind(pick_picture,PIC_TALK,_1,"talk","talkpic"));
|
||||
monst_dlg["cancel"].attachClickHandler(std::bind(&cDialog::toast, &monst_dlg, false));
|
||||
monst_dlg["pic"].attachFocusHandler(std::bind(check_monst_pic, _1, _2, _3, std::ref(store_monst)));
|
||||
monst_dlg["level"].attachFocusHandler(std::bind(check_range, _1, _2, _3, 0, 40, "level"));
|
||||
|
||||
@@ -268,6 +268,13 @@ short choose_text(eStrType list, unsigned short cur_choice, cDialog* parent, con
|
||||
case STRT_SUMMON:
|
||||
strings = {"0 - no summon (weak)", "1 - weak summoning", "2 - summoning", "3 - major summoning", "4 - no summon (unique/powerful"};
|
||||
break;
|
||||
case STRT_TALK:
|
||||
for(cTown* town : scenario.towns) {
|
||||
for(cPersonality who : town->talking.people) {
|
||||
strings.push_back(who.title + " (in " + town->town_name + ")");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(cur_choice < 0 || cur_choice >= strings.size())
|
||||
cur_choice = -1;
|
||||
|
||||
@@ -10,7 +10,7 @@ enum eStrType {
|
||||
STRT_PICT, STRT_SND, STRT_CMP, STRT_ACCUM, STRT_TRAP,
|
||||
STRT_ATTITUDE, STRT_STAIR, STRT_LIGHT, STRT_CONTEXT,
|
||||
STRT_SHOP, STRT_COST_ADJ, STRT_STAIR_MODE, STRT_TALK_NODE,
|
||||
STRT_STATUS, STRT_SPELL_PAT, STRT_SUMMON,
|
||||
STRT_STATUS, STRT_SPELL_PAT, STRT_SUMMON, STRT_TALK,
|
||||
};
|
||||
|
||||
bool cre(short val,short min,short max,std::string text1,std::string text2,cDialog* parent) ;
|
||||
|
||||
@@ -33,11 +33,11 @@ extern location cur_out;
|
||||
cTownperson store_placed_monst,store_placed_monst2;
|
||||
short store_which_placed_monst;
|
||||
|
||||
const char *day_str_1[] = {"Unused","Day creature appears","Day creature disappears","",
|
||||
"Unused","Unused","Unused","Unused","Unused"};
|
||||
const char *day_str_2[] = {"Unused","Event code (0 - no event)","Event code (0 - no event)","",
|
||||
const char *day_str_1[] = {"Unused","Day creature appears","Day creature disappears",
|
||||
"Unused","Unused","Unused","Unused","Unused","Unused"};
|
||||
const char *day_str_2[] = {"Unused","Event code (0 - no event)","Event code (0 - no event)",
|
||||
"Unused","Unused","Unused",
|
||||
"Event code (0 - no event)","Event code (0 - no event)"};
|
||||
"Event code (0 - no event)","Event code (0 - no event)","Unused"};
|
||||
|
||||
static void put_placed_monst_in_dlog(cDialog& me) {
|
||||
me["num"].setTextToNum(store_which_placed_monst);
|
||||
@@ -48,21 +48,18 @@ static void put_placed_monst_in_dlog(cDialog& me) {
|
||||
me["talk"].setTextToNum(store_placed_monst.personality);
|
||||
me["picnum"].setTextToNum(store_placed_monst.facial_pic);
|
||||
// TODO: Use -1 instead of 0 for "no pic", since 0 is a valid talking picture
|
||||
if((store_placed_monst.facial_pic < 1))
|
||||
dynamic_cast<cPict&>(me["pic"]).setPict(-1);
|
||||
if(short(store_placed_monst.facial_pic) < 0)
|
||||
dynamic_cast<cPict&>(me["pic"]).setPict(scenario.scen_monsters[store_placed_monst.number].picture_num, PIC_MONST);
|
||||
else if((store_placed_monst.facial_pic >= 1000))
|
||||
dynamic_cast<cPict&>(me["pic"]).setPict(store_placed_monst.facial_pic - 1000,PIC_CUSTOM_TALK);
|
||||
else dynamic_cast<cPict&>(me["pic"]).setPict(store_placed_monst.facial_pic,PIC_TALK);
|
||||
}
|
||||
|
||||
static bool get_placed_monst_in_dlog(cDialog& me) {
|
||||
static void get_placed_monst_in_dlog(cDialog& me) {
|
||||
store_placed_monst.start_attitude = dynamic_cast<cLedGroup&>(me["attitude"]).getSelected()[3] - '1';
|
||||
store_placed_monst.mobility = dynamic_cast<cLedGroup&>(me["mobility"]).getSelected()[3] - '1';
|
||||
store_placed_monst.personality = me["talk"].getTextAsNum();
|
||||
store_placed_monst.facial_pic = me["picnum"].getTextAsNum();
|
||||
// later
|
||||
town->creatures[store_which_placed_monst] = store_placed_monst;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool edit_placed_monst_event_filter(cDialog& me, std::string item_hit, eKeyMod) {
|
||||
@@ -70,25 +67,31 @@ static bool edit_placed_monst_event_filter(cDialog& me, std::string item_hit, eK
|
||||
cTownperson store_m;
|
||||
|
||||
if(item_hit == "okay") {
|
||||
if(!get_placed_monst_in_dlog(me)) return true;
|
||||
me.toast(true);
|
||||
if(!me.toast(true)) return true;
|
||||
get_placed_monst_in_dlog(me);
|
||||
town->creatures[store_which_placed_monst] = store_placed_monst;
|
||||
} else if(item_hit == "cancel") {
|
||||
me.toast(false);
|
||||
} else if(item_hit == "del") {
|
||||
me.toast(false);
|
||||
town->creatures[store_which_placed_monst].number = 0;
|
||||
} else if(item_hit == "type-edit") {
|
||||
if(!get_placed_monst_in_dlog(me)) return true;
|
||||
get_placed_monst_in_dlog(me);
|
||||
i = choose_text(STRT_MONST,store_placed_monst.number,&me,"Choose Which Monster:");
|
||||
if(i >= 0) {
|
||||
store_placed_monst.number = i;
|
||||
put_placed_monst_in_dlog(me);
|
||||
}
|
||||
} else if(item_hit == "pict-edit") {
|
||||
if(!get_placed_monst_in_dlog(me)) return true;
|
||||
get_placed_monst_in_dlog(me);
|
||||
i = choose_graphic(store_placed_monst.facial_pic,PIC_TALK,&me);
|
||||
if(i >= 0) {
|
||||
// TODO: Use -1 instead of 0 for "no pic"
|
||||
store_placed_monst.facial_pic = i + 1;
|
||||
}
|
||||
else return true;
|
||||
store_placed_monst.facial_pic = i;
|
||||
put_placed_monst_in_dlog(me);
|
||||
} else if(item_hit == "talk-edit") {
|
||||
get_placed_monst_in_dlog(me);
|
||||
i = choose_text(STRT_TALK, store_placed_monst.personality, &me, "Which personality?");
|
||||
if(i >= 0)
|
||||
store_placed_monst.personality = i;
|
||||
put_placed_monst_in_dlog(me);
|
||||
} else if(item_hit == "more") { //advanced
|
||||
store_m = edit_placed_monst_adv(store_placed_monst, me);
|
||||
@@ -103,7 +106,7 @@ void edit_placed_monst(short which_m) {
|
||||
store_which_placed_monst = which_m;
|
||||
|
||||
cDialog edit("edit-townperson");
|
||||
edit.attachClickHandlers(edit_placed_monst_event_filter, {"type-edit", "pict-edit", "okay", "cancel", "more"});
|
||||
edit.attachClickHandlers(edit_placed_monst_event_filter, {"type-edit", "pict-edit", "talk-edit", "okay", "cancel", "more", "del"});
|
||||
|
||||
put_placed_monst_in_dlog(edit);
|
||||
|
||||
@@ -111,7 +114,6 @@ void edit_placed_monst(short which_m) {
|
||||
}
|
||||
|
||||
static void put_placed_monst_adv_in_dlog(cDialog& me) {
|
||||
|
||||
me["num"].setTextToNum(store_which_placed_monst);
|
||||
me["type"].setText(scenario.scen_monsters[store_placed_monst2.number].m_name);
|
||||
int iTime = 0;
|
||||
@@ -131,8 +133,7 @@ static void put_placed_monst_adv_in_dlog(cDialog& me) {
|
||||
me["extra2-lbl"].setText(day_str_2[iTime]);
|
||||
me["extra1"].setTextToNum(store_placed_monst2.monster_time);
|
||||
me["extra2"].setTextToNum(store_placed_monst2.time_code);
|
||||
// TODO: Why on earth is this an LED group? Just use a text field!
|
||||
dynamic_cast<cLedGroup&>(me["group"]).setSelected("group" + std::to_string(store_placed_monst2.spec_enc_code));
|
||||
me["group"].setTextToNum(store_placed_monst2.spec_enc_code);
|
||||
me["death"].setTextToNum(store_placed_monst2.special_on_kill);
|
||||
me["sdfx"].setTextToNum(store_placed_monst2.spec1);
|
||||
me["sdfy"].setTextToNum(store_placed_monst2.spec2);
|
||||
@@ -161,9 +162,7 @@ static bool get_placed_monst_adv_in_dlog(cDialog& me) {
|
||||
store_placed_monst2.spec2 = me["sdfy"].getTextAsNum();
|
||||
if(cre(store_placed_monst2.spec2,-1,9,"Second part of special flag must be -1 (if this is to be ignored) or from 0 to 9.","",&me)) return false;
|
||||
|
||||
std::string group = dynamic_cast<cLedGroup&>(me["group"]).getSelected();
|
||||
if(group == "group10") store_placed_monst2.spec_enc_code = 10;
|
||||
else store_placed_monst2.spec_enc_code = group[5] - '0';
|
||||
store_placed_monst2.spec_enc_code = me["group"].getTextAsNum();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,14 +177,28 @@ static bool edit_placed_monst_adv_event_filter(cDialog& me, std::string item_hit
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool edit_placed_monst_adv_time_flag(cDialog& me, std::string id, bool losingFocus) {
|
||||
static bool edit_placed_monst_adv_time_flag(cDialog& me, std::string, bool losingFocus) {
|
||||
if(losingFocus) return true;
|
||||
|
||||
if(id.substr(0,4) == "time") {
|
||||
int item_hit = id[4] - '1';
|
||||
me["extra1-lbl"].setText(day_str_1[item_hit]);
|
||||
me["extra2-lbl"].setText(day_str_2[item_hit]);
|
||||
cLedGroup& time = dynamic_cast<cLedGroup&>(me["time"]);
|
||||
int item_hit = time.getSelected()[4] - '1';
|
||||
me["extra1-lbl"].setText(day_str_1[item_hit]);
|
||||
me["extra2-lbl"].setText(day_str_2[item_hit]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool edit_placed_monst_adv_death(cDialog& me, std::string, eKeyMod) {
|
||||
short spec = store_placed_monst2.special_on_kill;
|
||||
if(spec < 0) {
|
||||
spec = get_fresh_spec(2);
|
||||
if(spec < 0) {
|
||||
giveError("You can't create a new town special encounter because there are no more free special nodes.",
|
||||
"To free a special node, set its type to No Special and set its Jump To special to -1.", &me);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(edit_spec_enc(spec,2,&me))
|
||||
me["death"].setTextToNum(spec);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -195,6 +208,7 @@ cTownperson edit_placed_monst_adv(cTownperson monst_record, cDialog& parent) {
|
||||
cDialog edit("edit-townperson-advanced", &parent);
|
||||
edit["okay"].attachClickHandler(edit_placed_monst_adv_event_filter);
|
||||
edit["cancel"].attachClickHandler(edit_placed_monst_adv_event_filter);
|
||||
edit["editdeath"].attachClickHandler(edit_placed_monst_adv_death);
|
||||
edit["time"].attachFocusHandler(edit_placed_monst_adv_time_flag);
|
||||
|
||||
put_placed_monst_adv_in_dlog(edit);
|
||||
|
||||
@@ -58,8 +58,7 @@ public:
|
||||
rectangle getEnclosingRect();
|
||||
};
|
||||
|
||||
// TODO: Okay, is this really needed? Also this value also means "blank pic" in the dialog engine.
|
||||
static const pic_num_t NO_PIC = std::numeric_limits<pic_num_t>::max();
|
||||
static const pic_num_t NO_PIC = -1;
|
||||
using graf_pos = std::pair<sf::Texture*,rectangle>;
|
||||
using graf_pos_ref = std::pair<sf::Texture*&,rectangle&>;
|
||||
using hilite_t = std::pair<size_t,size_t>;
|
||||
|
||||
Reference in New Issue
Block a user