set outdoor wandering encounter locations individually
This commit is contained in:
@@ -17,8 +17,9 @@
|
||||
<text name='ally1' framed='true' top='303' left='129' width='145' height='14'/>
|
||||
<text name='ally2' framed='true' top='327' left='129' width='145' height='14'/>
|
||||
<text name='ally3' framed='true' top='351' left='129' width='145' height='14'/>
|
||||
<button name='left' type='left' def-key='left' top='370' left='11'/>
|
||||
<button name='right' type='right' def-key='right' top='370' left='74'/>
|
||||
<text name='location' framed='true' top='380' left='129' width='145' height='14'/>
|
||||
<button name='left' type='left' def-key='left' top='400' left='11'/>
|
||||
<button name='right' type='right' def-key='right' top='400' left='74'/>
|
||||
<button name='choose-foe1' type='regular' top='130' left='280'>Choose</button>
|
||||
<button name='choose-foe2' type='regular' top='154' left='280'>Choose</button>
|
||||
<button name='choose-foe3' type='regular' top='178' left='280'>Choose</button>
|
||||
@@ -29,6 +30,7 @@
|
||||
<button name='choose-ally1' type='regular' top='298' left='280'>Choose</button>
|
||||
<button name='choose-ally2' type='regular' top='322' left='280'>Choose</button>
|
||||
<button name='choose-ally3' type='regular' top='346' left='280'>Choose</button>
|
||||
<button name='choose-location' type='regular' top='375' left='280'>Choose</button>
|
||||
<button name='edit-meet' type='large' top='186' left='412'>Create/Edit</button>
|
||||
<button name='edit-win' type='large' top='229' left='412'>Create/Edit</button>
|
||||
<button name='edit-flee' type='large' top='271' left='412'>Create/Edit</button>
|
||||
@@ -43,6 +45,7 @@
|
||||
<text top='303' left='11' width='113' height='14'>Friendly (7-10)</text>
|
||||
<text top='327' left='11' width='113' height='14'>Friendly (2-4)</text>
|
||||
<text top='351' left='11' width='113' height='14'>Friendly (1)</text>
|
||||
<text name='loc-label' size='large' top='380' left='11' width='113' height='14'>Location</text>
|
||||
<text top='97' left='50' width='127' height='14'>Encounter number:</text>
|
||||
<text name='num' top='97' left='180' width='35' height='14'/>
|
||||
<pict type='dlog' num='16' top='8' left='8'/>
|
||||
@@ -68,6 +71,6 @@
|
||||
<text top='299' left='352' width='103' height='33'>Stuff done flag to eliminate encounter</text>
|
||||
|
||||
<!-- OK button -->
|
||||
<button name='okay' type='regular' top='370' left='489'>OK</button>
|
||||
<button name='cancel' type='regular' top='370' left='423'>Cancel</button>
|
||||
<button name='okay' type='regular' top='400' left='489'>OK</button>
|
||||
<button name='cancel' type='regular' top='400' left='423'>Cancel</button>
|
||||
</dialog>
|
||||
|
||||
@@ -77,7 +77,7 @@ extern short right_button_hovered;
|
||||
|
||||
ePalBtn out_buttons[6][10] = {
|
||||
{PAL_PENCIL, PAL_BRUSH_LG, PAL_BRUSH_SM, PAL_SPRAY_LG, PAL_SPRAY_SM, PAL_ERASER, PAL_RECT_HOLLOW, PAL_RECT_FILLED, PAL_BUCKET, PAL_DROPPER},
|
||||
{PAL_EDIT_TOWN, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_EDIT_SIGN, PAL_TEXT_AREA, PAL_WANDER, PAL_START, PAL_ZOOM},
|
||||
{PAL_EDIT_TOWN, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_EDIT_SIGN, PAL_TEXT_AREA, PAL_BLANK, PAL_START, PAL_ZOOM},
|
||||
{PAL_SPEC, PAL_COPY_SPEC, PAL_ERASE_SPEC, PAL_EDIT_SPEC, PAL_SPEC_SPOT, PAL_BOAT, PAL_HORSE, PAL_COPY_TER, PAL_CHANGE, PAL_PASTE},
|
||||
{PAL_ROAD, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK},
|
||||
{PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK},
|
||||
|
||||
@@ -634,6 +634,7 @@ static void put_out_wand_in_dlog(cDialog& me, short which, const cOutdoors::cWan
|
||||
me["onflee"].setTextToNum(wand.spec_on_flee);
|
||||
me["endy"].setTextToNum(wand.end_spec1);
|
||||
me["endx"].setTextToNum(wand.end_spec2);
|
||||
me["location"].setText(boost::lexical_cast<std::string>(current_terrain->wandering_locs[which]));
|
||||
}
|
||||
|
||||
static void save_out_wand(cDialog& me, short which, cOutdoors::cWandering& wand, short mode) {
|
||||
@@ -649,6 +650,7 @@ static void save_out_wand(cDialog& me, short which, cOutdoors::cWandering& wand,
|
||||
switch(mode) {
|
||||
case 0:
|
||||
current_terrain->wandering[which] = wand;
|
||||
current_terrain->wandering_locs[which] = boost::lexical_cast<location>(me["location"].getText());
|
||||
break;
|
||||
case 1:
|
||||
current_terrain->special_enc[which] = wand;
|
||||
@@ -729,9 +731,19 @@ void edit_out_wand(short mode) {
|
||||
me["endy"].setTextToNum(sdf.y);
|
||||
return true;
|
||||
});
|
||||
wand_dlg["choose-location"].attachClickHandler([&which](cDialog& me, std::string, eKeyMod) {
|
||||
location current = boost::lexical_cast<location>(me["location"].getText());
|
||||
current = cLocationPicker(current, *town, "Choose wandering encounter " + std::to_string(which) + " location", &me).run();
|
||||
me["location"].setText(boost::lexical_cast<std::string>(current));
|
||||
return true;
|
||||
});
|
||||
|
||||
if(mode == 1)
|
||||
if(mode == 1){
|
||||
wand_dlg["title"].setText("Outdoor Special Encounter:");
|
||||
wand_dlg["loc-label"].hide();
|
||||
wand_dlg["location"].hide();
|
||||
wand_dlg["choose-location"].hide();
|
||||
}
|
||||
|
||||
put_out_wand_in_dlog(wand_dlg, which, wand);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user