Fixed a bug that disallowed overwriting equipment quick slots with inventory quick slots.
This commit is contained in:
+3
-1
@@ -659,7 +659,7 @@ int i18n_find_language_index(const string[] @languageCodes, const string& in lan
|
||||
}
|
||||
|
||||
int i18n_run_language_selection_menu(const string[] @languageCodes, const string[] @languageLabels,
|
||||
int defaultIndex = 0) {
|
||||
int defaultIndex = 0, bool allowCancel = false) {
|
||||
if (@languageCodes is null || @languageLabels is null)
|
||||
return -1;
|
||||
if (languageCodes.length() == 0 || languageLabels.length() == 0)
|
||||
@@ -705,6 +705,8 @@ int i18n_run_language_selection_menu(const string[] @languageCodes, const string
|
||||
}
|
||||
|
||||
if (key_pressed(KEY_ESCAPE)) {
|
||||
if (allowCancel)
|
||||
return -1;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,34 @@ void reset_quick_slots() {
|
||||
}
|
||||
}
|
||||
|
||||
void bind_equipment_to_quick_slot(int slot_index, int equip_type, int rune_type) {
|
||||
if (slot_index < 0 || slot_index >= int(quick_slots.length())) {
|
||||
return;
|
||||
}
|
||||
|
||||
quick_slots[slot_index] = equip_type;
|
||||
if (slot_index >= 0 && slot_index < int(quick_slot_runes.length())) {
|
||||
quick_slot_runes[slot_index] = rune_type;
|
||||
}
|
||||
if (slot_index >= 0 && slot_index < int(item_count_slots.length())) {
|
||||
item_count_slots[slot_index] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void bind_item_count_to_quick_slot(int slot_index, int item_type) {
|
||||
if (slot_index < 0 || slot_index >= int(item_count_slots.length())) {
|
||||
return;
|
||||
}
|
||||
|
||||
item_count_slots[slot_index] = item_type;
|
||||
if (slot_index >= 0 && slot_index < int(quick_slots.length())) {
|
||||
quick_slots[slot_index] = -1;
|
||||
}
|
||||
if (slot_index >= 0 && slot_index < int(quick_slot_runes.length())) {
|
||||
quick_slot_runes[slot_index] = RUNE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
int get_personal_stack_limit() {
|
||||
int limit = MAX_ITEM_STACK;
|
||||
if (equipped_arms == EQUIP_POUCH) {
|
||||
|
||||
@@ -220,10 +220,7 @@ void run_equipment_menu() {
|
||||
if (slot_index != -1 && filtered_indices.length() > 0) {
|
||||
int equip_type = equipment_types[filtered_indices[selection]];
|
||||
int rune_type = rune_types[filtered_indices[selection]];
|
||||
quick_slots[slot_index] = equip_type;
|
||||
if (slot_index >= 0 && slot_index < int(quick_slot_runes.length())) {
|
||||
quick_slot_runes[slot_index] = rune_type;
|
||||
}
|
||||
bind_equipment_to_quick_slot(slot_index, equip_type, rune_type);
|
||||
string name = get_full_equipment_name(equip_type, rune_type);
|
||||
dictionary args;
|
||||
args.set("name", name);
|
||||
|
||||
@@ -194,7 +194,7 @@ void run_inventory_menu(bool allow_deposit) {
|
||||
if (slot_index != -1 && filtered_indices.length() > 0) {
|
||||
int item_type = item_types[filtered_indices[selection]];
|
||||
if (slot_index >= 0 && slot_index < int(item_count_slots.length())) {
|
||||
item_count_slots[slot_index] = item_type;
|
||||
bind_item_count_to_quick_slot(slot_index, item_type);
|
||||
string name = get_item_count_binding_name(item_type);
|
||||
dictionary args;
|
||||
args.set("name", name);
|
||||
|
||||
Reference in New Issue
Block a user