Change setModifed so it can't change modified back to false (#1805)

This commit is contained in:
Lucwousin
2019-10-17 23:46:24 +02:00
committed by Ganom
parent bca49d2f7d
commit 220b90c0a6
13 changed files with 29 additions and 18 deletions

View File

@@ -240,7 +240,7 @@ public class MenuManager
// Need to set the event entries to prevent conflicts
event.setMenuEntries(arrayEntries);
event.setModified(true);
event.setModified();
}
private void onMenuEntryAdded(MenuEntryAdded event)
@@ -889,7 +889,7 @@ public class MenuManager
}
@AllArgsConstructor
private class SortMapping implements Comparable<SortMapping>
private static class SortMapping implements Comparable<SortMapping>
{
private final int priority;
private final MenuEntry entry;

View File

@@ -541,7 +541,10 @@ public class AgilityPlugin extends Plugin
changed |= checkAndModify(entry);
}
event.setModified(changed);
if (changed)
{
event.setModified();
}
}
private boolean checkAndModify(MenuEntry old)

View File

@@ -202,7 +202,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
newEntries[i].setOpcode(MenuOpcode.RUNELITE.getId());
event.setMenuEntries(newEntries);
event.setModified(true);
event.setModified();
return;
}

View File

@@ -258,7 +258,7 @@ public class CorpPlugin extends Plugin
}
event.setOpcode(NPC_SECOND_OPTION.getId() + MENU_ACTION_DEPRIORITIZE_OFFSET);
event.setModified(true);
event.setModified();
}
private void onConfigChanged(ConfigChanged configChanged)

View File

@@ -407,7 +407,7 @@ public class DevToolsPlugin extends Plugin
}
entry.setTarget(entry.getTarget() + " " + ColorUtil.prependColorTag("(" + info + ")", JagexColors.MENU_TARGET));
entry.setModified(true);
entry.setModified();
}
}

View File

@@ -448,7 +448,7 @@ public class GrandExchangePlugin extends Plugin
case WidgetID.SHOP_INVENTORY_GROUP_ID:
menuEntry.setOption(SEARCH_GRAND_EXCHANGE);
menuEntry.setOpcode(MenuOpcode.RUNELITE.getId());
menuEntry.setModified(true);
menuEntry.setModified();
}
}

View File

@@ -983,7 +983,7 @@ public class GroundItemsPlugin extends Plugin
{
final String optionText = telegrabEntry ? "Cast" : "Take";
lastEntry.setOption(ColorUtil.prependColorTag(optionText, color));
lastEntry.setModified(true);
lastEntry.setModified();
}
if (mode == BOTH || mode == NAME)
@@ -1003,14 +1003,14 @@ public class GroundItemsPlugin extends Plugin
}
lastEntry.setTarget(target);
lastEntry.setModified(true);
lastEntry.setModified();
}
}
if (this.showMenuItemQuantities && itemComposition.isStackable() && quantity > 1)
{
lastEntry.setTarget(lastEntry.getTarget() + " (" + quantity + ")");
lastEntry.setModified(true);
lastEntry.setModified();
}
if (this.removeIgnored && lastEntry.getOption().equals("Take") && hiddenItemList.contains(Text.removeTags(lastEntry.getTarget())))

View File

@@ -250,7 +250,7 @@ public class InventoryTagsPlugin extends Plugin
// Need to set the event entries to prevent conflicts
event.setMenuEntries(menuList);
event.setModified(true);
event.setModified();
}
}

View File

@@ -578,7 +578,7 @@ public class MenuEntrySwapperPlugin extends Plugin
}
event.setMenuEntries(menu_entries.toArray(new MenuEntry[0]));
event.setModified(true);
event.setModified();
}
public void onMenuEntryAdded(MenuEntryAdded event)

View File

@@ -311,7 +311,7 @@ public class NpcIndicatorsPlugin extends Plugin
{
final String target = ColorUtil.prependColorTag(Text.removeTags(event.getTarget()), this.getHighlightColor);
event.setTarget(target);
event.setModified(true);
event.setModified();
}
else if (hotKeyPressed && type == MenuOpcode.EXAMINE_NPC.getId())
{