Rework the scenario editor toolbars.
* The rightmost column is now mostly dedicated to non-modifying operations – eyedropper and zoom are moved there, pushing the 3 palette buttons down in town mode. * Set Starting Location and Set Town Boundaries moved from the menus into the toolbar. * Place Same Creature and Place Same Monster removed, since placing a monster or creature no longer resets the mode, so you can place as many of the same one as you like. * Erase Town Entrance removed – what is it even good for? Removing the entrance without removing the town terrain is nonsensical. A town entrance can now be erased just by painting over it. * Copy Item, Copy Monster, and Copy Terrain added. The latter copies a rectangle of terrain. * Paste Special is removed. Instead there's a generic Paste button which pastes whatever type of thing you copied last, whether it be a special, a monster, an item, or even some terrain. * Horse and boat no longer share a row with road. Instead, some of the fields have been reshuffled, so now fields take up three rows (though not three complete rows)
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 5.0 KiB |
@@ -122,12 +122,10 @@ BEGIN
|
||||
BEGIN
|
||||
MENUITEM "Town &Details\tCtrl+D", IDM_TOWN_DETAILS
|
||||
MENUITEM "Town &Wandering Monsters", IDM_TOWN_WANDER
|
||||
MENUITEM "Set Town &Boundaries", IDM_TOWN_BOUNDS
|
||||
MENUITEM "&Frill Up Terrain", IDM_TOWN_FRILL
|
||||
MENUITEM "&Remove Terrain Frills", IDM_TOWN_UNFRILL
|
||||
MENUITEM "Edit &Area Descriptions", IDM_TOWN_AREAS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Set Starting &Location", IDM_SCEN_START
|
||||
MENUITEM "Add Rand&om Items", IDM_TOWN_RANDOM_ITEMS
|
||||
MENUITEM "Set All Items Not Propert&y", IDM_TOWN_NOT_PROPERTY
|
||||
MENUITEM "Clear All &Items", IDM_TOWN_CLEAR_ITEMS
|
||||
@@ -149,8 +147,6 @@ BEGIN
|
||||
MENUITEM "&Remove Terrain Frills", IDM_OUT_UNFRILL
|
||||
MENUITEM "Edit &Area Descriptions", IDM_OUT_AREAS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Set Starting &Location", IDM_OUT_START
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Advanced:", IDM_GRAYED_LABEL, GRAYED
|
||||
MENUITEM " Edit Special &Nodes\tCtrl+7", IDM_OUT_ADV_SPECIALS
|
||||
MENUITEM " Edit Outdoor &Text\tCtrl+8", IDM_OUT_ADV_TEXT
|
||||
|
@@ -587,14 +587,6 @@
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="787350">
|
||||
<reference key="NSMenu" ref="61689393"/>
|
||||
<string key="NSTitle">Set Town Boundaries</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="562756354">
|
||||
<reference key="NSMenu" ref="61689393"/>
|
||||
<string key="NSTitle">Frill Up Terrain</string>
|
||||
@@ -629,14 +621,6 @@
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="646438288">
|
||||
<reference key="NSMenu" ref="61689393"/>
|
||||
<string key="NSTitle">Set Starting Location</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="1038227897">
|
||||
<reference key="NSMenu" ref="61689393"/>
|
||||
<string key="NSTitle">Add Random Items</string>
|
||||
@@ -783,24 +767,6 @@
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="176104287">
|
||||
<reference key="NSMenu" ref="784697102"/>
|
||||
<bool key="NSIsDisabled">YES</bool>
|
||||
<bool key="NSIsSeparator">YES</bool>
|
||||
<string key="NSTitle"/>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="739405725">
|
||||
<reference key="NSMenu" ref="784697102"/>
|
||||
<string key="NSTitle">Set Starting Location</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="229763992"/>
|
||||
<reference key="NSMixedImage" ref="909111550"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="910633781">
|
||||
<reference key="NSMenu" ref="784697102"/>
|
||||
<bool key="NSIsDisabled">YES</bool>
|
||||
@@ -1326,7 +1292,6 @@
|
||||
<reference ref="795424393"/>
|
||||
<reference ref="562756354"/>
|
||||
<reference ref="665547983"/>
|
||||
<reference ref="787350"/>
|
||||
<reference ref="1071553007"/>
|
||||
<reference ref="861242611"/>
|
||||
<reference ref="1038227897"/>
|
||||
@@ -1338,7 +1303,6 @@
|
||||
<reference ref="654574897"/>
|
||||
<reference ref="156465632"/>
|
||||
<reference ref="2020849"/>
|
||||
<reference ref="646438288"/>
|
||||
</array>
|
||||
<reference key="parent" ref="12009264"/>
|
||||
</object>
|
||||
@@ -1365,8 +1329,6 @@
|
||||
<reference ref="461847598"/>
|
||||
<reference ref="102319515"/>
|
||||
<reference ref="31942883"/>
|
||||
<reference ref="176104287"/>
|
||||
<reference ref="739405725"/>
|
||||
<reference ref="910633781"/>
|
||||
<reference ref="976110066"/>
|
||||
<reference ref="913717399"/>
|
||||
@@ -1475,11 +1437,6 @@
|
||||
<reference key="object" ref="665547983"/>
|
||||
<reference key="parent" ref="61689393"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">828</int>
|
||||
<reference key="object" ref="787350"/>
|
||||
<reference key="parent" ref="61689393"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">829</int>
|
||||
<reference key="object" ref="1071553007"/>
|
||||
@@ -1555,16 +1512,6 @@
|
||||
<reference key="object" ref="31942883"/>
|
||||
<reference key="parent" ref="784697102"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">844</int>
|
||||
<reference key="object" ref="176104287"/>
|
||||
<reference key="parent" ref="784697102"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">845</int>
|
||||
<reference key="object" ref="739405725"/>
|
||||
<reference key="parent" ref="784697102"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">846</int>
|
||||
<reference key="object" ref="910633781"/>
|
||||
@@ -1665,11 +1612,6 @@
|
||||
<reference key="object" ref="327378958"/>
|
||||
<reference key="parent" ref="399390342"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">805</int>
|
||||
<reference key="object" ref="646438288"/>
|
||||
<reference key="parent" ref="61689393"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
|
@@ -11,12 +11,10 @@
|
||||
#define IDM_FILE_QUIT 106
|
||||
#define IDM_SCEN_NEW_TOWN 107
|
||||
#define IDM_SCEN_DETAILS 108
|
||||
#define IDM_SCEN_START 109
|
||||
#define IDM_SCEN_ADV_SPECIALS 110
|
||||
#define IDM_SCEN_ADV_TEXT 111
|
||||
#define IDM_SCEN_ADV_JOURNAL 112
|
||||
#define IDM_SCEN_ADV_IMPORT_TOWN 113
|
||||
#define IDM_SCEN_ADV_SAVE_RECTS 114
|
||||
#define IDM_SCEN_ADV_HORSES 115
|
||||
#define IDM_SCEN_ADV_BOATS 116
|
||||
#define IDM_SCEN_ADV_TOWN_VARY 117
|
||||
@@ -29,7 +27,6 @@
|
||||
#define IDM_SCEN_PASSWORD 124
|
||||
#define IDM_TOWN_DETAILS 125
|
||||
#define IDM_TOWN_WANDER 126
|
||||
#define IDM_TOWN_BOUNDS 127
|
||||
#define IDM_TOWN_FRILL 128
|
||||
#define IDM_TOWN_UNFRILL 129
|
||||
#define IDM_TOWN_AREAS 130
|
||||
@@ -48,7 +45,6 @@
|
||||
#define IDM_OUT_FRILL 143
|
||||
#define IDM_OUT_UNFRILL 144
|
||||
#define IDM_OUT_AREAS 145
|
||||
#define IDM_OUT_START 146
|
||||
#define IDM_OUT_ADV_SPECIALS 147
|
||||
#define IDM_OUT_ADV_TEXT 148
|
||||
#define IDM_OUT_ADV_SIGNS 149
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/variant.hpp>
|
||||
#include "scen.global.hpp"
|
||||
#include "scenario/scenario.hpp"
|
||||
#include "gfx/render_shapes.hpp"
|
||||
@@ -43,11 +44,8 @@ short current_block_edited = 0;
|
||||
short current_terrain_type = 0;
|
||||
short safety = 0;
|
||||
location spot_hit,last_spot_hit(-1,-1),mouse_spot(-1,-1);
|
||||
short copied_spec = -1;
|
||||
cUndoList undo_list;
|
||||
|
||||
cTown::cItem store_place_item;
|
||||
|
||||
short flood_count = 0;
|
||||
|
||||
rectangle terrain_rects[256],terrain_rect_base = {0,0,16,16},command_rects[21];
|
||||
@@ -75,31 +73,36 @@ rectangle palette_buttons[10][6];
|
||||
short current_rs_top = 0;
|
||||
|
||||
ePalBtn out_buttons[6][10] = {
|
||||
{PAL_PENCIL, PAL_BRUSH_LG, PAL_BRUSH_SM, PAL_SPRAY_LG, PAL_SPRAY_SM, PAL_ERASER, PAL_DROPPER, PAL_RECT_HOLLOW, PAL_RECT_FILLED, PAL_BUCKET},
|
||||
{PAL_EDIT_TOWN, PAL_ERASE_TOWN, PAL_BLANK, PAL_BLANK, PAL_EDIT_SIGN, PAL_TEXT_AREA, PAL_WANDER, PAL_CHANGE, PAL_ZOOM, PAL_BLANK},
|
||||
{PAL_SPEC, PAL_COPY_SPEC, PAL_PASTE_SPEC, PAL_ERASE_SPEC, PAL_EDIT_SPEC, PAL_SPEC_SPOT, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK},
|
||||
{PAL_BOAT, PAL_HORSE, PAL_ROAD, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK},
|
||||
{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_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},
|
||||
{PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK, PAL_BLANK},
|
||||
};
|
||||
|
||||
ePalBtn town_buttons[6][10] = {
|
||||
{PAL_PENCIL, PAL_BRUSH_LG, PAL_BRUSH_SM, PAL_SPRAY_LG, PAL_SPRAY_SM, PAL_ERASER, PAL_DROPPER, PAL_RECT_HOLLOW, PAL_RECT_FILLED, PAL_BUCKET},
|
||||
{PAL_ENTER_N, PAL_ENTER_W, PAL_ENTER_S, PAL_ENTER_E, PAL_EDIT_SIGN, PAL_TEXT_AREA, PAL_WANDER, PAL_CHANGE, PAL_ZOOM, PAL_TERRAIN},
|
||||
{PAL_SPEC, PAL_COPY_SPEC, PAL_PASTE_SPEC, PAL_ERASE_SPEC, PAL_EDIT_SPEC, PAL_SPEC_SPOT, PAL_EDIT_ITEM, PAL_SAME_ITEM, PAL_ERASE_ITEM, PAL_ITEM},
|
||||
{PAL_BOAT, PAL_HORSE, PAL_ROAD, PAL_BLANK, PAL_BLANK, PAL_EDIT_STORAGE, PAL_EDIT_MONST, PAL_SAME_MONST, PAL_ERASE_MONST, PAL_MONST},
|
||||
{PAL_WEB, PAL_CRATE, PAL_BARREL, PAL_BLOCK, PAL_FIRE_BARR, PAL_FORCE_BARR, PAL_QUICKFIRE, PAL_FORCECAGE, PAL_ERASE_FIELD, PAL_BLANK},
|
||||
{PAL_SFX_SB, PAL_SFX_MB, PAL_SFX_LB, PAL_SFX_SS, PAL_SFX_LS, PAL_SFX_ASH, PAL_SFX_BONE, PAL_SFX_ROCK, PAL_BLANK, PAL_BLANK},
|
||||
{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_ENTER_N, PAL_ENTER_W, PAL_ENTER_S, PAL_ENTER_E, PAL_TOWN_BORDER, PAL_EDIT_SIGN, PAL_TEXT_AREA, PAL_WANDER, 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_TERRAIN},
|
||||
{PAL_ROAD, PAL_WEB, PAL_CRATE, PAL_BARREL, PAL_BLOCK, PAL_EDIT_STORAGE, PAL_EDIT_ITEM, PAL_COPY_ITEM, PAL_ERASE_ITEM, PAL_ITEM},
|
||||
{PAL_FIRE_BARR, PAL_FORCE_BARR, PAL_QUICKFIRE, PAL_FORCECAGE, PAL_BLANK, PAL_PASTE, PAL_EDIT_MONST, PAL_COPY_MONST, PAL_ERASE_MONST, PAL_MONST},
|
||||
{PAL_SFX_SB, PAL_SFX_MB, PAL_SFX_LB, PAL_SFX_SS, PAL_SFX_LS, PAL_SFX_ASH, PAL_SFX_BONE, PAL_SFX_ROCK, PAL_ERASE_FIELD, PAL_BLANK},
|
||||
};
|
||||
|
||||
cTownperson last_placed_monst;
|
||||
|
||||
rectangle working_rect;
|
||||
location last_space_hit;
|
||||
bool erasing_mode;
|
||||
ter_num_t current_ground = 0;
|
||||
location last_placement{-1,-1};
|
||||
|
||||
short special_to_paste = -1;
|
||||
boost::variant<
|
||||
boost::none_t,
|
||||
std::pair<long /* special */, bool /* town */>,
|
||||
cTownperson /* monst */,
|
||||
cTown::cItem /* item */,
|
||||
vector2d<ter_num_t> /* terrain */
|
||||
> clipboard = boost::none;
|
||||
|
||||
bool monst_on_space(location loc,short m_num);
|
||||
static bool terrain_matches(unsigned char x, unsigned char y, ter_num_t ter);
|
||||
@@ -152,11 +155,11 @@ static cursor_type get_edit_cursor() {
|
||||
|
||||
case MODE_ROOM_RECT: case MODE_SET_TOWN_RECT:
|
||||
case MODE_HOLLOW_RECT: case MODE_FILLED_RECT:
|
||||
case MODE_STORAGE_RECT:
|
||||
case MODE_STORAGE_RECT: case MODE_COPY_TERRAIN:
|
||||
return mode_count == 2 ? topleft_curs : bottomright_curs;
|
||||
|
||||
case MODE_ERASE_CREATURE: case MODE_ERASE_ITEM:
|
||||
case MODE_ERASE_SPECIAL: case MODE_ERASE_TOWN_ENTRANCE:
|
||||
case MODE_ERASE_SPECIAL:
|
||||
|
||||
case MODE_ERASER: case MODE_CLEAR_FIELDS:
|
||||
return eraser_curs;
|
||||
@@ -165,8 +168,8 @@ static cursor_type get_edit_cursor() {
|
||||
case MODE_EDIT_SPECIAL: case MODE_EDIT_TOWN_ENTRANCE:
|
||||
case MODE_EDIT_SIGN:
|
||||
|
||||
case MODE_PLACE_SAME_CREATURE: case MODE_PLACE_SAME_ITEM:
|
||||
case MODE_COPY_SPECIAL: case MODE_PASTE_SPECIAL:
|
||||
case MODE_COPY_SPECIAL: case MODE_COPY_ITEM:
|
||||
case MODE_COPY_CREATURE: case MODE_PASTE:
|
||||
|
||||
case MODE_PLACE_EAST_ENTRANCE: case MODE_PLACE_NORTH_ENTRANCE:
|
||||
case MODE_PLACE_SOUTH_ENTRANCE: case MODE_PLACE_WEST_ENTRANCE:
|
||||
@@ -718,21 +721,27 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
if(!cur_area->is_on_map(spot_hit)) ;
|
||||
else switch(overall_mode) {
|
||||
case MODE_DRAWING:
|
||||
if((!mouse_button_held && terrain_matches(spot_hit.x,spot_hit.y,current_terrain_type)) ||
|
||||
(mouse_button_held && erasing_mode)) {
|
||||
set_terrain(spot_hit,current_ground);
|
||||
erasing_mode = true;
|
||||
if(!mouse_button_held) {
|
||||
erasing_mode = terrain_matches(spot_hit.x, spot_hit.y, current_terrain_type);
|
||||
mouse_button_held = true;
|
||||
}
|
||||
else {
|
||||
mouse_button_held = true;
|
||||
set_terrain(spot_hit,current_terrain_type);
|
||||
erasing_mode = false;
|
||||
if(!editing_town) {
|
||||
// Implicitly erase town entrances when a space is set from a town terrain to a non-town terrain
|
||||
const cTerrain& paint_ter = scenario.ter_types[current_terrain_type];
|
||||
const cTerrain& erase_ter = scenario.ter_types[current_ground];
|
||||
const cTerrain& cur_ter = scenario.ter_types[cur_area->terrain(spot_hit.x, spot_hit.y)];
|
||||
if(cur_ter.special == eTerSpec::TOWN_ENTRANCE && (erasing_mode ? erase_ter : paint_ter).special != eTerSpec::TOWN_ENTRANCE)
|
||||
for(short i = current_terrain->city_locs.size() - 1; i >= 0; i--) {
|
||||
if(current_terrain->city_locs[i] == spot_hit)
|
||||
current_terrain->city_locs.erase(current_terrain->city_locs.begin() + i);
|
||||
}
|
||||
}
|
||||
if(erasing_mode) set_terrain(spot_hit,current_ground);
|
||||
else set_terrain(spot_hit,current_terrain_type);
|
||||
break;
|
||||
|
||||
case MODE_ROOM_RECT: case MODE_SET_TOWN_RECT: case MODE_HOLLOW_RECT: case MODE_FILLED_RECT:
|
||||
case MODE_STORAGE_RECT:
|
||||
case MODE_STORAGE_RECT: case MODE_COPY_TERRAIN:
|
||||
if(mouse_button_held)
|
||||
break;
|
||||
if(mode_count == 2) {
|
||||
@@ -777,6 +786,17 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
scenario.store_item_rects[cur_town] = working_rect;
|
||||
change_made = true;
|
||||
}
|
||||
else if(overall_mode == MODE_COPY_TERRAIN) {
|
||||
vector2d<ter_num_t> copied;
|
||||
copied.resize(working_rect.width() + 1, working_rect.height() + 1);
|
||||
for(int i = 0; i <= working_rect.width(); i++) {
|
||||
for(int j = 0; j <= working_rect.height(); j++) {
|
||||
if(editing_town) copied[i][j] = town->terrain(i + working_rect.left, j + working_rect.top);
|
||||
else copied[i][j] = current_terrain->terrain(i + working_rect.left, j + working_rect.top);
|
||||
}
|
||||
}
|
||||
clipboard = copied;
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_SET_WANDER_POINTS:
|
||||
@@ -834,7 +854,7 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
break;
|
||||
case MODE_PLACE_ITEM:
|
||||
// If we just placed this item there, forget it
|
||||
if(!mouse_button_held || store_place_item.loc != spot_hit) {
|
||||
if(!mouse_button_held || last_placement != spot_hit) {
|
||||
mouse_button_held = true;
|
||||
auto iter = std::find_if(town->preset_items.begin(), town->preset_items.end(), [](const cTown::cItem& item) {
|
||||
return item.code < 0;
|
||||
@@ -842,12 +862,11 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
if(iter != town->preset_items.end()) {
|
||||
*iter = {spot_hit, mode_count, scenario.scen_items[mode_count]};
|
||||
if(container_there(spot_hit)) iter->contained = true;
|
||||
store_place_item = *iter;
|
||||
} else {
|
||||
town->preset_items.push_back({spot_hit, mode_count, scenario.scen_items[mode_count]});
|
||||
if(container_there(spot_hit)) town->preset_items.back().contained = true;
|
||||
store_place_item = town->preset_items.back();
|
||||
}
|
||||
last_placement = spot_hit;
|
||||
}
|
||||
break;
|
||||
case MODE_EDIT_ITEM:
|
||||
@@ -855,41 +874,80 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
if((spot_hit.x == town->preset_items[x].loc.x) &&
|
||||
(spot_hit.y == town->preset_items[x].loc.y) && (town->preset_items[x].code >= 0)) {
|
||||
edit_placed_item(x);
|
||||
store_place_item = town->preset_items[x];
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_PLACE_SAME_CREATURE:
|
||||
if(last_placed_monst.number == 0) {
|
||||
showError("Either no monster has been placed, or the last time you tried to place a monster the operation failed.");
|
||||
} else {
|
||||
case MODE_PASTE:
|
||||
if(auto spec = boost::get<std::pair<long,bool>>(&clipboard)) {
|
||||
if(!editing_town && (spot_hit.x == 0 || spot_hit.x == 47 || spot_hit.y == 0 || spot_hit.y == 47)) {
|
||||
cChoiceDlog("not-at-edge").show();
|
||||
break;
|
||||
} else {
|
||||
auto& specials = cur_area->special_locs;
|
||||
for(short x = 0; x <= specials.size(); x++) {
|
||||
if(x == specials.size())
|
||||
specials.emplace_back(-1,-1,-1);
|
||||
if(specials[x].spec < 0) {
|
||||
specials[x] = spot_hit;
|
||||
specials[x].spec = spec->first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(auto monst = boost::get<cTownperson>(&clipboard)) {
|
||||
if(!editing_town) {
|
||||
set_string("Paste monster","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
auto iter = std::find_if(town->creatures.begin(), town->creatures.end(), [](const cTownperson& who) {
|
||||
return who.number == 0;
|
||||
});
|
||||
if(iter != town->creatures.end()) {
|
||||
*iter = last_placed_monst;
|
||||
*iter = *monst;
|
||||
iter->start_loc = spot_hit;
|
||||
} else { // Placement failed
|
||||
town->creatures.push_back(last_placed_monst);
|
||||
town->creatures.push_back(*monst);
|
||||
town->creatures.back().start_loc = spot_hit;
|
||||
}
|
||||
} else if(auto item = boost::get<cTown::cItem>(&clipboard)) {
|
||||
if(!editing_town) {
|
||||
set_string("Paste item","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
auto iter = std::find_if(town->preset_items.begin(), town->preset_items.end(), [](const cTown::cItem& item) {
|
||||
return item.code < 0;
|
||||
});
|
||||
if(iter != town->preset_items.end()) {
|
||||
*iter = *item;
|
||||
iter->loc = spot_hit;
|
||||
iter->contained = container_there(spot_hit);
|
||||
} else {
|
||||
town->preset_items.push_back(*item);
|
||||
town->preset_items.back().loc = spot_hit;
|
||||
town->preset_items.back().contained = container_there(spot_hit);
|
||||
}
|
||||
} else if(auto patch = boost::get<vector2d<ter_num_t>>(&clipboard)) {
|
||||
for(int x = 0; x < patch->width(); x++)
|
||||
for(int y = 0; y < patch->height(); y++)
|
||||
cur_area->terrain(spot_hit.x + x, spot_hit.y + y) = (*patch)[x][y];
|
||||
} else {
|
||||
showError("Nothing to paste. Try copying something first.");
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_PLACE_CREATURE:
|
||||
// If we just placed this same creature here, forget it
|
||||
if(!mouse_button_held || last_placed_monst.start_loc != spot_hit) {
|
||||
if(!mouse_button_held || last_placement != spot_hit) {
|
||||
mouse_button_held = true;
|
||||
auto iter = std::find_if(town->creatures.begin(), town->creatures.end(), [](const cTownperson& who) {
|
||||
return who.number == 0;
|
||||
});
|
||||
if(iter != town->creatures.end()) {
|
||||
*iter = {spot_hit, static_cast<mon_num_t>(mode_count), scenario.scen_monsters[mode_count]};
|
||||
last_placed_monst = *iter;
|
||||
} else { // Placement failed
|
||||
town->creatures.push_back({spot_hit, static_cast<mon_num_t>(mode_count), scenario.scen_monsters[mode_count]});
|
||||
last_placed_monst = town->creatures.back();
|
||||
}
|
||||
last_placement = spot_hit;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -966,25 +1024,6 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
set_new_terrain(cur_area->terrain(spot_hit.x,spot_hit.y));
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_PLACE_SAME_ITEM:
|
||||
if(store_place_item.code < 0) {
|
||||
showError("Either no item has been placed, or the last time you tried to place an item the operation failed.");
|
||||
} else {
|
||||
auto iter = std::find_if(town->preset_items.begin(), town->preset_items.end(), [](const cTown::cItem& item) {
|
||||
return item.code < 0;
|
||||
});
|
||||
if(iter != town->preset_items.end()) {
|
||||
*iter = store_place_item;
|
||||
iter->loc = spot_hit;
|
||||
iter->contained = container_there(spot_hit);
|
||||
} else {
|
||||
town->preset_items.push_back(store_place_item);
|
||||
town->preset_items.back().loc = spot_hit;
|
||||
town->preset_items.back().contained = container_there(spot_hit);
|
||||
}
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_EDIT_SIGN: //edit sign
|
||||
{
|
||||
auto& signs = cur_area->sign_locs;
|
||||
@@ -1003,7 +1042,6 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
for(short x = 0; x < town->creatures.size(); x++)
|
||||
if(monst_on_space(spot_hit,x)) {
|
||||
edit_placed_monst(x);
|
||||
last_placed_monst = town->creatures[x];
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
@@ -1018,31 +1056,11 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
return loc == spot_hit && loc.spec >= 0;
|
||||
});
|
||||
if(iter != specials.end())
|
||||
copied_spec = iter->spec;
|
||||
clipboard = std::pair<long,bool>{iter->spec, editing_town};
|
||||
else showError("There wasn't a special on that spot.");
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
}
|
||||
case MODE_PASTE_SPECIAL: //paste special
|
||||
if(copied_spec < 0) {
|
||||
showError("You need to select a special to copy first.");
|
||||
} else if(!editing_town && (spot_hit.x == 0 || spot_hit.x == 47 || spot_hit.y == 0 || spot_hit.y == 47)) {
|
||||
cChoiceDlog("not-at-edge").show();
|
||||
break;
|
||||
} else {
|
||||
auto& specials = cur_area->special_locs;
|
||||
for(short x = 0; x <= specials.size(); x++) {
|
||||
if(x == specials.size())
|
||||
specials.emplace_back(-1,-1,-1);
|
||||
if(specials[x].spec < 0) {
|
||||
specials[x] = spot_hit;
|
||||
specials[x].spec = copied_spec;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_ERASE_SPECIAL: //erase special
|
||||
{
|
||||
auto& specials = cur_area->special_locs;
|
||||
@@ -1069,14 +1087,6 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
town_entry(spot_hit);
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_ERASE_TOWN_ENTRANCE:
|
||||
for(short x = current_terrain->city_locs.size() - 1; x >= 0; x--) {
|
||||
if(current_terrain->city_locs[x] == spot_hit)
|
||||
current_terrain->city_locs.erase(current_terrain->city_locs.begin() + x);
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
change_made = true;
|
||||
break;
|
||||
case MODE_SET_OUT_START:
|
||||
if((spot_hit.x != minmax(4,43,spot_hit.x)) || (spot_hit.y != minmax(4,43,spot_hit.y))) {
|
||||
showError("You can't put the starting location this close to the edge of an outdoor section. It has to be at least 4 spaces away.");
|
||||
@@ -1149,6 +1159,22 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
|
||||
case MODE_EDIT_TYPES:
|
||||
case MODE_MAIN_SCREEN:
|
||||
break; // Nothing to do here, of course.
|
||||
case MODE_COPY_CREATURE:
|
||||
for(short x = 0; x < town->creatures.size(); x++)
|
||||
if(monst_on_space(spot_hit,x)) {
|
||||
clipboard = town->creatures[x];
|
||||
break;
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
case MODE_COPY_ITEM:
|
||||
for(short x = 0; x < town->preset_items.size(); x++)
|
||||
if((spot_hit.x == town->preset_items[x].loc.x) && (spot_hit.y == town->preset_items[x].loc.y) && (town->preset_items[x].code >= 0)) {
|
||||
clipboard = town->preset_items[x];
|
||||
break;
|
||||
}
|
||||
overall_mode = MODE_DRAWING;
|
||||
break;
|
||||
}
|
||||
if((overall_mode == MODE_DRAWING) && (old_mode != MODE_DRAWING))
|
||||
set_string("Drawing mode",scenario.ter_types[current_terrain_type].name);
|
||||
@@ -1357,14 +1383,6 @@ static bool handle_toolpal_action(location cur_point2) {
|
||||
set_string("Set town entrance","Select town to edit");
|
||||
overall_mode = MODE_EDIT_TOWN_ENTRANCE;
|
||||
break;
|
||||
case PAL_ERASE_TOWN:
|
||||
if(editing_town) {
|
||||
set_string("Can only erase town entrances outdoors","");
|
||||
break;
|
||||
}
|
||||
set_string("Erase town entrance","Select town to erase");
|
||||
overall_mode = MODE_ERASE_TOWN_ENTRANCE;
|
||||
break;
|
||||
case PAL_EDIT_ITEM:
|
||||
if(!editing_town) {
|
||||
set_string("Edit placed item","Not while outdoors.");
|
||||
@@ -1373,13 +1391,13 @@ static bool handle_toolpal_action(location cur_point2) {
|
||||
set_string("Edit placed item","Select item to edit");
|
||||
overall_mode = MODE_EDIT_ITEM;
|
||||
break;
|
||||
case PAL_SAME_ITEM:
|
||||
case PAL_COPY_ITEM:
|
||||
if(!editing_town) {
|
||||
set_string("Edit placed item","Not while outdoors.");
|
||||
set_string("Copy item","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
set_string("Place same item","Select location");
|
||||
overall_mode = MODE_PLACE_SAME_ITEM;
|
||||
set_string("Copy item","Select item");
|
||||
overall_mode = MODE_COPY_ITEM;
|
||||
break;
|
||||
case PAL_ERASE_ITEM:
|
||||
set_string("Delete an item","Select item");
|
||||
@@ -1393,12 +1411,30 @@ static bool handle_toolpal_action(location cur_point2) {
|
||||
set_string("Copy special","Select special to copy");
|
||||
overall_mode = MODE_COPY_SPECIAL;
|
||||
break;
|
||||
case PAL_PASTE_SPEC:
|
||||
if(special_to_paste < 0) {
|
||||
set_string("Can't paste special","No special to paste");
|
||||
}
|
||||
set_string("Paste special","Select location to paste");
|
||||
overall_mode = MODE_PASTE_SPECIAL;
|
||||
case PAL_PASTE:
|
||||
if(auto spec = boost::get<std::pair<long,bool>>(&clipboard))
|
||||
if(editing_town == spec->second) set_string("Paste special","Select location to paste");
|
||||
else {
|
||||
if(editing_town) set_string("Paste special","Not while in town");
|
||||
else set_string("Paste special","Not while outdoors");
|
||||
break;
|
||||
}
|
||||
else if(boost::get<cTownperson>(&clipboard))
|
||||
if(editing_town) set_string("Paste monster","Select location to paste");
|
||||
else {
|
||||
set_string("Paste monster","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
else if(boost::get<cTown::cItem>(&clipboard))
|
||||
if(editing_town) set_string("Paste item","Select location to paste");
|
||||
else {
|
||||
set_string("Paste item","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
else if(boost::get<vector2d<ter_num_t>>(&clipboard))
|
||||
set_string("Paste terrain","Select location to paste");
|
||||
else set_string("Can't paste","Nothing to paste");
|
||||
overall_mode = MODE_PASTE;
|
||||
break;
|
||||
case PAL_ERASE_SPEC:
|
||||
set_string("Erase special","Select special to erase");
|
||||
@@ -1412,9 +1448,9 @@ static bool handle_toolpal_action(location cur_point2) {
|
||||
set_string("Edit creature","Select creature to edit");
|
||||
overall_mode = MODE_EDIT_CREATURE;
|
||||
break;
|
||||
case PAL_SAME_MONST:
|
||||
set_string("Place same creature","Select creature location");
|
||||
overall_mode = MODE_PLACE_SAME_CREATURE;
|
||||
case PAL_COPY_MONST:
|
||||
set_string("Copy creature","Select creature");
|
||||
overall_mode = MODE_COPY_CREATURE;
|
||||
break;
|
||||
case PAL_ERASE_MONST:
|
||||
set_string("Delete a creature","Select creature");
|
||||
@@ -1540,6 +1576,29 @@ static bool handle_toolpal_action(location cur_point2) {
|
||||
set_string("Place/edit horse","Select horse location");
|
||||
overall_mode = MODE_PLACE_HORSE;
|
||||
break;
|
||||
case PAL_TOWN_BORDER:
|
||||
if(!editing_town) {
|
||||
set_string("Place boundaries","Not while outdoors.");
|
||||
break;
|
||||
}
|
||||
overall_mode = MODE_SET_TOWN_RECT;
|
||||
mode_count = 2;
|
||||
set_string("Set town boundary","Select upper left corner");
|
||||
break;
|
||||
case PAL_START:
|
||||
if(editing_town) {
|
||||
overall_mode = MODE_SET_TOWN_START;
|
||||
set_string("Select party starting location.","");
|
||||
} else {
|
||||
overall_mode = MODE_SET_OUT_START;
|
||||
set_string("Select party starting location.","");
|
||||
}
|
||||
break;
|
||||
case PAL_COPY_TER:
|
||||
set_string("Copy terrain", "Select upper left corner");
|
||||
overall_mode = MODE_COPY_TERRAIN;
|
||||
mode_count = 2;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1707,10 +1766,6 @@ void handle_keystroke(sf::Event event) {
|
||||
mode_count = 2;
|
||||
set_string("Create info rect.");
|
||||
break;*/
|
||||
//case 'e':
|
||||
// set_string("Pick item to edit.");
|
||||
// overall_mode = 5;
|
||||
// break;
|
||||
/*case 'q':
|
||||
if(overall_mode != 7) {
|
||||
set_string("Place monster.");
|
||||
@@ -1721,9 +1776,6 @@ void handle_keystroke(sf::Event event) {
|
||||
overall_mode = 8;
|
||||
}
|
||||
break;
|
||||
case '`':
|
||||
set_string("Place same monster.");
|
||||
overall_mode = 8;
|
||||
break;*/
|
||||
case 'D':
|
||||
pass_point.x = RIGHT_AREA_UL_X + 6 + palette_buttons[0][0].left;
|
||||
@@ -1759,18 +1811,10 @@ void handle_keystroke(sf::Event event) {
|
||||
set_string("Pick item to edit.","");
|
||||
overall_mode = MODE_EDIT_ITEM;
|
||||
break;
|
||||
case '`':
|
||||
set_string("Place same creature","Select creature location");
|
||||
overall_mode = MODE_PLACE_SAME_CREATURE;
|
||||
break;
|
||||
case ',':
|
||||
set_string("Edit creature","Select creature to edit");
|
||||
overall_mode = MODE_EDIT_CREATURE;
|
||||
break;
|
||||
case '/':
|
||||
set_string("Place same item","Select location");
|
||||
overall_mode = MODE_PLACE_SAME_ITEM;
|
||||
break;
|
||||
|
||||
default:
|
||||
if(chr >= 'a' && chr <= 'z') {
|
||||
@@ -2440,7 +2484,6 @@ void start_town_edit() {
|
||||
pal_sbar->show();
|
||||
set_string("Drawing mode",scenario.ter_types[current_terrain_type].name);
|
||||
place_location();
|
||||
copied_spec = -1;
|
||||
for(short i = 0; i < town->max_dim; i++)
|
||||
for(short j = 0; j < town->max_dim; j++)
|
||||
if(town->terrain(i,j) == 0)
|
||||
@@ -2471,7 +2514,6 @@ void start_out_edit() {
|
||||
shut_down_menus(1);
|
||||
set_string("Drawing mode",scenario.ter_types[current_terrain_type].name);
|
||||
place_location();
|
||||
copied_spec = -1;
|
||||
for(short i = 0; i < 48; i++)
|
||||
for(short j = 0; j < 48; j++)
|
||||
if(current_terrain->terrain[i][j] == 0)
|
||||
|
@@ -31,7 +31,7 @@ enum eScenMode {
|
||||
MODE_EDIT_ITEM = 5,
|
||||
MODE_TOGGLE_SPECIAL_DOT = 6,
|
||||
MODE_SET_TOWN_START = 7,
|
||||
MODE_PLACE_SAME_CREATURE = 8,
|
||||
MODE_COPY_CREATURE = 8,
|
||||
MODE_SET_TOWN_RECT = 9,
|
||||
MODE_PLACE_NORTH_ENTRANCE = 10,
|
||||
MODE_PLACE_EAST_ENTRANCE = 11,
|
||||
@@ -64,15 +64,15 @@ enum eScenMode {
|
||||
MODE_EDIT_CREATURE = 39,
|
||||
MODE_EDIT_SPECIAL = 40, // or create a special if there's none there
|
||||
MODE_COPY_SPECIAL = 41,
|
||||
MODE_PASTE_SPECIAL = 42,
|
||||
MODE_PASTE = 42,
|
||||
MODE_ERASE_SPECIAL = 43,
|
||||
MODE_PLACE_SPECIAL = 44, // or set the special to be called if there's already one there
|
||||
MODE_EDIT_TOWN_ENTRANCE = 45, // for outdoors
|
||||
MODE_PLACE_SAME_ITEM = 46,
|
||||
MODE_COPY_ITEM = 46,
|
||||
MODE_SET_OUT_START = 47,
|
||||
MODE_ERASE_CREATURE = 48,
|
||||
MODE_ERASE_ITEM = 49,
|
||||
MODE_ERASE_TOWN_ENTRANCE = 50,
|
||||
MODE_COPY_TERRAIN = 50,
|
||||
// Modes below this do not have the terrain area visible.
|
||||
MODE_MAIN_SCREEN = 60,
|
||||
MODE_INTRO_SCREEN = 61,
|
||||
@@ -94,10 +94,10 @@ enum eStrMode {
|
||||
enum ePalBtn {
|
||||
PAL_BLANK = -1,
|
||||
PAL_PENCIL = 0, PAL_BRUSH_LG = 1, PAL_BRUSH_SM = 2, PAL_SPRAY_LG = 3, PAL_SPRAY_SM = 4, PAL_DROPPER = 5, PAL_RECT_HOLLOW = 6, PAL_RECT_FILLED = 7, PAL_BUCKET = 8,
|
||||
PAL_ZOOM = 10, PAL_ERASER = 11, PAL_EDIT_SIGN = 12, PAL_TEXT_AREA = 13, PAL_WANDER = 14, PAL_CHANGE = 15, PAL_ERASE_TOWN = 16, PAL_EDIT_TOWN = 17, PAL_EDIT_STORAGE = 18,
|
||||
PAL_EDIT_ITEM = 20, PAL_SAME_ITEM = 21, PAL_ERASE_ITEM = 22, PAL_SPEC = 23, PAL_COPY_SPEC = 24, PAL_PASTE_SPEC = 25, PAL_ERASE_SPEC = 26, PAL_EDIT_SPEC = 27,
|
||||
PAL_EDIT_MONST = 30, PAL_SAME_MONST = 31, PAL_ERASE_MONST = 32, PAL_ENTER_N = 34, PAL_ENTER_W = 35, PAL_ENTER_S = 36, PAL_ENTER_E = 37,
|
||||
PAL_WEB = 40, PAL_CRATE = 41, PAL_BARREL = 42, PAL_FIRE_BARR = 43, PAL_FORCE_BARR = 44, PAL_QUICKFIRE = 45, PAL_SPEC_SPOT = 46, PAL_BLOCK = 47, PAL_FORCECAGE = 48, PAL_ERASE_FIELD = 33,
|
||||
PAL_ZOOM = 10, PAL_ERASER = 11, PAL_EDIT_SIGN = 12, PAL_TEXT_AREA = 13, PAL_WANDER = 14, PAL_CHANGE = 15, PAL_TOWN_BORDER = 16, PAL_EDIT_TOWN = 17, PAL_EDIT_STORAGE = 18,
|
||||
PAL_EDIT_ITEM = 20, PAL_COPY_ITEM = 21, PAL_ERASE_ITEM = 22, PAL_SPEC = 23, PAL_COPY_SPEC = 24, PAL_PASTE = 25, PAL_ERASE_SPEC = 26, PAL_EDIT_SPEC = 27, PAL_START = 28,
|
||||
PAL_EDIT_MONST = 30, PAL_COPY_MONST = 31, PAL_ERASE_MONST = 32, PAL_ERASE_FIELD = 33, PAL_ENTER_N = 34, PAL_ENTER_W = 35, PAL_ENTER_S = 36, PAL_ENTER_E = 37, PAL_COPY_TER = 38,
|
||||
PAL_WEB = 40, PAL_CRATE = 41, PAL_BARREL = 42, PAL_FIRE_BARR = 43, PAL_FORCE_BARR = 44, PAL_QUICKFIRE = 45, PAL_SPEC_SPOT = 46, PAL_BLOCK = 47, PAL_FORCECAGE = 48,
|
||||
PAL_SFX_SB = 50, PAL_SFX_MB = 51, PAL_SFX_LB = 52, PAL_SFX_SS = 53, PAL_SFX_LS = 54, PAL_SFX_ASH = 55, PAL_SFX_BONE = 56, PAL_SFX_ROCK = 57, PAL_ROAD = 58,
|
||||
PAL_ARROW_UP = 9, PAL_ARROW_DOWN = 69, PAL_TERRAIN = 29, PAL_ITEM = 39, PAL_MONST = 49,
|
||||
PAL_BOAT = 60, PAL_HORSE = 61,
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include "tools/drawable_manager.hpp"
|
||||
#include "tools/cursors.hpp"
|
||||
#include "tools/winutil.hpp"
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#include "dialogxml/dialogs/dialog.hpp"
|
||||
|
||||
@@ -53,6 +54,7 @@ extern sf::Texture bg_gworld;
|
||||
extern rectangle right_buttons[NRSONPAGE];
|
||||
extern rectangle right_scrollbar_rect;
|
||||
extern std::shared_ptr<cScrollbar> right_sbar, pal_sbar;
|
||||
extern boost::variant<boost::none_t, std::pair<long,bool>, cTownperson, cTown::cItem, vector2d<ter_num_t>> clipboard;
|
||||
|
||||
extern bool left_buttons_active,right_buttons_active;
|
||||
extern std::array<lb_t,NLS> left_button_status;
|
||||
@@ -884,7 +886,7 @@ void draw_terrain(){
|
||||
large_hilite = true;
|
||||
} else if(where_draw == mouse_spot)
|
||||
need_hilite = true;
|
||||
else if(overall_mode == MODE_PLACE_CREATURE || overall_mode == MODE_PLACE_SAME_CREATURE) {
|
||||
else if(overall_mode == MODE_PLACE_CREATURE) {
|
||||
extern short mode_count;
|
||||
cMonster& monst = scenario.scen_monsters[mode_count];
|
||||
for(int x = 0; x < monst.x_width; x++) {
|
||||
@@ -906,6 +908,26 @@ void draw_terrain(){
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(overall_mode == MODE_PASTE) {
|
||||
if(auto who = boost::get<cTownperson>(&clipboard)) {
|
||||
cMonster& monst = scenario.scen_monsters[who->number];
|
||||
for(int x = 0; x < monst.x_width; x++) {
|
||||
for(int y = 0; y < monst.y_width; y++) {
|
||||
location this_spot = {where_draw.x - x, where_draw.y - y};
|
||||
if(this_spot == mouse_spot)
|
||||
need_hilite = true;
|
||||
}
|
||||
}
|
||||
} else if(auto ter = boost::get<vector2d<ter_num_t>>(&clipboard)) {
|
||||
for(int x = 0; x < ter->width(); x++) {
|
||||
for(int y = 0; y < ter->height(); y++) {
|
||||
location this_spot = {where_draw.x - x, where_draw.y - y};
|
||||
if(this_spot == mouse_spot)
|
||||
need_hilite = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(need_hilite) {
|
||||
fill_rect(mainPtr(), destrec, hilite_colour);
|
||||
@@ -1385,9 +1407,10 @@ void place_location() {
|
||||
place_selected_terrain(current_terrain_type, draw_rect);
|
||||
extern short mode_count;
|
||||
bool draw_field = false;
|
||||
if(overall_mode == MODE_PLACE_CREATURE || overall_mode == MODE_PLACE_SAME_CREATURE) {
|
||||
if(overall_mode == MODE_PLACE_CREATURE || (overall_mode == MODE_PASTE && boost::get<cTownperson>(&clipboard))) {
|
||||
rectangle to_rect = draw_rect;
|
||||
picture_wanted = scenario.scen_monsters[mode_count].picture_num;
|
||||
mon_num_t m_num = overall_mode == MODE_PLACE_CREATURE ? mode_count : boost::get<cTownperson>(&clipboard)->number;
|
||||
picture_wanted = scenario.scen_monsters[m_num].picture_num;
|
||||
if(picture_wanted >= 4000) {
|
||||
picture_wanted %= 1000;
|
||||
to_rect.width() = to_rect.width() / 2;
|
||||
@@ -1484,8 +1507,9 @@ void place_location() {
|
||||
rect_draw_some_item(monst_gworld(picture_wanted / 20), source_rect, mainPtr(), to_rect, sf::BlendAlpha);
|
||||
}
|
||||
}
|
||||
} else if(overall_mode == MODE_PLACE_ITEM || overall_mode == MODE_PLACE_SAME_ITEM) {
|
||||
picture_wanted = scenario.scen_items[mode_count].graphic_num;
|
||||
} else if(overall_mode == MODE_PLACE_ITEM || (overall_mode == MODE_PASTE && boost::get<cTown::cItem>(&clipboard))) {
|
||||
item_num_t i_num = overall_mode == MODE_PLACE_ITEM ? mode_count : boost::get<cTown::cItem>(&clipboard)->code;
|
||||
picture_wanted = scenario.scen_items[i_num].graphic_num;
|
||||
if(picture_wanted >= 1000) {
|
||||
std::shared_ptr<const sf::Texture> source_gworld;
|
||||
graf_pos_ref(source_gworld, source_rect) = spec_scen_g.find_graphic(picture_wanted % 1000);
|
||||
|
@@ -561,10 +561,6 @@ void handle_menu_choice(eMenu item_hit) {
|
||||
edit_scen_intro();
|
||||
change_made = true;
|
||||
break;
|
||||
case eMenu::TOWN_START:
|
||||
overall_mode = MODE_SET_TOWN_START;
|
||||
set_string("Select party starting location.","");
|
||||
break;
|
||||
case eMenu::SCEN_SHEETS:
|
||||
edit_custom_sheets();
|
||||
change_made = true;
|
||||
@@ -652,11 +648,6 @@ void handle_menu_choice(eMenu item_hit) {
|
||||
edit_town_wand();
|
||||
change_made = true;
|
||||
break;
|
||||
case eMenu::TOWN_BOUNDARIES:
|
||||
overall_mode = MODE_SET_TOWN_RECT;
|
||||
mode_count = 2;
|
||||
set_string("Set town boundary","Select upper left corner");
|
||||
break;
|
||||
case eMenu::FRILL:
|
||||
frill_up_terrain();
|
||||
change_made = true;
|
||||
@@ -725,10 +716,6 @@ void handle_menu_choice(eMenu item_hit) {
|
||||
right_sbar->setPosition(0);
|
||||
start_string_editing(STRS_OUT_RECT,0);
|
||||
break;
|
||||
case eMenu::OUT_START:
|
||||
overall_mode = MODE_SET_OUT_START;
|
||||
set_string("Select party starting location.","");
|
||||
break;
|
||||
case eMenu::OUT_SPECIALS:
|
||||
right_sbar->setPosition(0);
|
||||
start_special_editing(1,0);
|
||||
|
@@ -96,11 +96,9 @@ void OpenBoESceneditMenu::add_persistent_menu_items(tgui::MenuBar::Ptr& menubar)
|
||||
|
||||
{ { "Town", "Town Details" }, eMenu::TOWN_DETAILS },
|
||||
{ { "Town", "Town Wandering Monsters" }, eMenu::TOWN_WANDERING },
|
||||
{ { "Town", "Set Town Boundaries" }, eMenu::TOWN_BOUNDARIES },
|
||||
{ { "Town", "Frill Up Terrain" }, eMenu::FRILL },
|
||||
{ { "Town", "Remove Terrain Frills" }, eMenu::UNFRILL },
|
||||
{ { "Town", "Edit Area Descriptions" }, eMenu::TOWN_AREAS },
|
||||
{ { "Town", "Set Starting Location" }, eMenu::TOWN_START },
|
||||
{ { "Town", "Add Random Items" }, eMenu::TOWN_ITEMS_RANDOM },
|
||||
{ { "Town", "Set All Items Not Property" }, eMenu::TOWN_ITEMS_NOT_PROPERTY },
|
||||
{ { "Town", "Clear All Items" }, eMenu::TOWN_ITEMS_CLEAR },
|
||||
@@ -117,7 +115,6 @@ void OpenBoESceneditMenu::add_persistent_menu_items(tgui::MenuBar::Ptr& menubar)
|
||||
{ { "Outdoors", "Frill Up Terrain" }, eMenu::FRILL },
|
||||
{ { "Outdoors", "Remove Terrain Frills" }, eMenu::UNFRILL },
|
||||
{ { "Outdoors", "Edit Area Descriptions" }, eMenu::OUT_AREAS },
|
||||
{ { "Outdoors", "Set Starting Location" }, eMenu::OUT_START },
|
||||
|
||||
{ { "Help", "Index F1" }, eMenu::HELP_TOC },
|
||||
{ { "Help", "About Blades Scenario Editor" }, eMenu::ABOUT },
|
||||
|
@@ -20,17 +20,17 @@ enum class eMenu {
|
||||
HELP_TOC, HELP_START, HELP_TEST, HELP_DIST, HELP_CONTEST,
|
||||
// Scenario menu
|
||||
LAUNCH_HERE, LAUNCH_START, LAUNCH_ENTRANCE, TOWN_CREATE, OUT_RESIZE,
|
||||
SCEN_DETAILS, SCEN_ADV_DETAILS, SCEN_INTRO, TOWN_START,
|
||||
SCEN_DETAILS, SCEN_ADV_DETAILS, SCEN_INTRO,
|
||||
SCEN_SPECIALS, SCEN_TEXT, SCEN_JOURNALS, TOWN_IMPORT, OUT_IMPORT,
|
||||
TOWN_VARYING, SCEN_TIMERS, SCEN_ITEM_SHORTCUTS, TOWN_DELETE,
|
||||
SCEN_DATA_DUMP, SCEN_TEXT_DUMP,
|
||||
SCEN_PICS, SCEN_SHEETS, SCEN_SNDS,
|
||||
// Town menu
|
||||
TOWN_DETAILS, TOWN_WANDERING, TOWN_BOUNDARIES, TOWN_AREAS,
|
||||
TOWN_DETAILS, TOWN_WANDERING, TOWN_AREAS,
|
||||
TOWN_ITEMS_RANDOM, TOWN_ITEMS_NOT_PROPERTY, TOWN_ITEMS_CLEAR,
|
||||
TOWN_SPECIALS, TOWN_TEXT, TOWN_SIGNS, TOWN_ADVANCED, TOWN_TIMERS,
|
||||
// Outdoors menu
|
||||
OUT_DETAILS, OUT_WANDERING, OUT_ENCOUNTERS, OUT_AREAS, OUT_START,
|
||||
OUT_DETAILS, OUT_WANDERING, OUT_ENCOUNTERS, OUT_AREAS,
|
||||
OUT_SPECIALS, OUT_TEXT, OUT_SIGNS,
|
||||
};
|
||||
|
||||
|
@@ -64,14 +64,14 @@ void init_menubar() {
|
||||
eMenu::TOWN_DELETE, eMenu::SCEN_DATA_DUMP, eMenu::SCEN_TEXT_DUMP,
|
||||
};
|
||||
static const eMenu town_choices[] = {
|
||||
eMenu::TOWN_DETAILS, eMenu::TOWN_WANDERING, eMenu::TOWN_BOUNDARIES, eMenu::FRILL, eMenu::UNFRILL, eMenu::TOWN_AREAS,
|
||||
eMenu::NONE, eMenu::TOWN_START, eMenu::TOWN_ITEMS_RANDOM, eMenu::TOWN_ITEMS_NOT_PROPERTY, eMenu::TOWN_ITEMS_CLEAR,
|
||||
eMenu::TOWN_DETAILS, eMenu::TOWN_WANDERING, eMenu::FRILL, eMenu::UNFRILL, eMenu::TOWN_AREAS,
|
||||
eMenu::NONE, eMenu::TOWN_ITEMS_RANDOM, eMenu::TOWN_ITEMS_NOT_PROPERTY, eMenu::TOWN_ITEMS_CLEAR,
|
||||
eMenu::NONE, eMenu::NONE,
|
||||
eMenu::TOWN_SPECIALS, eMenu::TOWN_TEXT, eMenu::TOWN_SIGNS, eMenu::TOWN_ADVANCED, eMenu::TOWN_TIMERS,
|
||||
};
|
||||
static const eMenu out_choices[] = {
|
||||
eMenu::OUT_DETAILS, eMenu::OUT_WANDERING, eMenu::OUT_ENCOUNTERS, eMenu::FRILL, eMenu::UNFRILL, eMenu::OUT_AREAS,
|
||||
eMenu::NONE, eMenu::OUT_START, eMenu::NONE, eMenu::NONE,
|
||||
eMenu::NONE, eMenu::NONE,
|
||||
eMenu::OUT_SPECIALS, eMenu::OUT_TEXT, eMenu::OUT_SIGNS,
|
||||
};
|
||||
static const eMenu help_choices[] = {
|
||||
|
@@ -84,14 +84,14 @@ void init_menubar() {
|
||||
eMenu::TOWN_DELETE, eMenu::SCEN_DATA_DUMP, eMenu::SCEN_TEXT_DUMP,
|
||||
};
|
||||
static const eMenu town_choices[] = {
|
||||
eMenu::TOWN_DETAILS, eMenu::TOWN_WANDERING, eMenu::TOWN_BOUNDARIES, eMenu::FRILL, eMenu::UNFRILL, eMenu::TOWN_AREAS,
|
||||
eMenu::NONE, eMenu::TOWN_START, eMenu::TOWN_ITEMS_RANDOM, eMenu::TOWN_ITEMS_NOT_PROPERTY, eMenu::TOWN_ITEMS_CLEAR,
|
||||
eMenu::TOWN_DETAILS, eMenu::TOWN_WANDERING, eMenu::FRILL, eMenu::UNFRILL, eMenu::TOWN_AREAS,
|
||||
eMenu::NONE, eMenu::TOWN_ITEMS_RANDOM, eMenu::TOWN_ITEMS_NOT_PROPERTY, eMenu::TOWN_ITEMS_CLEAR,
|
||||
eMenu::NONE, eMenu::NONE,
|
||||
eMenu::TOWN_SPECIALS, eMenu::TOWN_TEXT, eMenu::TOWN_SIGNS, eMenu::TOWN_ADVANCED, eMenu::TOWN_TIMERS,
|
||||
};
|
||||
static const eMenu out_choices[] = {
|
||||
eMenu::OUT_DETAILS, eMenu::OUT_WANDERING, eMenu::OUT_ENCOUNTERS, eMenu::FRILL, eMenu::UNFRILL, eMenu::OUT_AREAS,
|
||||
eMenu::NONE, eMenu::OUT_START, eMenu::NONE, eMenu::NONE,
|
||||
eMenu::NONE, eMenu::NONE,
|
||||
eMenu::OUT_SPECIALS, eMenu::OUT_TEXT, eMenu::OUT_SIGNS,
|
||||
};
|
||||
static const eMenu help_choices[] = {
|
||||
|
Reference in New Issue
Block a user