Fix arrow buttons in edit special item dialog

This commit is contained in:
2015-01-23 14:40:15 -05:00
parent c63544054f
commit 78cdadc13c
2 changed files with 6 additions and 6 deletions

View File

@@ -1783,7 +1783,7 @@ static bool save_spec_item(cDialog& me, cSpecItem& item, short which) {
return true;
}
static bool edit_spec_item_event_filter(cDialog& me, std::string hit, cSpecItem& item, short which) {
static bool edit_spec_item_event_filter(cDialog& me, std::string hit, cSpecItem& item, short& which) {
if(hit == "cancel") {
me.toast(false);
} else if(hit == "okay") {
@@ -1827,7 +1827,7 @@ void edit_spec_item(short which_item) {
cDialog item_dlg("edit-special-item");
item_dlg["spec"].attachFocusHandler(std::bind(check_range_msg, _1, _2, _3, -1, 255, "Scenario special node called", "-1 for no special"));
item_dlg.attachClickHandlers(std::bind(edit_spec_item_event_filter, _1, _2, std::ref(item), which_item), {"okay", "cancel", "clear", "edit-spec", "left", "right"});
item_dlg.attachClickHandlers(std::bind(edit_spec_item_event_filter, _1, _2, std::ref(item), std::ref(which_item)), {"okay", "cancel", "clear", "edit-spec", "left", "right"});
put_spec_item_in_dlog(item_dlg, item, which_item);
item_dlg["clear"].hide();

View File

@@ -317,7 +317,7 @@ void edit_sign(short which_sign,short picture) {
sign_dlg.run();
}
static bool save_roomdescs(cDialog& me, bool isTown, bool str_do_delete[]) {
static bool save_roomdescs(cDialog& me, bool isTown, std::array<bool,16> str_do_delete) {
if(!me.toast(true)) return true;
int numDescs = isTown ? 16 : 8;
for(int i = 0; i < numDescs; i++) {
@@ -335,7 +335,7 @@ static bool save_roomdescs(cDialog& me, bool isTown, bool str_do_delete[]) {
return true;
}
static void put_roomdescs_in_dlog(cDialog& me, bool isTown, bool str_do_delete[]) {
static void put_roomdescs_in_dlog(cDialog& me, bool isTown, std::array<bool,16> str_do_delete) {
int numDescs = isTown ? 16 : 8;
for(int i = 0; i < numDescs; i++) {
std::string id = std::to_string(i + 1);
@@ -358,7 +358,7 @@ static void put_roomdescs_in_dlog(cDialog& me, bool isTown, bool str_do_delete[]
}
}
static bool delete_roomdesc(cDialog& me, std::string id, bool isTown, bool str_do_delete[]) {
static bool delete_roomdesc(cDialog& me, std::string id, bool isTown, std::array<bool,16> str_do_delete) {
int item_hit = boost::lexical_cast<int>(id.substr(3));
me["desc" + id.substr(3)].setText("");
str_do_delete[item_hit - 1] = true;
@@ -368,7 +368,7 @@ static bool delete_roomdesc(cDialog& me, std::string id, bool isTown, bool str_d
void edit_roomdescs(bool town) {
using namespace std::placeholders;
bool str_do_delete[16] = {0};
std::array<bool,16> str_do_delete = {0};
int numDescs = town ? 16 : 8;
cDialog room_dlg(town ? "edit-town-roomdescs" : "edit-out-roomdescs");