conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
private final ItemIdentificationPlugin plugin;
=======
private final ItemIdentificationConfig config;
private final ItemManager itemManager;
>>>>>>>
private final ItemIdentificationPlugin plugin;
private final ItemManager itemManager; |
<<<<<<<
else if (itemId == ItemID.XERICS_TALISMAN)
{
if (!config.showXericTalismanCharges())
{
return;
}
charges = config.xericTalisman();
}
else if (itemId == ItemID.SOUL_BEARER)
{
if (!config.showSoulBearerCharges())
{
return;
}
charges = config.soulBearer();
}
else if (itemId == ItemID.CHRONICLE)
{
if (!config.showChronicleCharges())
{
return;
}
charges = config.chronicle();
}
=======
else if (itemId >= ItemID.EXPLORERS_RING_1 && itemId <= ItemID.EXPLORERS_RING_4)
{
if (!config.showExplorerRingCharges())
{
return;
}
charges = config.explorerRing();
}
>>>>>>>
else if (itemId == ItemID.XERICS_TALISMAN)
{
if (!config.showXericTalismanCharges())
{
return;
}
charges = config.xericTalisman();
}
else if (itemId == ItemID.SOUL_BEARER)
{
if (!config.showSoulBearerCharges())
{
return;
}
charges = config.soulBearer();
}
else if (itemId == ItemID.CHRONICLE)
{
if (!config.showChronicleCharges())
{
return;
}
charges = config.chronicle();
}
else if (itemId >= ItemID.EXPLORERS_RING_1 && itemId <= ItemID.EXPLORERS_RING_4)
{
if (!config.showExplorerRingCharges())
{
return;
}
charges = config.explorerRing();
} |
<<<<<<<
private final Map<Integer, ItemDefinition> results = new LinkedHashMap<>();
=======
private final Map<Integer, ItemComposition> results = new LinkedHashMap<>();
>>>>>>>
private final Map<Integer, ItemDefinition> results = new LinkedHashMap<>();
<<<<<<<
item.setName("<col=ff9040>" + itemDefinition.getName());
item.setItemId(itemDefinition.getId());
=======
item.setName(JagexColors.MENU_TARGET_TAG + itemComposition.getName());
item.setItemId(itemComposition.getId());
>>>>>>>
item.setName(JagexColors.MENU_TARGET_TAG + itemDefinition.getName());
item.setItemId(itemDefinition.getId()); |
<<<<<<<
=======
private final File sessionFile;
private final AccountClient accountClient;
>>>>>>>
private final AccountClient accountClient;
<<<<<<<
private SessionManager(EventBus eventBus, WSClient wsClient)
=======
private SessionManager(
@Named("sessionfile") File sessionfile,
ConfigManager configManager,
EventBus eventBus,
WSClient wsClient,
OkHttpClient okHttpClient)
>>>>>>>
private SessionManager(
EventBus eventBus,
WSClient wsClient,
OkHttpClient okHttpClient)
<<<<<<<
=======
this.sessionFile = sessionfile;
this.accountClient = new AccountClient(okHttpClient);
>>>>>>>
this.accountClient = new AccountClient(okHttpClient);
<<<<<<<
AccountClient accountClient = new AccountClient(session.getUuid());
accountClient.sessionCheck()
.subscribeOn(Schedulers.io())
.subscribe(b ->
{
if (!b)
{
log.debug("Loaded session {} is invalid", session.getUuid());
}
else
{
openSession(session, false);
}
}, ex ->
{
if (ex instanceof IOException)
{
log.debug("Unable to verify session", ex);
openSession(session, false);
}
});
=======
accountClient.setUuid(session.getUuid());
if (!accountClient.sessionCheck())
{
log.debug("Loaded session {} is invalid", session.getUuid());
return;
}
openSession(session, false);
>>>>>>>
accountClient.setUuid(session.getUuid());
accountClient.sessionCheck()
.subscribeOn(Schedulers.io())
.subscribe(b ->
{
if (!b)
{
log.debug("Loaded session {} is invalid", session.getUuid());
}
else
{
openSession(session, false);
}
}, ex ->
{
if (ex instanceof IOException)
{
log.debug("Unable to verify session", ex);
openSession(session, false);
}
}); |
<<<<<<<
Sprite createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale);
=======
@Nullable
SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale);
>>>>>>>
@Nullable
Sprite createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale);
<<<<<<<
Sprite[] getSprites(IndexDataBase source, int archiveId, int fileId);
=======
@Nullable
SpritePixels[] getSprites(IndexDataBase source, int archiveId, int fileId);
>>>>>>>
@Nullable
Sprite[] getSprites(IndexDataBase source, int archiveId, int fileId); |
<<<<<<<
private static final int WALK = MenuAction.WALK.getId();
=======
private static final int CAST_ON_ITEM = MenuAction.SPELL_CAST_ON_GROUND_ITEM.getId();
private static final String TELEGRAB_TEXT = ColorUtil.wrapWithColorTag("Telekinetic Grab", Color.GREEN) + ColorUtil.prependColorTag(" -> ", Color.WHITE);
>>>>>>>
private static final int WALK = MenuAction.WALK.getId();
private static final int CAST_ON_ITEM = MenuAction.SPELL_CAST_ON_GROUND_ITEM.getId();
private static final String TELEGRAB_TEXT = ColorUtil.wrapWithColorTag("Telekinetic Grab", Color.GREEN) + ColorUtil.prependColorTag(" -> ", Color.WHITE);
<<<<<<<
if (this.itemHighlightMode != OVERLAY
&& event.getOption().equals("Take")
&& event.getType() == THIRD_OPTION)
=======
if (config.itemHighlightMode() != OVERLAY)
>>>>>>>
if (this.itemHighlightMode != OVERLAY) |
<<<<<<<
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.n52.iceland.coding.decode.Decoder;
import org.n52.iceland.coding.decode.DecoderKey;
import org.n52.iceland.exception.CodedException;
import org.n52.iceland.exception.ows.InvalidParameterValueException;
import org.n52.iceland.exception.ows.MissingParameterValueException;
import org.n52.iceland.exception.ows.OwsExceptionCode;
import org.n52.iceland.exception.ows.OwsExceptionReport;
import org.n52.iceland.exception.ows.concrete.UnsupportedDecoderInputException;
import org.n52.iceland.ogc.gml.AbstractFeature;
import org.n52.iceland.ogc.gml.CodeWithAuthority;
import org.n52.iceland.ogc.gml.time.Time;
import org.n52.iceland.ogc.gml.time.Time.NilReason;
import org.n52.iceland.ogc.gml.time.Time.TimeIndeterminateValue;
import org.n52.iceland.ogc.gml.time.TimeInstant;
import org.n52.iceland.ogc.gml.time.TimePeriod;
import org.n52.iceland.ogc.om.OmConstants;
import org.n52.iceland.ogc.sos.ConformanceClasses;
import org.n52.iceland.ogc.sos.Sos2Constants;
import org.n52.iceland.ogc.sos.SosConstants;
import org.n52.iceland.service.ServiceConstants.SupportedType;
import org.n52.iceland.util.Constants;
import org.n52.iceland.w3c.xlink.W3CHrefAttribute;
import org.n52.sos.exception.ows.concrete.UnsupportedDecoderXmlInputException;
import org.n52.sos.ogc.gml.AbstractGeometry;
=======
import org.n52.sos.exception.CodedException;
import org.n52.sos.exception.ows.InvalidParameterValueException;
import org.n52.sos.exception.ows.MissingParameterValueException;
import org.n52.sos.exception.ows.OwsExceptionCode;
import org.n52.sos.ogc.gml.AbstractFeature;
>>>>>>>
import org.n52.iceland.coding.decode.DecoderKey;
import org.n52.iceland.exception.CodedException;
import org.n52.iceland.exception.ows.InvalidParameterValueException;
import org.n52.iceland.exception.ows.MissingParameterValueException;
import org.n52.iceland.exception.ows.OwsExceptionCode;
import org.n52.iceland.exception.ows.OwsExceptionReport;
import org.n52.iceland.ogc.gml.AbstractFeature;
import org.n52.iceland.ogc.gml.time.Time;
import org.n52.iceland.ogc.gml.time.Time.NilReason;
import org.n52.iceland.ogc.gml.time.Time.TimeIndeterminateValue;
import org.n52.iceland.ogc.gml.time.TimeInstant;
import org.n52.iceland.ogc.gml.time.TimePeriod;
import org.n52.iceland.ogc.om.OmConstants;
import org.n52.iceland.ogc.sos.ConformanceClasses;
import org.n52.iceland.ogc.sos.Sos2Constants;
import org.n52.iceland.ogc.sos.SosConstants;
import org.n52.iceland.service.ServiceConstants.SupportedType;
import org.n52.iceland.util.Constants;
<<<<<<<
=======
import org.n52.sos.util.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
private Set<NamedValue<?>> parseNamedValueTypeArray(NamedValuePropertyType[] namedValuePropertyArray)
throws OwsExceptionReport {
Set<NamedValue<?>> parameters = Sets.newHashSet();
for (NamedValuePropertyType namedValueProperty : namedValuePropertyArray) {
parameters.add(parseNamedValueType(namedValueProperty));
}
return parameters;
}
private NamedValue<?> parseNamedValueType(NamedValuePropertyType namedValueProperty) throws OwsExceptionReport {
if (namedValueProperty.isSetNamedValue()) {
NamedValueType namedValue = namedValueProperty.getNamedValue();
NamedValue<?> sosNamedValue = parseNamedValueValue(namedValue.getValue());
ReferenceType referenceType = (ReferenceType) CodingHelper.decodeXmlObject(namedValue.getName());
sosNamedValue.setName(referenceType);
return sosNamedValue;
} else if (namedValueProperty.isSetHref()) {
NamedValue<?> sosNamedValue = new NamedValue<ReferenceType>();
ReferenceType referenceType = new ReferenceType(namedValueProperty.getHref());
if (namedValueProperty.isSetTitle()) {
referenceType.setTitle(namedValueProperty.getTitle());
}
sosNamedValue.setName(referenceType);
return sosNamedValue;
} else {
throw new UnsupportedDecoderXmlInputException(this, namedValueProperty);
}
}
private NamedValue<?> parseNamedValueValue(XmlObject xmlObject) throws OwsExceptionReport {
if (xmlObject.schemaType() == XmlAnyTypeImpl.type) {
try {
xmlObject = XmlObject.Factory.parse(xmlObject.xmlText().trim());
} catch (XmlException e) {
LOGGER.error("Error while parsing NamedValueValue", e);
}
}
Object value = CodingHelper.decodeXmlObject(xmlObject);
if (value instanceof BooleanValue) {
NamedValue<Boolean> namedValue = new NamedValue<Boolean>();
namedValue.setValue((BooleanValue) value);
return namedValue;
} else if (value instanceof CategoryValue) {
NamedValue<String> namedValue = new NamedValue<String>();
namedValue.setValue((CategoryValue) value);
return namedValue;
} else if (value instanceof CountValue) {
NamedValue<Integer> namedValue = new NamedValue<Integer>();
namedValue.setValue((CountValue) value);
return namedValue;
} else if (value instanceof GeometryValue) {
NamedValue<Geometry> namedValue = new NamedValue<Geometry>();
namedValue.setValue((GeometryValue) value);
return namedValue;
} else if (value instanceof QuantityValue) {
NamedValue<Double> namedValue = new NamedValue<Double>();
namedValue.setValue((QuantityValue) value);
return namedValue;
} else if (value instanceof TextValue) {
NamedValue<String> namedValue = new NamedValue<String>();
namedValue.setValue((TextValue) value);
return namedValue;
} else if (value instanceof AbstractGeometry) {
NamedValue<Geometry> namedValue = new NamedValue<Geometry>();
namedValue.setValue(new GeometryValue((AbstractGeometry)value));
return namedValue;
} else if (value instanceof ReferenceType) {
NamedValue<ReferenceType> namedValue = new NamedValue<ReferenceType>();
namedValue.setValue(new ReferenceValue((ReferenceType)value));
return namedValue;
} else if (value instanceof W3CHrefAttribute) {
NamedValue<W3CHrefAttribute> namedValue = new NamedValue<W3CHrefAttribute>();
namedValue.setValue(new HrefAttributeValue((W3CHrefAttribute)value));
return namedValue;
} else {
throw new UnsupportedDecoderXmlInputException(this, xmlObject);
}
}
private CodeWithAuthority getIdentifier(OMObservationType omObservation) throws OwsExceptionReport {
if (omObservation.getIdentifier() != null) {
Object decodedObject = CodingHelper.decodeXmlObject(omObservation.getIdentifier());
if (decodedObject instanceof CodeWithAuthority) {
return (CodeWithAuthority) decodedObject;
}
}
return null;
}
=======
>>>>>>> |
<<<<<<<
private int previousTimerValue;
=======
private WintertodtNotifyMode notifyCondition;
private Color damageNotificationColor;
>>>>>>>
private int previousTimerValue;
private WintertodtNotifyMode notifyCondition;
private Color damageNotificationColor; |
<<<<<<<
@Inject
private EventBus eventBus;
=======
@Getter
@Inject
private ColorPickerManager colorPickerManager;
>>>>>>>
@Getter
@Inject
private ColorPickerManager colorPickerManager;
@Inject
private EventBus eventBus; |
<<<<<<<
public static final int FULLSCREEN_CONTAINER_TLI = 165;
=======
public static final int FULLSCREEN_CONTAINER_TLI = 165;
>>>>>>>
public static final int FULLSCREEN_CONTAINER_TLI = 165;
<<<<<<<
=======
public static final int SETTINGS_SIDE_GROUP_ID = 116;
public static final int SETTINGS_GROUP_ID = 134;
public static final int GWD_KC_GROUP_ID = 406;
>>>>>>>
public static final int SETTINGS_SIDE_GROUP_ID = 116;
public static final int SETTINGS_GROUP_ID = 134;
public static final int GWD_KC_GROUP_ID = 406;
<<<<<<<
static final int MULTICOMBAT_INDICATOR = 17;
=======
static final int MULTICOMBAT_INDICATOR = 18;
>>>>>>>
public static final int MULTICOMBAT_INDICATOR = 18;
<<<<<<<
static class HORN_GLORY
{
static final int ATTACKER = 5;
static final int DEFENDER = 6;
static final int COLLECTOR = 7;
static final int HEALER = 8;
}
static class REWARD_VALUES
{
static final int RUNNERS_PASSED = 14;
static final int HITPOINTS_REPLENISHED = 19;
static final int WRONG_POISON_PACKS_USED = 20;
static final int EGGS_COLLECTED = 21;
static final int FAILED_ATTACKER_ATTACKS = 22;
static final int RUNNERS_PASSED_POINTS = 24;
static final int RANGERS_KILLED = 25;
static final int FIGHTERS_KILLED = 26;
static final int HEALERS_KILLED = 27;
static final int RUNNERS_KILLED = 28;
static final int HITPOINTS_REPLENISHED_POINTS = 29;
static final int WRONG_POISON_PACKS_USED_POINTS = 30;
static final int EGGS_COLLECTED_POINTS = 31;
static final int FAILED_ATTACKER_ATTACKS_POINTS = 32;
static final int BASE_POINTS = 33;
static final int HONOUR_POINTS_REWARD = 49;
}
=======
>>>>>>>
<<<<<<<
static class DialogSprite2
{
static final int SPRITE1 = 1;
static final int TEXT = 2;
static final int SPRITE2 = 3;
static final int CONTINUE = 4;
}
static class QuestTab
{
static final int QUEST_TAB = 3;
}
=======
>>>>>>>
<<<<<<<
static class JewelBox
{
static final int DUEL_RING = 2;
static final int GAME_NECK = 3;
static final int COMB_BRAC = 4;
static final int SKIL_NECK = 5;
static final int RING_OFGP = 6;
static final int AMUL_GLOR = 7; // yes
}
static class Options
=======
static class SettingsSide
{
static final int CAMERA_ZOOM_SLIDER_TRACK = 59;
static final int MUSIC_SLIDER = 13;
static final int SOUND_EFFECT_SLIDER = 17;
static final int AREA_SOUND_SLIDER = 21;
}
static class Settings
>>>>>>>
static class SettingsSide
{
static final int CAMERA_ZOOM_SLIDER_TRACK = 59;
static final int MUSIC_SLIDER = 13;
static final int SOUND_EFFECT_SLIDER = 17;
static final int AREA_SOUND_SLIDER = 21;
}
static class Settings |
<<<<<<<
import net.runelite.client.util.StackFormatter;
=======
import net.runelite.client.util.QuantityFormatter;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
>>>>>>>
import net.runelite.client.util.QuantityFormatter; |
<<<<<<<
/**
* Used when getting High Alchemy value - multiplied by general store price.
*/
public static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
=======
/**
* Width of a standard item sprite
*/
public static final int ITEM_SPRITE_WIDTH = 36;
/**
* Height of a standard item sprite
*/
public static final int ITEM_SPRITE_HEIGHT = 32;
/**
* High alchemy = shop price * HIGH_ALCHEMY_MULTIPLIER
*
* @see ItemComposition#getPrice
*/
public static final float HIGH_ALCHEMY_MULTIPLIER = .6f;
>>>>>>>
/**
* Used when getting High Alchemy value - multiplied by general store price.
*/
public static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
/**
* Width of a standard item sprite
*/
public static final int ITEM_SPRITE_WIDTH = 36;
/**
* Height of a standard item sprite
*/
public static final int ITEM_SPRITE_HEIGHT = 32;
/**
* High alchemy = shop price * HIGH_ALCHEMY_MULTIPLIER
*
* @see ItemComposition#getPrice
*/
public static final float HIGH_ALCHEMY_MULTIPLIER = .6f; |
<<<<<<<
public RuneLiteModule(final Supplier<Applet> clientLoader, boolean developerMode)
=======
public RuneLiteModule(Supplier<Applet> clientLoader, boolean developerMode, File sessionfile, File config)
>>>>>>>
public RuneLiteModule(final Supplier<Applet> clientLoader, File config) |
<<<<<<<
else if (plugin.getRoomBlacklist().contains(room.getBoss().getName().toLowerCase())
|| plugin.isEnableRotationWhitelist() && bossCount > bossMatches)
=======
else if (plugin.getRoomBlacklist().contains(room.getName().toLowerCase())
|| config.enableRotationWhitelist() && bossCount > bossMatches)
>>>>>>>
else if (plugin.getRoomBlacklist().contains(room.getName().toLowerCase())
|| plugin.isEnableRotationWhitelist() && bossCount > bossMatches)
<<<<<<<
String bossName = room.getBoss().getName();
String bossNameLC = bossName.toLowerCase();
if (plugin.isShowRecommendedItems() && plugin.getRecommendedItemsList().get(bossNameLC) != null)
{
imageIds.addAll(plugin.getRecommendedItemsList().get(bossNameLC));
}
tableComponent.addRow(plugin.isShowRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(bossName, color));
=======
String name = room == RaidRoom.UNKNOWN_COMBAT ? "Unknown" : room.getName();
panelComponent.getChildren().add(LineComponent.builder()
.left(room.getType().getName())
.right(name)
.rightColor(color)
.build());
>>>>>>>
String bossName = room.getName();
String bossNameLC = bossName.toLowerCase();
if (plugin.isShowRecommendedItems() && plugin.getRecommendedItemsList().get(bossNameLC) != null)
{
imageIds.addAll(plugin.getRecommendedItemsList().get(bossNameLC));
}
tableComponent.addRow(plugin.isShowRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(bossName, color));
<<<<<<<
tableComponent.addRow(plugin.isShowRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(puzzleName, color));
break;
case FARMING:
if (plugin.isShowScavsFarms())
{
tableComponent.addRow("", ColorUtil.prependColorTag(room.getType().getName(), new Color(181, 230, 29)));
}
=======
name = room == RaidRoom.UNKNOWN_PUZZLE ? "Unknown" : room.getName();
panelComponent.getChildren().add(LineComponent.builder()
.left(room.getType().getName())
.right(name)
.rightColor(color)
.build());
>>>>>>>
tableComponent.addRow(plugin.isShowRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(puzzleName, color));
break;
case FARMING:
if (plugin.isShowScavsFarms())
{
tableComponent.addRow("", ColorUtil.prependColorTag(room.getType().getName(), new Color(181, 230, 29)));
} |
<<<<<<<
/* Display flight speed */
if (this.flight.enabled)
{
String speed = String.format(this.stringSpeed + ": %.1f", this.flight.speed);
int width = this.fontRendererObj.getStringWidth(speed);
int x = this.width - 10 - width;
int y = this.height - 30;
Gui.drawRect(x - 2, y - 2, x + width + 2, y + 9, 0x88000000);
this.fontRendererObj.drawStringWithShadow(speed, x, y, 0xffffff);
}
if (running)
{
this.scrub.value = (int) this.runner.ticks;
this.scrub.value = MathHelper.clamp(this.scrub.value, this.scrub.min, this.scrub.max);
this.frame.setValue(this.scrub.value);
}
if (!running && this.playing)
{
this.updatePlauseButton();
this.runner.attachOutside();
this.scrub.setValueFromScrub(0);
ClientProxy.EVENT_BUS.post(new CameraEditorPlaybackStateEvent(false, this.scrub.value));
this.playing = false;
}
=======
>>>>>>> |
<<<<<<<
=======
//------------------------------------------------------------//
// Skilling
//------------------------------------------------------------//
/* @ConfigItem(
keyName = "easyConstruction",
name = "Easy Construction",
description = "Makes 'Remove'/'Build' the default option for listed item ID's in build mode.<br>Tip: Use dev tools \"'Game Objects\" to find out the ID!",
position = 59,
group = "Skilling"
)
default boolean getEasyConstruction()
{
return false;
}
>>>>>>>
//------------------------------------------------------------//
// Skilling
//------------------------------------------------------------// |
<<<<<<<
@Inject
private EventBus eventBus;
=======
@Inject
private PvpToolsPlugin pvpTools;
@Inject
private PvpToolsConfig pvpToolsConfig;
>>>>>>>
@Inject
private EventBus eventBus;
@Inject
private PvpToolsPlugin pvpTools;
@Inject
private PvpToolsConfig pvpToolsConfig;
<<<<<<<
eventBus.unregister(this);
client.setHideFriendCastOptions(false);
=======
>>>>>>>
eventBus.unregister(this); |
<<<<<<<
import org.jetbrains.annotations.NotNull;
=======
import okhttp3.OkHttpClient;
>>>>>>>
import org.jetbrains.annotations.NotNull;
import okhttp3.OkHttpClient;
<<<<<<<
=======
@Value
private static class ImageKey
{
private final int itemId;
private final int itemQuantity;
private final boolean stackable;
}
@Value
private static class OutlineKey
{
private final int itemId;
private final int itemQuantity;
private final Color outlineColor;
}
private final Client client;
private final ClientThread clientThread;
private final ItemClient itemClient;
private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
private Map<Integer, ItemStats> itemStats = Collections.emptyMap();
private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages;
private final LoadingCache<Integer, ItemComposition> itemCompositions;
private final LoadingCache<OutlineKey, BufferedImage> itemOutlines;
>>>>>>>
@Value
private static class ImageKey
{
private final int itemId;
private final int itemQuantity;
private final boolean stackable;
}
@Value
private static class OutlineKey
{
private final int itemId;
private final int itemQuantity;
private final Color outlineColor;
}
private final Client client;
private final ClientThread clientThread;
private final ItemClient itemClient;
private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
private Map<Integer, ItemStats> itemStats = Collections.emptyMap();
private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages;
private final LoadingCache<Integer, ItemDefinition> itemDefinitions;
private final LoadingCache<OutlineKey, BufferedImage> itemOutlines;
<<<<<<<
public ItemManager(
Client client,
ScheduledExecutorService executor,
ClientThread clientThread,
EventBus eventbus,
ItemClient itemClient
)
=======
public ItemManager(Client client, ScheduledExecutorService scheduledExecutorService, ClientThread clientThread,
OkHttpClient okHttpClient)
>>>>>>>
public ItemManager(
Client client,
ScheduledExecutorService executor,
ClientThread clientThread,
EventBus eventbus,
OkHttpClient okHttpClient) |
<<<<<<<
=======
private final boolean developerMode;
private final boolean safeMode;
>>>>>>>
private final boolean safeMode;
<<<<<<<
=======
@Named("developerMode") final boolean developerMode,
@Named("safeMode") final boolean safeMode,
>>>>>>>
@Named("safeMode") final boolean safeMode,
<<<<<<<
=======
this.developerMode = developerMode;
this.safeMode = safeMode;
>>>>>>>
this.safeMode = safeMode;
<<<<<<<
@SuppressWarnings("unchecked") Class<Plugin> pluginClass = (Class<Plugin>) clazz;
=======
if (pluginDescriptor.developerPlugin() && !developerMode)
{
continue;
}
if (safeMode && !pluginDescriptor.loadInSafeMode())
{
log.debug("Disabling {} due to safe mode", clazz);
// also disable the plugin from autostarting later
configManager.unsetConfiguration(RuneLiteConfig.GROUP_NAME, clazz.getSimpleName().toLowerCase());
continue;
}
Class<Plugin> pluginClass = (Class<Plugin>) clazz;
>>>>>>>
if (safeMode && !pluginDescriptor.loadInSafeMode())
{
log.debug("Disabling {} due to safe mode", clazz);
// also disable the plugin from autostarting later
configManager.unsetConfiguration(RuneLiteConfig.GROUP_NAME, clazz.getSimpleName().toLowerCase());
continue;
}
@SuppressWarnings("unchecked") Class<Plugin> pluginClass = (Class<Plugin>) clazz; |
<<<<<<<
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.HitsplatApplied;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.PlayerDespawned;
=======
import net.runelite.client.events.ConfigChanged;
>>>>>>>
import net.runelite.api.events.GameTick;
import net.runelite.api.events.HitsplatApplied;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.PlayerDespawned; |
<<<<<<<
import java.awt.Image;
import lombok.AccessLevel;
=======
>>>>>>>
import lombok.AccessLevel;
<<<<<<<
IndicatorIndicator(final GameIndicator indicator, final Image image, final Plugin plugin)
=======
IndicatorIndicator(GameIndicator indicator, Plugin plugin)
>>>>>>>
IndicatorIndicator(final GameIndicator indicator, final Plugin plugin) |
<<<<<<<
=======
import java.io.File;
import java.io.IOException;
>>>>>>>
import java.io.File;
<<<<<<<
import net.runelite.api.Client;
=======
import javax.inject.Named;
import net.runelite.client.RuneLite;
>>>>>>>
import javax.inject.Named;
import net.runelite.api.Client;
import net.runelite.client.RuneLite;
<<<<<<<
@Mock
@Bind
private OpenOSRSConfig openOSRSConfig;
=======
@Bind
@Named("sessionfile")
File sessionfile = RuneLite.DEFAULT_SESSION_FILE;
@Bind
@Named("config")
File config = RuneLite.DEFAULT_CONFIG_FILE;
>>>>>>>
@Mock
@Bind
private OpenOSRSConfig openOSRSConfig;
@Bind
@Named("config")
private File config = RuneLite.DEFAULT_CONFIG_FILE; |
<<<<<<<
import java.awt.Component;
import java.awt.Dimension;
=======
import java.awt.Component;
import java.awt.Container;
import java.awt.EventQueue;
>>>>>>>
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue; |
<<<<<<<
import com.dianping.puma.core.entity.PumaTask;
import com.dianping.puma.core.entity.SrcDBInstance;
=======
import com.dianping.puma.biz.entity.PumaTask;
import com.dianping.puma.biz.entity.SrcDBInstance;
import com.dianping.puma.core.model.event.EventCenter;
import com.dianping.puma.core.storage.holder.BinlogInfoHolder;
>>>>>>>
<<<<<<<
import com.dianping.puma.core.monitor.NotifyService;
import com.dianping.puma.core.service.PumaTaskStateService;
import com.dianping.puma.core.service.SrcDBInstanceService;
import com.dianping.puma.core.storage.holder.BinlogInfoHolder;
=======
import com.dianping.puma.biz.monitor.NotifyService;
import com.dianping.puma.biz.service.PumaTaskStateService;
import com.dianping.puma.biz.service.SrcDBInstanceService;
>>>>>>>
import com.dianping.puma.core.storage.holder.BinlogInfoHolder;
<<<<<<<
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
>>>>>>> |
<<<<<<<
import net.runelite.client.plugins.loottracker.localstorage.LTItemEntry;
import net.runelite.client.plugins.loottracker.localstorage.LTRecord;
import net.runelite.client.plugins.loottracker.localstorage.LootRecordWriter;
=======
import net.runelite.client.task.Schedule;
>>>>>>>
import net.runelite.client.plugins.loottracker.localstorage.LTItemEntry;
import net.runelite.client.plugins.loottracker.localstorage.LTRecord;
import net.runelite.client.plugins.loottracker.localstorage.LootRecordWriter;
import net.runelite.client.task.Schedule;
<<<<<<<
eventBus.unregister(this);
=======
submitLoot();
>>>>>>>
eventBus.unregister(this);
submitLoot();
<<<<<<<
private void onMenuOptionClicked(MenuOptionClicked event)
{
if (event.getActionParam1() != WidgetInfo.INVENTORY.getId())
{
return;
}
int itemId = event.getIdentifier();
if (itemId == -1)
{
return;
}
String option = event.getOption();
ItemDefinition itemComposition = client.getItemDefinition(itemId);
if (option.equals("Open") && itemComposition.getName().equals("Supply crate"))
{
eventType = WINTERTODT_EVENT;
takeInventorySnapshot();
}
}
private void saveLocalLootRecord(LootRecord lootRecord)
{
lootRecords.add(lootRecord);
try
{
BufferedWriter bufferedWriter = Files.newBufferedWriter(LOOT_RECORDS_FILE.toPath());
bufferedWriter.append(RuneLiteAPI.GSON.toJson(lootRecords));
bufferedWriter.close();
}
catch (IOException e)
{
if (e instanceof FileNotFoundException)
{
try
{
LOOT_RECORDS_FILE.createNewFile();
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
e.printStackTrace();
}
}
void deleteLocalRecords()
{
try
{
lootRecords.clear();
Files.deleteIfExists(LOOT_RECORDS_FILE.toPath());
}
catch (IOException e)
{
log.error("Error deleting local loot records file.");
log.error(Arrays.toString(e.getStackTrace()));
}
}
/**
* Takes a snapshot of the local player's inventory and equipment right before respawn.
*/
private void deathInventorySnapshot()
{
final ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
inventorySnapshot = HashMultiset.create();
if (inventory != null)
{
Arrays.stream(inventory.getItems())
.forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity()));
}
if (equipment != null)
{
Arrays.stream(equipment.getItems())
.forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity()));
}
}
=======
@Schedule(
period = 5,
unit = ChronoUnit.MINUTES,
asynchronous = true
)
public void submitLootTask()
{
submitLoot();
}
private void submitLoot()
{
List<LootRecord> copy;
synchronized (queuedLoots)
{
if (queuedLoots.isEmpty())
{
return;
}
copy = new ArrayList<>(queuedLoots);
queuedLoots.clear();
}
if (lootTrackerClient == null || !config.saveLoot())
{
return;
}
log.debug("Submitting {} loot records", copy.size());
lootTrackerClient.submit(copy);
}
>>>>>>>
private void onMenuOptionClicked(MenuOptionClicked event)
{
if (event.getActionParam1() != WidgetInfo.INVENTORY.getId())
{
return;
}
int itemId = event.getIdentifier();
if (itemId == -1)
{
return;
}
String option = event.getOption();
ItemDefinition itemComposition = client.getItemDefinition(itemId);
if (option.equals("Open") && itemComposition.getName().equals("Supply crate"))
{
eventType = WINTERTODT_EVENT;
takeInventorySnapshot();
}
}
private void saveLocalLootRecord(LootRecord lootRecord)
{
lootRecords.add(lootRecord);
try
{
BufferedWriter bufferedWriter = Files.newBufferedWriter(LOOT_RECORDS_FILE.toPath());
bufferedWriter.append(RuneLiteAPI.GSON.toJson(lootRecords));
bufferedWriter.close();
}
catch (IOException e)
{
if (e instanceof FileNotFoundException)
{
try
{
LOOT_RECORDS_FILE.createNewFile();
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
e.printStackTrace();
}
}
void deleteLocalRecords()
{
try
{
lootRecords.clear();
Files.deleteIfExists(LOOT_RECORDS_FILE.toPath());
}
catch (IOException e)
{
log.error("Error deleting local loot records file.");
log.error(Arrays.toString(e.getStackTrace()));
}
}
/**
* Takes a snapshot of the local player's inventory and equipment right before respawn.
*/
private void deathInventorySnapshot()
{
final ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
inventorySnapshot = HashMultiset.create();
if (inventory != null)
{
Arrays.stream(inventory.getItems())
.forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity()));
}
if (equipment != null)
{
Arrays.stream(equipment.getItems())
.forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity()));
}
}
@Schedule(
period = 5,
unit = ChronoUnit.MINUTES,
asynchronous = true
)
public void submitLootTask()
{
submitLoot();
}
private void submitLoot()
{
List<LootRecord> copy;
synchronized (queuedLoots)
{
if (queuedLoots.isEmpty())
{
return;
}
copy = new ArrayList<>(queuedLoots);
queuedLoots.clear();
}
if (lootTrackerClient == null || !config.saveLoot())
{
return;
}
log.debug("Submitting {} loot records", copy.size());
lootTrackerClient.submit(copy);
} |
<<<<<<<
import net.runelite.client.plugins.menuentryswapper.util.teleEquippedMode;
=======
import net.runelite.client.plugins.menuentryswapper.util.ConstructionCapeMode;
import static net.runelite.client.util.MenuUtil.swap;
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
else if (this.getSwapTanning && option.equalsIgnoreCase("Tan 1"))
{
swap(client, "Tan All", option, target);
}
else if (this.getSwapSawmill && target.equalsIgnoreCase("Sawmill operator"))
{
swap(client, "Buy-plank", option, target);
}
else if (this.getSwapSawmillPlanks && option.equalsIgnoreCase("Buy 1"))
{
swap(client, "Buy All", option, target);
}
else if (option.equalsIgnoreCase("Clear-All") && target.equalsIgnoreCase("Bank Filler"))
{
swap(client, "Clear", option, target);
}
else if (target.contains("ardougne cloak") && this.getSwapArdougneCape)
{
swap(client, "Kandarin Monastery", option, target);
swap(client, "Monastery Teleport", option, target);
}
else if (target.contains("crafting cape") && this.getSwapCraftingCape)
{
swap(client, "Teleport", option, target);
}
else if (target.contains("construct. cape") && this.getSwapConstructionCape)
{
swap(client, constructionCapeMode.toString(), option, target);
}
else if (target.contains("magic cape") && this.getSwapMagicCape)
{
swap(client, "Spellbook", option, target);
}
else if (target.contains("explorer's ring") && this.getSwapExplorersRing)
{
swap(client, "Teleport", option, target);
}
>>>>>>>
<<<<<<<
=======
if (option.equals("talk-to") || option.equals("attack"))
{
if (this.swapPickpocket)
{
swap(client, "pickpocket", option, target, true);
}
>>>>>>>
<<<<<<<
if (this.getSwapBuyFifty)
=======
else if (this.swapHardWoodGrove && option.equals("open") && target.equals("hardwood grove doors"))
>>>>>>>
if (this.getSwapBuyFifty)
<<<<<<<
if (this.getSwapSellOne)
=======
else if (this.swapTravel && option.equals("inspect") && target.equals("trapdoor"))
>>>>>>>
if (this.getSwapSellOne)
<<<<<<<
if (this.swapAssignment)
=======
else if (this.swapAdmire && option.equals("admire"))
>>>>>>>
if (this.swapAssignment)
<<<<<<<
if (this.teleEquippedCape)
{
menuManager.addPriorityEntry(this.telecapeMode.toString(), "tele to poh");
menuManager.addPriorityEntry(this.telecapeMode.toString(), "teleport");
}
=======
>>>>>>>
<<<<<<<
menuManager.removeSwaps("Fairy ring");
menuManager.removeSwaps("Tree");
menuManager.removePriorityEntry("Smith All");
menuManager.removePriorityEntry("Smith All Sets");
menuManager.removePriorityEntry("Tan All");
menuManager.removePriorityEntry("Buy-plank", "Sawmill operator");
menuManager.removePriorityEntry("Buy All");
menuManager.removePriorityEntry("Kandarin Monastery");
menuManager.removePriorityEntry("Monastery Teleport");
menuManager.removePriorityEntry("Teleport", "Crafting cape");
menuManager.removePriorityEntry("Teleport", "Crafting cape(t)");
menuManager.removePriorityEntry("Tele to poh", "Construct. cape");
menuManager.removePriorityEntry("Tele to poh", "Construct. cape(t)");
menuManager.removePriorityEntry("Spellbook", "Magic cape");
menuManager.removePriorityEntry("Spellbook", "Magic cape(t)");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 2");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 3");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 4");
menuManager.removePriorityEntry("Pickpocket");
menuManager.removePriorityEntry("Send-parcel", "Rionasta");
menuManager.removePriorityEntry("Bank");
menuManager.removePriorityEntry("Exchange");
menuManager.removePriorityEntry("Contract");
menuManager.removePriorityEntry("Repairs");
menuManager.removePriorityEntry("Claim-slime");
menuManager.removePriorityEntry("Decant");
menuManager.removePriorityEntry("Claim");
menuManager.removePriorityEntry("Heal");
menuManager.removePriorityEntry("Help");
menuManager.removePriorityEntry("Assignment");
menuManager.removePriorityEntry("Buy-plank");
menuManager.removePriorityEntry("Trade");
menuManager.removePriorityEntry("Trade-with");
menuManager.removePriorityEntry("Shop");
menuManager.removePriorityEntry("Story");
menuManager.removePriorityEntry("Escort");
menuManager.removePriorityEntry("Dream");
menuManager.removePriorityEntry("Start-minigame");
menuManager.removePriorityEntry("Travel");
menuManager.removePriorityEntry("Pay-fare");
menuManager.removePriorityEntry("Charter");
menuManager.removePriorityEntry("Take-boat");
menuManager.removePriorityEntry("Fly");
menuManager.removePriorityEntry("Jatizso");
menuManager.removePriorityEntry("Neitiznot");
menuManager.removePriorityEntry("Rellekka");
menuManager.removePriorityEntry("Follow");
menuManager.removePriorityEntry("Transport");
menuManager.removePriorityEntry("Teleport", "Mage of zamorak");
menuManager.removePriorityEntry("Pay");
menuManager.removePriorityEntry("Pay (");
menuManager.removePriorityEntry("Quick-travel");
menuManager.removePriorityEntry("Enchant");
menuManager.removePriorityEntry("Edgeville", "Lever");
menuManager.removePriorityEntry("Metamorphosis", "Baby chinchompa");
menuManager.removePriorityEntry("Stun", "Hoop snake");
menuManager.removePriorityEntry("Pay-toll(2-ecto)", "Energy barrier");
menuManager.removePriorityEntry("Pay-toll(10gp)", "Gate");
menuManager.removePriorityEntry("Travel", "Trapdoor");
menuManager.removePriorityEntry("Harpoon");
menuManager.removePriorityEntry("Reset");
menuManager.removePriorityEntry("Lay");
menuManager.removePriorityEntry("Activate");
menuManager.removePriorityEntry("Chase");
menuManager.removePriorityEntry("Empty", "Birdhouse");
menuManager.removePriorityEntry("Quick-enter");
menuManager.removePriorityEntry("Quick-start");
menuManager.removePriorityEntry("Quick-pass");
menuManager.removePriorityEntry("Quick-open");
menuManager.removePriorityEntry("Quick-enter");
menuManager.removePriorityEntry("Quick-leave");
menuManager.removePriorityEntry("Teleport");
menuManager.removePriorityEntry("Spellbook");
menuManager.removePriorityEntry("Perks");
menuManager.removePriorityEntry("Private");
menuManager.removePriorityEntry("Pick-lots");
menuManager.removePriorityEntry("Search");
menuManager.removePriorityEntry("Search for traps");
menuManager.removePriorityEntry("Guzzle");
menuManager.removePriorityEntry("Rub");
menuManager.removePriorityEntry("Teleport");
switch (this.swapFairyRingMode)
{
case OFF:
case ZANARIS:
menuManager.removeSwaps("Fairy ring");
menuManager.removeSwaps("Tree");
break;
case CONFIGURE:
menuManager.removePriorityEntry("Configure");
break;
case LAST_DESTINATION:
menuManager.removePriorityEntry("Last-destination");
break;
}
switch (this.swapOccultMode)
{
case LUNAR:
menuManager.removePriorityEntry("Lunar");
break;
case ANCIENT:
menuManager.removePriorityEntry("Ancient");
break;
case ARCEUUS:
menuManager.removePriorityEntry("Arceuus");
break;
}
switch (this.swapObeliskMode)
{
case SET_DESTINATION:
menuManager.removePriorityEntry("Set destination");
break;
case TELEPORT_TO_DESTINATION:
menuManager.removePriorityEntry("Teleport to destination");
break;
}
switch (this.swapHomePortalMode)
{
case HOME:
menuManager.removePriorityEntry("Home");
break;
case BUILD_MODE:
menuManager.removePriorityEntry("Build mode");
break;
case FRIENDS_HOUSE:
menuManager.removePriorityEntry("Friend's house");
break;
}
=======
>>>>>>>
menuManager.removeSwaps("Fairy ring");
menuManager.removeSwaps("Tree");
menuManager.removePriorityEntry("Smith All");
menuManager.removePriorityEntry("Smith All Sets");
menuManager.removePriorityEntry("Tan All");
menuManager.removePriorityEntry("Buy-plank", "Sawmill operator");
menuManager.removePriorityEntry("Buy All");
menuManager.removePriorityEntry("Kandarin Monastery");
menuManager.removePriorityEntry("Monastery Teleport");
menuManager.removePriorityEntry("Teleport", "Crafting cape");
menuManager.removePriorityEntry("Teleport", "Crafting cape(t)");
menuManager.removePriorityEntry("Tele to poh", "Construct. cape");
menuManager.removePriorityEntry("Tele to poh", "Construct. cape(t)");
menuManager.removePriorityEntry("Spellbook", "Magic cape");
menuManager.removePriorityEntry("Spellbook", "Magic cape(t)");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 2");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 3");
menuManager.removePriorityEntry("Teleport", "Explorer's ring 4");
menuManager.removePriorityEntry("Pickpocket");
menuManager.removePriorityEntry("Send-parcel", "Rionasta");
menuManager.removePriorityEntry("Bank");
menuManager.removePriorityEntry("Exchange");
menuManager.removePriorityEntry("Contract");
menuManager.removePriorityEntry("Repairs");
menuManager.removePriorityEntry("Claim-slime");
menuManager.removePriorityEntry("Decant");
menuManager.removePriorityEntry("Claim");
menuManager.removePriorityEntry("Heal");
menuManager.removePriorityEntry("Help");
menuManager.removePriorityEntry("Assignment");
menuManager.removePriorityEntry("Buy-plank");
menuManager.removePriorityEntry("Trade");
menuManager.removePriorityEntry("Trade-with");
menuManager.removePriorityEntry("Shop");
menuManager.removePriorityEntry("Story");
menuManager.removePriorityEntry("Escort");
menuManager.removePriorityEntry("Dream");
menuManager.removePriorityEntry("Start-minigame");
menuManager.removePriorityEntry("Travel");
menuManager.removePriorityEntry("Pay-fare");
menuManager.removePriorityEntry("Charter");
menuManager.removePriorityEntry("Take-boat");
menuManager.removePriorityEntry("Fly");
menuManager.removePriorityEntry("Jatizso");
menuManager.removePriorityEntry("Neitiznot");
menuManager.removePriorityEntry("Rellekka");
menuManager.removePriorityEntry("Follow");
menuManager.removePriorityEntry("Transport");
menuManager.removePriorityEntry("Teleport", "Mage of zamorak");
menuManager.removePriorityEntry("Pay");
menuManager.removePriorityEntry("Pay (");
menuManager.removePriorityEntry("Quick-travel");
menuManager.removePriorityEntry("Enchant");
menuManager.removePriorityEntry("Edgeville", "Lever");
menuManager.removePriorityEntry("Metamorphosis", "Baby chinchompa");
menuManager.removePriorityEntry("Stun", "Hoop snake");
menuManager.removePriorityEntry("Pay-toll(2-ecto)", "Energy barrier");
menuManager.removePriorityEntry("Pay-toll(10gp)", "Gate");
menuManager.removePriorityEntry("Travel", "Trapdoor");
menuManager.removePriorityEntry("Harpoon");
menuManager.removePriorityEntry("Reset");
menuManager.removePriorityEntry("Lay");
menuManager.removePriorityEntry("Activate");
menuManager.removePriorityEntry("Chase");
menuManager.removePriorityEntry("Empty", "Birdhouse");
menuManager.removePriorityEntry("Quick-enter");
menuManager.removePriorityEntry("Quick-start");
menuManager.removePriorityEntry("Quick-pass");
menuManager.removePriorityEntry("Quick-open");
menuManager.removePriorityEntry("Quick-enter");
menuManager.removePriorityEntry("Quick-leave");
menuManager.removePriorityEntry("Teleport");
menuManager.removePriorityEntry("Spellbook");
menuManager.removePriorityEntry("Perks");
menuManager.removePriorityEntry("Private");
menuManager.removePriorityEntry("Pick-lots");
menuManager.removePriorityEntry("Search");
menuManager.removePriorityEntry("Search for traps");
menuManager.removePriorityEntry("Guzzle");
menuManager.removePriorityEntry("Rub");
menuManager.removePriorityEntry("Teleport");
switch (this.swapFairyRingMode)
{
case OFF:
case ZANARIS:
menuManager.removeSwaps("Fairy ring");
menuManager.removeSwaps("Tree");
break;
case CONFIGURE:
menuManager.removePriorityEntry("Configure");
break;
case LAST_DESTINATION:
menuManager.removePriorityEntry("Last-destination");
break;
}
switch (this.swapOccultMode)
{
case LUNAR:
menuManager.removePriorityEntry("Lunar");
break;
case ANCIENT:
menuManager.removePriorityEntry("Ancient");
break;
case ARCEUUS:
menuManager.removePriorityEntry("Arceuus");
break;
}
switch (this.swapObeliskMode)
{
case SET_DESTINATION:
menuManager.removePriorityEntry("Set destination");
break;
case TELEPORT_TO_DESTINATION:
menuManager.removePriorityEntry("Teleport to destination");
break;
}
switch (this.swapHomePortalMode)
{
case HOME:
menuManager.removePriorityEntry("Home");
break;
case BUILD_MODE:
menuManager.removePriorityEntry("Build mode");
break;
case FRIENDS_HOUSE:
menuManager.removePriorityEntry("Friend's house");
break;
} |
<<<<<<<
/*
* Copyright (c) 2018, Psikoi <https://github.com/Psikoi>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.worldhopper;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import javax.annotation.Nonnull;
import javax.inject.Singleton;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.FontManager;
import net.runelite.client.util.ImageUtil;
@Singleton
class WorldTableHeader extends JPanel
{
private static final ImageIcon ARROW_UP;
private static final ImageIcon HIGHLIGHT_ARROW_DOWN;
private static final ImageIcon HIGHLIGHT_ARROW_UP;
private static final Color ARROW_COLOR = ColorScheme.LIGHT_GRAY_COLOR;
private static final Color HIGHLIGHT_COLOR = ColorScheme.BRAND_BLUE;
static
{
final BufferedImage arrowDown = ImageUtil.getResourceStreamFromClass(WorldHopperPlugin.class, "arrow_down.png");
final BufferedImage arrowUp = ImageUtil.rotateImage(arrowDown, Math.PI);
final BufferedImage arrowUpFaded = ImageUtil.grayscaleOffset(arrowUp, -80);
ARROW_UP = new ImageIcon(arrowUpFaded);
final BufferedImage highlightArrowDown = ImageUtil.fillImage(arrowDown, HIGHLIGHT_COLOR);
final BufferedImage highlightArrowUp = ImageUtil.fillImage(arrowUp, HIGHLIGHT_COLOR);
HIGHLIGHT_ARROW_DOWN = new ImageIcon(highlightArrowDown);
HIGHLIGHT_ARROW_UP = new ImageIcon(highlightArrowUp);
}
private final JLabel textLabel = new JLabel();
private final JLabel arrowLabel = new JLabel();
// Determines if this header column is being used to order the list
private boolean ordering = false;
WorldTableHeader(String title, boolean ordered, boolean ascending, @Nonnull Runnable onRefresh)
{
setLayout(new BorderLayout(5, 0));
setBorder(new CompoundBorder(
BorderFactory.createMatteBorder(0, 0, 0, 1, ColorScheme.MEDIUM_GRAY_COLOR),
new EmptyBorder(0, 5, 0, 2)));
setBackground(ColorScheme.SCROLL_TRACK_COLOR);
addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent mouseEvent)
{
textLabel.setForeground(HIGHLIGHT_COLOR);
if (!ordering)
{
arrowLabel.setIcon(HIGHLIGHT_ARROW_UP);
}
}
@Override
public void mouseExited(MouseEvent mouseEvent)
{
if (!ordering)
{
textLabel.setForeground(ARROW_COLOR);
arrowLabel.setIcon(ARROW_UP);
}
}
});
textLabel.setText(title);
textLabel.setFont(FontManager.getRunescapeSmallFont());
final JMenuItem refresh = new JMenuItem("Refresh worlds");
refresh.addActionListener(e ->
onRefresh.run());
final JPopupMenu popupMenu = new JPopupMenu();
popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(refresh);
textLabel.setComponentPopupMenu(popupMenu);
setComponentPopupMenu(popupMenu);
highlight(ordered, ascending);
add(textLabel, BorderLayout.WEST);
add(arrowLabel, BorderLayout.EAST);
}
/**
* The labels inherit the parent's mouse listeners.
*/
@Override
public void addMouseListener(MouseListener mouseListener)
{
super.addMouseListener(mouseListener);
textLabel.addMouseListener(mouseListener);
arrowLabel.addMouseListener(mouseListener);
}
/**
* If this column header is being used to order, then it should be
* highlighted, changing it's font color and icon.
*/
public void highlight(boolean on, boolean ascending)
{
ordering = on;
arrowLabel.setIcon(on ? (ascending ? HIGHLIGHT_ARROW_DOWN : HIGHLIGHT_ARROW_UP) : ARROW_UP);
textLabel.setForeground(on ? HIGHLIGHT_COLOR : ARROW_COLOR);
}
}
=======
/*
* Copyright (c) 2018, Psikoi <https://github.com/Psikoi>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.worldhopper;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import javax.annotation.Nonnull;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.FontManager;
import net.runelite.client.util.ImageUtil;
class WorldTableHeader extends JPanel
{
private static final ImageIcon ARROW_UP;
private static final ImageIcon HIGHLIGHT_ARROW_DOWN;
private static final ImageIcon HIGHLIGHT_ARROW_UP;
private static final Color ARROW_COLOR = ColorScheme.LIGHT_GRAY_COLOR;
private static final Color HIGHLIGHT_COLOR = ColorScheme.BRAND_ORANGE;
static
{
final BufferedImage arrowDown = ImageUtil.getResourceStreamFromClass(WorldHopperPlugin.class, "arrow_down.png");
final BufferedImage arrowUp = ImageUtil.rotateImage(arrowDown, Math.PI);
final BufferedImage arrowUpFaded = ImageUtil.luminanceOffset(arrowUp, -80);
ARROW_UP = new ImageIcon(arrowUpFaded);
final BufferedImage highlightArrowDown = ImageUtil.fillImage(arrowDown, HIGHLIGHT_COLOR);
final BufferedImage highlightArrowUp = ImageUtil.fillImage(arrowUp, HIGHLIGHT_COLOR);
HIGHLIGHT_ARROW_DOWN = new ImageIcon(highlightArrowDown);
HIGHLIGHT_ARROW_UP = new ImageIcon(highlightArrowUp);
}
private final JLabel textLabel = new JLabel();
private final JLabel arrowLabel = new JLabel();
// Determines if this header column is being used to order the list
private boolean ordering = false;
WorldTableHeader(String title, boolean ordered, boolean ascending, @Nonnull Runnable onRefresh)
{
setLayout(new BorderLayout(5, 0));
setBorder(new CompoundBorder(
BorderFactory.createMatteBorder(0, 0, 0, 1, ColorScheme.MEDIUM_GRAY_COLOR),
new EmptyBorder(0, 5, 0, 2)));
setBackground(ColorScheme.SCROLL_TRACK_COLOR);
addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent mouseEvent)
{
textLabel.setForeground(HIGHLIGHT_COLOR);
if (!ordering)
{
arrowLabel.setIcon(HIGHLIGHT_ARROW_UP);
}
}
@Override
public void mouseExited(MouseEvent mouseEvent)
{
if (!ordering)
{
textLabel.setForeground(ARROW_COLOR);
arrowLabel.setIcon(ARROW_UP);
}
}
});
textLabel.setText(title);
textLabel.setFont(FontManager.getRunescapeSmallFont());
final JMenuItem refresh = new JMenuItem("Refresh worlds");
refresh.addActionListener(e ->
{
onRefresh.run();
});
final JPopupMenu popupMenu = new JPopupMenu();
popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(refresh);
textLabel.setComponentPopupMenu(popupMenu);
setComponentPopupMenu(popupMenu);
highlight(ordered, ascending);
add(textLabel, BorderLayout.WEST);
add(arrowLabel, BorderLayout.EAST);
}
/**
* The labels inherit the parent's mouse listeners.
*/
@Override
public void addMouseListener(MouseListener mouseListener)
{
super.addMouseListener(mouseListener);
textLabel.addMouseListener(mouseListener);
arrowLabel.addMouseListener(mouseListener);
}
/**
* If this column header is being used to order, then it should be
* highlighted, changing it's font color and icon.
*/
public void highlight(boolean on, boolean ascending)
{
ordering = on;
arrowLabel.setIcon(on ? (ascending ? HIGHLIGHT_ARROW_DOWN : HIGHLIGHT_ARROW_UP) : ARROW_UP);
textLabel.setForeground(on ? HIGHLIGHT_COLOR : ARROW_COLOR);
}
}
>>>>>>>
/*
* Copyright (c) 2018, Psikoi <https://github.com/Psikoi>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.worldhopper;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import javax.annotation.Nonnull;
import javax.inject.Singleton;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.FontManager;
import net.runelite.client.util.ImageUtil;
@Singleton
class WorldTableHeader extends JPanel
{
private static final ImageIcon ARROW_UP;
private static final ImageIcon HIGHLIGHT_ARROW_DOWN;
private static final ImageIcon HIGHLIGHT_ARROW_UP;
private static final Color ARROW_COLOR = ColorScheme.LIGHT_GRAY_COLOR;
private static final Color HIGHLIGHT_COLOR = ColorScheme.BRAND_BLUE;
static
{
final BufferedImage arrowDown = ImageUtil.getResourceStreamFromClass(WorldHopperPlugin.class, "arrow_down.png");
final BufferedImage arrowUp = ImageUtil.rotateImage(arrowDown, Math.PI);
final BufferedImage arrowUpFaded = ImageUtil.luminanceOffset(arrowUp, -80);
ARROW_UP = new ImageIcon(arrowUpFaded);
final BufferedImage highlightArrowDown = ImageUtil.fillImage(arrowDown, HIGHLIGHT_COLOR);
final BufferedImage highlightArrowUp = ImageUtil.fillImage(arrowUp, HIGHLIGHT_COLOR);
HIGHLIGHT_ARROW_DOWN = new ImageIcon(highlightArrowDown);
HIGHLIGHT_ARROW_UP = new ImageIcon(highlightArrowUp);
}
private final JLabel textLabel = new JLabel();
private final JLabel arrowLabel = new JLabel();
// Determines if this header column is being used to order the list
private boolean ordering = false;
WorldTableHeader(String title, boolean ordered, boolean ascending, @Nonnull Runnable onRefresh)
{
setLayout(new BorderLayout(5, 0));
setBorder(new CompoundBorder(
BorderFactory.createMatteBorder(0, 0, 0, 1, ColorScheme.MEDIUM_GRAY_COLOR),
new EmptyBorder(0, 5, 0, 2)));
setBackground(ColorScheme.SCROLL_TRACK_COLOR);
addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent mouseEvent)
{
textLabel.setForeground(HIGHLIGHT_COLOR);
if (!ordering)
{
arrowLabel.setIcon(HIGHLIGHT_ARROW_UP);
}
}
@Override
public void mouseExited(MouseEvent mouseEvent)
{
if (!ordering)
{
textLabel.setForeground(ARROW_COLOR);
arrowLabel.setIcon(ARROW_UP);
}
}
});
textLabel.setText(title);
textLabel.setFont(FontManager.getRunescapeSmallFont());
final JMenuItem refresh = new JMenuItem("Refresh worlds");
refresh.addActionListener(e ->
onRefresh.run());
final JPopupMenu popupMenu = new JPopupMenu();
popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(refresh);
textLabel.setComponentPopupMenu(popupMenu);
setComponentPopupMenu(popupMenu);
highlight(ordered, ascending);
add(textLabel, BorderLayout.WEST);
add(arrowLabel, BorderLayout.EAST);
}
/**
* The labels inherit the parent's mouse listeners.
*/
@Override
public void addMouseListener(MouseListener mouseListener)
{
super.addMouseListener(mouseListener);
textLabel.addMouseListener(mouseListener);
arrowLabel.addMouseListener(mouseListener);
}
/**
* If this column header is being used to order, then it should be
* highlighted, changing it's font color and icon.
*/
public void highlight(boolean on, boolean ascending)
{
ordering = on;
arrowLabel.setIcon(on ? (ascending ? HIGHLIGHT_ARROW_DOWN : HIGHLIGHT_ARROW_UP) : ARROW_UP);
textLabel.setForeground(on ? HIGHLIGHT_COLOR : ARROW_COLOR);
}
} |
<<<<<<<
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
=======
import com.google.common.base.Joiner;
>>>>>>>
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
<<<<<<<
import java.awt.Color;
import java.awt.image.BufferedImage;
=======
import java.io.IOException;
>>>>>>>
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.IOException;
<<<<<<<
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
=======
import java.util.Arrays;
import java.util.concurrent.ScheduledExecutorService;
>>>>>>>
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
<<<<<<<
import net.runelite.api.ItemID;
import net.runelite.api.MenuOpcode;
=======
import net.runelite.api.MenuAction;
import net.runelite.api.MessageNode;
>>>>>>>
import net.runelite.api.ItemID;
import net.runelite.api.MenuOpcode;
import net.runelite.api.MessageNode;
<<<<<<<
import net.runelite.api.events.ClientTick;
import net.runelite.api.events.ConfigChanged;
=======
import net.runelite.client.events.ConfigChanged;
>>>>>>>
import net.runelite.api.events.ClientTick;
<<<<<<<
import net.runelite.client.eventbus.EventBus;
=======
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ChatInput;
>>>>>>>
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.events.ChatInput;
import net.runelite.client.events.ConfigChanged;
<<<<<<<
import net.runelite.client.plugins.raids.solver.RotationSolver;
import net.runelite.client.ui.ClientToolbar;
import net.runelite.client.ui.NavigationButton;
=======
>>>>>>>
import net.runelite.client.ui.ClientToolbar;
import net.runelite.client.ui.NavigationButton;
<<<<<<<
import net.runelite.client.ui.overlay.tooltip.Tooltip;
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
import net.runelite.client.util.ImageUtil;
import net.runelite.api.util.Text;
import org.apache.commons.lang3.StringUtils;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
=======
import net.runelite.client.util.Text;
import static net.runelite.client.util.Text.sanitize;
>>>>>>>
import net.runelite.client.ui.overlay.tooltip.Tooltip;
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
import net.runelite.client.util.ImageUtil;
<<<<<<<
private static final Pattern RAID_COMPLETE_REGEX = Pattern.compile("Congratulations - your raid is complete! Duration: ([0-9:]+)");
private static final ImmutableSet<String> GOOD_CRABS_FIRST = ImmutableSet.of(
"FSCCP.PCSCF - #WNWSWN#ESEENW", //both good crabs
"SCSPF.CCSPF - #ESWWNW#ESENES", //both good crabs
"SPCFC.CSPCF - #WWNEEE#WSWNWS", //both good crabs
"SCFCP.CSCFS - #ENEESW#ENWWSW", //good crabs
"SCPFC.CCSSF - #NEESEN#WSWWNE", //good crabs
"SCFPC.CSPCF - #WSWWNE#WSEENE" //good crabs first rare crabs second
);
private static final ImmutableSet<String> GOOD_CRABS_SECOND = ImmutableSet.of(
"FSCCP.PCSCF - #WNWSWN#ESEENW", //both good crabs
"SCSPF.CCSPF - #ESWWNW#ESENES", //both good crabs
"SPCFC.CSPCF - #WWNEEE#WSWNWS", //both good crabs
"SCPFC.CSPCF - #NEEESW#WWNEEE", //rare crabs first good crabs second
"SCFCP.CCSPF - #ESEENW#ESWWNW", //bad crabs first good crabs second
"SCPFC.CSPSF - #WWSEEE#NWSWWN", //bad crabs first good crabs second
"SFCCS.PCPSF - #ENWWSW#ENESEN", //bad crabs first good crabs second
"SPCFC.SCCPF - #ESENES#WWWNEE", //bad crabs first good crabs second
"SPSFP.CCCSF - #NWSWWN#ESEENW", //bad crabs first good crabs second
"FSCCP.PCSCF - #ENWWWS#NEESEN", //bad crabs first good crabs second
"FSCCS.PCPSF - #WSEEEN#WSWNWS" //bad crabs first good crabs second
);
private static final ImmutableSet<String> RARE_CRABS_FIRST = ImmutableSet.of(
"SCPFC.CSPCF - #NEEESW#WWNEEE", //rare crabs first good crabs second
"SCPFC.PCSCF - #WNEEES#NWSWNW", //rare crabs first bad crabs second
"SCPFC.CCPSF - #NWWWSE#WNEESE" //both rare crabs
);
private static final ImmutableSet<String> RARE_CRABS_SECOND = ImmutableSet.of(
"SCPFC.CCPSF - #NWWWSE#WNEESE", //both rare crabs
"FSCPC.CSCPF - #WNWWSE#EENWWW", //bad crabs first rare crabs second
"SCFPC.PCCSF - #WSEENE#WWWSEE", //bad crabs first rare crabs second
"SCFPC.SCPCF - #NESENE#WSWWNE", //bad crabs first rare crabs second
"SFCCP.CSCPF - #WNEESE#NWSWWN", //bad crabs first rare crabs second
"SCFPC.CSPCF - #WSWWNE#WSEENE" //good crabs first rare crabs second
);
private static final Pattern PUZZLES = Pattern.compile("Puzzle - (\\w+)");
@Getter(AccessLevel.NONE)
=======
private static final String LAYOUT_COMMAND = "!layout";
>>>>>>>
private static final String LAYOUT_COMMAND = "!layout";
private static final Pattern RAID_COMPLETE_REGEX = Pattern.compile("Congratulations - your raid is complete! Duration: ([0-9:]+)");
private static final ImmutableSet<String> GOOD_CRABS_FIRST = ImmutableSet.of(
"FSCCP.PCSCF - #WNWSWN#ESEENW", //both good crabs
"SCSPF.CCSPF - #ESWWNW#ESENES", //both good crabs
"SPCFC.CSPCF - #WWNEEE#WSWNWS", //both good crabs
"SCFCP.CSCFS - #ENEESW#ENWWSW", //good crabs
"SCPFC.CCSSF - #NEESEN#WSWWNE", //good crabs
"SCFPC.CSPCF - #WSWWNE#WSEENE" //good crabs first rare crabs second
);
private static final ImmutableSet<String> GOOD_CRABS_SECOND = ImmutableSet.of(
"FSCCP.PCSCF - #WNWSWN#ESEENW", //both good crabs
"SCSPF.CCSPF - #ESWWNW#ESENES", //both good crabs
"SPCFC.CSPCF - #WWNEEE#WSWNWS", //both good crabs
"SCPFC.CSPCF - #NEEESW#WWNEEE", //rare crabs first good crabs second
"SCFCP.CCSPF - #ESEENW#ESWWNW", //bad crabs first good crabs second
"SCPFC.CSPSF - #WWSEEE#NWSWWN", //bad crabs first good crabs second
"SFCCS.PCPSF - #ENWWSW#ENESEN", //bad crabs first good crabs second
"SPCFC.SCCPF - #ESENES#WWWNEE", //bad crabs first good crabs second
"SPSFP.CCCSF - #NWSWWN#ESEENW", //bad crabs first good crabs second
"FSCCP.PCSCF - #ENWWWS#NEESEN", //bad crabs first good crabs second
"FSCCS.PCPSF - #WSEEEN#WSWNWS" //bad crabs first good crabs second
);
private static final ImmutableSet<String> RARE_CRABS_FIRST = ImmutableSet.of(
"SCPFC.CSPCF - #NEEESW#WWNEEE", //rare crabs first good crabs second
"SCPFC.PCSCF - #WNEEES#NWSWNW", //rare crabs first bad crabs second
"SCPFC.CCPSF - #NWWWSE#WNEESE" //both rare crabs
);
private static final ImmutableSet<String> RARE_CRABS_SECOND = ImmutableSet.of(
"SCPFC.CCPSF - #NWWWSE#WNEESE", //both rare crabs
"FSCPC.CSCPF - #WNWWSE#EENWWW", //bad crabs first rare crabs second
"SCFPC.PCCSF - #WSEENE#WWWSEE", //bad crabs first rare crabs second
"SCFPC.SCPCF - #NESENE#WSWWNE", //bad crabs first rare crabs second
"SFCCP.CSCPF - #WNEESE#NWSWWN", //bad crabs first rare crabs second
"SCFPC.CSPCF - #WSWWNE#WSEENE" //good crabs first rare crabs second
);
private static final Pattern PUZZLES = Pattern.compile("Puzzle - (\\w+)");
@Getter(AccessLevel.NONE)
<<<<<<<
widgetOverlay = overlayManager.getWidgetOverlay(WidgetInfo.RAIDS_POINTS_INFOBOX);
RaidsPanel panel = injector.getInstance(RaidsPanel.class);
panel.init();
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(this.getClass(), "instancereloadhelper.png");
navButton = NavigationButton.builder()
.tooltip("Raids Reload")
.icon(icon)
.priority(8)
.panel(panel)
.build();
clientToolbar.addNavigation(navButton);
=======
chatCommandManager.registerCommandAsync(LAYOUT_COMMAND, this::lookupRaid, this::submitRaid);
>>>>>>>
chatCommandManager.registerCommandAsync(LAYOUT_COMMAND, this::lookupRaid, this::submitRaid);
widgetOverlay = overlayManager.getWidgetOverlay(WidgetInfo.RAIDS_POINTS_INFOBOX);
RaidsPanel panel = injector.getInstance(RaidsPanel.class);
panel.init();
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(this.getClass(), "instancereloadhelper.png");
navButton = NavigationButton.builder()
.tooltip("Raids Reload")
.icon(icon)
.priority(8)
.panel(panel)
.build();
clientToolbar.addNavigation(navButton);
<<<<<<<
eventBus.unregister(this);
=======
chatCommandManager.unregisterCommand(LAYOUT_COMMAND);
>>>>>>>
eventBus.unregister(this);
chatCommandManager.unregisterCommand(LAYOUT_COMMAND); |
<<<<<<<
@ObfuscatedName("mk")
=======
@ObfuscatedName("qb")
@ObfuscatedGetter(
intValue = -910754411
)
@Export("currentTrackGroupId")
static int currentTrackGroupId;
@ObfuscatedName("mo")
>>>>>>>
@ObfuscatedName("mk")
<<<<<<<
@Export("meslayerContinueWidget")
static Widget meslayerContinueWidget;
=======
@Export("areaSoundEffectVolume")
static int areaSoundEffectVolume;
>>>>>>>
@Export("meslayerContinueWidget")
static Widget meslayerContinueWidget;
<<<<<<<
@ObfuscatedName("pj")
=======
@ObfuscatedName("qi")
@ObfuscatedGetter(
intValue = -114703177
)
@Export("musicVolume")
static int musicVolume;
@ObfuscatedName("pu")
>>>>>>>
@ObfuscatedName("pj")
<<<<<<<
field864 = 255;
field865 = -1;
field855 = false;
=======
musicVolume = 255;
currentTrackGroupId = -1;
field759 = false;
>>>>>>>
musicVolume = 255;
currentTrackGroupId = -1;
field855 = false;
<<<<<<<
class197.musicTrack = null;
ByteArrayPool.soundCache = null;
}
=======
class49.midiPcmStream.setPcmStreamVolume(var5);
} else {
class49.midiPcmStream.clear();
class49.midiPcmStream.removeAll();
if (class197.musicTrackArchive != null) {
class197.field2386 = 2;
} else {
class197.field2386 = 0;
>>>>>>>
class197.musicTrack = null;
ByteArrayPool.soundCache = null;
}
<<<<<<<
if (class197.midiPcmStream.loadMusicTrack(class197.musicTrack, class197.musicPatchesArchive, ByteArrayPool.soundCache, 22050)) {
class197.midiPcmStream.clearAll();
class197.midiPcmStream.method3942(class197.field2379);
class197.midiPcmStream.setMusicTrack(class197.musicTrack, ScriptFrame.musicTrackBoolean);
class197.field2377 = 0;
=======
if (class49.midiPcmStream.loadMusicTrack(class197.musicTrack, class197.musicPatchesArchive, FriendLoginUpdate.soundCache, 22050)) {
class49.midiPcmStream.clearAll();
class49.midiPcmStream.setPcmStreamVolume(TileItem.musicTrackVolume);
class49.midiPcmStream.setMusicTrack(class197.musicTrack, WorldMapSectionType.musicTrackBoolean);
class197.field2386 = 0;
>>>>>>>
if (class197.midiPcmStream.loadMusicTrack(class197.musicTrack, class197.musicPatchesArchive, ByteArrayPool.soundCache, 22050)) {
class197.midiPcmStream.clearAll();
class197.midiPcmStream.setPcmStreamVolume(class197.musicTrackVolume);
class197.midiPcmStream.setMusicTrack(class197.musicTrack, ScriptFrame.musicTrackBoolean);
class197.field2377 = 0;
<<<<<<<
timer.method5119();
GrandExchangeOfferTotalQuantityComparator.method130();
ArchiveLoader.updatePlayer(var2);
WorldMapSectionType.field140 = -1;
Clock.loadRegions(false, var2);
=======
timer.method4939();
mouseLastLastPressedTimeMillis = -1L;
WorldMapLabel.mouseRecorder.index = 0;
TaskHandler.hasFocus = true;
hadFocus = true;
field860 = -1L;
class96.reflectionChecks = new IterableNodeDeque();
packetWriter.clearBuffer();
packetWriter.packetBuffer.offset = 0;
packetWriter.serverPacket = null;
packetWriter.field1300 = null;
packetWriter.field1291 = null;
packetWriter.field1301 = null;
packetWriter.serverPacketLength = 0;
packetWriter.field1297 = 0;
rebootTimer = 0;
logoutTimer = 0;
hintArrowType = 0;
ScriptEvent.method1205();
MouseHandler.MouseHandler_idleCycles = 0;
WorldMapDecoration.method349();
isItemSelected = 0;
isSpellSelected = false;
soundEffectCount = 0;
camAngleY = 0;
oculusOrbState = 0;
StudioGame.field3086 = null;
minimapState = 0;
field643 = -1;
destinationX = 0;
destinationY = 0;
playerAttackOption = AttackOption.AttackOption_hidden;
npcAttackOption = AttackOption.AttackOption_hidden;
npcCount = 0;
ClientPreferences.method1861();
for (var33 = 0; var33 < 2048; ++var33) {
players[var33] = null;
}
for (var33 = 0; var33 < 32768; ++var33) {
npcs[var33] = null;
}
combatTargetPlayerIndex = -1;
projectiles.clear();
graphicsObjects.clear();
for (var33 = 0; var33 < 4; ++var33) {
for (var14 = 0; var14 < 104; ++var14) {
for (var16 = 0; var16 < 104; ++var16) {
groundItems[var33][var14][var16] = null;
}
}
}
pendingSpawns = new NodeDeque();
Tiles.friendSystem.clear();
for (var33 = 0; var33 < VarpDefinition.VarpDefinition_fileCount; ++var33) {
VarpDefinition var28 = AbstractWorldMapData.VarpDefinition_get(var33);
if (var28 != null) {
Varps.Varps_temp[var33] = 0;
Varps.Varps_main[var33] = 0;
}
}
class197.varcs.clearTransient();
followerIndex = -1;
if (rootInterface != -1) {
InterfaceParent.method1192(rootInterface);
}
for (InterfaceParent var26 = (InterfaceParent)interfaceParents.first(); var26 != null; var26 = (InterfaceParent)interfaceParents.next()) {
FontName.closeInterface(var26, true);
}
rootInterface = -1;
interfaceParents = new NodeHashTable(8);
meslayerContinueWidget = null;
ScriptEvent.method1205();
playerAppearance.update((int[])null, new int[]{0, 0, 0, 0, 0}, false, -1);
for (var33 = 0; var33 < 8; ++var33) {
playerMenuActions[var33] = null;
playerOptionsPriorities[var33] = false;
}
FontName.method5266();
isLoading = true;
for (var33 = 0; var33 < 100; ++var33) {
field841[var33] = true;
}
class210.method3948();
Varps.clanChat = null;
for (var33 = 0; var33 < 8; ++var33) {
grandExchangeOffers[var33] = new GrandExchangeOffer();
}
TileItem.grandExchangeEvents = null;
AttackOption.updatePlayer(var2);
ServerPacket.field2131 = -1;
PlayerType.loadRegions(false, var2);
>>>>>>>
timer.method5119();
GrandExchangeOfferTotalQuantityComparator.method130();
ArchiveLoader.updatePlayer(var2);
WorldMapSectionType.field140 = -1;
Clock.loadRegions(false, var2);
<<<<<<<
=======
NetSocket.changeGameOptions(var5);
field782[++field823 - 1 & 31] = var5;
>>>>>>>
<<<<<<<
=======
NetSocket.changeGameOptions(var16);
field782[++field823 - 1 & 31] = var16;
>>>>>>>
<<<<<<<
if (ServerPacket.field2175 == var1.serverPacket) {
isCameraLocked = false;
for (var16 = 0; var16 < 5; ++var16) {
field641[var16] = false;
=======
if (ServerPacket.field2169 == var1.serverPacket) {
for (var16 = 0; var16 < Varps.Varps_main.length; ++var16) {
if (Varps.Varps_temp[var16] != Varps.Varps_main[var16]) {
Varps.Varps_main[var16] = Varps.Varps_temp[var16];
NetSocket.changeGameOptions(var16);
field782[++field823 - 1 & 31] = var16;
}
>>>>>>>
if (ServerPacket.field2175 == var1.serverPacket) {
isCameraLocked = false;
for (var16 = 0; var16 < 5; ++var16) {
field641[var16] = false;
<<<<<<<
if (ServerPacket.field2128 == var1.serverPacket) {
BoundaryObject.method3393();
var16 = var3.method5697();
var5 = var3.method5603();
var6 = var3.readUnsignedByte();
experience[var16] = var5;
currentLevels[var16] = var6;
levels[var16] = 1;
for (var7 = 0; var7 < 98; ++var7) {
if (var5 >= Skills.Skills_experienceTable[var7]) {
levels[var16] = var7 + 2;
=======
if (ServerPacket.field2099 == var1.serverPacket) {
for (var16 = 0; var16 < VarpDefinition.VarpDefinition_fileCount; ++var16) {
VarpDefinition var54 = AbstractWorldMapData.VarpDefinition_get(var16);
if (var54 != null) {
Varps.Varps_temp[var16] = 0;
Varps.Varps_main[var16] = 0;
>>>>>>>
if (ServerPacket.field2128 == var1.serverPacket) {
BoundaryObject.method3393();
var16 = var3.method5697();
var5 = var3.method5603();
var6 = var3.readUnsignedByte();
experience[var16] = var5;
currentLevels[var16] = var6;
levels[var16] = 1;
for (var7 = 0; var7 < 98; ++var7) {
if (var5 >= Skills.Skills_experienceTable[var7]) {
levels[var16] = var7 + 2; |
<<<<<<<
public static final int CRYSTALLINE_RAT_DEATH = 8334;
public static final int CRYSTALLINE_BAT_DEATH = 4917;
public static final int CRYSTALLINE_WOLF_DEATH = 8335;
public static final int CRYSTALLINE_SPIDER_DEATH = 8338;
public static final int CRYSTALLINE_UNICORN_DEATH = 6377;
public static final int CRYSTALLINE_DRAGON_DEATH = 92;
public static final int CRYSTALLINE_BEAR_DEATH = 4929;
public static final int CRYSTALLINE_DARK_BEAST_DEATH = 2733;
public static final int CORRUPTED_SCORPION_DEATH = 6256;
=======
public static final int FISHING_TRAILBLAZER_HARPOON = 8784;
public static final int FISHING_TRAILBLAZER_HARPOON_2 = 8785;
>>>>>>>
public static final int CRYSTALLINE_RAT_DEATH = 8334;
public static final int CRYSTALLINE_BAT_DEATH = 4917;
public static final int CRYSTALLINE_WOLF_DEATH = 8335;
public static final int CRYSTALLINE_SPIDER_DEATH = 8338;
public static final int CRYSTALLINE_UNICORN_DEATH = 6377;
public static final int CRYSTALLINE_DRAGON_DEATH = 92;
public static final int CRYSTALLINE_BEAR_DEATH = 4929;
public static final int CRYSTALLINE_DARK_BEAST_DEATH = 2733;
public static final int CORRUPTED_SCORPION_DEATH = 6256;
public static final int FISHING_TRAILBLAZER_HARPOON = 8784;
public static final int FISHING_TRAILBLAZER_HARPOON_2 = 8785; |
<<<<<<<
import net.runelite.client.util.NonScheduledExecutorServiceExceptionLogger;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Cache;
=======
import net.runelite.http.api.chat.ChatClient;
>>>>>>>
import net.runelite.client.util.NonScheduledExecutorServiceExceptionLogger;
import net.runelite.http.api.chat.ChatClient;
<<<<<<<
bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT.newBuilder()
.cache(new Cache(new File(RuneLite.CACHE_DIR, "okhttp"), MAX_OKHTTP_CACHE_SIZE))
.build());
=======
bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()));
bind(OkHttpClient.class).toInstance(okHttpClient);
>>>>>>>
bind(OkHttpClient.class).toInstance(okHttpClient);
<<<<<<<
@Provides
@Singleton
LauncherConfig provideLauncherConfig(ConfigManager configManager)
{
return configManager.getConfig(LauncherConfig.class);
}
@Provides
@Singleton
ScheduledExecutorService provideScheduledExecutorService()
{
return new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder()
.setNameFormat("scheduled-%d")
.build()));
}
@Provides
@Singleton
ExecutorService provideExecutorService()
{
int poolSize = 2 * Runtime.getRuntime().availableProcessors();
// Will start up to poolSize threads (because of allowCoreThreadTimeOut) as necessary, and times out
// unused threads after 1 minute
ThreadPoolExecutor executor = new ThreadPoolExecutor(poolSize, poolSize,
60L, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
new ThreadFactoryBuilder().setNameFormat("worker-%d").build());
executor.allowCoreThreadTimeOut(true);
return new NonScheduledExecutorServiceExceptionLogger(executor);
}
=======
@Provides
@Singleton
ChatClient provideChatClient(OkHttpClient okHttpClient)
{
return new ChatClient(okHttpClient);
}
>>>>>>>
@Provides
@Singleton
LauncherConfig provideLauncherConfig(ConfigManager configManager)
{
return configManager.getConfig(LauncherConfig.class);
}
@Provides
@Singleton
ScheduledExecutorService provideScheduledExecutorService()
{
return new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder()
.setNameFormat("scheduled-%d")
.build()));
}
@Provides
@Singleton
ExecutorService provideExecutorService()
{
int poolSize = 2 * Runtime.getRuntime().availableProcessors();
// Will start up to poolSize threads (because of allowCoreThreadTimeOut) as necessary, and times out
// unused threads after 1 minute
ThreadPoolExecutor executor = new ThreadPoolExecutor(poolSize, poolSize,
60L, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
new ThreadFactoryBuilder().setNameFormat("worker-%d").build());
executor.allowCoreThreadTimeOut(true);
return new NonScheduledExecutorServiceExceptionLogger(executor);
}
@Provides
@Singleton
ChatClient provideChatClient(OkHttpClient okHttpClient)
{
return new ChatClient(okHttpClient);
} |
<<<<<<<
import java.util.Arrays;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.naming.directory.SearchResult;
=======
import java.lang.reflect.Type;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
>>>>>>>
import java.util.Arrays;
import javax.imageio.ImageIO;
import javax.naming.directory.SearchResult;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
<<<<<<<
@Inject
public ItemClient(OkHttpClient client)
{
this.client = client;
}
public ItemPrice lookupItemPrice(int itemId) throws IOException
=======
public ItemPrice[] getPrices() throws IOException
>>>>>>>
public ItemPrice lookupItemPrice(int itemId) throws IOException
<<<<<<<
logger.debug("Error looking up item {}: {}", itemId, response);
=======
log.warn("Error looking up prices: {}", response);
>>>>>>>
log.debug("Error looking up item {}: {}", itemId, response);
<<<<<<<
logger.debug("Error looking up items {}: {}", Arrays.toString(itemIds), response);
=======
log.warn("Error looking up item stats: {}", response);
>>>>>>>
log.debug("Error looking up items {}: {}", Arrays.toString(itemIds), response); |
<<<<<<<
@Subscribe
=======
private void addSubscriptions()
{
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
eventBus.subscribe(PlayerLootReceived.class, this, this::onPlayerLootReceived);
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
}
>>>>>>>
@Subscribe
<<<<<<<
@Subscribe
private void onLocalPlayerDeath(LocalPlayerDeath event)
=======
private void onPlayerDeath(PlayerDeath event)
>>>>>>>
@Subscribe
private void onPlayerDeath(PlayerDeath event)
<<<<<<<
@Subscribe
private void onPlayerDeath(PlayerDeath event)
{
=======
>>>>>>> |
<<<<<<<
static final int MULTICOMBAT_INDICATOR = 21;
static final int BANK_PIN = 22;
static final int CLAN_CHAT_TAB = 32;
static final int FRIENDS_TAB = 34;
static final int IGNORES_TAB = 33;
static final int LOGOUT_TAB = 35;
static final int OPTIONS_TAB = 36;
static final int EMOTES_TAB = 37;
static final int MUSIC_TAB = 38;
static final int CLAN_CHAT_ICON = 39;
static final int FRIENDS_ICON = 41;
static final int IGNORES_ICON = 40;
static final int LOGOUT_ICON = 42;
static final int OPTIONS_ICON = 43;
static final int EMOTES_ICON = 44;
static final int MUSIC_ICON = 45;
static final int COMBAT_TAB = 49;
static final int STATS_TAB = 50;
static final int QUESTS_TAB = 51;
static final int INVENTORY_TAB = 52;
static final int EQUIPMENT_TAB = 53;
static final int PRAYER_TAB = 54;
static final int MAGIC_TAB = 55;
static final int COMBAT_ICON = 56;
static final int STATS_ICON = 57;
static final int QUESTS_ICON = 58;
static final int INVENTORY_ICON = 59;
static final int EQUIPMENT_ICON = 60;
static final int PRAYER_ICON = 61;
static final int MAGIC_ICON = 62;
static final int ROOT_INTERFACE_CONTAINER = 63;
static final int BANK_CONTAINER = 65;
static final int INTERFACE_CONTAINER = 66;
static final int INVENTORY_CONTAINER = 70;
=======
static final int CLAN_CHAT_TAB = 33;
static final int FRIENDS_TAB = 35;
static final int IGNORES_TAB = 34;
static final int LOGOUT_TAB = 36;
static final int OPTIONS_TAB = 37;
static final int EMOTES_TAB = 38;
static final int MUSIC_TAB = 39;
static final int CLAN_CHAT_ICON = 40;
static final int FRIENDS_ICON = 42;
static final int IGNORES_ICON = 41;
static final int LOGOUT_ICON = 43;
static final int OPTIONS_ICON = 44;
static final int EMOTES_ICON = 45;
static final int MUSIC_ICON = 46;
static final int COMBAT_TAB = 50;
static final int STATS_TAB = 51;
static final int QUESTS_TAB = 52;
static final int INVENTORY_TAB = 53;
static final int EQUIPMENT_TAB = 54;
static final int PRAYER_TAB = 55;
static final int MAGIC_TAB = 56;
static final int COMBAT_ICON = 57;
static final int STATS_ICON = 58;
static final int QUESTS_ICON = 59;
static final int INVENTORY_ICON = 60;
static final int EQUIPMENT_ICON = 61;
static final int PRAYER_ICON = 62;
static final int MAGIC_ICON = 63;
static final int ROOT_INTERFACE_CONTAINER = 64;
static final int BANK_CONTAINER = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 71;
>>>>>>>
static final int MULTICOMBAT_INDICATOR = 21;
static final int BANK_PIN = 22;
static final int CLAN_CHAT_TAB = 33;
static final int FRIENDS_TAB = 35;
static final int IGNORES_TAB = 34;
static final int LOGOUT_TAB = 36;
static final int OPTIONS_TAB = 37;
static final int EMOTES_TAB = 38;
static final int MUSIC_TAB = 39;
static final int CLAN_CHAT_ICON = 40;
static final int FRIENDS_ICON = 42;
static final int IGNORES_ICON = 41;
static final int LOGOUT_ICON = 43;
static final int OPTIONS_ICON = 44;
static final int EMOTES_ICON = 45;
static final int MUSIC_ICON = 46;
static final int COMBAT_TAB = 50;
static final int STATS_TAB = 51;
static final int QUESTS_TAB = 52;
static final int INVENTORY_TAB = 53;
static final int EQUIPMENT_TAB = 54;
static final int PRAYER_TAB = 55;
static final int MAGIC_TAB = 56;
static final int COMBAT_ICON = 57;
static final int STATS_ICON = 58;
static final int QUESTS_ICON = 59;
static final int INVENTORY_ICON = 60;
static final int EQUIPMENT_ICON = 61;
static final int PRAYER_ICON = 62;
static final int MAGIC_ICON = 63;
static final int ROOT_INTERFACE_CONTAINER = 64;
static final int BANK_CONTAINER = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 71;
<<<<<<<
static final int ITEMS_KEPT_ON_DEATH = 13;
static final int BANK_PIN = 13;
static final int MULTICOMBAT_INDICATOR = 17;
static final int CLAN_CHAT_TAB = 36;
static final int FRIENDS_TAB = 38;
static final int IGNORES_TAB = 37;
static final int LOGOUT_TAB = 39;
static final int OPTIONS_TAB = 40;
static final int EMOTES_TAB = 41;
static final int MUSIC_TAB = 42;
static final int CLAN_CHAT_ICON = 43;
static final int FRIENDS_ICON = 45;
static final int IGNORES_ICON = 44;
static final int LOGOUT_ICON = 46;
static final int OPTIONS_ICON = 47;
static final int EMOTES_ICON = 48;
static final int MUSIC_ICON = 49;
static final int COMBAT_TAB = 52;
static final int STATS_TAB = 53;
static final int QUESTS_TAB = 54;
static final int INVENTORY_TAB = 55;
static final int EQUIPMENT_TAB = 56;
static final int PRAYER_TAB = 57;
static final int MAGIC_TAB = 58;
static final int COMBAT_ICON = 59;
static final int STATS_ICON = 60;
static final int QUESTS_ICON = 61;
static final int INVENTORY_ICON = 62;
static final int EQUIPMENT_ICON = 63;
static final int PRAYER_ICON = 64;
static final int MAGIC_ICON = 65;
static final int INTERFACE_CONTAINER = 66;
static final int INVENTORY_CONTAINER = 72;
=======
static final int CLAN_CHAT_TAB = 37;
static final int FRIENDS_TAB = 39;
static final int IGNORES_TAB = 38;
static final int LOGOUT_TAB = 40;
static final int OPTIONS_TAB = 41;
static final int EMOTES_TAB = 42;
static final int MUSIC_TAB = 43;
static final int CLAN_CHAT_ICON = 44;
static final int FRIENDS_ICON = 46;
static final int IGNORES_ICON = 45;
static final int LOGOUT_ICON = 47;
static final int OPTIONS_ICON = 48;
static final int EMOTES_ICON = 49;
static final int MUSIC_ICON = 50;
static final int COMBAT_TAB = 53;
static final int STATS_TAB = 54;
static final int QUESTS_TAB = 55;
static final int INVENTORY_TAB = 56;
static final int EQUIPMENT_TAB = 57;
static final int PRAYER_TAB = 58;
static final int MAGIC_TAB = 59;
static final int COMBAT_ICON = 60;
static final int STATS_ICON = 61;
static final int QUESTS_ICON = 62;
static final int INVENTORY_ICON = 63;
static final int EQUIPMENT_ICON = 64;
static final int PRAYER_ICON = 65;
static final int MAGIC_ICON = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 73;
>>>>>>>
static final int ITEMS_KEPT_ON_DEATH = 13;
static final int BANK_PIN = 13;
static final int MULTICOMBAT_INDICATOR = 17;
static final int CLAN_CHAT_TAB = 37;
static final int FRIENDS_TAB = 39;
static final int IGNORES_TAB = 38;
static final int LOGOUT_TAB = 40;
static final int OPTIONS_TAB = 41;
static final int EMOTES_TAB = 42;
static final int MUSIC_TAB = 43;
static final int CLAN_CHAT_ICON = 44;
static final int FRIENDS_ICON = 46;
static final int IGNORES_ICON = 45;
static final int LOGOUT_ICON = 47;
static final int OPTIONS_ICON = 48;
static final int EMOTES_ICON = 49;
static final int MUSIC_ICON = 50;
static final int COMBAT_TAB = 53;
static final int STATS_TAB = 54;
static final int QUESTS_TAB = 55;
static final int INVENTORY_TAB = 56;
static final int EQUIPMENT_TAB = 57;
static final int PRAYER_TAB = 58;
static final int MAGIC_TAB = 59;
static final int COMBAT_ICON = 60;
static final int STATS_ICON = 61;
static final int QUESTS_ICON = 62;
static final int INVENTORY_ICON = 63;
static final int EQUIPMENT_ICON = 64;
static final int PRAYER_ICON = 65;
static final int MAGIC_ICON = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 73;
<<<<<<<
static final int BANK_PIN = 13;
static final int LOGOUT_BUTTON_OVERLAY = 30;
=======
static final int LOGOUT_BUTTON_OVERLAY = 31;
>>>>>>>
static final int BANK_PIN = 13;
static final int LOGOUT_BUTTON_OVERLAY = 31; |
<<<<<<<
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
=======
import net.runelite.client.config.Units;
>>>>>>>
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units; |
<<<<<<<
import net.runelite.client.plugins.menuentryswapper.BankComparableEntry;
import net.runelite.client.plugins.menuentryswapper.EquipmentComparableEntry;
=======
import static net.runelite.client.plugins.runecraft.AbyssRifts.*;
>>>>>>>
import net.runelite.client.plugins.menuentryswapper.BankComparableEntry;
import net.runelite.client.plugins.menuentryswapper.EquipmentComparableEntry;
import static net.runelite.client.plugins.runecraft.AbyssRifts.*;
<<<<<<<
=======
@Getter(AccessLevel.PACKAGE)
private final Set<DecorativeObject> abyssObjects = new HashSet<>();
@Getter(AccessLevel.PACKAGE)
private final Set<AbyssRifts> rifts = new HashSet<>();
@Getter(AccessLevel.PACKAGE)
private boolean degradedPouchInInventory;
@Getter(AccessLevel.PACKAGE)
private NPC darkMage;
>>>>>>>
private final Set<AbyssRifts> rifts = new HashSet<>();
<<<<<<<
@Getter(AccessLevel.NONE)
private RunecraftOverlay runecraftOverlay;
@Inject
@Getter(AccessLevel.NONE)
=======
private AbyssMinimapOverlay abyssMinimapOverlay;
@Inject
>>>>>>>
@Getter(AccessLevel.NONE)
private AbyssMinimapOverlay abyssMinimapOverlay;
@Inject
@Getter(AccessLevel.NONE)
private RunecraftOverlay runecraftOverlay;
@Inject
@Getter(AccessLevel.NONE)
<<<<<<<
updateConfig();
addSubscriptions();
abyssOverlay.updateConfig();
overlayManager.add(abyssOverlay);
overlayManager.add(runecraftOverlay);
handleSwaps();
=======
overlayManager.add(abyssOverlay);
overlayManager.add(abyssMinimapOverlay);
updateRifts();
>>>>>>>
updateConfig();
addSubscriptions();
overlayManager.add(abyssOverlay);
overlayManager.add(abyssMinimapOverlay);
overlayManager.add(runecraftOverlay);
handleSwaps();
<<<<<<<
eventBus.unregister(this);
=======
overlayManager.remove(abyssOverlay);
overlayManager.remove(abyssMinimapOverlay);
>>>>>>>
eventBus.unregister(this);
<<<<<<<
return;
}
updateConfig();
abyssOverlay.updateConfig();
if (event.getKey().equals("essPouch") || event.getKey().equals("Lavas"))
{
removeSwaps();
handleSwaps();
=======
updateRifts();
>>>>>>>
return;
}
updateConfig();
if (event.getKey().equals("essPouch") || event.getKey().equals("Lavas"))
{
removeSwaps();
handleSwaps();
<<<<<<<
private void handleSwaps()
{
if (this.essPouch)
{
menuManager.addPriorityEntry(POUCH).setPriority(100);
menuManager.addPriorityEntry(EMPTY_SMALL).setPriority(10);
menuManager.addPriorityEntry(EMPTY_MEDIUM).setPriority(10);
menuManager.addPriorityEntry(EMPTY_LARGE).setPriority(10);
menuManager.addPriorityEntry(EMPTY_GIANT).setPriority(10);
}
else
{
menuManager.removePriorityEntry(POUCH);
menuManager.removePriorityEntry(EMPTY_SMALL);
menuManager.removePriorityEntry(EMPTY_MEDIUM);
menuManager.removePriorityEntry(EMPTY_LARGE);
menuManager.removePriorityEntry(EMPTY_GIANT);
}
if (client.getLocalPlayer() == null || !this.lavas)
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "pure essence", false, true);
return;
}
if (client.getLocalPlayer().getWorldLocation().getRegionID() != FIRE_ALTAR)
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "Pure essence", false, true);
menuManager.addPriorityEntry(DUEL_ARENA).setPriority(100);
menuManager.removePriorityEntry(CASTLE_WARS);
}
else if (client.getLocalPlayer().getWorldLocation().getRegionID() == FIRE_ALTAR)
{
menuManager.addHiddenEntry("craft", "altar", false, false);
menuManager.addHiddenEntry("use", "Pure essence", false, true);
menuManager.addPriorityEntry(CASTLE_WARS).setPriority(100);
menuManager.removePriorityEntry(DUEL_ARENA);
}
}
private void removeSwaps()
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "Pure essence", false, true);
menuManager.removePriorityEntry(POUCH);
menuManager.removePriorityEntry(EMPTY_SMALL);
menuManager.removePriorityEntry(EMPTY_MEDIUM);
menuManager.removePriorityEntry(EMPTY_LARGE);
menuManager.removePriorityEntry(EMPTY_GIANT);
menuManager.removePriorityEntry(CASTLE_WARS);
menuManager.removePriorityEntry(DUEL_ARENA);
}
private void updateConfig()
{
this.lavas = config.lavas();
this.essPouch = config.essPouch();
this.hightlightDarkMage = config.hightlightDarkMage();
this.degradingNotification = config.degradingNotification();
this.showRifts = config.showRifts();
this.showAir = config.showAir();
this.showBlood = config.showBlood();
this.showBody = config.showBody();
this.showChaos = config.showChaos();
this.showCosmic = config.showCosmic();
this.showDeath = config.showDeath();
this.showEarth = config.showEarth();
this.showFire = config.showFire();
this.showLaw = config.showLaw();
this.showMind = config.showMind();
this.showNature = config.showNature();
this.showSoul = config.showSoul();
this.showWater = config.showWater();
this.showClickBox = config.showClickBox();
}
=======
private void updateRifts()
{
rifts.clear();
if (config.showAir())
{
rifts.add(AIR_RIFT);
}
if (config.showBlood())
{
rifts.add(BLOOD_RIFT);
}
if (config.showBody())
{
rifts.add(BODY_RIFT);
}
if (config.showChaos())
{
rifts.add(CHAOS_RIFT);
}
if (config.showCosmic())
{
rifts.add(COSMIC_RIFT);
}
if (config.showDeath())
{
rifts.add(DEATH_RIFT);
}
if (config.showEarth())
{
rifts.add(EARTH_RIFT);
}
if (config.showFire())
{
rifts.add(FIRE_RIFT);
}
if (config.showLaw())
{
rifts.add(LAW_RIFT);
}
if (config.showMind())
{
rifts.add(MIND_RIFT);
}
if (config.showNature())
{
rifts.add(NATURE_RIFT);
}
if (config.showSoul())
{
rifts.add(SOUL_RIFT);
}
if (config.showWater())
{
rifts.add(WATER_RIFT);
}
}
>>>>>>>
private void handleSwaps()
{
if (this.essPouch)
{
menuManager.addPriorityEntry(POUCH).setPriority(100);
menuManager.addPriorityEntry(EMPTY_SMALL).setPriority(10);
menuManager.addPriorityEntry(EMPTY_MEDIUM).setPriority(10);
menuManager.addPriorityEntry(EMPTY_LARGE).setPriority(10);
menuManager.addPriorityEntry(EMPTY_GIANT).setPriority(10);
}
else
{
menuManager.removePriorityEntry(POUCH);
menuManager.removePriorityEntry(EMPTY_SMALL);
menuManager.removePriorityEntry(EMPTY_MEDIUM);
menuManager.removePriorityEntry(EMPTY_LARGE);
menuManager.removePriorityEntry(EMPTY_GIANT);
}
if (client.getLocalPlayer() == null || !this.lavas)
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "pure essence", false, true);
return;
}
if (client.getLocalPlayer().getWorldLocation().getRegionID() != FIRE_ALTAR)
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "Pure essence", false, true);
menuManager.addPriorityEntry(DUEL_ARENA).setPriority(100);
menuManager.removePriorityEntry(CASTLE_WARS);
}
else if (client.getLocalPlayer().getWorldLocation().getRegionID() == FIRE_ALTAR)
{
menuManager.addHiddenEntry("craft", "altar", false, false);
menuManager.addHiddenEntry("use", "Pure essence", false, true);
menuManager.addPriorityEntry(CASTLE_WARS).setPriority(100);
menuManager.removePriorityEntry(DUEL_ARENA);
}
}
private void removeSwaps()
{
menuManager.removeHiddenEntry("craft", "altar", false, false);
menuManager.removeHiddenEntry("use", "Pure essence", false, true);
menuManager.removePriorityEntry(POUCH);
menuManager.removePriorityEntry(EMPTY_SMALL);
menuManager.removePriorityEntry(EMPTY_MEDIUM);
menuManager.removePriorityEntry(EMPTY_LARGE);
menuManager.removePriorityEntry(EMPTY_GIANT);
menuManager.removePriorityEntry(CASTLE_WARS);
menuManager.removePriorityEntry(DUEL_ARENA);
}
private void updateConfig()
{
this.lavas = config.lavas();
this.essPouch = config.essPouch();
this.hightlightDarkMage = config.hightlightDarkMage();
this.degradingNotification = config.degradingNotification();
this.showRifts = config.showRifts();
this.showAir = config.showAir();
this.showBlood = config.showBlood();
this.showBody = config.showBody();
this.showChaos = config.showChaos();
this.showCosmic = config.showCosmic();
this.showDeath = config.showDeath();
this.showEarth = config.showEarth();
this.showFire = config.showFire();
this.showLaw = config.showLaw();
this.showMind = config.showMind();
this.showNature = config.showNature();
this.showSoul = config.showSoul();
this.showWater = config.showWater();
this.showClickBox = config.showClickBox();
updateRifts();
}
private void updateRifts()
{
rifts.clear();
if (config.showAir())
{
rifts.add(AIR_RIFT);
}
if (config.showBlood())
{
rifts.add(BLOOD_RIFT);
}
if (config.showBody())
{
rifts.add(BODY_RIFT);
}
if (config.showChaos())
{
rifts.add(CHAOS_RIFT);
}
if (config.showCosmic())
{
rifts.add(COSMIC_RIFT);
}
if (config.showDeath())
{
rifts.add(DEATH_RIFT);
}
if (config.showEarth())
{
rifts.add(EARTH_RIFT);
}
if (config.showFire())
{
rifts.add(FIRE_RIFT);
}
if (config.showLaw())
{
rifts.add(LAW_RIFT);
}
if (config.showMind())
{
rifts.add(MIND_RIFT);
}
if (config.showNature())
{
rifts.add(NATURE_RIFT);
}
if (config.showSoul())
{
rifts.add(SOUL_RIFT);
}
if (config.showWater())
{
rifts.add(WATER_RIFT);
}
} |
<<<<<<<
import java.util.HashMap;
=======
import java.nio.charset.StandardCharsets;
import java.util.List;
>>>>>>>
import java.util.HashMap;
import java.nio.charset.StandardCharsets;
<<<<<<<
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<HashMap<Integer, Integer[]>>() {}.getType());
=======
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), new TypeToken<List<XteaKey>>() { }.getType());
>>>>>>>
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), new TypeToken<HashMap<Integer, Integer[]>>() {}.getType());
<<<<<<<
=======
public XteaKey get(int region) throws IOException
{
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
.addPathSegment("xtea")
.addPathSegment(Integer.toString(region))
.build();
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = client.newCall(request).execute())
{
InputStream in = response.body().byteStream();
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), XteaKey.class);
}
catch (JsonParseException ex)
{
throw new IOException(ex);
}
}
>>>>>>> |
<<<<<<<
import com.google.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.events.ConfigChanged;
=======
import net.runelite.client.events.ConfigChanged;
>>>>>>>
import com.google.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter; |
<<<<<<<
import net.runelite.client.eventbus.Subscribe;
import org.junit.After;
=======
import okhttp3.OkHttpClient;
import okhttp3.Request;
>>>>>>>
import net.runelite.client.eventbus.Subscribe;
import okhttp3.OkHttpClient;
import org.junit.After;
<<<<<<<
private ExecutorService executorService;
private Set<Class> pluginClasses;
private Set<Class> configClasses;
=======
private Set<Class<?>> pluginClasses;
private Set<Class<?>> configClasses;
>>>>>>>
private ExecutorService executorService;
private Set<Class> pluginClasses;
private Set<Class> configClasses;
<<<<<<<
executorService = Executors.newSingleThreadScheduledExecutor();
=======
OkHttpClient okHttpClient = mock(OkHttpClient.class);
when(okHttpClient.newCall(any(Request.class)))
.thenThrow(new RuntimeException("in plugin manager test"));
>>>>>>>
OkHttpClient okHttpClient = mock(OkHttpClient.class);
executorService = Executors.newSingleThreadScheduledExecutor();
<<<<<<<
.override(new RuneLiteModule(() -> null, false, RuneLite.DEFAULT_CONFIG_FILE))
=======
.override(new RuneLiteModule(okHttpClient, () -> null, true, false,
RuneLite.DEFAULT_SESSION_FILE,
RuneLite.DEFAULT_CONFIG_FILE))
>>>>>>>
.override(new RuneLiteModule(okHttpClient, () -> null, false, RuneLite.DEFAULT_CONFIG_FILE))
<<<<<<<
modules.add(new RuneLiteModule(() -> null, false, RuneLite.DEFAULT_CONFIG_FILE));
=======
modules.add(new RuneLiteModule(mock(OkHttpClient.class), () -> null, true, false,
RuneLite.DEFAULT_SESSION_FILE,
RuneLite.DEFAULT_CONFIG_FILE));
>>>>>>>
modules.add(new RuneLiteModule(mock(OkHttpClient.class), () -> null, false, RuneLite.DEFAULT_CONFIG_FILE)); |
<<<<<<<
SKULL(SpriteID.PLAYER_KILLER_SKULL_523, GameTimerImageType.SPRITE, "Skull", 20, ChronoUnit.MINUTES),
ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison"),
ANTIVENOM(ItemID.ANTIVENOM4, GameTimerImageType.ITEM, "Anti-venom"),
DRAGON_FIRE_SHIELD(ItemID.DRAGONFIRE_SHIELD_11284, GameTimerImageType.ITEM, "Dragonfire Shield Special", 2, ChronoUnit.MINUTES);
=======
DRAGON_FIRE_SHIELD(ItemID.DRAGONFIRE_SHIELD_11284, GameTimerImageType.ITEM, "Dragonfire Shield Special", 2, ChronoUnit.MINUTES),
DIVINE_SUPER_ATTACK(ItemID.DIVINE_SUPER_ATTACK_POTION4, GameTimerImageType.ITEM, "Divine Super Attack", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_STRENGTH(ItemID.DIVINE_SUPER_STRENGTH_POTION4, GameTimerImageType.ITEM, "Divine Super Strength", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_DEFENCE(ItemID.DIVINE_SUPER_DEFENCE_POTION4, GameTimerImageType.ITEM, "Divine Super Defence", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_COMBAT(ItemID.DIVINE_SUPER_COMBAT_POTION4, GameTimerImageType.ITEM, "Divine Super Combat", 5, ChronoUnit.MINUTES, true),
DIVINE_RANGING(ItemID.DIVINE_RANGING_POTION4, GameTimerImageType.ITEM, "Divine Ranging", 5, ChronoUnit.MINUTES, true),
DIVINE_MAGIC(ItemID.DIVINE_MAGIC_POTION4, GameTimerImageType.ITEM, "Divine Magic", 5, ChronoUnit.MINUTES, true);
>>>>>>>
SKULL(SpriteID.PLAYER_KILLER_SKULL_523, GameTimerImageType.SPRITE, "Skull", 20, ChronoUnit.MINUTES),
ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison"),
ANTIVENOM(ItemID.ANTIVENOM4, GameTimerImageType.ITEM, "Anti-venom"),
DRAGON_FIRE_SHIELD(ItemID.DRAGONFIRE_SHIELD_11284, GameTimerImageType.ITEM, "Dragonfire Shield Special", 2, ChronoUnit.MINUTES),
DIVINE_SUPER_ATTACK(ItemID.DIVINE_SUPER_ATTACK_POTION4, GameTimerImageType.ITEM, "Divine Super Attack", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_STRENGTH(ItemID.DIVINE_SUPER_STRENGTH_POTION4, GameTimerImageType.ITEM, "Divine Super Strength", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_DEFENCE(ItemID.DIVINE_SUPER_DEFENCE_POTION4, GameTimerImageType.ITEM, "Divine Super Defence", 5, ChronoUnit.MINUTES, true),
DIVINE_SUPER_COMBAT(ItemID.DIVINE_SUPER_COMBAT_POTION4, GameTimerImageType.ITEM, "Divine Super Combat", 5, ChronoUnit.MINUTES, true),
DIVINE_RANGING(ItemID.DIVINE_RANGING_POTION4, GameTimerImageType.ITEM, "Divine Ranging", 5, ChronoUnit.MINUTES, true),
DIVINE_MAGIC(ItemID.DIVINE_MAGIC_POTION4, GameTimerImageType.ITEM, "Divine Magic", 5, ChronoUnit.MINUTES, true); |
<<<<<<<
import com.google.common.annotations.VisibleForTesting;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.inject.Inject;
=======
>>>>>>>
import com.google.common.annotations.VisibleForTesting;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.inject.Inject;
<<<<<<<
// calculate initial required numbers
double base = DEF_HP_MULT * (defenceLevel + hitpointsLevel + Math.floor(prayerLevel / 2D));
double melee = ATT_STR_MULT * (attackLevel + strengthLevel);
double range = RANGE_MAGIC_MULT * Math.floor(rangedLevel * RANGE_MAGIC_LEVEL_MULT);
double mage = RANGE_MAGIC_MULT * Math.floor(magicLevel * RANGE_MAGIC_LEVEL_MULT);
double max = Math.max(melee, Math.max(range, mage));
=======
>>>>>>> |
<<<<<<<
@Autowired
private LionService lionService;
@Autowired
private PumaTaskTargetDao pumaTaskTargetDao;
@Autowired
private PumaServerService pumaServerService;
private final String env = EnvZooKeeperConfig.getEnv();
private static final Pattern JDBC_URL_PATTERN = Pattern.compile("jdbc:mysql://([^:]+:\\d+)/([^\\?]+).*");
private ConfigCache configCache = ConfigCache.getInstance();
private volatile Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
@SuppressWarnings("unused")
private volatile Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
@Override
@PostConstruct
public void init() {
try {
buildConfigFromZebra();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Set<String> getUrlByCluster(String clusterName) {
return clusterIpMap.get(clusterName);
}
protected void buildConfigFromZebra() throws IOException {
// Map<String, Set<String>> targets = getTargets();
// Map<String, InstanceChangedEvent> cachedEvent = new HashMap<String, InstanceChangedEvent>();
Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
Map<String, String> allProperties = lionService.getConfigByProject(env, Constants.DEFAULT_DATASOURCE_GROUP_PRFIX);
for (String groupds : allProperties.values()) {
Map<String, DefaultDataSourceConfigManager.ReadOrWriteRole> groupdsResult = DefaultDataSourceConfigManager.ReadOrWriteRole
.parseConfig(groupds);
Optional<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>> write = FluentIterable
.from(groupdsResult.entrySet())
.filter(new Predicate<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>>() {
@Override
public boolean apply(Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> input) {
return input.getValue().isWrite();
}
}).first();
if (!write.isPresent()) {
continue;
}
String writeJdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", write.get().getKey()));
if (Strings.isNullOrEmpty(writeJdbcUrl)) {
continue;
}
Matcher writeMatcher = JDBC_URL_PATTERN.matcher(writeJdbcUrl);
if (!writeMatcher.matches()) {
continue;
}
String writeUrl = writeMatcher.group(1);
String db = writeMatcher.group(2).toLowerCase();
Set<String> clusterDbs = clusterDbMap.get(writeUrl);
if (clusterDbs == null) {
clusterDbs = new HashSet<String>();
clusterDbMap.put(writeUrl, clusterDbs);
}
clusterDbs.add(db);
Set<String> clusterIps = clusterIpMap.get(writeUrl);
if (clusterIps == null) {
clusterIps = new HashSet<String>();
clusterIpMap.put(writeUrl, clusterIps);
}
for (Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> entry : groupdsResult.entrySet()) {
if (!entry.getValue().isRead()) {
continue;
}
String jdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", entry.getKey()));
if (Strings.isNullOrEmpty(jdbcUrl)) {
continue;
}
Matcher matcher = JDBC_URL_PATTERN.matcher(jdbcUrl);
if (!matcher.matches()) {
continue;
}
String url = matcher.group(1);
clusterIps.add(url);
}
this.clusterDbMap = clusterDbMap;
this.clusterIpMap = clusterIpMap;
}
}
private String getSingleDataSourceKey(String key, String dsId) {
return String.format("%s.%s.jdbc.%s", Constants.DEFAULT_DATASOURCE_SINGLE_PRFIX, dsId, key);
}
public void setLionService(LionService lionService) {
this.lionService = lionService;
}
// protected Map<String, Set<String>> getTargets() {
// List<PumaServerEntity> servers = pumaServerService.findOnCurrentServer();
// Map<String, Set<String>> targetResult = new HashMap<String, Set<String>>();
// for (PumaServerEntity server : servers) {
// List<PumaTaskTargetEntity> targets = pumaTaskTargetDao.findByTaskId(server.getId());
// for (PumaTaskTargetEntity target : targets) {
// Set<String> tables = targetResult.get(target.getDatabase());
// if (tables == null) {
// tables = new HashSet<String>();
// targetResult.put(target.getDatabase(), tables);
// }
// tables.add(target.getTable());
// }
// }
// return targetResult;
// }
=======
@Autowired
private PumaTaskTargetDao pumaTaskTargetDao;
@Autowired
private PumaServerService pumaServerService;
@Autowired
private ConfigManager configManager;
private final String env = EnvZooKeeperConfig.getEnv();
private static final Pattern JDBC_URL_PATTERN = Pattern.compile("jdbc:mysql://([^:]+:\\d+)/([^\\?]+).*");
private ConfigCache configCache = ConfigCache.getInstance();
private volatile Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
private volatile Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
@Override
@PostConstruct
public void init() {
try {
buildConfigFromZebra();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Set<String> getUrlByCluster(String clusterName) {
return clusterIpMap.get(clusterName);
}
protected void buildConfigFromZebra() throws IOException {
// Map<String, Set<String>> targets = getTargets();
// Map<String, InstanceChangedEvent> cachedEvent = new HashMap<String, InstanceChangedEvent>();
Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
Map<String, String> allProperties = configManager.getConfigByProject(env, Constants.DEFAULT_DATASOURCE_GROUP_PRFIX);
for (String groupds : allProperties.values()) {
Map<String, DefaultDataSourceConfigManager.ReadOrWriteRole> groupdsResult = DefaultDataSourceConfigManager.ReadOrWriteRole.parseConfig(groupds);
Optional<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>> write = FluentIterable.from(groupdsResult.entrySet()).filter(new Predicate<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>>() {
@Override
public boolean apply(Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> input) {
return input.getValue().isWrite();
}
}).first();
if (!write.isPresent()) {
continue;
}
String writeJdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", write.get().getKey()));
if (Strings.isNullOrEmpty(writeJdbcUrl)) {
continue;
}
Matcher writeMatcher = JDBC_URL_PATTERN.matcher(writeJdbcUrl);
if (!writeMatcher.matches()) {
continue;
}
String writeUrl = writeMatcher.group(1);
String db = writeMatcher.group(2).toLowerCase();
Set<String> clusterDbs = clusterDbMap.get(writeUrl);
if (clusterDbs == null) {
clusterDbs = new HashSet<String>();
clusterDbMap.put(writeUrl, clusterDbs);
}
clusterDbs.add(db);
Set<String> clusterIps = clusterIpMap.get(writeUrl);
if (clusterIps == null) {
clusterIps = new HashSet<String>();
clusterIpMap.put(writeUrl, clusterIps);
}
for (Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> entry : groupdsResult.entrySet()) {
if (!entry.getValue().isRead()) {
continue;
}
String jdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", entry.getKey()));
if (Strings.isNullOrEmpty(jdbcUrl)) {
continue;
}
Matcher matcher = JDBC_URL_PATTERN.matcher(jdbcUrl);
if (!matcher.matches()) {
continue;
}
String url = matcher.group(1);
clusterIps.add(url);
}
this.clusterDbMap = clusterDbMap;
this.clusterIpMap = clusterIpMap;
}
}
private String getSingleDataSourceKey(String key, String dsId) {
return String.format("%s.%s.jdbc.%s", Constants.DEFAULT_DATASOURCE_SINGLE_PRFIX, dsId, key);
}
public void setConfigManager(ConfigManager configManager) {
this.configManager = configManager;
}
// protected Map<String, Set<String>> getTargets() {
// List<PumaServerEntity> servers = pumaServerService.findOnCurrentServer();
// Map<String, Set<String>> targetResult = new HashMap<String, Set<String>>();
// for (PumaServerEntity server : servers) {
// List<PumaTaskTargetEntity> targets = pumaTaskTargetDao.findByTaskId(server.getId());
// for (PumaTaskTargetEntity target : targets) {
// Set<String> tables = targetResult.get(target.getDatabase());
// if (tables == null) {
// tables = new HashSet<String>();
// targetResult.put(target.getDatabase(), tables);
// }
// tables.add(target.getTable());
// }
// }
// return targetResult;
// }
>>>>>>>
@Autowired
private PumaTaskTargetDao pumaTaskTargetDao;
@Autowired
private PumaServerService pumaServerService;
@Autowired
private ConfigManager configManager;
private final String env = EnvZooKeeperConfig.getEnv();
private static final Pattern JDBC_URL_PATTERN = Pattern.compile("jdbc:mysql://([^:]+:\\d+)/([^\\?]+).*");
private ConfigCache configCache = ConfigCache.getInstance();
private volatile Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
@SuppressWarnings("unused")
private volatile Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
@Override
@PostConstruct
public void init() {
try {
buildConfigFromZebra();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Set<String> getUrlByCluster(String clusterName) {
return clusterIpMap.get(clusterName);
}
protected void buildConfigFromZebra() throws IOException {
// Map<String, Set<String>> targets = getTargets();
// Map<String, InstanceChangedEvent> cachedEvent = new HashMap<String, InstanceChangedEvent>();
Map<String, Set<String>> clusterIpMap = new HashMap<String, Set<String>>();
Map<String, Set<String>> clusterDbMap = new HashMap<String, Set<String>>();
Map<String, String> allProperties = configManager.getConfigByProject(env,
Constants.DEFAULT_DATASOURCE_GROUP_PRFIX);
for (String groupds : allProperties.values()) {
Map<String, DefaultDataSourceConfigManager.ReadOrWriteRole> groupdsResult = DefaultDataSourceConfigManager.ReadOrWriteRole
.parseConfig(groupds);
Optional<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>> write = FluentIterable
.from(groupdsResult.entrySet())
.filter(new Predicate<Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole>>() {
@Override
public boolean apply(Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> input) {
return input.getValue().isWrite();
}
}).first();
if (!write.isPresent()) {
continue;
}
String writeJdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", write.get().getKey()));
if (Strings.isNullOrEmpty(writeJdbcUrl)) {
continue;
}
Matcher writeMatcher = JDBC_URL_PATTERN.matcher(writeJdbcUrl);
if (!writeMatcher.matches()) {
continue;
}
String writeUrl = writeMatcher.group(1);
String db = writeMatcher.group(2).toLowerCase();
Set<String> clusterDbs = clusterDbMap.get(writeUrl);
if (clusterDbs == null) {
clusterDbs = new HashSet<String>();
clusterDbMap.put(writeUrl, clusterDbs);
}
clusterDbs.add(db);
Set<String> clusterIps = clusterIpMap.get(writeUrl);
if (clusterIps == null) {
clusterIps = new HashSet<String>();
clusterIpMap.put(writeUrl, clusterIps);
}
for (Map.Entry<String, DefaultDataSourceConfigManager.ReadOrWriteRole> entry : groupdsResult.entrySet()) {
if (!entry.getValue().isRead()) {
continue;
}
String jdbcUrl = configCache.getProperty(getSingleDataSourceKey("url", entry.getKey()));
if (Strings.isNullOrEmpty(jdbcUrl)) {
continue;
}
Matcher matcher = JDBC_URL_PATTERN.matcher(jdbcUrl);
if (!matcher.matches()) {
continue;
}
String url = matcher.group(1);
clusterIps.add(url);
}
this.clusterDbMap = clusterDbMap;
this.clusterIpMap = clusterIpMap;
}
}
private String getSingleDataSourceKey(String key, String dsId) {
return String.format("%s.%s.jdbc.%s", Constants.DEFAULT_DATASOURCE_SINGLE_PRFIX, dsId, key);
}
public void setConfigManager(ConfigManager configManager) {
this.configManager = configManager;
}
// protected Map<String, Set<String>> getTargets() {
// List<PumaServerEntity> servers = pumaServerService.findOnCurrentServer();
// Map<String, Set<String>> targetResult = new HashMap<String, Set<String>>();
// for (PumaServerEntity server : servers) {
// List<PumaTaskTargetEntity> targets = pumaTaskTargetDao.findByTaskId(server.getId());
// for (PumaTaskTargetEntity target : targets) {
// Set<String> tables = targetResult.get(target.getDatabase());
// if (tables == null) {
// tables = new HashSet<String>();
// targetResult.put(target.getDatabase(), tables);
// }
// tables.add(target.getTable());
// }
// }
// return targetResult;
// } |
<<<<<<<
private boolean hasOverlay(final Skill skill)
{
return overlayManager.anyMatch(o -> o instanceof XpInfoBoxOverlay && ((XpInfoBoxOverlay) o).getSkill() == skill);
}
private void onConfigChanged(ConfigChanged event)
{
if (!event.getGroup().equals("xpTracker"))
{
return;
}
updateConfig();
}
private void updateConfig()
{
this.hideMaxed = xpTrackerConfig.hideMaxed();
this.pauseOnLogout = xpTrackerConfig.pauseOnLogout();
this.showIntermediateLevels = xpTrackerConfig.showIntermediateLevels();
this.pauseSkillAfter = xpTrackerConfig.pauseSkillAfter();
this.onScreenDisplayMode = xpTrackerConfig.onScreenDisplayMode();
this.onScreenDisplayModeBottom = xpTrackerConfig.onScreenDisplayModeBottom();
}
=======
>>>>>>>
private void onConfigChanged(ConfigChanged event)
{
if (!event.getGroup().equals("xpTracker"))
{
return;
}
updateConfig();
}
private void updateConfig()
{
this.hideMaxed = xpTrackerConfig.hideMaxed();
this.pauseOnLogout = xpTrackerConfig.pauseOnLogout();
this.showIntermediateLevels = xpTrackerConfig.showIntermediateLevels();
this.pauseSkillAfter = xpTrackerConfig.pauseSkillAfter();
this.onScreenDisplayMode = xpTrackerConfig.onScreenDisplayMode();
this.onScreenDisplayModeBottom = xpTrackerConfig.onScreenDisplayModeBottom();
} |
<<<<<<<
import javax.annotation.Nullable;
import javax.inject.Singleton;
=======
>>>>>>>
import javax.annotation.Nullable;
import javax.inject.Singleton;
<<<<<<<
import lombok.AccessLevel;
=======
import javax.swing.JPopupMenu;
import javax.swing.JToggleButton;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
>>>>>>>
import lombok.AccessLevel;
<<<<<<<
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigDescriptor;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
=======
import net.runelite.client.externalplugins.ExternalPluginManifest;
>>>>>>>
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigDescriptor;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
<<<<<<<
=======
import net.runelite.client.util.SwingUtil;
>>>>>>>
<<<<<<<
public JLabel nameLabel;
=======
>>>>>>>
public JLabel nameLabel;
<<<<<<<
private static final ImageIcon ON_SWITCHER;
public static final ImageIcon OFF_SWITCHER;
=======
>>>>>>>
private static final ImageIcon ON_SWITCHER;
public static final ImageIcon OFF_SWITCHER;
<<<<<<<
private final IconButton pinButton = new IconButton(OFF_STAR);
private final IconButton configButton = new IconButton(CONFIG_ICON, CONFIG_ICON_HOVER);
private final IconButton toggleButton = new IconButton(OFF_SWITCHER);
@Getter(AccessLevel.PACKAGE)
private boolean isPluginEnabled = false;
@Getter(AccessLevel.PACKAGE)
private boolean isPinned = false;
=======
private final JToggleButton pinButton;
private final JToggleButton onOffToggle;
>>>>>>>
private final IconButton pinButton = new IconButton(OFF_STAR);
private final IconButton configButton = new IconButton(CONFIG_ICON, CONFIG_ICON_HOVER);
private final IconButton toggleButton = new IconButton(OFF_SWITCHER);
@Getter(AccessLevel.PACKAGE)
private boolean isPluginEnabled = false;
@Getter(AccessLevel.PACKAGE)
private boolean isPinned = false;
<<<<<<<
ON_SWITCHER = new ImageIcon(ImageUtil.recolorImage(onSwitcher, ColorScheme.BRAND_BLUE));
ON_STAR = new ImageIcon(ImageUtil.recolorImage(onStar, ColorScheme.BRAND_BLUE));
CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.grayscaleOffset(configIcon, -100));
BufferedImage offSwitcherImage = ImageUtil.flipImage(
ImageUtil.grayscaleOffset(
ImageUtil.grayscaleImage(onSwitcher),
0.61f
),
true,
false
);
OFF_SWITCHER = new ImageIcon(offSwitcherImage);
BufferedImage offStar = ImageUtil.grayscaleOffset(
=======
ON_STAR = new ImageIcon(onStar);
CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.luminanceOffset(configIcon, -100));
BufferedImage offStar = ImageUtil.luminanceScale(
>>>>>>>
ON_SWITCHER = new ImageIcon(ImageUtil.recolorImage(onSwitcher, ColorScheme.BRAND_BLUE));
ON_STAR = new ImageIcon(ImageUtil.recolorImage(onStar, ColorScheme.BRAND_BLUE));
CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.luminanceOffset(configIcon, -100));
BufferedImage offSwitcherImage = ImageUtil.flipImage(
ImageUtil.luminanceScale(
ImageUtil.grayscaleImage(onSwitcher),
0.61f
),
true,
false
);
OFF_SWITCHER = new ImageIcon(offSwitcherImage);
BufferedImage offStar = ImageUtil.luminanceScale(
<<<<<<<
add(nameLabel, BorderLayout.CENTER);
=======
pinButton = new JToggleButton(OFF_STAR);
pinButton.setSelectedIcon(ON_STAR);
SwingUtil.removeButtonDecorations(pinButton);
SwingUtil.addModalTooltip(pinButton, "Unpin plugin", "Pin plugin");
>>>>>>>
add(nameLabel, BorderLayout.CENTER);
<<<<<<<
isHidden = hidden;
}
void updateToggleButton(IconButton button)
{
button.setIcon(isPluginEnabled ? ON_SWITCHER : OFF_SWITCHER);
button.setToolTipText(isPluginEnabled ? "Disable plugin" : "Enable plugin");
=======
pluginListPanel.openConfigurationPanel(pluginConfig);
>>>>>>>
isHidden = hidden;
}
void updateToggleButton(IconButton button)
{
button.setIcon(isPluginEnabled ? ON_SWITCHER : OFF_SWITCHER);
button.setToolTipText(isPluginEnabled ? "Disable plugin" : "Enable plugin");
<<<<<<<
}
return true;
}
=======
});
}
>>>>>>>
}
return true;
} |
<<<<<<<
public static final int PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID = 243;
public static final int DIALOG_MINIGAME_GROUP_ID = 229;
public static final int CLAN_CHAT_GROUP_ID = 7;
=======
public static final int FRIENDS_CHAT_GROUP_ID = 7;
>>>>>>>
public static final int PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID = 243;
public static final int DIALOG_MINIGAME_GROUP_ID = 229;
public static final int FRIENDS_CHAT_GROUP_ID = 7;
<<<<<<<
static final int MULTICOMBAT_INDICATOR = 21;
static final int BANK_PIN = 22;
static final int CLAN_CHAT_TAB = 33;
=======
static final int FRIENDS_CHAT_TAB = 33;
>>>>>>>
static final int MULTICOMBAT_INDICATOR = 21;
static final int BANK_PIN = 22;
static final int FRIENDS_CHAT_TAB = 33;
<<<<<<<
static final int ITEMS_KEPT_ON_DEATH = 13;
static final int BANK_PIN = 13;
static final int MULTICOMBAT_INDICATOR = 17;
static final int CLAN_CHAT_TAB = 37;
=======
static final int FRIENDS_CHAT_TAB = 37;
>>>>>>>
static final int ITEMS_KEPT_ON_DEATH = 13;
static final int BANK_PIN = 13;
static final int MULTICOMBAT_INDICATOR = 17;
static final int FRIENDS_CHAT_TAB = 37; |
<<<<<<<
screenshotPlugin.setScreenshotRewards(true);
screenshotPlugin.setScreenshotLevels(true);
screenshotPlugin.setScreenshotValuableDrop(true);
screenshotPlugin.setScreenshotUntradeableDrop(true);
=======
when(screenshotConfig.screenshotLevels()).thenReturn(true);
when(screenshotConfig.screenshotValuableDrop()).thenReturn(true);
when(screenshotConfig.screenshotUntradeableDrop()).thenReturn(true);
>>>>>>>
screenshotPlugin.setScreenshotRewards(true);
screenshotPlugin.setScreenshotLevels(true);
screenshotPlugin.setScreenshotValuableDrop(true);
screenshotPlugin.setScreenshotUntradeableDrop(true);
<<<<<<<
Widget widget = mock(Widget.class);
=======
>>>>>>>
<<<<<<<
Widget widget = mock(Widget.class);
=======
>>>>>>>
<<<<<<<
Widget widget = mock(Widget.class);
=======
>>>>>>>
<<<<<<<
Widget widget = mock(Widget.class);
=======
>>>>>>> |
<<<<<<<
/**
* Changes the parent ID for the widget
*/
void setParentId(int id);
/**
* Changes the ID of the widget
*/
void setId(int id);
/**
* Sets the index of this element
*/
void setIndex(int index);
/**
* Seems like this needs to set to true when creating new widgets
*/
void setIsIf3(boolean isIf3);
/**
* Returns yes if your mouse pointer is over this widget or any of it's children.
*/
boolean containsMouse();
/**
* Gets the image which is (or should be) drawn on this widget
*/
Sprite getSprite();
=======
/**
* {@link net.runelite.api.VarPlayer}s that triggers this widgets varTransmitListener
*/
void setVarTransmitTrigger(int ...trigger);
/**
* Sets a script to be ran the first client tick the mouse is held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnClickListener(Object ...args);
/**
* Sets a script to be ran the every client tick the mouse is held ontop of this widget,
* except the first client tick.
*
* @param args A ScriptID, then the args for the script
*/
void setOnHoldListener(Object ...args);
/**
* Sets a script to be ran the first client tick the mouse is not held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnReleaseListener(Object ...args);
>>>>>>>
/**
* Changes the parent ID for the widget
*/
void setParentId(int id);
/**
* Changes the ID of the widget
*/
void setId(int id);
/**
* Sets the index of this element
*/
void setIndex(int index);
/**
* Seems like this needs to set to true when creating new widgets
*/
void setIsIf3(boolean isIf3);
/**
* Returns yes if your mouse pointer is over this widget or any of it's children.
*/
boolean containsMouse();
/**
* Gets the image which is (or should be) drawn on this widget
*/
Sprite getSprite();
/**
* {@link net.runelite.api.VarPlayer}s that triggers this widgets varTransmitListener
*/
void setVarTransmitTrigger(int ...trigger);
/**
* Sets a script to be ran the first client tick the mouse is held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnClickListener(Object ...args);
/**
* Sets a script to be ran the every client tick the mouse is held ontop of this widget,
* except the first client tick.
*
* @param args A ScriptID, then the args for the script
*/
void setOnHoldListener(Object ...args);
/**
* Sets a script to be ran the first client tick the mouse is not held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnReleaseListener(Object ...args); |
<<<<<<<
/*
* Copyright (c) 2020, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay.infobox;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.awt.Color;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Inject;
import net.runelite.client.config.OpenOSRSConfig;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.plugins.Plugin;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class InfoBoxManagerTest
{
@Inject
private InfoBoxManager infoBoxManager;
@Mock
@Bind
private RuneLiteConfig runeLiteConfig;
@Mock
@Bind
private OpenOSRSConfig openOSRSConfig;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
private static class TestInfobox extends InfoBox
{
private static final Plugin PLUGIN = mock(Plugin.class);
static
{
when(PLUGIN.getName()).thenReturn("");
}
private final String text;
private TestInfobox(InfoBoxPriority infoBoxPriority)
{
this(infoBoxPriority, null);
}
private TestInfobox(InfoBoxPriority infoBoxPriority, String text)
{
super(null, PLUGIN);
setPriority(infoBoxPriority);
this.text = text;
}
@Override
public String getText()
{
return text;
}
@Override
public Color getTextColor()
{
return null;
}
}
@Test
public void testSorting()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.LOW));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.HIGH));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED));
List<InfoBoxPriority> order = infoBoxManager.getInfoBoxes().stream().map(InfoBox::getPriority).collect(Collectors.toList());
assertEquals(Arrays.asList(InfoBoxPriority.HIGH, InfoBoxPriority.MED, InfoBoxPriority.LOW), order);
}
@Test
public void testSamePluginAndPriority()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "one"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "two"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "three"));
assertEquals(3, infoBoxManager.getInfoBoxes().size());
assertEquals("one", infoBoxManager.getInfoBoxes().get(0).getText());
assertEquals("two", infoBoxManager.getInfoBoxes().get(1).getText());
assertEquals("three", infoBoxManager.getInfoBoxes().get(2).getText());
}
=======
/*
* Copyright (c) 2020, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay.infobox;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.awt.Color;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.plugins.Plugin;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class InfoBoxManagerTest
{
@Inject
private InfoBoxManager infoBoxManager;
@Mock
@Bind
private RuneLiteConfig runeLiteConfig;
@Mock
@Bind
private ConfigManager configManager;
@Mock
@Bind
private Client client;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
private static class TestInfobox extends InfoBox
{
private static final Plugin PLUGIN = mock(Plugin.class);
static
{
when(PLUGIN.getName()).thenReturn("");
}
private final String text;
private TestInfobox(InfoBoxPriority infoBoxPriority)
{
this(infoBoxPriority, null);
}
private TestInfobox(InfoBoxPriority infoBoxPriority, String text)
{
super(null, PLUGIN);
setPriority(infoBoxPriority);
this.text = text;
}
@Override
public String getText()
{
return text;
}
@Override
public Color getTextColor()
{
return null;
}
}
@Test
public void testSorting()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.LOW));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.HIGH));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED));
List<InfoBoxPriority> order = infoBoxManager.getInfoBoxes().stream().map(InfoBox::getPriority).collect(Collectors.toList());
assertEquals(Arrays.asList(InfoBoxPriority.HIGH, InfoBoxPriority.MED, InfoBoxPriority.LOW), order);
}
@Test
public void testSamePluginAndPriority()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "one"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "two"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "three"));
assertEquals(3, infoBoxManager.getInfoBoxes().size());
assertEquals("one", infoBoxManager.getInfoBoxes().get(0).getText());
assertEquals("two", infoBoxManager.getInfoBoxes().get(1).getText());
assertEquals("three", infoBoxManager.getInfoBoxes().get(2).getText());
}
>>>>>>>
/*
* Copyright (c) 2020, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay.infobox;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.awt.Color;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.OpenOSRSConfig;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.plugins.Plugin;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class InfoBoxManagerTest
{
@Inject
private InfoBoxManager infoBoxManager;
@Mock
@Bind
private RuneLiteConfig runeLiteConfig;
@Mock
@Bind
private OpenOSRSConfig openOSRSConfig;
@Mock
@Bind
private ConfigManager configManager;
@Mock
@Bind
private Client client;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
private static class TestInfobox extends InfoBox
{
private static final Plugin PLUGIN = mock(Plugin.class);
static
{
when(PLUGIN.getName()).thenReturn("");
}
private final String text;
private TestInfobox(InfoBoxPriority infoBoxPriority)
{
this(infoBoxPriority, null);
}
private TestInfobox(InfoBoxPriority infoBoxPriority, String text)
{
super(null, PLUGIN);
setPriority(infoBoxPriority);
this.text = text;
}
@Override
public String getText()
{
return text;
}
@Override
public Color getTextColor()
{
return null;
}
}
@Test
public void testSorting()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.LOW));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.HIGH));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED));
List<InfoBoxPriority> order = infoBoxManager.getInfoBoxes().stream().map(InfoBox::getPriority).collect(Collectors.toList());
assertEquals(Arrays.asList(InfoBoxPriority.HIGH, InfoBoxPriority.MED, InfoBoxPriority.LOW), order);
}
@Test
public void testSamePluginAndPriority()
{
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "one"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "two"));
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "three"));
assertEquals(3, infoBoxManager.getInfoBoxes().size());
assertEquals("one", infoBoxManager.getInfoBoxes().get(0).getText());
assertEquals("two", infoBoxManager.getInfoBoxes().get(1).getText());
assertEquals("three", infoBoxManager.getInfoBoxes().get(2).getText());
} |
<<<<<<<
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
=======
import java.util.List;
>>>>>>>
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
<<<<<<<
import org.apache.commons.lang3.StringUtils;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
=======
import net.runelite.client.ws.PartyMember;
import net.runelite.client.ws.PartyService;
import net.runelite.client.ws.WSClient;
import net.runelite.http.api.ws.messages.party.PartyChatMessage;
>>>>>>>
import org.apache.commons.lang3.StringUtils;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
import net.runelite.client.ws.PartyMember;
import net.runelite.client.ws.PartyService;
import net.runelite.client.ws.WSClient;
import net.runelite.http.api.ws.messages.party.PartyChatMessage;
<<<<<<<
private static final String SPLIT_REGEX = "\\s*,\\s*";
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###.##");
=======
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###.##");
private static final DecimalFormat POINTS_FORMAT = new DecimalFormat("#,###");
>>>>>>>
private static final String SPLIT_REGEX = "\\s*,\\s*";
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###.##");
<<<<<<<
@Getter(AccessLevel.NONE)
@Inject
private TooltipManager tooltipManager;
@Getter(AccessLevel.NONE)
@Inject
private ClientToolbar clientToolbar;
@Getter(AccessLevel.NONE)
@Inject
private ItemManager itemManager;
@Getter(AccessLevel.NONE)
@Inject
private EventBus eventBus;
private boolean raidStarted;
=======
@Inject
private PartyService party;
@Inject
private WSClient ws;
@Getter
private final ArrayList<String> roomWhitelist = new ArrayList<>();
@Getter
private final ArrayList<String> roomBlacklist = new ArrayList<>();
@Getter
private final ArrayList<String> rotationWhitelist = new ArrayList<>();
@Getter
private final ArrayList<String> layoutWhitelist = new ArrayList<>();
@Getter
private Raid raid;
@Getter
>>>>>>>
@Getter(AccessLevel.NONE)
@Inject
private TooltipManager tooltipManager;
@Getter(AccessLevel.NONE)
@Inject
private ClientToolbar clientToolbar;
@Getter(AccessLevel.NONE)
@Inject
private ItemManager itemManager;
@Getter(AccessLevel.NONE)
@Inject
private EventBus eventBus;
private boolean raidStarted;
@Inject
private PartyService party;
@Inject
private WSClient ws;
@Getter
private final ArrayList<String> roomWhitelist = new ArrayList<>();
@Getter
private final ArrayList<String> roomBlacklist = new ArrayList<>();
@Getter
private final ArrayList<String> rotationWhitelist = new ArrayList<>();
@Getter
private final ArrayList<String> layoutWhitelist = new ArrayList<>();
@Getter
private Raid raid;
<<<<<<<
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Layout: ")
.append(ChatColorType.NORMAL)
.append(raidData)
.build())
.build());
if (recordRaid() != null)
{
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("You have scouted a record raid, whilst this is a very good raid to do you will probably end up profiting more by selling this raid to a team looking for it.")
.build())
.build());
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("The following are some places you can sell this raid: Scout Trading in We do Raids discord, and Buying Cox Rotations in Oblivion discord.")
.build())
.build());
}
=======
final String layoutMessage = new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Layout: ")
.append(ChatColorType.NORMAL)
.append(raidData)
.build();
final PartyMember localMember = party.getLocalMember();
if (party.getMembers().isEmpty() || localMember == null)
{
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(layoutMessage)
.build());
}
else
{
final PartyChatMessage message = new PartyChatMessage(layoutMessage);
message.setMemberId(localMember.getMemberId());
ws.send(message);
}
>>>>>>>
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Layout: ")
.append(ChatColorType.NORMAL)
.append(raidData)
.build())
.build());
if (recordRaid() != null)
{
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("You have scouted a record raid, whilst this is a very good raid to do you will probably end up profiting more by selling this raid to a team looking for it.")
.build())
.build());
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("The following are some places you can sell this raid: Scout Trading in We do Raids discord, and Buying Cox Rotations in Oblivion discord.")
.build())
.build());
}
final PartyMember localMember = party.getLocalMember();
if (party.getMembers().isEmpty() || localMember == null)
{
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(layoutMessage)
.build());
}
else
{
final PartyChatMessage message = new PartyChatMessage(layoutMessage);
message.setMemberId(localMember.getMemberId());
ws.send(message);
} |
<<<<<<<
import lombok.AccessLevel;
import lombok.Getter;
=======
import lombok.AccessLevel;
import lombok.Setter;
>>>>>>>
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter; |
<<<<<<<
import java.io.IOException;
=======
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
>>>>>>>
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
<<<<<<<
import javax.inject.Singleton;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import lombok.extern.slf4j.Slf4j;
=======
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.RuneLite;
>>>>>>>
import javax.inject.Singleton;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.RuneLite;
<<<<<<<
@Singleton
=======
@Slf4j
>>>>>>>
@Singleton
<<<<<<<
if (selectedCursor == CustomCursor.SKILL_SPECS)
{
if (skillSpecsRage != null)
{
if (skillSpecsRage.isRunning())
{
skillSpecsRage.stop();
}
skillSpecsRage.setFramePosition(0);
skillSpecsRage.start();
}
}
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
=======
if (selectedCursor == CustomCursor.CUSTOM_IMAGE)
{
if (CUSTOM_IMAGE_FILE.exists())
{
try
{
BufferedImage image;
synchronized (ImageIO.class)
{
image = ImageIO.read(CUSTOM_IMAGE_FILE);
}
clientUI.setCursor(image, selectedCursor.getName());
}
catch (Exception e)
{
log.error("error setting custom cursor", e);
clientUI.resetCursor();
}
}
else
{
clientUI.resetCursor();
}
return;
}
assert selectedCursor.getCursorImage() != null;
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.getName());
>>>>>>>
if (selectedCursor == CustomCursor.SKILL_SPECS)
{
if (skillSpecsRage != null)
{
if (skillSpecsRage.isRunning())
{
skillSpecsRage.stop();
}
skillSpecsRage.setFramePosition(0);
skillSpecsRage.start();
}
}
else if (selectedCursor == CustomCursor.CUSTOM_IMAGE)
{
if (CUSTOM_IMAGE_FILE.exists())
{
try
{
BufferedImage image;
synchronized (ImageIO.class)
{
image = ImageIO.read(CUSTOM_IMAGE_FILE);
}
clientUI.setCursor(image, selectedCursor.getName());
}
catch (Exception e)
{
log.error("error setting custom cursor", e);
clientUI.resetCursor();
}
}
else
{
clientUI.resetCursor();
}
return;
}
assert selectedCursor.getCursorImage() != null;
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.getName());
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString()); |
<<<<<<<
import net.runelite.client.util.StackFormatter;
=======
import net.runelite.client.util.QuantityFormatter;
import net.runelite.client.util.Text;
>>>>>>>
import net.runelite.client.util.QuantityFormatter; |
<<<<<<<
=======
public static final int HALLOWED_SEPULCHRE_TIMER_GROUP_ID = 668;
public static final int BANK_PIN_GROUP_ID = 213;
>>>>>>>
public static final int HALLOWED_SEPULCHRE_TIMER_GROUP_ID = 668;
<<<<<<<
=======
static class HallowedSepulchreTimer
{
static final int CONTAINER = 2;
}
static class BankPin
{
static final int CONTAINER = 0;
}
>>>>>>>
static class HallowedSepulchreTimer
{
static final int CONTAINER = 2;
} |
<<<<<<<
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameTick;
=======
>>>>>>>
import net.runelite.api.events.ConfigChanged;
<<<<<<<
eventBus.unregister(this);
lastEventTick = 0;
=======
lastNotificationTick = 0;
>>>>>>>
eventBus.unregister(this);
lastNotificationTick = 0;
<<<<<<<
private void addSubscriptions()
{
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
}
private void onNpcSpawned(NpcSpawned event)
=======
@Subscribe
public void onInteractingChanged(InteractingChanged event)
>>>>>>>
private void addSubscriptions()
{
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
}
private void onInteractingChanged(InteractingChanged event)
<<<<<<<
private void onInteractingChanged(InteractingChanged event)
{
Actor source = event.getSource();
Actor target = event.getTarget();
=======
currentRandomEvent = (NPC) source;
>>>>>>>
currentRandomEvent = (NPC) source;
<<<<<<<
private void onGameTick(GameTick event)
=======
@Subscribe
public void onNpcDespawned(NpcDespawned npcDespawned)
>>>>>>>
private void onNpcDespawned(NpcDespawned npcDespawned) |
<<<<<<<
@Subscribe
=======
private void addSubscriptions()
{
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
eventBus.subscribe(WidgetHiddenChanged.class, this, this::onWidgetHiddenChanged);
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
}
>>>>>>>
@Subscribe
<<<<<<<
@Subscribe
private void onLocalPlayerDeath(LocalPlayerDeath event)
=======
private void onPlayerDeath(PlayerDeath playerDeath)
>>>>>>>
@Subscribe
private void onPlayerDeath(PlayerDeath playerDeath) |
<<<<<<<
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig);
=======
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, chatColorConfig, colorPickerManager);
>>>>>>>
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig, colorPickerManager); |
<<<<<<<
import com.dianping.puma.comparison.model.TaskResult;
=======
import com.dianping.puma.comparison.TaskResult;
import com.dianping.puma.comparison.manager.utils.ThreadPool;
>>>>>>>
import com.dianping.puma.comparison.model.TaskResult;
import com.dianping.puma.comparison.manager.utils.ThreadPool; |
<<<<<<<
=======
@Value
private static class ImageKey
{
private final int itemId;
private final int itemQuantity;
private final boolean stackable;
}
@Value
private static class OutlineKey
{
private final int itemId;
private final int itemQuantity;
private final Color outlineColor;
}
private final Client client;
private final ScheduledExecutorService scheduledExecutorService;
private final ClientThread clientThread;
private final ItemClient itemClient;
private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
private Map<Integer, ItemStats> itemStats = Collections.emptyMap();
private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages;
private final LoadingCache<Integer, ItemComposition> itemCompositions;
private final LoadingCache<OutlineKey, BufferedImage> itemOutlines;
>>>>>>>
<<<<<<<
public ItemManager(
Client client,
ScheduledExecutorService executor,
ClientThread clientThread,
EventBus eventbus
)
=======
public ItemManager(Client client, ScheduledExecutorService executor, ClientThread clientThread,
ItemClient itemClient)
>>>>>>>
public ItemManager(
Client client,
ScheduledExecutorService executor,
ClientThread clientThread,
EventBus eventbus,
ItemClient itemClient
) |
<<<<<<<
=======
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
>>>>>>>
import net.runelite.client.events.ConfigChanged;
<<<<<<<
eventBus.subscribe(PluginChanged.class, this, this::onPluginChanged);
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
=======
this.runeLiteConfig = runeLiteConfig;
}
@Subscribe
public void onConfigChanged(final ConfigChanged event)
{
if (!RuneLiteConfig.GROUP_NAME.equals(event.getGroup()) || !"overlayBackgroundColor".equals(event.getKey()))
{
return;
}
overlays.forEach(this::updateOverlayConfig);
>>>>>>>
this.runeLiteConfig = runeLiteConfig;
eventBus.subscribe(PluginChanged.class, this, this::onPluginChanged);
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
}
public void onConfigChanged(final ConfigChanged event)
{
if (!RuneLiteConfig.GROUP_NAME.equals(event.getGroup()) || !"overlayBackgroundColor".equals(event.getKey()))
{
return;
}
overlays.forEach(this::updateOverlayConfig); |
<<<<<<<
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ArrayHandler;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
=======
>>>>>>>
<<<<<<<
import com.dianping.puma.storage.DefaultArchiveStrategy;
import com.dianping.puma.storage.DefaultCleanupStrategy;
import com.dianping.puma.storage.DefaultEventStorage;
import com.dianping.puma.storage.EventChannel;
import com.dianping.puma.storage.bucket.LocalFileDataBucketManager;
=======
import com.dianping.puma.storage.*;
>>>>>>>
import com.dianping.puma.storage.DefaultArchiveStrategy;
import com.dianping.puma.storage.DefaultCleanupStrategy;
import com.dianping.puma.storage.DefaultEventStorage;
import com.dianping.puma.storage.EventChannel;
import com.dianping.puma.storage.bucket.LocalFileDataBucketManager; |
<<<<<<<
import net.runelite.api.events.ConfigChanged;
=======
import net.runelite.api.Varbits;
import net.runelite.api.events.ItemContainerChanged;
>>>>>>>
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.Varbits;
import net.runelite.api.events.ItemContainerChanged;
<<<<<<<
@Inject
private EventBus eventBus;
=======
@Inject
private ContainerCalculation bankCalculation;
@Inject
private ContainerCalculation seedVaultCalculation;
>>>>>>>
@Inject
private EventBus eventBus;
@Inject
private ContainerCalculation bankCalculation;
@Inject
private ContainerCalculation seedVaultCalculation;
<<<<<<<
if (this.showGE && gePrice != 0)
=======
updateSeedVaultTotal();
}
@Subscribe
public void onItemContainerChanged(ItemContainerChanged event)
{
if (event.getContainerId() != InventoryID.SEED_VAULT.getId() || !config.seedVaultValue())
{
return;
}
updateSeedVaultTotal();
}
private String createValueText(final ContainerPrices prices)
{
final long gePrice = prices.getGePrice();
final long haPrice = prices.getHighAlchPrice();
String strCurrentTab = "";
if (config.showGE() && gePrice != 0)
>>>>>>>
updateSeedVaultTotal();
}
private void onItemContainerChanged(ItemContainerChanged event)
{
if (event.getContainerId() != InventoryID.SEED_VAULT.getId() || !config.seedVaultValue())
{
return;
}
updateSeedVaultTotal();
}
private String createValueText(final ContainerPrices prices)
{
final long gePrice = prices.getGePrice();
final long haPrice = prices.getHighAlchPrice();
String strCurrentTab = "";
if (config.showGE() && gePrice != 0) |
<<<<<<<
private DevToolsButton logMenuActions;
=======
private DevToolsButton soundEffects;
>>>>>>>
private DevToolsButton soundEffects;
private DevToolsButton logMenuActions; |
<<<<<<<
public static final int GAUNTLET_MAP_GROUP_ID = 638;
=======
public static final int HALLOWED_SEPULCHRE_TIMER_GROUP_ID = 668;
public static final int HEALTH_OVERLAY_BAR_GROUP_ID = 303;
>>>>>>>
public static final int GAUNTLET_MAP_GROUP_ID = 638;
public static final int HALLOWED_SEPULCHRE_TIMER_GROUP_ID = 668;
public static final int HEALTH_OVERLAY_BAR_GROUP_ID = 303;
<<<<<<<
static class GauntletMap
{
static final int CONTAINER = 4;
}
=======
static class HallowedSepulchreTimer
{
static final int CONTAINER = 2;
}
static class EncounterHealthBar
{
static final int CONTAINER = 6;
}
>>>>>>>
static class GauntletMap
{
static final int CONTAINER = 4;
}
static class HallowedSepulchreTimer
{
static final int CONTAINER = 2;
}
static class EncounterHealthBar
{
static final int CONTAINER = 6;
} |
<<<<<<<
/*
* Copyright (c) 2018, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import java.io.IOException;
import java.util.UUID;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.HttpUrl;
import okhttp3.Request;
import okhttp3.Response;
class SessionClient
{
Observable<UUID> openSession()
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addPathSegment("new")
.build();
return Observable.fromCallable(() ->
{
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return RuneLiteAPI.GSON.fromJson(response.body().string(), UUID.class);
}
});
}
Completable pingSession(UUID uuid)
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addPathSegment("ping")
.addQueryParameter("uuid", uuid.toString())
.build();
return Completable.fromAction(() ->
{
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
if (!response.isSuccessful())
{
throw new IOException("Unsuccesful ping");
}
}
});
}
Completable delete(UUID uuid)
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addQueryParameter("session", uuid.toString())
.build();
return Completable.fromAction(() ->
{
Request request = new Request.Builder()
.delete()
.url(url)
.build();
RuneLiteAPI.CLIENT.newCall(request).execute().close();
});
}
}
=======
/*
* Copyright (c) 2018, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client;
import com.google.gson.JsonParseException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.UUID;
import lombok.AllArgsConstructor;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
@AllArgsConstructor
class SessionClient
{
private final OkHttpClient okHttpClient;
UUID open() throws IOException
{
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.build();
Request request = new Request.Builder()
.post(RequestBody.create(null, new byte[0]))
.url(url)
.build();
try (Response response = okHttpClient.newCall(request).execute())
{
ResponseBody body = response.body();
InputStream in = body.byteStream();
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), UUID.class);
}
catch (JsonParseException | IllegalArgumentException ex) // UUID.fromString can throw IllegalArgumentException
{
throw new IOException(ex);
}
}
void ping(UUID uuid, boolean loggedIn) throws IOException
{
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addPathSegment("ping")
.addQueryParameter("session", uuid.toString())
.addQueryParameter("logged-in", String.valueOf(loggedIn))
.build();
Request request = new Request.Builder()
.post(RequestBody.create(null, new byte[0]))
.url(url)
.build();
try (Response response = okHttpClient.newCall(request).execute())
{
if (!response.isSuccessful())
{
throw new IOException("Unsuccessful ping");
}
}
}
void delete(UUID uuid) throws IOException
{
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addQueryParameter("session", uuid.toString())
.build();
Request request = new Request.Builder()
.delete()
.url(url)
.build();
okHttpClient.newCall(request).execute().close();
}
}
>>>>>>>
/*
* Copyright (c) 2018, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import java.io.IOException;
import java.util.UUID;
import lombok.AllArgsConstructor;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
@AllArgsConstructor
class SessionClient
{
private final OkHttpClient okHttpClient;
Observable<UUID> openSession()
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addPathSegment("new")
.build();
return Observable.fromCallable(() ->
{
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = okHttpClient.newCall(request).execute())
{
return RuneLiteAPI.GSON.fromJson(response.body().string(), UUID.class);
}
});
}
Completable pingSession(UUID uuid)
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addPathSegment("ping")
.addQueryParameter("uuid", uuid.toString())
.build();
return Completable.fromAction(() ->
{
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = okHttpClient.newCall(request).execute())
{
if (!response.isSuccessful())
{
throw new IOException("Unsuccessful ping");
}
}
});
}
Completable delete(UUID uuid)
{
final HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
.addQueryParameter("session", uuid.toString())
.build();
return Completable.fromAction(() ->
{
Request request = new Request.Builder()
.delete()
.url(url)
.build();
okHttpClient.newCall(request).execute().close();
});
}
} |
<<<<<<<
/**
* Adds a MenuEntry to the current menu.
*/
void insertMenuItem(String action, String target, int opcode, int identifier, int argument1, int argument2, boolean forceLeftClick);
void setSelectedItemID(int id);
void setSelectedItemWidget(int widgetID);
void setSelectedItemSlot(int idx);
int getSelectedSpellWidget();
int getSelectedSpellChildIndex();
void setSelectedSpellWidget(int widgetID);
void setSelectedSpellChildIndex(int index);
/**
* Scales values from pixels onto canvas
*
* @param canvas the array we're writing to
* @param pixels pixels to draw
* @param color should be 0
* @param pixelX x index
* @param pixelY y index
* @param canvasIdx index in canvas (canvas[canvasIdx])
* @param canvasOffset x offset
* @param newWidth new width
* @param newHeight new height
* @param pixelWidth pretty much horizontal scale
* @param pixelHeight pretty much vertical scale
* @param oldWidth old width
* @see net.runelite.client.util.ImageUtil#resizeSprite(Client, Sprite, int, int)
*/
void scaleSprite(int[] canvas, int[] pixels, int color, int pixelX, int pixelY, int canvasIdx, int canvasOffset, int newWidth, int newHeight, int pixelWidth, int pixelHeight, int oldWidth);
/**
* Get the MenuEntry at client.getMenuOptionCount() - 1
* <p>
* This is useful so you don't have to use getMenuEntries,
* which will create a big array, when you only want to change
* the left click one.
*/
MenuEntry getLeftClickMenuEntry();
/**
* Set the MenuEntry at client.getMenuOptionCount() - 1
* <p>
* This is useful so you don't have to use setMenuEntries,
* which will arraycopy a big array to several smaller arrays lol,
* when you only want to change the left click one.
*/
void setLeftClickMenuEntry(MenuEntry entry);
/**
* If this field is set to true, getting 5 minute logged won't show
* the "You have been disconnected." message anymore.
*/
void setHideDisconnect(boolean dontShow);
/**
* Sets the fields in the temporary menu entry that's saved in the client
* when a inventory item is clicked and dragged.
*/
void setTempMenuEntry(MenuEntry entry);
void setShowMouseCross(boolean show);
void setMouseIdleTicks(int cycles);
void setKeyboardIdleTicks(int cycles);
=======
/**
* Sets the result count for GE search
*/
void setGeSearchResultCount(int count);
/**
* Sets the array of item ids for GE search
*/
void setGeSearchResultIds(short[] ids);
/**
* Sets the starting index in the item id array for GE search
*/
void setGeSearchResultIndex(int index);
>>>>>>>
/**
* Adds a MenuEntry to the current menu.
*/
void insertMenuItem(String action, String target, int opcode, int identifier, int argument1, int argument2, boolean forceLeftClick);
void setSelectedItemID(int id);
void setSelectedItemWidget(int widgetID);
void setSelectedItemSlot(int idx);
int getSelectedSpellWidget();
int getSelectedSpellChildIndex();
void setSelectedSpellWidget(int widgetID);
void setSelectedSpellChildIndex(int index);
/**
* Scales values from pixels onto canvas
*
* @param canvas the array we're writing to
* @param pixels pixels to draw
* @param color should be 0
* @param pixelX x index
* @param pixelY y index
* @param canvasIdx index in canvas (canvas[canvasIdx])
* @param canvasOffset x offset
* @param newWidth new width
* @param newHeight new height
* @param pixelWidth pretty much horizontal scale
* @param pixelHeight pretty much vertical scale
* @param oldWidth old width
* @see net.runelite.client.util.ImageUtil#resizeSprite(Client, Sprite, int, int)
*/
void scaleSprite(int[] canvas, int[] pixels, int color, int pixelX, int pixelY, int canvasIdx, int canvasOffset, int newWidth, int newHeight, int pixelWidth, int pixelHeight, int oldWidth);
/**
* Get the MenuEntry at client.getMenuOptionCount() - 1
* <p>
* This is useful so you don't have to use getMenuEntries,
* which will create a big array, when you only want to change
* the left click one.
*/
MenuEntry getLeftClickMenuEntry();
/**
* Set the MenuEntry at client.getMenuOptionCount() - 1
* <p>
* This is useful so you don't have to use setMenuEntries,
* which will arraycopy a big array to several smaller arrays lol,
* when you only want to change the left click one.
*/
void setLeftClickMenuEntry(MenuEntry entry);
/**
* If this field is set to true, getting 5 minute logged won't show
* the "You have been disconnected." message anymore.
*/
void setHideDisconnect(boolean dontShow);
/**
* Sets the fields in the temporary menu entry that's saved in the client
* when a inventory item is clicked and dragged.
*/
void setTempMenuEntry(MenuEntry entry);
void setShowMouseCross(boolean show);
void setMouseIdleTicks(int cycles);
void setKeyboardIdleTicks(int cycles);
/**
* Sets the result count for GE search
*/
void setGeSearchResultCount(int count);
/**
* Sets the array of item ids for GE search
*/
void setGeSearchResultIds(short[] ids);
/**
* Sets the starting index in the item id array for GE search
*/
void setGeSearchResultIndex(int index); |
<<<<<<<
=======
import com.google.inject.Provides;
import java.util.Arrays;
import java.util.stream.Stream;
>>>>>>>
import com.google.inject.Provides;
<<<<<<<
if (ev.getOp() == 6)
=======
if (ev.getOp() == searchIndex + 1)
>>>>>>>
if (ev.getOp() == searchIndex + 1) |
<<<<<<<
&& !isTradeable(itemManager.getItemDefinition(id)) && wildyLevel <= DEEP_WILDY
&& (wildyLevel <= 0 || ItemReclaimCost.of(id) != null))
=======
&& !isTradeable(itemManager.getItemComposition(id))
&& (wildyLevel <= 0
|| LockedItem.getBaseIdFromLockedId(id) != null
|| (wildyLevel <= DEEP_WILDY && BrokenOnDeathItem.getRepairPrice(id) != null))
)
>>>>>>>
&& !isTradeable(itemManager.getItemComposition(id))
&& (wildyLevel <= 0
|| LockedItem.getBaseIdFromLockedId(id) != null
|| (wildyLevel <= DEEP_WILDY && ItemReclaimCost.of(id) != null))
) |
<<<<<<<
private final DiscordPlugin plugin;
private final PartyService party;
private final RuneLiteProperties properties;
=======
private final DiscordConfig config;
private PartyService party;
>>>>>>>
private final DiscordPlugin plugin;
private final PartyService party;
<<<<<<<
private DiscordState(final DiscordService discordService, final DiscordPlugin plugin, final PartyService party, final RuneLiteProperties properties)
=======
private DiscordState(final DiscordService discordService, final DiscordConfig config, final PartyService party)
>>>>>>>
private DiscordState(final DiscordService discordService, final DiscordPlugin plugin, final PartyService party) |
<<<<<<<
static final int MULTICOMBAT_INDICATOR = 21;
static final int BANK_PIN = 22;
static final int FRIENDS_CHAT_TAB = 33;
static final int FRIENDS_TAB = 35;
static final int IGNORES_TAB = 34;
static final int LOGOUT_TAB = 36;
static final int OPTIONS_TAB = 37;
static final int EMOTES_TAB = 38;
static final int MUSIC_TAB = 39;
static final int FRIENDS_CHAT_ICON = 40;
static final int FRIENDS_ICON = 42;
static final int IGNORES_ICON = 41;
static final int LOGOUT_ICON = 43;
static final int OPTIONS_ICON = 44;
static final int EMOTES_ICON = 45;
static final int MUSIC_ICON = 46;
static final int COMBAT_TAB = 50;
static final int STATS_TAB = 51;
static final int QUESTS_TAB = 52;
static final int INVENTORY_TAB = 53;
static final int EQUIPMENT_TAB = 54;
static final int PRAYER_TAB = 55;
static final int MAGIC_TAB = 56;
static final int COMBAT_ICON = 57;
static final int STATS_ICON = 58;
static final int QUESTS_ICON = 59;
static final int INVENTORY_ICON = 60;
static final int EQUIPMENT_ICON = 61;
static final int PRAYER_ICON = 62;
static final int MAGIC_ICON = 63;
static final int ROOT_INTERFACE_CONTAINER = 64;
static final int BANK_CONTAINER = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 71;
=======
static final int FRIENDS_CHAT_TAB = 34;
static final int FRIENDS_TAB = 36;
static final int IGNORES_TAB = 35;
static final int LOGOUT_TAB = 37;
static final int OPTIONS_TAB = 38;
static final int EMOTES_TAB = 39;
static final int MUSIC_TAB = 40;
static final int FRIENDS_CHAT_ICON = 41;
static final int FRIENDS_ICON = 43;
static final int IGNORES_ICON = 42;
static final int LOGOUT_ICON = 44;
static final int OPTIONS_ICON = 45;
static final int EMOTES_ICON = 46;
static final int MUSIC_ICON = 47;
static final int COMBAT_TAB = 51;
static final int STATS_TAB = 52;
static final int QUESTS_TAB = 53;
static final int INVENTORY_TAB = 54;
static final int EQUIPMENT_TAB = 55;
static final int PRAYER_TAB = 56;
static final int MAGIC_TAB = 57;
static final int COMBAT_ICON = 58;
static final int STATS_ICON = 59;
static final int QUESTS_ICON = 60;
static final int INVENTORY_ICON = 61;
static final int EQUIPMENT_ICON = 62;
static final int PRAYER_ICON = 63;
static final int MAGIC_ICON = 64;
static final int ROOT_INTERFACE_CONTAINER = 65;
static final int BANK_CONTAINER = 67;
static final int INTERFACE_CONTAINER = 68;
static final int INVENTORY_CONTAINER = 72;
>>>>>>>
static final int MULTICOMBAT_INDICATOR = 21;
static final int FRIENDS_CHAT_TAB = 34;
static final int FRIENDS_TAB = 36;
static final int IGNORES_TAB = 35;
static final int LOGOUT_TAB = 37;
static final int OPTIONS_TAB = 38;
static final int EMOTES_TAB = 39;
static final int MUSIC_TAB = 40;
static final int FRIENDS_CHAT_ICON = 41;
static final int FRIENDS_ICON = 43;
static final int IGNORES_ICON = 42;
static final int LOGOUT_ICON = 44;
static final int OPTIONS_ICON = 45;
static final int EMOTES_ICON = 46;
static final int MUSIC_ICON = 47;
static final int COMBAT_TAB = 51;
static final int STATS_TAB = 52;
static final int QUESTS_TAB = 53;
static final int INVENTORY_TAB = 54;
static final int EQUIPMENT_TAB = 55;
static final int PRAYER_TAB = 56;
static final int MAGIC_TAB = 57;
static final int COMBAT_ICON = 58;
static final int STATS_ICON = 59;
static final int QUESTS_ICON = 60;
static final int INVENTORY_ICON = 61;
static final int EQUIPMENT_ICON = 62;
static final int PRAYER_ICON = 63;
static final int MAGIC_ICON = 64;
static final int ROOT_INTERFACE_CONTAINER = 65;
static final int BANK_CONTAINER = 67;
static final int INTERFACE_CONTAINER = 68;
static final int INVENTORY_CONTAINER = 72;
<<<<<<<
static final int ITEMS_KEPT_ON_DEATH = 13;
static final int BANK_PIN = 13;
static final int MULTICOMBAT_INDICATOR = 17;
static final int FRIENDS_CHAT_TAB = 37;
static final int FRIENDS_TAB = 39;
static final int IGNORES_TAB = 38;
static final int LOGOUT_TAB = 40;
static final int OPTIONS_TAB = 41;
static final int EMOTES_TAB = 42;
static final int MUSIC_TAB = 43;
static final int FRIENDS_CHAT_ICON = 44;
static final int FRIENDS_ICON = 46;
static final int IGNORES_ICON = 45;
static final int LOGOUT_ICON = 47;
static final int OPTIONS_ICON = 48;
static final int EMOTES_ICON = 49;
static final int MUSIC_ICON = 50;
static final int COMBAT_TAB = 53;
static final int STATS_TAB = 54;
static final int QUESTS_TAB = 55;
static final int INVENTORY_TAB = 56;
static final int EQUIPMENT_TAB = 57;
static final int PRAYER_TAB = 58;
static final int MAGIC_TAB = 59;
static final int COMBAT_ICON = 60;
static final int STATS_ICON = 61;
static final int QUESTS_ICON = 62;
static final int INVENTORY_ICON = 63;
static final int EQUIPMENT_ICON = 64;
static final int PRAYER_ICON = 65;
static final int MAGIC_ICON = 66;
static final int INTERFACE_CONTAINER = 67;
static final int INVENTORY_CONTAINER = 73;
=======
static final int FRIENDS_CHAT_TAB = 38;
static final int FRIENDS_TAB = 40;
static final int IGNORES_TAB = 39;
static final int LOGOUT_TAB = 41;
static final int OPTIONS_TAB = 42;
static final int EMOTES_TAB = 43;
static final int MUSIC_TAB = 44;
static final int FRIENDS_CHAT_ICON = 45;
static final int FRIENDS_ICON = 47;
static final int IGNORES_ICON = 46;
static final int LOGOUT_ICON = 48;
static final int OPTIONS_ICON = 49;
static final int EMOTES_ICON = 50;
static final int MUSIC_ICON = 51;
static final int COMBAT_TAB = 54;
static final int STATS_TAB = 55;
static final int QUESTS_TAB = 56;
static final int INVENTORY_TAB = 57;
static final int EQUIPMENT_TAB = 58;
static final int PRAYER_TAB = 59;
static final int MAGIC_TAB = 60;
static final int COMBAT_ICON = 61;
static final int STATS_ICON = 62;
static final int QUESTS_ICON = 63;
static final int INVENTORY_ICON = 64;
static final int EQUIPMENT_ICON = 65;
static final int PRAYER_ICON = 66;
static final int MAGIC_ICON = 67;
static final int INTERFACE_CONTAINER = 68;
static final int INVENTORY_CONTAINER = 74;
>>>>>>>
static final int MULTICOMBAT_INDICATOR = 17;
static final int FRIENDS_CHAT_TAB = 38;
static final int FRIENDS_TAB = 40;
static final int IGNORES_TAB = 39;
static final int LOGOUT_TAB = 41;
static final int OPTIONS_TAB = 42;
static final int EMOTES_TAB = 43;
static final int MUSIC_TAB = 44;
static final int FRIENDS_CHAT_ICON = 45;
static final int FRIENDS_ICON = 47;
static final int IGNORES_ICON = 46;
static final int LOGOUT_ICON = 48;
static final int OPTIONS_ICON = 49;
static final int EMOTES_ICON = 50;
static final int MUSIC_ICON = 51;
static final int COMBAT_TAB = 54;
static final int STATS_TAB = 55;
static final int QUESTS_TAB = 56;
static final int INVENTORY_TAB = 57;
static final int EQUIPMENT_TAB = 58;
static final int PRAYER_TAB = 59;
static final int MAGIC_TAB = 60;
static final int COMBAT_ICON = 61;
static final int STATS_ICON = 62;
static final int QUESTS_ICON = 63;
static final int INVENTORY_ICON = 64;
static final int EQUIPMENT_ICON = 65;
static final int PRAYER_ICON = 66;
static final int MAGIC_ICON = 67;
static final int INTERFACE_CONTAINER = 68;
static final int INVENTORY_CONTAINER = 74;
<<<<<<<
static final int BANK_PIN = 13;
static final int LOGOUT_BUTTON_OVERLAY = 31;
=======
static final int LOGOUT_BUTTON_OVERLAY = 32;
>>>>>>>
static final int LOGOUT_BUTTON_OVERLAY = 32;
<<<<<<<
static class KeptOnDeath
{
static final int KEPT_ITEMS_CONTAINER = 18;
static final int KEPT_ITEMS_TEXT = 17;
static final int LOST_ITEMS_TEXT = 20;
static final int LOST_ITEMS_CONTAINER = 21;
static final int LOST_ITEMS_VALUE = 23;
static final int INFORMATION_CONTAINER = 29;
static final int MAX_ITEMS_KEPT_ON_DEATH = 30;
static final int SAFE_ZONE_CONTAINER = 31;
static final int CUSTOM_TEXT_CONTAINER = 33;
}
public static class TradeScreen
{
public static final int FIRST_TRADING_WITH = 31;
public static final int SECOND_ACCEPT_FUNC = 13;
public static final int SECOND_DECLINE_FUNC = 14;
public static final int SECOND_MY_OFFER = 23;
public static final int SECOND_THEIR_OFFER = 24;
public static final int SECOND_ACCEPT_TEXT = 25;
public static final int SECOND_DECLINE_TEXT = 26;
public static final int SECOND_MY_ITEMS = 28;
public static final int SECOND_THEIR_ITEMS = 29;
public static final int SECOND_TRADING_WITH = 30;
}
public static class DuelConfig
{
public static final int CONFIG_GROUP_IP = 482;
public static final int TITLE = 35;
public static final int OPPONENT_ATT = 9;
public static final int OPPONENT_STR = 13;
public static final int OPPONENT_DEF = 17;
public static final int OPPONENT_HP = 21;
}
public static class DuelResult
{
public static final int RESULT_GROUP_ID = 372;
public static final int TITLE = 16;
public static final int TOTAL_STAKED = 32;
public static final int TOTAL_TAX = 39;
public static final int WINNINGS = 40;
}
// Also used for many other interfaces!
static class BankPin
{
static final int CONTAINER = 0;
static final int TOP_LEFT_TEXT = 2;
static final int FIRST_ENTERED = 3;
static final int SECOND_ENTERED = 4;
static final int THIRD_ENTERED = 5;
static final int FOURTH_ENTERED = 6;
static final int INSTRUCTION_TEXT = 10;
static final int EXIT_BUTTON = 13;
static final int FORGOT_BUTTON = 15;
static final int BUTTON_1 = 16;
static final int BUTTON_2 = 18;
static final int BUTTON_3 = 20;
static final int BUTTON_4 = 22;
static final int BUTTON_5 = 24;
static final int BUTTON_6 = 26;
static final int BUTTON_7 = 28;
static final int BUTTON_8 = 30;
static final int BUTTON_9 = 32;
static final int BUTTON_10 = 34;
}
=======
>>>>>>>
public static class TradeScreen
{
public static final int FIRST_TRADING_WITH = 31;
public static final int SECOND_ACCEPT_FUNC = 13;
public static final int SECOND_DECLINE_FUNC = 14;
public static final int SECOND_MY_OFFER = 23;
public static final int SECOND_THEIR_OFFER = 24;
public static final int SECOND_ACCEPT_TEXT = 25;
public static final int SECOND_DECLINE_TEXT = 26;
public static final int SECOND_MY_ITEMS = 28;
public static final int SECOND_THEIR_ITEMS = 29;
public static final int SECOND_TRADING_WITH = 30;
}
public static class DuelConfig
{
public static final int CONFIG_GROUP_IP = 482;
public static final int TITLE = 35;
public static final int OPPONENT_ATT = 9;
public static final int OPPONENT_STR = 13;
public static final int OPPONENT_DEF = 17;
public static final int OPPONENT_HP = 21;
}
public static class DuelResult
{
public static final int RESULT_GROUP_ID = 372;
public static final int TITLE = 16;
public static final int TOTAL_STAKED = 32;
public static final int TOTAL_TAX = 39;
public static final int WINNINGS = 40;
}
// Also used for many other interfaces!
static class BankPin
{
static final int CONTAINER = 0;
static final int TOP_LEFT_TEXT = 2;
static final int FIRST_ENTERED = 3;
static final int SECOND_ENTERED = 4;
static final int THIRD_ENTERED = 5;
static final int FOURTH_ENTERED = 6;
static final int INSTRUCTION_TEXT = 10;
static final int EXIT_BUTTON = 13;
static final int FORGOT_BUTTON = 15;
static final int BUTTON_1 = 16;
static final int BUTTON_2 = 18;
static final int BUTTON_3 = 20;
static final int BUTTON_4 = 22;
static final int BUTTON_5 = 24;
static final int BUTTON_6 = 26;
static final int BUTTON_7 = 28;
static final int BUTTON_8 = 30;
static final int BUTTON_9 = 32;
static final int BUTTON_10 = 34;
} |
<<<<<<<
import net.runelite.api.Prayer;
import net.runelite.api.Skill;
import net.runelite.api.SkullIcon;
import net.runelite.api.VarPlayer;
=======
>>>>>>>
import net.runelite.api.Skill;
import net.runelite.api.SkullIcon;
import net.runelite.api.VarPlayer; |
<<<<<<<
public boolean submitHost(int world, String location, House house) throws IOException
{
HttpUrl url = RuneLiteAPI.getOpenOSRSApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("hosts")
.addQueryParameter("world", Integer.toString(world))
.addQueryParameter("location", location)
.addQueryParameter("owner", house.getOwner())
.addQueryParameter("guildedAltar", Boolean.toString(house.isGuildedAltarPresent()))
.addQueryParameter("occultAltar", Boolean.toString(house.isOccultAltarPresent()))
.addQueryParameter("spiritTree", Boolean.toString(house.isSpiritTreePresent()))
.addQueryParameter("fairyRing", Boolean.toString(house.isFairyRingPresent()))
.addQueryParameter("wildernessObelisk", Boolean.toString(house.isWildernessObeliskPresent()))
.addQueryParameter("repairStand", Boolean.toString(house.isRepairStandPresent()))
.addQueryParameter("combatDummy", Boolean.toString(house.isCombatDummyPresent()))
.build();
Request request = new Request.Builder()
.post(body)
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
public boolean removeHost(int world, String location, House house) throws IOException
{
HttpUrl url = RuneLiteAPI.getOpenOSRSApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("hosts")
.addQueryParameter("world", Integer.toString(world))
.addQueryParameter("location", location)
.addQueryParameter("owner", house.getOwner())
.addQueryParameter("guildedAltar", Boolean.toString(house.isGuildedAltarPresent()))
.addQueryParameter("occultAltar", Boolean.toString(house.isOccultAltarPresent()))
.addQueryParameter("spiritTree", Boolean.toString(house.isSpiritTreePresent()))
.addQueryParameter("fairyRing", Boolean.toString(house.isFairyRingPresent()))
.addQueryParameter("wildernessObelisk", Boolean.toString(house.isWildernessObeliskPresent()))
.addQueryParameter("repairStand", Boolean.toString(house.isRepairStandPresent()))
.addQueryParameter("combatDummy", Boolean.toString(house.isCombatDummyPresent()))
.addQueryParameter("remove", Boolean.toString(true))
.build();
Request request = new Request.Builder()
.post(body)
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
=======
public boolean submitLayout(String username, LayoutRoom[] rooms) throws IOException
{
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("layout")
.addQueryParameter("name", username)
.build();
Request request = new Request.Builder()
.post(RequestBody.create(RuneLiteAPI.JSON, RuneLiteAPI.GSON.toJson(rooms)))
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
public LayoutRoom[] getLayout(String username) throws IOException
{
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("layout")
.addQueryParameter("name", username)
.build();
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
if (!response.isSuccessful())
{
throw new IOException("Unable to look up layout!");
}
InputStream in = response.body().byteStream();
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), LayoutRoom[].class);
}
catch (JsonParseException ex)
{
throw new IOException(ex);
}
}
>>>>>>>
public boolean submitHost(int world, String location, House house) throws IOException
{
HttpUrl url = RuneLiteAPI.getOpenOSRSApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("hosts")
.addQueryParameter("world", Integer.toString(world))
.addQueryParameter("location", location)
.addQueryParameter("owner", house.getOwner())
.addQueryParameter("guildedAltar", Boolean.toString(house.isGuildedAltarPresent()))
.addQueryParameter("occultAltar", Boolean.toString(house.isOccultAltarPresent()))
.addQueryParameter("spiritTree", Boolean.toString(house.isSpiritTreePresent()))
.addQueryParameter("fairyRing", Boolean.toString(house.isFairyRingPresent()))
.addQueryParameter("wildernessObelisk", Boolean.toString(house.isWildernessObeliskPresent()))
.addQueryParameter("repairStand", Boolean.toString(house.isRepairStandPresent()))
.addQueryParameter("combatDummy", Boolean.toString(house.isCombatDummyPresent()))
.build();
Request request = new Request.Builder()
.post(body)
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
public boolean removeHost(int world, String location, House house) throws IOException
{
HttpUrl url = RuneLiteAPI.getOpenOSRSApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("hosts")
.addQueryParameter("world", Integer.toString(world))
.addQueryParameter("location", location)
.addQueryParameter("owner", house.getOwner())
.addQueryParameter("guildedAltar", Boolean.toString(house.isGuildedAltarPresent()))
.addQueryParameter("occultAltar", Boolean.toString(house.isOccultAltarPresent()))
.addQueryParameter("spiritTree", Boolean.toString(house.isSpiritTreePresent()))
.addQueryParameter("fairyRing", Boolean.toString(house.isFairyRingPresent()))
.addQueryParameter("wildernessObelisk", Boolean.toString(house.isWildernessObeliskPresent()))
.addQueryParameter("repairStand", Boolean.toString(house.isRepairStandPresent()))
.addQueryParameter("combatDummy", Boolean.toString(house.isCombatDummyPresent()))
.addQueryParameter("remove", Boolean.toString(true))
.build();
Request request = new Request.Builder()
.post(body)
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
public boolean submitLayout(String username, LayoutRoom[] rooms) throws IOException
{
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("layout")
.addQueryParameter("name", username)
.build();
Request request = new Request.Builder()
.post(RequestBody.create(RuneLiteAPI.JSON, RuneLiteAPI.GSON.toJson(rooms)))
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
return response.isSuccessful();
}
}
public LayoutRoom[] getLayout(String username) throws IOException
{
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
.addPathSegment("chat")
.addPathSegment("layout")
.addQueryParameter("name", username)
.build();
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
{
if (!response.isSuccessful())
{
throw new IOException("Unable to look up layout!");
}
InputStream in = response.body().byteStream();
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), LayoutRoom[].class);
}
catch (JsonParseException ex)
{
throw new IOException(ex);
}
} |
<<<<<<<
@Inject
private EventBus eventBus;
=======
@Inject
private ColorPickerManager colorPickerManager;
>>>>>>>
@Inject
private ColorPickerManager colorPickerManager;
@Inject
private EventBus eventBus;
<<<<<<<
addSubscriptions();
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig);
=======
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig, colorPickerManager);
>>>>>>>
addSubscriptions();
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig, colorPickerManager); |
<<<<<<<
@ConfigTitleSection(
keyName = "uiTitle",
name = "User interface",
description = "",
position = 1
)
default Title uiTitle()
{
return new Title();
}
=======
String GROUP_NAME = "runelite";
>>>>>>>
String GROUP_NAME = "runelite";
@ConfigTitleSection(
keyName = "uiTitle",
name = "User interface",
description = "",
position = 1
)
default Title uiTitle()
{
return new Title();
} |
<<<<<<<
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.HashMultiset;
=======
import com.google.common.base.Strings;
>>>>>>>
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.HashMultiset;
import com.google.common.base.Strings;
<<<<<<<
import net.runelite.api.events.ConfigChanged;
=======
import net.runelite.api.SpriteID;
import net.runelite.api.VarClientInt;
import net.runelite.api.VarClientStr;
>>>>>>>
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.SpriteID;
import net.runelite.api.VarClientInt;
import net.runelite.api.VarClientStr;
<<<<<<<
private boolean largePinNumbers;
private Multiset<Integer> itemQuantities; // bank item quantities for bank value search
=======
private String searchString;
>>>>>>>
private boolean largePinNumbers;
private Multiset<Integer> itemQuantities; // bank item quantities for bank value search
private String searchString;
<<<<<<<
itemQuantities = null;
=======
searchString = "";
>>>>>>>
itemQuantities = null;
<<<<<<<
private void onItemContainerChanged(ItemContainerChanged event)
=======
@Subscribe
public void onVarClientStrChanged(VarClientStrChanged event)
{
String searchVar = client.getVar(VarClientStr.INPUT_TEXT);
if (!searchVar.equals(searchString))
{
Widget searchButtonBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND);
if (searchButtonBackground != null && searchButtonBackground.hasListener())
{
searchButtonBackground.setOnTimerListener((Object[]) null);
searchButtonBackground.setHasListener(false);
}
clientThread.invokeLater(() -> bankSearch.layoutBank());
searchString = searchVar;
}
if (client.getVar(VarClientInt.INPUT_TYPE) != InputType.SEARCH.getType() && Strings.isNullOrEmpty(client.getVar(VarClientStr.INPUT_TEXT)))
{
Widget searchBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND);
if (searchBackground != null)
{
searchBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE);
}
}
}
@Subscribe
public void onItemContainerChanged(ItemContainerChanged event)
>>>>>>>
public void onVarClientStrChanged(VarClientStrChanged event)
{
String searchVar = client.getVar(VarClientStr.INPUT_TEXT);
if (!searchVar.equals(searchString))
{
Widget searchButtonBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND);
if (searchButtonBackground != null && searchButtonBackground.hasListener())
{
searchButtonBackground.setOnTimerListener((Object[]) null);
searchButtonBackground.setHasListener(false);
}
clientThread.invokeLater(() -> bankSearch.layoutBank());
searchString = searchVar;
}
if (client.getVar(VarClientInt.INPUT_TYPE) != InputType.SEARCH.getType() && Strings.isNullOrEmpty(client.getVar(VarClientStr.INPUT_TEXT)))
{
Widget searchBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND);
if (searchBackground != null)
{
searchBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE);
}
}
}
public void onItemContainerChanged(ItemContainerChanged event) |
<<<<<<<
public static final int JEWELLERY_BOX_GROUP_ID = 590;
public static final int OPTIONS_GROUP_ID = 261;
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
public static final int GWD_KC_GROUP_ID = 406;
=======
public static final int ADVENTURE_LOG_ID = 187;
public static final int COUNTERS_LOG_GROUP_ID = 625;
>>>>>>>
public static final int JEWELLERY_BOX_GROUP_ID = 590;
public static final int OPTIONS_GROUP_ID = 261;
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
public static final int GWD_KC_GROUP_ID = 406;
public static final int ADVENTURE_LOG_ID = 187;
public static final int COUNTERS_LOG_GROUP_ID = 625;
<<<<<<<
=======
static class Lms
{
static final int INFO = 3;
}
static class LmsKDA
{
static final int INFO = 4;
}
static class AdventureLog
{
static final int CONTAINER = 0;
}
static class CountersLog
{
static final int OWNER = 4;
static final int TEXT = 6;
}
>>>>>>>
static class Lms
{
static final int INFO = 3;
}
static class LmsKDA
{
static final int INFO = 4;
}
static class AdventureLog
{
static final int CONTAINER = 0;
}
static class CountersLog
{
static final int OWNER = 4;
static final int TEXT = 6;
} |
<<<<<<<
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.var") CoreConstructor varTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.coef") CoreConstructor coefTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:ide") CoreConstructor ideTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:zro") CoreConstructor zroTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:negative") CoreConstructor negativeTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:*") CoreConstructor mulTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:+") CoreConstructor addTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "AlgData.terms-equality") CoreFunctionDefinition semiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "RingData.terms-equality") CoreFunctionDefinition ringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CAlgData.terms-equality") CoreFunctionDefinition commSemiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CRingData.terms-equality") CoreFunctionDefinition commRingTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "RingData.interpret") CoreFunctionDefinition ringInterpret;
@Dependency(module = "Algebra.Ring.Solver", name = "gensZeroToIdealZero") CoreFunctionDefinition gensZeroToIdealZero;
=======
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.var") CoreConstructor varTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.coef") CoreConstructor coefTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:ide") CoreConstructor ideTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:zro") CoreConstructor zroTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:negative") CoreConstructor negativeTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:*") CoreConstructor mulTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:+") CoreConstructor addTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "AlgData.terms-equality") CoreFunctionDefinition semiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "RingData.terms-equality") CoreFunctionDefinition ringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CAlgData.terms-equality") CoreFunctionDefinition commSemiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CRingData.terms-equality") CoreFunctionDefinition commRingTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "LatticeData.terms-equality") CoreFunctionDefinition latticeTermsEq;
>>>>>>>
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.var") CoreConstructor varTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.coef") CoreConstructor coefTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:ide") CoreConstructor ideTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:zro") CoreConstructor zroTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:negative") CoreConstructor negativeTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:*") CoreConstructor mulTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "RingTerm.:+") CoreConstructor addTerm;
@Dependency(module = "Algebra.Ring.Solver", name = "AlgData.terms-equality") CoreFunctionDefinition semiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "RingData.terms-equality") CoreFunctionDefinition ringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CAlgData.terms-equality") CoreFunctionDefinition commSemiringTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "CRingData.terms-equality") CoreFunctionDefinition commRingTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "LatticeData.terms-equality") CoreFunctionDefinition latticeTermsEq;
@Dependency(module = "Algebra.Ring.Solver", name = "RingData.interpret") CoreFunctionDefinition ringInterpret;
@Dependency(module = "Algebra.Ring.Solver", name = "gensZeroToIdealZero") CoreFunctionDefinition gensZeroToIdealZero; |
<<<<<<<
import net.runelite.api.Varbits;
import net.runelite.api.WorldType;
=======
>>>>>>>
import net.runelite.api.Varbits;
<<<<<<<
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.screenshot.imgur.ImageUploadRequest;
import net.runelite.client.plugins.screenshot.imgur.ImageUploadResponse;
=======
>>>>>>>
import net.runelite.client.plugins.PluginType;
<<<<<<<
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
=======
import net.runelite.client.util.Text;
>>>>>>>
import org.jetbrains.annotations.Nullable;
<<<<<<<
private static String format(Date date)
{
synchronized (TIME_FORMAT)
{
return TIME_FORMAT.format(date);
}
}
=======
>>>>>>>
private static String format(Date date)
{
synchronized (TIME_FORMAT)
{
return TIME_FORMAT.format(date);
}
}
<<<<<<<
takeScreenshot(client.getLocalPlayer().getName() + " dead " + format(new Date()), "Deaths");
=======
takeScreenshot("Death");
>>>>>>>
takeScreenshot(client.getLocalPlayer().getName() + " dead " + format(new Date()), "Deaths");
<<<<<<<
takeScreenshot(event.getPlayer().getName() + " dead " + format(new Date()), "Deaths");
=======
takeScreenshot("Death " + player.getName());
>>>>>>>
takeScreenshot(event.getPlayer().getName() + " dead " + format(new Date()), "Deaths");
<<<<<<<
File playerFolder;
if (client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
{
final EnumSet<WorldType> worldTypes = client.getWorldType();
String playerDir = client.getLocalPlayer().getName();
if (worldTypes.contains(WorldType.DEADMAN))
{
playerDir += "-Deadman";
}
else if (worldTypes.contains(WorldType.LEAGUE))
{
playerDir += "-League";
}
playerFolder = new File(SCREENSHOT_DIR, playerDir);
}
else
{
playerFolder = SCREENSHOT_DIR;
}
playerFolder.mkdirs();
if (subdirectory != null)
{
//uhh just tried to do this as workaround, not sure if it's the best idea tho
File actualplayerFolder = new File(playerFolder, subdirectory);
actualplayerFolder.mkdir();
playerFolder = actualplayerFolder;
}
try
{
File screenshotFile = new File(playerFolder, fileName + ".png");
// To make sure that screenshots don't get overwritten, check if file exists,
// and if it does create file with same name and suffix.
int i = 1;
while (screenshotFile.exists())
{
screenshotFile = new File(playerFolder, fileName + String.format("(%d)", i++) + ".png");
}
ImageIO.write(screenshot, "PNG", screenshotFile);
UploadStyle uploadStyle = this.uploadScreenshot;
if (uploadStyle == UploadStyle.IMGUR)
{
uploadScreenshot(screenshotFile);
}
else if (uploadStyle == UploadStyle.CLIPBOARD)
{
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
TransferableBufferedImage transferableBufferedImage = new TransferableBufferedImage(screenshot);
clipboard.setContents(transferableBufferedImage, null);
if (this.notifyWhenTaken)
{
notifier.notify("A screenshot was saved and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
else if (this.notifyWhenTaken)
{
notifier.notify("A screenshot was saved to " + screenshotFile, TrayIcon.MessageType.INFO);
}
}
catch (IOException ex)
{
log.warn("error writing screenshot", ex);
}
}
/**
* Uploads a screenshot to the Imgur image-hosting service,
* and copies the image link to the clipboard.
*
* @param screenshotFile Image file to upload.
* @throws IOException Thrown if the file cannot be read.
*/
/**
* Uploads a screenshot to the Imgur image-hosting service,
* and copies the image link to the clipboard.
*
* @param screenshotFile Image file to upload.
* @throws IOException Thrown if the file cannot be read.
*/
private void uploadScreenshot(File screenshotFile) throws IOException
{
String json = RuneLiteAPI.GSON.toJson(new ImageUploadRequest(screenshotFile));
Request request = new Request.Builder()
.url(IMGUR_IMAGE_UPLOAD_URL)
.addHeader("Authorization", "Client-ID " + IMGUR_CLIENT_ID)
.post(RequestBody.create(JSON, json))
.build();
RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(@NotNull Call call, @NotNull IOException ex)
{
log.warn("error uploading screenshot", ex);
}
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException
{
try (InputStream in = response.body().byteStream())
{
ImageUploadResponse imageUploadResponse = RuneLiteAPI.GSON
.fromJson(new InputStreamReader(in), ImageUploadResponse.class);
if (imageUploadResponse.isSuccess())
{
String link = imageUploadResponse.getData().getLink();
StringSelection selection = new StringSelection(link);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
if (notifyWhenTaken)
{
notifier.notify("A screenshot was uploaded and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
}
}
});
=======
imageCapture.takeScreenshot(screenshot, fileName, config.notifyWhenTaken(), config.uploadScreenshot());
>>>>>>>
imageCapture.takeScreenshot(screenshot, fileName, config.notifyWhenTaken(), config.uploadScreenshot()); |
<<<<<<<
private static final Pattern XERIC_CHECK_CHARGE_PATTERN = Pattern.compile(
"talisman has (\\d+|one) charges?");
private static final Pattern XERIC_RECHARGEWIDGET_PATTERN = Pattern.compile(
"Your talisman now has (\\d+|one) charges?\\.");
private static final Pattern XERIC_OUT_OF_CHARGES = Pattern.compile(
"Your talisman has run out of charges");
private static final Pattern XERIC_UNCHARGE_PATTERN = Pattern.compile(
"lizard fangs? from your talisman\\.");
private static final Pattern SOULBEARER_RECHARGE_PATTERN = Pattern.compile(
"You add (\\d+|a) charges? to your soul bearer.It now has (\\d+) charges\\.");
private static final Pattern SOULBEARER_RECHARGE_PATTERN2 = Pattern.compile(
"Your soul bearer now has one charge\\.");
private static final Pattern SOULBEARER_CHECK_CHARGE_PATTERN = Pattern.compile(
"soul bearer has (\\d+|one) charges?\\.");
private static final Pattern SOULBEARER_UNCHARGE_PATTERN = Pattern.compile(
"You remove the runes from the soul bearer\\.");
private static final Pattern SOULBEARER_BANKHEADS_PATTERN = Pattern.compile(
"Your soul bearer carries the ensouled heads? to your ?bank\\. It has (\\d+|one) charges? left\\.");
private static final Pattern SOULBEARER_OUT_OF_CHARGES = Pattern.compile(
"Your soul bearer carries the ensouled heads? to (.+)\\. It has run out of charges\\.");
private static final Pattern CHRONICLE_CHECK_CHARGE_PATTERN = Pattern.compile(
"Your book has (\\d+) charges left\\.");
private static final Pattern CHRONICLE_ADD_CHARGE_PATTERN = Pattern.compile(
"You add (\\d+|a single) charges? to your book. It now has (\\d+) charges\\.");
private static final Pattern CHRONICLE_LAST_CHARGE_PATTERN = Pattern.compile(
"You have one charge left in your book\\.");
private static final Pattern CHRONICLE_OUT_OF_CHARGES_PATTERN = Pattern.compile(
"Your book has run out of charges\\.");
=======
private static final Pattern RING_OF_FORGING_CHECK_PATTERN = Pattern.compile(
"You can smelt ([0-9+]+|one) more pieces? of iron ore before a ring melts\\.");
private static final String RING_OF_FORGING_USED_TEXT = "You retrieve a bar of iron.";
private static final String RING_OF_FORGING_BREAK_TEXT = "<col=7f007f>Your Ring of Forging has melted.</col>";
>>>>>>>
private static final Pattern XERIC_CHECK_CHARGE_PATTERN = Pattern.compile(
"talisman has (\\d+|one) charges?");
private static final Pattern XERIC_RECHARGEWIDGET_PATTERN = Pattern.compile(
"Your talisman now has (\\d+|one) charges?\\.");
private static final Pattern XERIC_OUT_OF_CHARGES = Pattern.compile(
"Your talisman has run out of charges");
private static final Pattern XERIC_UNCHARGE_PATTERN = Pattern.compile(
"lizard fangs? from your talisman\\.");
private static final Pattern SOULBEARER_RECHARGE_PATTERN = Pattern.compile(
"You add (\\d+|a) charges? to your soul bearer.It now has (\\d+) charges\\.");
private static final Pattern SOULBEARER_RECHARGE_PATTERN2 = Pattern.compile(
"Your soul bearer now has one charge\\.");
private static final Pattern SOULBEARER_CHECK_CHARGE_PATTERN = Pattern.compile(
"soul bearer has (\\d+|one) charges?\\.");
private static final Pattern SOULBEARER_UNCHARGE_PATTERN = Pattern.compile(
"You remove the runes from the soul bearer\\.");
private static final Pattern SOULBEARER_BANKHEADS_PATTERN = Pattern.compile(
"Your soul bearer carries the ensouled heads? to your ?bank\\. It has (\\d+|one) charges? left\\.");
private static final Pattern SOULBEARER_OUT_OF_CHARGES = Pattern.compile(
"Your soul bearer carries the ensouled heads? to (.+)\\. It has run out of charges\\.");
private static final Pattern CHRONICLE_CHECK_CHARGE_PATTERN = Pattern.compile(
"Your book has (\\d+) charges left\\.");
private static final Pattern CHRONICLE_ADD_CHARGE_PATTERN = Pattern.compile(
"You add (\\d+|a single) charges? to your book. It now has (\\d+) charges\\.");
private static final Pattern CHRONICLE_LAST_CHARGE_PATTERN = Pattern.compile(
"You have one charge left in your book\\.");
private static final Pattern CHRONICLE_OUT_OF_CHARGES_PATTERN = Pattern.compile(
"Your book has run out of charges\\.");
private static final Pattern RING_OF_FORGING_CHECK_PATTERN = Pattern.compile(
"You can smelt ([0-9+]+|one) more pieces? of iron ore before a ring melts\\.");
private static final String RING_OF_FORGING_USED_TEXT = "You retrieve a bar of iron.";
private static final String RING_OF_FORGING_BREAK_TEXT = "<col=7f007f>Your Ring of Forging has melted.</col>";
<<<<<<<
Matcher xericRechargeMatcher = XERIC_CHECK_CHARGE_PATTERN.matcher(message);
Matcher xericOutOfChargesMatcher = XERIC_OUT_OF_CHARGES.matcher(message);
Matcher soulbearerCheckMatcher = SOULBEARER_CHECK_CHARGE_PATTERN.matcher(message);
Matcher chronicleCheckMatcher = CHRONICLE_CHECK_CHARGE_PATTERN.matcher(message);
Matcher chronicleRechargeMatcher = CHRONICLE_ADD_CHARGE_PATTERN.matcher(message);
Matcher chronicleLastChargeMatcher = CHRONICLE_LAST_CHARGE_PATTERN.matcher(message);
Matcher chronicleOutOfChargesMatcher = CHRONICLE_OUT_OF_CHARGES_PATTERN.matcher(message);
=======
Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message);
>>>>>>>
Matcher xericRechargeMatcher = XERIC_CHECK_CHARGE_PATTERN.matcher(message);
Matcher xericOutOfChargesMatcher = XERIC_OUT_OF_CHARGES.matcher(message);
Matcher soulbearerCheckMatcher = SOULBEARER_CHECK_CHARGE_PATTERN.matcher(message);
Matcher chronicleCheckMatcher = CHRONICLE_CHECK_CHARGE_PATTERN.matcher(message);
Matcher chronicleRechargeMatcher = CHRONICLE_ADD_CHARGE_PATTERN.matcher(message);
Matcher chronicleLastChargeMatcher = CHRONICLE_LAST_CHARGE_PATTERN.matcher(message);
Matcher chronicleOutOfChargesMatcher = CHRONICLE_OUT_OF_CHARGES_PATTERN.matcher(message);
Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message);
<<<<<<<
else if (xericRechargeMatcher.find())
{
final int xericCharges = xericRechargeMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(xericRechargeMatcher.group(1)));
updateXericCharges(xericCharges);
}
else if (xericOutOfChargesMatcher.find())
{
final int xericCharges = 0;
updateXericCharges(xericCharges);
}
else if (soulbearerCheckMatcher.find())
{
final int soulbearerCharges = soulbearerCheckMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(soulbearerCheckMatcher.group(1)));
updateSoulBearerCharges(soulbearerCharges);
}
else if (chronicleCheckMatcher.find())
{
final int chronicleCharges = chronicleCheckMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(chronicleCheckMatcher.group(1)));
updateChronicleCharges(chronicleCharges);
}
else if (chronicleRechargeMatcher.find())
{
final int chronicleCharges = chronicleRechargeMatcher.group(2).equals("one") ? 1 : (Integer.parseInt(chronicleRechargeMatcher.group(2)));
updateChronicleCharges(chronicleCharges);
}
else if (chronicleLastChargeMatcher.find())
{
final int chronicleCharges = 1;
updateChronicleCharges(chronicleCharges);
}
else if (chronicleOutOfChargesMatcher.find())
{
final int chronicleCharges = 0;
updateChronicleCharges(chronicleCharges);
}
=======
else if (ringOfForgingCheckMatcher.find())
{
final String match = ringOfForgingCheckMatcher.group(1);
int charges = 1;
if (!match.equals("one"))
{
charges = Integer.parseInt(match);
}
updateRingOfForgingCharges(charges);
}
else if (message.equals(RING_OF_FORGING_USED_TEXT))
{
final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
// Determine if the player smelted with a Ring of Forging equipped.
if (equipment == null)
{
return;
}
Item[] items = equipment.getItems();
if (EquipmentInventorySlot.RING.getSlotIdx() < items.length
&& items[EquipmentInventorySlot.RING.getSlotIdx()].getId() == ItemID.RING_OF_FORGING)
{
int charges = Ints.constrainToRange(config.ringOfForging() - 1, 0, MAX_RING_OF_FORGING_CHARGES);
updateRingOfForgingCharges(charges);
}
}
else if (message.equals(RING_OF_FORGING_BREAK_TEXT))
{
if (config.ringOfForgingNotification())
{
notifier.notify("Your ring of forging has melted.");
}
updateRingOfForgingCharges(MAX_RING_OF_FORGING_CHARGES);
}
>>>>>>>
else if (xericRechargeMatcher.find())
{
final int xericCharges = xericRechargeMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(xericRechargeMatcher.group(1)));
updateXericCharges(xericCharges);
}
else if (xericOutOfChargesMatcher.find())
{
final int xericCharges = 0;
updateXericCharges(xericCharges);
}
else if (soulbearerCheckMatcher.find())
{
final int soulbearerCharges = soulbearerCheckMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(soulbearerCheckMatcher.group(1)));
updateSoulBearerCharges(soulbearerCharges);
}
else if (chronicleCheckMatcher.find())
{
final int chronicleCharges = chronicleCheckMatcher.group(1).equals("one") ? 1 : (Integer.parseInt(chronicleCheckMatcher.group(1)));
updateChronicleCharges(chronicleCharges);
}
else if (chronicleRechargeMatcher.find())
{
final int chronicleCharges = chronicleRechargeMatcher.group(2).equals("one") ? 1 : (Integer.parseInt(chronicleRechargeMatcher.group(2)));
updateChronicleCharges(chronicleCharges);
}
else if (chronicleLastChargeMatcher.find())
{
final int chronicleCharges = 1;
updateChronicleCharges(chronicleCharges);
}
else if (chronicleOutOfChargesMatcher.find())
{
final int chronicleCharges = 0;
updateChronicleCharges(chronicleCharges);
}
else if (ringOfForgingCheckMatcher.find())
{
final String match = ringOfForgingCheckMatcher.group(1);
int charges = 1;
if (!match.equals("one"))
{
charges = Integer.parseInt(match);
}
updateRingOfForgingCharges(charges);
}
else if (message.equals(RING_OF_FORGING_USED_TEXT))
{
final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
// Determine if the player smelted with a Ring of Forging equipped.
if (equipment == null)
{
return;
}
Item[] items = equipment.getItems();
if (EquipmentInventorySlot.RING.getSlotIdx() < items.length
&& items[EquipmentInventorySlot.RING.getSlotIdx()].getId() == ItemID.RING_OF_FORGING)
{
int charges = Ints.constrainToRange(this.ringOfForging - 1, 0, MAX_RING_OF_FORGING_CHARGES);
updateRingOfForgingCharges(charges);
}
}
else if (message.equals(RING_OF_FORGING_BREAK_TEXT))
{
if (config.ringOfForgingNotification())
{
notifier.notify("Your ring of forging has melted.");
}
updateRingOfForgingCharges(MAX_RING_OF_FORGING_CHARGES);
} |
<<<<<<<
import java.util.EnumSet;
=======
import net.runelite.api.Actor;
>>>>>>>
import java.util.EnumSet;
import net.runelite.api.Actor;
<<<<<<<
plugin.onGameTick(GameTick.INSTANCE);
=======
plugin.onGameTick(new GameTick());
>>>>>>>
plugin.onGameTick(GameTick.INSTANCE);
<<<<<<<
plugin.onGameTick(GameTick.INSTANCE);
=======
plugin.onGameTick(new GameTick());
>>>>>>>
plugin.onGameTick(GameTick.INSTANCE);
<<<<<<<
when(player.getInteracting()).thenReturn(monster);
plugin.onGameTick(GameTick.INSTANCE);
=======
when(player.getInteracting()).thenReturn(mock(Actor.class));
plugin.onGameTick(new GameTick());
>>>>>>>
when(player.getInteracting()).thenReturn(mock(Actor.class));
plugin.onGameTick(GameTick.INSTANCE);
<<<<<<<
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(400); // 40%
plugin.onGameTick(GameTick.INSTANCE); // once to set lastSpecEnergy to 400
=======
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(400); // 40%
plugin.onGameTick(new GameTick()); // once to set lastSpecEnergy to 400
>>>>>>>
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(400); // 40%
plugin.onGameTick(GameTick.INSTANCE); // once to set lastSpecEnergy to 400
<<<<<<<
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(500); // 50%
plugin.onGameTick(GameTick.INSTANCE);
verify(notifier).notify(eq("[" + PLAYER_NAME + "] has restored spec energy!"));
=======
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(500); // 50%
plugin.onGameTick(new GameTick());
verify(notifier).notify(eq("[" + PLAYER_NAME + "] has restored spec energy!"));
>>>>>>>
when(client.getVar(eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(500); // 50%
plugin.onGameTick(GameTick.INSTANCE);
verify(notifier).notify(eq("[" + PLAYER_NAME + "] has restored spec energy!")); |
<<<<<<<
import net.runelite.client.ui.overlay.tooltip.Tooltip;
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
import net.runelite.client.util.ImageUtil;
=======
import net.runelite.client.util.HotkeyListener;
>>>>>>>
import net.runelite.client.ui.overlay.tooltip.Tooltip;
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.HotkeyListener;
<<<<<<<
@Inject
private ClientToolbar clientToolbar;
private RaidsPanel panel;
private int upperTime = -1;
private int middleTime = -1;
private int lowerTime = -1;
private int raidTime = -1;
private WidgetOverlay widgetOverlay;
private String tooltip;
public boolean canShow;
private NavigationButton navButton;
=======
private boolean raidStarted;
>>>>>>>
@Inject
private ClientToolbar clientToolbar;
private RaidsPanel panel;
private int upperTime = -1;
private int middleTime = -1;
private int lowerTime = -1;
private int raidTime = -1;
private WidgetOverlay widgetOverlay;
private String tooltip;
public boolean canShow;
private NavigationButton navButton;
private boolean raidStarted;
<<<<<<<
if (config.partyDisplay())
{
overlayManager.add(partyOverlay);
}
=======
keyManager.registerKeyListener(hotkeyListener);
>>>>>>>
if (config.partyDisplay())
{
overlayManager.add(partyOverlay);
}
keyManager.registerKeyListener(hotkeyListener);
<<<<<<<
widgetOverlay = null;
=======
raidStarted = false;
>>>>>>>
widgetOverlay = null;
raidStarted = false;
<<<<<<<
if (config.raidsTimer())
{
timer = new RaidsTimer(spriteManager.getSprite(TAB_QUESTS_BROWN_RAIDING_PARTY, 0), this, Instant.now());
infoBoxManager.addInfoBox(timer);
}
if (config.partyDisplay())
{
// Base this on visible players since party size shows people outside the lobby
// and they did not get to come on the raid
List<Player> players = client.getPlayers();
startPlayerCount = players.size();
partyMembers.clear();
startingPartyMembers.clear();
missingPartyMembers.clear();
startingPartyMembers.addAll(Lists.transform(players, Player::getName));
partyMembers.addAll(startingPartyMembers);
}
=======
timer = new RaidsTimer(spriteManager.getSprite(TAB_QUESTS_BROWN_RAIDING_PARTY, 0), this, Instant.now());
infoBoxManager.addInfoBox(timer);
raidStarted = true;
>>>>>>>
if (config.raidsTimer())
{
timer = new RaidsTimer(spriteManager.getSprite(TAB_QUESTS_BROWN_RAIDING_PARTY, 0), this, Instant.now());
infoBoxManager.addInfoBox(timer);
raidStarted = true;
}
if (config.partyDisplay())
{
// Base this on visible players since party size shows people outside the lobby
// and they did not get to come on the raid
List<Player> players = client.getPlayers();
startPlayerCount = players.size();
partyMembers.clear();
startingPartyMembers.clear();
missingPartyMembers.clear();
startingPartyMembers.addAll(Lists.transform(players, Player::getName));
partyMembers.addAll(startingPartyMembers);
}
<<<<<<<
public void reset()
{
raid = null;
upperTime = -1;
middleTime = -1;
lowerTime = -1;
raidTime = -1;
tooltip = null;
}
private int timeToSeconds(String s)
{
int seconds = -1;
String[] split = s.split(":");
if (split.length == 2)
{
seconds = Integer.parseInt(split[0]) * 60 + Integer.parseInt(split[1]);
}
if (split.length == 3)
{
seconds = Integer.parseInt(split[0]) * 3600 + Integer.parseInt(split[1]) * 60 + Integer.parseInt(split[2]);
}
return seconds;
}
private String secondsToTime(int seconds)
{
StringBuilder builder = new StringBuilder();
if (seconds >= 3600)
{
builder.append((int) Math.floor(seconds / 3600) + ";");
}
seconds %= 3600;
if (builder.toString().equals(""))
{
builder.append((int) Math.floor(seconds / 60));
}
else
{
builder.append(StringUtils.leftPad(String.valueOf((int) Math.floor(seconds / 60)), 2, '0'));
}
builder.append(":");
seconds %= 60;
builder.append(StringUtils.leftPad(String.valueOf(seconds), 2, '0'));
return builder.toString();
}
private void updateTooltip()
{
StringBuilder builder = new StringBuilder();
if (upperTime == -1)
{
tooltip = null;
return;
}
builder.append("Upper level: ").append(secondsToTime(upperTime));
if (middleTime == -1)
{
if (lowerTime == -1)
{
tooltip = builder.toString();
return;
}
else
{
builder.append("</br>Lower level: ").append(secondsToTime(lowerTime - upperTime));
}
}
else
{
builder.append("</br>Middle level: ").append(secondsToTime(middleTime - upperTime));
if (lowerTime == -1)
{
tooltip = builder.toString();
return;
}
else
{
builder.append("</br>Lower level: ").append(secondsToTime(lowerTime - middleTime));
}
}
if (raidTime == -1)
{
tooltip = builder.toString();
return;
}
builder.append("</br>Olm: ").append(secondsToTime(raidTime - lowerTime));
tooltip = builder.toString();
}
=======
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.hotkey())
{
@Override
public void hotkeyPressed()
{
if (config.scoutOverlayInRaid() && raidStarted)
{
if (overlay.isScoutOverlayShown())
{
overlay.setScoutOverlayShown(false);
}
else
{
overlay.setScoutOverlayShown(true);
}
}
}
};
>>>>>>>
public void reset()
{
raid = null;
upperTime = -1;
middleTime = -1;
lowerTime = -1;
raidTime = -1;
tooltip = null;
}
private int timeToSeconds(String s)
{
int seconds = -1;
String[] split = s.split(":");
if (split.length == 2)
{
seconds = Integer.parseInt(split[0]) * 60 + Integer.parseInt(split[1]);
}
if (split.length == 3)
{
seconds = Integer.parseInt(split[0]) * 3600 + Integer.parseInt(split[1]) * 60 + Integer.parseInt(split[2]);
}
return seconds;
}
private String secondsToTime(int seconds)
{
StringBuilder builder = new StringBuilder();
if (seconds >= 3600)
{
builder.append((int) Math.floor(seconds / 3600) + ";");
}
seconds %= 3600;
if (builder.toString().equals(""))
{
builder.append((int) Math.floor(seconds / 60));
}
else
{
builder.append(StringUtils.leftPad(String.valueOf((int) Math.floor(seconds / 60)), 2, '0'));
}
builder.append(":");
seconds %= 60;
builder.append(StringUtils.leftPad(String.valueOf(seconds), 2, '0'));
return builder.toString();
}
private void updateTooltip()
{
StringBuilder builder = new StringBuilder();
if (upperTime == -1)
{
tooltip = null;
return;
}
builder.append("Upper level: ").append(secondsToTime(upperTime));
if (middleTime == -1)
{
if (lowerTime == -1)
{
tooltip = builder.toString();
return;
}
else
{
builder.append("</br>Lower level: ").append(secondsToTime(lowerTime - upperTime));
}
}
else
{
builder.append("</br>Middle level: ").append(secondsToTime(middleTime - upperTime));
if (lowerTime == -1)
{
tooltip = builder.toString();
return;
}
else
{
builder.append("</br>Lower level: ").append(secondsToTime(lowerTime - middleTime));
}
}
if (raidTime == -1)
{
tooltip = builder.toString();
return;
}
builder.append("</br>Olm: ").append(secondsToTime(raidTime - lowerTime));
tooltip = builder.toString();
}
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.hotkey())
{
@Override
public void hotkeyPressed()
{
if (config.scoutOverlayInRaid() && raidStarted)
{
if (overlay.isScoutOverlayShown())
{
overlay.setScoutOverlayShown(false);
}
else
{
overlay.setScoutOverlayShown(true);
}
}
}
}; |
<<<<<<<
=======
// Hespori loot handling
private static final String HESPORI_LOOTED_MESSAGE = "You have successfully cleared this patch for new crops.";
private static final String HESPORI_EVENT = "Hespori";
private static final int HESPORI_REGION = 5021;
// Gauntlet loot handling
private static final String GAUNTLET_LOOTED_MESSAGE = "You open the chest.";
private static final String GAUNTLET_EVENT = "The Gauntlet";
private static final int GAUNTLET_LOBBY_REGION = 12127;
>>>>>>>
// Hespori loot handling
private static final String HESPORI_LOOTED_MESSAGE = "You have successfully cleared this patch for new crops.";
private static final String HESPORI_EVENT = "Hespori";
private static final int HESPORI_REGION = 5021;
// Gauntlet loot handling
private static final String GAUNTLET_LOOTED_MESSAGE = "You open the chest.";
private static final String GAUNTLET_EVENT = "The Gauntlet";
private static final int GAUNTLET_LOBBY_REGION = 12127;
<<<<<<<
public static final Instant SESSION_START_TIME = Instant.now();
@Inject
public Client client;
@VisibleForTesting
private Collection<LootRecord> lootRecords = new ArrayList<>();
private boolean pvpDeath = false;
=======
// Last man standing map regions
private static final Set<Integer> LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916);
>>>>>>>
public static final Instant SESSION_START_TIME = Instant.now();
@Inject
public Client client;
@VisibleForTesting
private Collection<LootRecord> lootRecords = new ArrayList<>();
private boolean pvpDeath = false;
// Last man standing map regions
private static final Set<Integer> LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916);
<<<<<<<
if (event.getPlayer().equals(client.getLocalPlayer()))
{
SwingUtilities.invokeLater(() -> panel.rebuild());
}
}
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
{
if (this.sendLootValueMessages)
{
if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) ||
WorldType.isPvpWorld(client.getWorldType()) || client.getVar(Varbits.IN_WILDERNESS) == 1)
{
final String totalValue = StackFormatter.quantityToRSStackSize(playerLootReceived.getItems().stream()
.mapToInt(itemStack -> itemManager.getItemPrice(itemStack.getId()) * itemStack.getQuantity()).sum());
chatMessageManager.queue(QueuedMessage.builder().type(ChatMessageType.CONSOLE).runeLiteFormattedMessage(
new ChatMessageBuilder().append("The total value of your loot is " + totalValue + " GP.")
.build()).build());
}
}
=======
// Ignore Last Man Standing player loots
if (isAtLMS())
{
return;
}
>>>>>>>
if (event.getPlayer().equals(client.getLocalPlayer()))
{
SwingUtilities.invokeLater(() -> panel.rebuild());
}
}
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
{
// Ignore Last Man Standing player loots
if (isAtLMS())
{
return;
}
if (this.sendLootValueMessages)
{
if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) ||
WorldType.isPvpWorld(client.getWorldType()) || client.getVar(Varbits.IN_WILDERNESS) == 1)
{
final String totalValue = StackFormatter.quantityToRSStackSize(playerLootReceived.getItems().stream()
.mapToInt(itemStack -> itemManager.getItemPrice(itemStack.getId()) * itemStack.getQuantity()).sum());
chatMessageManager.queue(QueuedMessage.builder().type(ChatMessageType.CONSOLE).runeLiteFormattedMessage(
new ChatMessageBuilder().append("The total value of your loot is " + totalValue + " GP.")
.build()).build());
}
}
<<<<<<<
// Remove all tags
final String chatMessage = Text.removeTags(message);
=======
final int regionID = client.getLocalPlayer().getWorldLocation().getRegionID();
if (HESPORI_REGION == regionID && message.equals(HESPORI_LOOTED_MESSAGE))
{
eventType = HESPORI_EVENT;
takeInventorySnapshot();
return;
}
if (GAUNTLET_LOBBY_REGION == regionID && message.equals(GAUNTLET_LOOTED_MESSAGE))
{
eventType = GAUNTLET_EVENT;
takeInventorySnapshot();
return;
}
>>>>>>>
// Remove all tags
final String chatMessage = Text.removeTags(message);
final int regionID = client.getLocalPlayer().getWorldLocation().getRegionID();
if (HESPORI_REGION == regionID && message.equals(HESPORI_LOOTED_MESSAGE))
{
eventType = HESPORI_EVENT;
takeInventorySnapshot();
return;
}
if (GAUNTLET_LOBBY_REGION == regionID && message.equals(GAUNTLET_LOOTED_MESSAGE))
{
eventType = GAUNTLET_EVENT;
takeInventorySnapshot();
return;
}
<<<<<<<
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
{
Multiset snapshot;
snapshot = inventorySnapshot;
deathInventorySnapshot();
if (inventorySnapshot != snapshot)
{
inventorySnapshot = snapshot;
ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
if (inventorySnapshot != null)
{
Multiset<Integer> currentInventory = HashMultiset.create();
if (inventory != null)
{
Arrays.stream(Objects.requireNonNull(client.getItemContainer(InventoryID.INVENTORY)).getItems())
.forEach(item -> currentInventory.add(item.getId(), item.getQuantity()));
}
final Multiset<Integer> diff = Multisets.difference(inventorySnapshot, currentInventory);
List<ItemStack> itemsLost = diff.entrySet().stream()
.map(e -> new ItemStack(e.getElement(), (-1 * e.getCount()), client.getLocalPlayer().getLocalLocation()))
.collect(Collectors.toList());
final LootTrackerItem[] entries = buildEntries(stack(itemsLost));
String name = "Death: " + client.getLocalPlayer().getName();
SwingUtilities.invokeLater(() -> panel.add(name, client.getLocalPlayer().getName(),
client.getLocalPlayer().getCombatLevel(), entries));
LootRecord lootRecord = new LootRecord(name, client.getLocalPlayer().getName(), LootRecordType.DEATH,
toGameItems(itemsLost), Instant.now());
if (lootTrackerClient != null && this.saveLoot)
{
lootTrackerClient.submit(lootRecord);
}
if (this.localPersistence)
{
saveLocalLootRecord(lootRecord);
}
pvpDeath = false;
inventorySnapshot = null;
}
}
}
if (eventType != null && (CHEST_EVENT_TYPES.containsValue(eventType) || HERBIBOR_EVENT.equals(eventType)))
=======
if (CHEST_EVENT_TYPES.containsValue(eventType)
|| HERBIBOAR_EVENT.equals(eventType)
|| HESPORI_EVENT.equals(eventType)
|| GAUNTLET_EVENT.equals(eventType))
>>>>>>>
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
{
Multiset snapshot;
snapshot = inventorySnapshot;
deathInventorySnapshot();
if (inventorySnapshot != snapshot)
{
inventorySnapshot = snapshot;
ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
if (inventorySnapshot != null)
{
Multiset<Integer> currentInventory = HashMultiset.create();
if (inventory != null)
{
Arrays.stream(Objects.requireNonNull(client.getItemContainer(InventoryID.INVENTORY)).getItems())
.forEach(item -> currentInventory.add(item.getId(), item.getQuantity()));
}
final Multiset<Integer> diff = Multisets.difference(inventorySnapshot, currentInventory);
List<ItemStack> itemsLost = diff.entrySet().stream()
.map(e -> new ItemStack(e.getElement(), (-1 * e.getCount()), client.getLocalPlayer().getLocalLocation()))
.collect(Collectors.toList());
final LootTrackerItem[] entries = buildEntries(stack(itemsLost));
String name = "Death: " + client.getLocalPlayer().getName();
SwingUtilities.invokeLater(() -> panel.add(name, client.getLocalPlayer().getName(),
client.getLocalPlayer().getCombatLevel(), entries));
LootRecord lootRecord = new LootRecord(name, client.getLocalPlayer().getName(), LootRecordType.DEATH,
toGameItems(itemsLost), Instant.now());
if (lootTrackerClient != null && this.saveLoot)
{
lootTrackerClient.submit(lootRecord);
}
if (this.localPersistence)
{
saveLocalLootRecord(lootRecord);
}
pvpDeath = false;
inventorySnapshot = null;
}
}
}
if (CHEST_EVENT_TYPES.containsValue(eventType)
|| HERBIBOAR_EVENT.equals(eventType)
|| HESPORI_EVENT.equals(eventType)
|| GAUNTLET_EVENT.equals(eventType))
<<<<<<<
private Collection<LTItemEntry> convertToLTItemEntries(Collection<ItemStack> stacks)
{
return stacks.stream().map(i ->
{
final ItemDefinition c = itemManager.getItemDefinition(i.getId());
final int id = c.getNote() == -1 ? c.getId() : c.getLinkedNoteId();
final int price = itemManager.getItemPrice(id);
return new LTItemEntry(c.getName(), i.getId(), i.getQuantity(), price);
}).collect(Collectors.toList());
}
private void updateConfig()
{
this.getIgnoredItems = config.getIgnoredItems();
this.saveLoot = config.saveLoot();
this.chestLootChat = config.chestLootChat();
this.syncPanel = config.syncPanel();
this.localPersistence = config.localPersistence();
this.sortType = config.sortType();
this.whitelistEnabled = config.whitelistEnabled();
this.getWhitelist = config.getWhitelist();
this.blacklistEnabled = config.blacklistEnabled();
this.getBlacklist = config.getBlacklist();
this.sendLootValueMessages = config.sendLootValueMessages();
}
=======
/**
* Is player at the Last Man Standing minigame
*/
private boolean isAtLMS()
{
final int[] mapRegions = client.getMapRegions();
for (int region : LAST_MAN_STANDING_REGIONS)
{
if (ArrayUtils.contains(mapRegions, region))
{
return true;
}
}
return false;
}
>>>>>>>
private Collection<LTItemEntry> convertToLTItemEntries(Collection<ItemStack> stacks)
{
return stacks.stream().map(i ->
{
final ItemDefinition c = itemManager.getItemDefinition(i.getId());
final int id = c.getNote() == -1 ? c.getId() : c.getLinkedNoteId();
final int price = itemManager.getItemPrice(id);
return new LTItemEntry(c.getName(), i.getId(), i.getQuantity(), price);
}).collect(Collectors.toList());
}
/**
* Is player at the Last Man Standing minigame
*/
private boolean isAtLMS()
{
final int[] mapRegions = client.getMapRegions();
for (int region : LAST_MAN_STANDING_REGIONS)
{
if (ArrayUtils.contains(mapRegions, region))
{
return true;
}
}
return false;
}
private void updateConfig()
{
this.getIgnoredItems = config.getIgnoredItems();
this.saveLoot = config.saveLoot();
this.chestLootChat = config.chestLootChat();
this.syncPanel = config.syncPanel();
this.localPersistence = config.localPersistence();
this.sortType = config.sortType();
this.whitelistEnabled = config.whitelistEnabled();
this.getWhitelist = config.getWhitelist();
this.blacklistEnabled = config.blacklistEnabled();
this.getBlacklist = config.getBlacklist();
this.sendLootValueMessages = config.sendLootValueMessages();
} |
<<<<<<<
SCORPIONS("Scorpions", ItemID.ENSOULED_SCORPION_HEAD,
asList("Scorpia"), Collections.emptyList()),
=======
CHAOS_DRUIDS("Chaos druids", ItemID.ELDER_CHAOS_HOOD, "Elder Chaos druid", "Chaos druid"),
BANDITS("Bandits", ItemID.BANDIT, "Bandit"),
MAGIC_AXES("Magic axes", ItemID.IRON_BATTLEAXE, "Magic axe"),
SARACHNIS("Sarachnis", ItemID.SRARACHA),
SCORPIONS("Scorpions", ItemID.ENSOULED_SCORPION_HEAD),
>>>>>>>
SCORPIONS("Scorpions", ItemID.ENSOULED_SCORPION_HEAD,
asList("Scorpia"), Collections.emptyList()),
SARACHNIS("Sarachnis", ItemID.SRARACHA), |
<<<<<<<
import javax.inject.Singleton;
=======
import lombok.AllArgsConstructor;
import lombok.Getter;
>>>>>>>
import javax.inject.Singleton;
import lombok.AllArgsConstructor;
import lombok.Getter;
<<<<<<<
final ItemDefinition c = itemManager.getItemDefinition(i.getId());
=======
>>>>>>>
final ItemDefinition c = itemManager.getItemDefinition(i.getId());
<<<<<<<
final ItemDefinition c1 = itemManager.getItemDefinition(canonicalizedItemId);
exchangePrice = c1.getPrice();
=======
final int basePrice = itemManager.getItemPrice(dynamicPrice.getChargedId(), true);
return dynamicPrice.calculateDeathPrice(basePrice);
}
// Some items have artificially offset death prices - such as ring imbues
// which are +2k over the non imbues. Check if the item has a fixed price offset
final FixedPriceItem fixedPrice = FixedPriceItem.find(canonicalizedItemId);
if (fixedPrice != null && fixedPrice.getBaseId() != -1)
{
// Grab base item price
exchangePrice = itemManager.getItemPrice(fixedPrice.getBaseId(), true);
>>>>>>>
final ItemDefinition c1 = itemManager.getItemDefinition(canonicalizedItemId);
exchangePrice = c1.getPrice();
final int basePrice = itemManager.getItemPrice(dynamicPrice.getChargedId(), true);
return dynamicPrice.calculateDeathPrice(basePrice);
}
// Some items have artificially offset death prices - such as ring imbues
// which are +2k over the non imbues. Check if the item has a fixed price offset
final FixedPriceItem fixedPrice = FixedPriceItem.find(canonicalizedItemId);
if (fixedPrice != null && fixedPrice.getBaseId() != -1)
{
// Grab base item price
exchangePrice = itemManager.getItemPrice(fixedPrice.getBaseId(), true);
<<<<<<<
private static Widget createItemWidget(final Widget parent, final int qty, final ItemDefinition c)
=======
private Widget createItemWidget(final Widget parent, final ItemStack item, boolean kept)
>>>>>>>
private Widget createItemWidget(final Widget parent, final ItemStack item, boolean kept) |
<<<<<<<
htpasswdFile = ".htpasswd";
enabledPlainText = false;
=======
htpasswdFile = "htpasswd";
String os = System.getProperty("os.name").toLowerCase();
enabledPlainTextPwd = os.startsWith("windows") || os.startsWith("netware");
usersAuthorizedForEverything = false;
}
public HtpasswdAuthOptions(JsonObject json) {
this();
HtpasswdAuthOptionsConverter.fromJson(json, this);
>>>>>>>
htpasswdFile = ".htpasswd";
enabledPlainText = false;
}
public HtpasswdAuthOptions(JsonObject json) {
this();
HtpasswdAuthOptionsConverter.fromJson(json, this);
<<<<<<<
=======
public boolean areUsersAuthorizedForEverything() {
return usersAuthorizedForEverything;
}
public HtpasswdAuthOptions setUsersAuthorizedForEverything(boolean usersAuthorizedForEverything) {
this.usersAuthorizedForEverything = usersAuthorizedForEverything;
return this;
}
public JsonObject toJson() {
final JsonObject json = new JsonObject();
HtpasswdAuthOptionsConverter.toJson(this, json);
return json;
}
>>>>>>>
public JsonObject toJson() {
final JsonObject json = new JsonObject();
HtpasswdAuthOptionsConverter.toJson(this, json);
return json;
} |
<<<<<<<
import lombok.AllArgsConstructor;
import lombok.Builder;
=======
import com.google.gson.annotations.SerializedName;
>>>>>>>
import lombok.AllArgsConstructor;
import lombok.Builder;
import com.google.gson.annotations.SerializedName; |
<<<<<<<
=======
import org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudFoundryRunTargetType;
import org.springframework.ide.eclipse.boot.dash.cloudfoundry.client.v2.DefaultCloudFoundryClientFactoryV2;
>>>>>>>
<<<<<<<
=======
import org.springframework.ide.eclipse.boot.dash.model.runtargettypes.RunTargetTypes;
>>>>>>>
<<<<<<<
// Initialize config for manifest YAML LS
=======
>>>>>>>
<<<<<<<
model = new BootDashViewModel(context);
=======
model = new BootDashViewModel(context,
RunTargetTypes.LOCAL,
new CloudFoundryRunTargetType(context, DefaultCloudFoundryClientFactoryV2.INSTANCE)
// RunTargetTypes.LATTICE
);
>>>>>>>
model = new BootDashViewModel(context);
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import java.util.Map.Entry;
import java.util.Set;
=======
>>>>>>>
import java.util.Map.Entry; |
<<<<<<<
Set<IProject> projectsToDeploy,
RunState runOrDebug) {
=======
Map<IProject, BootDashElement> projectsToDeploy,
RunState runOrDebug,
DebugSupport debugSupport) {
>>>>>>>
Set<IProject> projectsToDeploy,
RunState runOrDebug,
DebugSupport debugSupport) {
<<<<<<<
}
=======
this.debugSupport = debugSupport;
}
>>>>>>>
this.debugSupport = debugSupport;
} |
<<<<<<<
=======
//Test for 'utilities' which may eventually be moved if we reuse them elsewhere
// (the test should also move then!)
OrderBasedComparatorTest.class,
DeploymentProperties2Yaml.class,
Yaml2DeploymentProperties.class,
ManifestCompareMergeTests.class
>>>>>>> |
<<<<<<<
import org.apache.pulsar.client.api.Schema;
=======
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.Reader;
>>>>>>>
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.Reader;
<<<<<<<
private final PulsarSpaceCache pcache;
private final Schema pulsarSchema;
=======
>>>>>>>
<<<<<<<
private LongFunction<PulsarOp> resolve() {
=======
@Override
public PulsarOp apply(long value) {
return opFunc.apply(value);
}
private boolean isBoolean(String str) {
return StringUtils.equalsAnyIgnoreCase(str, "yes", "true");
}
private LongFunction<PulsarOp> resolve() {
>>>>>>>
@Override
public PulsarOp apply(long value) {
return opFunc.apply(value);
}
private boolean isBoolean(String str) {
return StringUtils.equalsAnyIgnoreCase(str, "yes", "true");
}
private LongFunction<PulsarOp> resolve() {
<<<<<<<
(l) -> pulsarSpace.getProducer(cycle_producer_name_func.apply(l), topic_uri_func.apply(l));
=======
(l) -> clientSpace.getProducer(topic_uri_func.apply(l), cycle_producer_name_func.apply(l));
>>>>>>>
(l) -> clientSpace.getProducer(topic_uri_func.apply(l), cycle_producer_name_func.apply(l)); |
<<<<<<<
private final HashMap<String, Object> driverConfMap = new HashMap<>();
private final HashMap<String, Object> schemaConfMap = new HashMap<>();
private final HashMap<String, Object> clientConfMap = new HashMap<>();
private final HashMap<String, Object> producerConfMap = new HashMap<>();
private final HashMap<String, Object> consumerConfMap = new HashMap<>();
private final HashMap<String, Object> readerConfMap = new HashMap<>();
=======
private HashMap<String, Object> schemaConfMap = new HashMap<>();
private HashMap<String, Object> clientConfMap = new HashMap<>();
private HashMap<String, Object> producerConfMap = new HashMap<>();
private HashMap<String, Object> consumerConfMap = new HashMap<>();
private HashMap<String, Object> readerConfMap = new HashMap<>();
>>>>>>>
private final HashMap<String, Object> schemaConfMap = new HashMap<>();
private final HashMap<String, Object> clientConfMap = new HashMap<>();
private final HashMap<String, Object> producerConfMap = new HashMap<>();
private final HashMap<String, Object> consumerConfMap = new HashMap<>();
private final HashMap<String, Object> readerConfMap = new HashMap<>();
<<<<<<<
// Get driver specific configuration settings
for (Iterator<String> it = config.getKeys(DRIVER_CONF_PREFIX); it.hasNext(); ) {
String confKey = it.next();
String confVal = config.getProperty(confKey).toString();
if (!StringUtils.isBlank(confVal))
driverConfMap.put(confKey.substring(DRIVER_CONF_PREFIX.length() + 1), config.getProperty(confKey));
}
=======
>>>>>>>
<<<<<<<
// Get NB Driver related config
public Map<String, Object> getDriverConfMap() {
return this.driverConfMap;
}
public boolean hasDriverConfKey(String key) {
if (key.contains(DRIVER_CONF_PREFIX))
return driverConfMap.containsKey(key.substring(DRIVER_CONF_PREFIX.length() + 1));
else
return driverConfMap.containsKey(key);
}
public Object getDriverConfValue(String key) {
if (key.contains(DRIVER_CONF_PREFIX))
return driverConfMap.get(key.substring(DRIVER_CONF_PREFIX.length() + 1));
else
return driverConfMap.get(key);
}
public void setDriverConfValue(String key, Object value) {
if (key.contains(DRIVER_CONF_PREFIX))
driverConfMap.put(key.substring(DRIVER_CONF_PREFIX.length() + 1), value);
else
driverConfMap.put(key, value);
}
// other driver helper functions ...
public String getPulsarClientType() {
Object confValue = getDriverConfValue("driver.client-type");
// If not explicitly specifying Pulsar client type, "producer" is the default type
if (confValue == null)
return PulsarActivityUtil.CLIENT_TYPES.PRODUCER.toString();
else
return confValue.toString();
}
//////////////////
=======
>>>>>>> |
<<<<<<<
public PulsarSpace(String name, PulsarNBClientConf pulsarClientConf) {
this.name = name;
=======
public PulsarSpace( String name, PulsarNBClientConf pulsarClientConf, String pulsarSvcUrl ) {
this.spaceName = name;
>>>>>>>
public PulsarSpace(String name, PulsarNBClientConf pulsarClientConf, String pulsarSvcUrl) {
this.spaceName = name;
<<<<<<<
String dftSvcUrl = "pulsar://localhost:6650";
if (!pulsarNBClientConf.hasClientConfKey(PulsarActivityUtil.CLNT_CONF_KEY.serviceUrl.toString())) {
pulsarNBClientConf.setClientConfValue(PulsarActivityUtil.CLNT_CONF_KEY.serviceUrl.toString(), dftSvcUrl);
}
=======
>>>>>>>
<<<<<<<
pulsarClient = clientBuilder.loadConf(clientConf).build();
} catch (PulsarClientException pce) {
=======
// Override "client.serviceUrl" setting in config.properties
clientConf.remove("serviceUrl", pulsarSvcUrl);
pulsarClient = clientBuilder
.loadConf(clientConf)
.serviceUrl(pulsarSvcUrl)
.build();
}
catch (PulsarClientException pce) {
>>>>>>>
// Override "client.serviceUrl" setting in config.properties
clientConf.remove("serviceUrl", pulsarSvcUrl);
pulsarClient = clientBuilder
.loadConf(clientConf)
.serviceUrl(pulsarSvcUrl)
.build();
} catch (PulsarClientException pce) { |
<<<<<<<
import com.manydesigns.elements.fields.PasswordField;
import com.manydesigns.elements.forms.FieldSet;
=======
>>>>>>>
<<<<<<<
import com.manydesigns.portofino.systemModel.users.Group;
import com.manydesigns.portofino.systemModel.users.Password;
=======
>>>>>>>
<<<<<<<
import java.util.List;
import java.util.ArrayList;
import java.util.logging.Logger;
=======
import java.util.logging.Logger;
>>>>>>>
import java.util.logging.Logger;
<<<<<<<
private boolean setUser() {
user = context.getCurrentUser();
groups.clear();
for (UsersGroups group : user.getGroups())
{
groups.add(group.getGroup());
}
//se l'utente è null lo mando ad Unauthorized
if (user==null) {
return true;
}
return false;
}
=======
>>>>>>> |
<<<<<<<
import com.manydesigns.elements.reflection.JavaClassAccessor;
import com.manydesigns.elements.reflection.PropertyAccessor;
import com.manydesigns.elements.util.ReflectionUtil;
=======
>>>>>>>
import com.manydesigns.elements.reflection.JavaClassAccessor;
import com.manydesigns.elements.reflection.PropertyAccessor;
import com.manydesigns.elements.util.ReflectionUtil;
<<<<<<<
import org.hibernate.*;
=======
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Query;
>>>>>>>
import org.hibernate.*;
<<<<<<<
Object... pk) {
throw new UnsupportedOperationException();
}
public Object getObjectByPk(String qualifiedTableName,
Object pk) {
=======
Object pk) {
>>>>>>>
Object... pk) {
throw new UnsupportedOperationException();
}
public Object getObjectByPk(String qualifiedTableName,
Object pk) {
<<<<<<<
public Object createNewObject(String qualifiedTableName) {
Table table = model.findTableByQualifiedName(qualifiedTableName);
String className = table.getClassName();
if (className == null) {
HashMap<String, Object> obj = new HashMap<String, Object>();
obj.put("$type$", qualifiedTableName);
return obj;
} else {
return ReflectionUtil.newInstance(className);
}
}
=======
>>>>>>>
public Object createNewObject(String qualifiedTableName) {
Table table = model.findTableByQualifiedName(qualifiedTableName);
String className = table.getClassName();
if (className == null) {
HashMap<String, Object> obj = new HashMap<String, Object>();
obj.put("$type$", qualifiedTableName);
return obj;
} else {
return ReflectionUtil.newInstance(className);
}
} |
<<<<<<<
=======
// Return to search
//**************************************************************************
public String returnToSearch() {
setupMetadata();
return RETURN_TO_SEARCH;
}
//**************************************************************************
>>>>>>>
<<<<<<<
=======
//**************************************************************************
// Utility methods
//**************************************************************************
public void setupMetadata() {
tableAccessor = context.getTableAccessor(userTable);
pkHelper = new PkHelper(tableAccessor);
if (tableAccessor == null) {
throw new ModelObjectNotFoundError(userTable);
}
}
protected FormBuilder createFormBuilderWithSelectionProviders() {
FormBuilder formBuilder = new FormBuilder(tableAccessor);
// setup relationship lookups
Table table = model.findTableByQualifiedName(userTable);
for (ForeignKey rel : table.getForeignKeys()) {
String[] fieldNames = createFieldNamesForRelationship(rel);
SelectionProvider selectionProvider =
createSelectionProviderForRelationship(rel);
boolean autocomplete = false;
for (ModelAnnotation current : rel.getModelAnnotations()) {
if ("com.manydesigns.elements.annotations.Autocomplete"
.equals(current.getType())) {
autocomplete = true;
}
}
selectionProvider.setAutocomplete(autocomplete);
formBuilder.configSelectionProvider(selectionProvider, fieldNames);
}
return formBuilder;
}
protected TableFormBuilder createTableFormBuilderWithSelectionProviders() {
TableFormBuilder tableFormBuilder = new TableFormBuilder(tableAccessor);
// setup relationship lookups
Table table = model.findTableByQualifiedName(userTable);
for (ForeignKey rel : table.getForeignKeys()) {
String[] fieldNames = createFieldNamesForRelationship(rel);
SelectionProvider selectionProvider =
createSelectionProviderForRelationship(rel);
boolean autocomplete = false;
for (ModelAnnotation current : rel.getModelAnnotations()) {
if ("com.manydesigns.elements.annotations.Autocomplete"
.equals(current.getType())) {
autocomplete = true;
}
}
selectionProvider.setAutocomplete(autocomplete);
tableFormBuilder.configSelectionProvider(selectionProvider, fieldNames);
}
return tableFormBuilder;
}
protected String[] createFieldNamesForRelationship(ForeignKey rel) {
List<Reference> references = rel.getReferences();
String[] fieldNames = new String[references.size()];
int i = 0;
for (Reference reference : references) {
Column column = reference.getActualFromColumn();
fieldNames[i] = column.getActualPropertyName();
i++;
}
return fieldNames;
}
protected SelectionProvider createSelectionProviderForRelationship(ForeignKey rel) {
// retrieve the related objects
Table relatedTable = rel.getActualToTable();
ClassAccessor classAccessor =
context.getTableAccessor(relatedTable.getQualifiedName());
List<Object> relatedObjects =
context.getAllObjects(relatedTable.getQualifiedName());
ShortName shortNameAnnotation =
classAccessor.getAnnotation(ShortName.class);
TextFormat[] textFormat = null;
if (shortNameAnnotation != null) {
textFormat = new TextFormat[] {
OgnlTextFormat.create(shortNameAnnotation.value())
};
}
return
DefaultSelectionProvider.create(rel.getForeignKeyName(),
relatedObjects, classAccessor, textFormat);
}
>>>>>>> |
<<<<<<<
=======
//**************************************************************************
// Constants
//**************************************************************************
public final static String REDIRECT_TO_TABLE = "redirectToTable";
public final static String NO_TABLES = "noTables";
public final static String JSON_SELECT_FIELD_OPTIONS =
"jsonSelectFieldOptions";
public static final String EXPORT_FILENAME_FORMAT = "export-{0}";
public static final String ACTIONURL = "Groups.action";
//**************************************************************************
// ServletRequestAware implementation
//**************************************************************************
public HttpServletRequest req;
public void setServletRequest(HttpServletRequest req) {
this.req = req;
}
//**************************************************************************
// Web parameters
//**************************************************************************
public String qualifiedTableName;
public String pk;
public String[] selection;
public String searchString;
public String cancelReturnUrl;
public String relName;
public int optionProviderIndex;
public String labelSearch;
//**************************************************************************
// Web parameters setters (for struts.xml inspections in IntelliJ)
//**************************************************************************
public void setQualifiedTableName(String qualifiedTableName) {
this.qualifiedTableName = qualifiedTableName;
}
//**************************************************************************
// Model metadata
//**************************************************************************
public ClassAccessor tableAccessor;
//**************************************************************************
// Model objects
//**************************************************************************
public Object object;
public List<Object> objects;
//**************************************************************************
// Presentation elements
//**************************************************************************
public TableForm tableForm;
public Form form;
public SearchForm searchForm;
public List<RelatedTableForm> relatedTableFormList;
public InputStream inputStream;
//**************************************************************************
// export parameters
//***************************************************************************
public String contentType;
public String fileName;
public Long contentLength;
public String chartId;
//**************************************************************************
// Other objects
//**************************************************************************
public PkHelper pkHelper;
public static final Logger logger =
LogUtil.getLogger(TableDataAction.class);
//**************************************************************************
// Action default execute method
//**************************************************************************
public String execute() {
if (qualifiedTableName == null) {
List<Table> tables = model.getAllTables();
if (tables.isEmpty()) {
return NO_TABLES;
} else {
qualifiedTableName = tables.get(0).getQualifiedName();
return REDIRECT_TO_TABLE;
}
}
if (pk == null) {
return searchFromString();
} else {
return read();
}
}
//**************************************************************************
// Search
//**************************************************************************
public String searchFromString() {
setupMetadata();
SearchFormBuilder searchFormBuilder =
new SearchFormBuilder(tableAccessor);
searchForm = searchFormBuilder.build();
configureSearchFormFromString();
return commonSearch();
}
protected void configureSearchFormFromString() {
if (searchString != null) {
DummyHttpServletRequest dummyRequest =
new DummyHttpServletRequest();
String[] parts = searchString.split(",");
Pattern pattern = Pattern.compile("(.*)=(.*)");
for (String part : parts) {
Matcher matcher = pattern.matcher(part);
if (matcher.matches()) {
String key = matcher.group(1);
String value = matcher.group(2);
LogUtil.fineMF(logger, "Matched part: {0}={1}", key, value);
dummyRequest.setParameter(key, value);
} else {
LogUtil.fineMF(logger, "Could not match part: {0}", part);
}
}
searchForm.readFromRequest(dummyRequest);
}
}
public String search() {
setupMetadata();
SearchFormBuilder searchFormBuilder =
new SearchFormBuilder(tableAccessor);
searchForm = searchFormBuilder.build();
searchForm.readFromRequest(req);
return commonSearch();
}
protected String commonSearch() {
searchString = searchForm.toSearchString();
if (searchString.length() == 0) {
searchString = null;
}
Criteria criteria = new Criteria(tableAccessor);
searchForm.configureCriteria(criteria);
objects = context.getObjects(criteria);
String readLinkExpression = getReadLinkExpression();
OgnlTextFormat hrefFormat =
OgnlTextFormat.create(readLinkExpression);
hrefFormat.setUrl(true);
TableFormBuilder tableFormBuilder =
createTableFormBuilderWithSelectionProviders()
.configNRows(objects.size())
.configMode(Mode.VIEW);
// ogni colonna chiave primaria sarà clickabile
for (PropertyAccessor property : tableAccessor.getKeyProperties()) {
tableFormBuilder.configHyperlinkGenerators(
property.getName(), hrefFormat, null);
}
tableForm = tableFormBuilder.build();
tableForm.setKeyGenerator(pkHelper.createPkGenerator());
tableForm.setSelectable(true);
tableForm.readFromObject(objects);
return SEARCH;
}
>>>>>>>
<<<<<<<
=======
// Return to search
//**************************************************************************
public String returnToSearch() {
setupMetadata();
return RETURN_TO_SEARCH;
}
//**************************************************************************
// Read
//**************************************************************************
public String read() {
setupMetadata();
Serializable pkObject = pkHelper.parsePkString(pk);
SearchFormBuilder searchFormBuilder =
new SearchFormBuilder(tableAccessor);
searchForm = searchFormBuilder.build();
configureSearchFormFromString();
Criteria criteria = new Criteria(tableAccessor);
searchForm.configureCriteria(criteria);
objects = context.getObjects(criteria);
object = context.getObjectByPk(qualifiedTableName, pkObject);
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.VIEW)
.build();
form.readFromObject(object);
relatedTableFormList = new ArrayList<RelatedTableForm>();
Table table = model.findTableByQualifiedName(qualifiedTableName);
for (ForeignKey relationship : table.getOneToManyRelationships()) {
setupRelatedTableForm(relationship);
}
return READ;
}
protected void setupRelatedTableForm(ForeignKey relationship) {
List<Object> relatedObjects =
context.getRelatedObjects(qualifiedTableName, object,
relationship.getForeignKeyName());
String qualifiedFromTableName =
relationship.getFromTable().getQualifiedName();
TableAccessor relatedTableAccessor =
context.getTableAccessor(qualifiedFromTableName);
TableFormBuilder tableFormBuilder =
new TableFormBuilder(relatedTableAccessor);
tableFormBuilder.configNRows(relatedObjects.size());
TableForm tableForm = tableFormBuilder
.configMode(Mode.VIEW)
.build();
tableForm.readFromObject(relatedObjects);
RelatedTableForm relatedTableForm =
new RelatedTableForm(relationship, tableForm, relatedObjects);
relatedTableFormList.add(relatedTableForm);
}
//**************************************************************************
// Create/Save
//**************************************************************************
public String create() {
setupMetadata();
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.CREATE)
.build();
return CREATE;
}
public String save() {
setupMetadata();
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.CREATE)
.build();
form.readFromRequest(req);
if (form.validate()) {
object = tableAccessor.newInstance();
form.writeToObject(object);
context.saveObject(qualifiedTableName, object);
String databaseName = model
.findTableByQualifiedName(qualifiedTableName)
.getDatabaseName();
context.commit(databaseName);
pk = pkHelper.generatePkString(object);
SessionMessages.addInfoMessage("SAVE avvenuto con successo");
return SAVE;
} else {
return CREATE;
}
}
//**************************************************************************
// Edit/Update
//**************************************************************************
public String edit() {
setupMetadata();
Serializable pkObject = pkHelper.parsePkString(pk);
object = context.getObjectByPk(qualifiedTableName, pkObject);
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.EDIT)
.build();
form.readFromObject(object);
return EDIT;
}
public String update() {
setupMetadata();
Serializable pkObject = pkHelper.parsePkString(pk);
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.EDIT)
.build();
object = context.getObjectByPk(qualifiedTableName, pkObject);
form.readFromObject(object);
form.readFromRequest(req);
if (form.validate()) {
form.writeToObject(object);
context.updateObject(qualifiedTableName, object);
String databaseName = model
.findTableByQualifiedName(qualifiedTableName).getDatabaseName();
context.commit(databaseName);
SessionMessages.addInfoMessage("UPDATE avvenuto con successo");
return UPDATE;
} else {
return EDIT;
}
}
//**************************************************************************
// Bulk Edit/Update
//**************************************************************************
public String bulkEdit() {
if (selection == null || selection.length == 0) {
SessionMessages.addWarningMessage(
"Nessun oggetto selezionato");
return CANCEL;
}
if (selection.length == 1) {
pk = selection[0];
return edit();
}
setupMetadata();
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.BULK_EDIT)
.build();
return BULK_EDIT;
}
public String bulkUpdate() {
setupMetadata();
form = createFormBuilderWithSelectionProviders()
.configMode(Mode.BULK_EDIT)
.build();
form.readFromRequest(req);
if (form.validate()) {
for (String current : selection) {
Serializable pkObject = pkHelper.parsePkString(current);
object = context.getObjectByPk(qualifiedTableName, pkObject);
form.writeToObject(object);
}
form.writeToObject(object);
context.updateObject(qualifiedTableName, object);
String databaseName = model.findTableByQualifiedName(qualifiedTableName)
.getDatabaseName();
context.commit(databaseName);
SessionMessages.addInfoMessage(MessageFormat.format(
"UPDATE di {0} oggetti avvenuto con successo", selection.length));
return BULK_UPDATE;
} else {
return BULK_EDIT;
}
}
//**************************************************************************
>>>>>>> |
<<<<<<<
=======
import com.manydesigns.portofino.scripting.ScriptingUtil;
import com.manydesigns.portofino.stripes.NoCacheStreamingResolution;
>>>>>>>
import com.manydesigns.portofino.stripes.NoCacheStreamingResolution; |
<<<<<<<
import com.manydesigns.portofino.model.site.UseCaseNode;
import com.manydesigns.portofino.model.site.usecases.UseCase;
=======
import com.manydesigns.portofino.model.selectionproviders.ModelSelectionProvider;
import com.manydesigns.portofino.model.selectionproviders.SelectionProperty;
import com.manydesigns.portofino.model.usecases.UseCase;
import com.manydesigns.portofino.reflection.TableAccessor;
>>>>>>>
import com.manydesigns.portofino.model.site.UseCaseNode;
import com.manydesigns.portofino.model.site.usecases.UseCase;
import com.manydesigns.portofino.model.selectionproviders.ModelSelectionProvider;
import com.manydesigns.portofino.model.selectionproviders.SelectionProperty;
import com.manydesigns.portofino.reflection.TableAccessor;
<<<<<<<
=======
import java.util.Collection;
import java.util.List;
>>>>>>>
import java.util.Collection;
<<<<<<<
=======
private void setupSelectionProviders(UseCase useCase, CrudUnit result) {
for (ModelSelectionProvider current : useCase.getModelSelectionProviders()) {
String name = current.getName();
String database = current.getDatabase();
String sql = current.getSql();
String hql = current.getHql();
String[] fieldNames =
new String[current.getSelectionProperties().size()];
int i = 0;
for (SelectionProperty selectionProperty :
current.getSelectionProperties()) {
fieldNames[i] = selectionProperty.getName();
i++;
}
SelectionProvider selectionProvider;
if (sql != null) {
Collection<Object[]> objects = context.runSql(database, sql);
selectionProvider = DefaultSelectionProvider.create(
name, fieldNames.length, objects);
} else if (hql != null) {
Collection<Object> objects = context.getObjects(hql);
String qualifiedTableName =
context.getQualifiedTableNameFromQueryString(hql);
TableAccessor tableAccessor =
context.getTableAccessor(qualifiedTableName);
ShortName shortNameAnnotation =
tableAccessor.getAnnotation(ShortName.class);
TextFormat[] textFormats = null;
if (shortNameAnnotation != null) {
textFormats = new TextFormat[] {
OgnlTextFormat.create(shortNameAnnotation.value())
};
}
selectionProvider = DefaultSelectionProvider.create(
name, objects, tableAccessor, textFormats);
} else {
LogUtil.warningMF(logger, "ModelSelection provider '{0}':" +
" both 'hql' and 'sql' are null", name);
break;
}
CrudSelectionProvider crudSelectionProvider =
new CrudSelectionProvider(selectionProvider, fieldNames);
result.crudSelectionProviders.add(crudSelectionProvider);
}
}
>>>>>>>
private void setupSelectionProviders(UseCase useCase, CrudUnit result) {
for (ModelSelectionProvider current : useCase.getModelSelectionProviders()) {
String name = current.getName();
String database = current.getDatabase();
String sql = current.getSql();
String hql = current.getHql();
String[] fieldNames =
new String[current.getSelectionProperties().size()];
int i = 0;
for (SelectionProperty selectionProperty :
current.getSelectionProperties()) {
fieldNames[i] = selectionProperty.getName();
i++;
}
SelectionProvider selectionProvider;
if (sql != null) {
Collection<Object[]> objects = context.runSql(database, sql);
selectionProvider = DefaultSelectionProvider.create(
name, fieldNames.length, objects);
} else if (hql != null) {
Collection<Object> objects = context.getObjects(hql);
String qualifiedTableName =
context.getQualifiedTableNameFromQueryString(hql);
TableAccessor tableAccessor =
context.getTableAccessor(qualifiedTableName);
ShortName shortNameAnnotation =
tableAccessor.getAnnotation(ShortName.class);
TextFormat[] textFormats = null;
if (shortNameAnnotation != null) {
textFormats = new TextFormat[] {
OgnlTextFormat.create(shortNameAnnotation.value())
};
}
selectionProvider = DefaultSelectionProvider.create(
name, objects, tableAccessor, textFormats);
} else {
LogUtil.warningMF(logger, "ModelSelection provider '{0}':" +
" both 'hql' and 'sql' are null", name);
break;
}
CrudSelectionProvider crudSelectionProvider =
new CrudSelectionProvider(selectionProvider, fieldNames);
result.crudSelectionProviders.add(crudSelectionProvider);
}
} |
<<<<<<<
} catch (NoSuchFieldException e) {
logger.warn("No state field in emailQueue",e);
=======
} catch (Throwable e) {
LogUtil.warning(logger, "cannot create emailQueue", e);
>>>>>>>
} catch (Throwable e) {
logger.warn("cannot create emailQueue", e);
<<<<<<<
while (!successQueue.isEmpty()) {
EmailSender email = successQueue.poll();
if ("true".equals(PortofinoProperties.getProperties()
.getProperty(PortofinoProperties.KEEP_SENT))){
continue;
}
try {
EmailUtils.deleteEmail(context,email.getEmailBean());
context.commit(EmailUtils.PORTOFINO);
} catch (Throwable e) {
logger.warn("Cannot delete email", e);
}
=======
while (!successQueue.isEmpty()) {
EmailSender email = successQueue.poll();
if ("true".equals(PortofinoProperties.getProperties()
.getProperty(PortofinoProperties.KEEP_SENT))) {
continue;
>>>>>>>
while (!successQueue.isEmpty()) {
EmailSender email = successQueue.poll();
if ("true".equals(PortofinoProperties.getProperties()
.getProperty(PortofinoProperties.KEEP_SENT))) {
continue;
<<<<<<<
if (users.size()==0){
logger.warn("no user found for email {}", email);
=======
if (users.size() == 0) {
LogUtil.warningMF(logger, "no user found for email {0}", email);
>>>>>>>
if (users.size() == 0) {
logger.warn("no user found for email {}", email);
<<<<<<<
logger.warn("cannot increment bounce for user", e);
=======
LogUtil.warning(logger, "cannot increment bounce for user", e);
>>>>>>>
logger.warn("cannot increment bounce for user", e); |
<<<<<<<
public void notifyEvents( Iterable<UnitOfWorkEvent> events )
=======
public void initialize()
throws ConstructionException
{
}
public void notifyChanges( Iterable<EntityState> entityStates )
>>>>>>>
public void initialize()
throws ConstructionException
{
}
public void notifyChanges( Iterable<EntityState> entityStates )
<<<<<<<
// Update entities
EntityStoreUnitOfWork uow = entityStore.newUnitOfWork( UsecaseBuilder.newUsecase( "Update index" ), new MetaInfo() );
for( EntityReference entityReference : updatedEntities )
{
EntityState entityState = null;
try
{
entityState = uow.getEntityState( entityReference );
}
catch( EntityNotFoundException e )
{
// Skip this one
continue;
}
for( EntityTypeReference entityTypeReference : entityState.entityTypeReferences() )
{
try
{
removeEntityState( entityState.identity(), connection ); // TODO Fix so that new entities are not removed first
indexEntityState( entityState, connection );
}
catch( UnknownEntityTypeException e )
{
// No EntityType registered - ignore
Logger.getLogger( getClass().getName() ).warning( "Could not get EntityType for " + entityTypeReference.toString() );
}
}
}
for( EntityReference entityId : removedEntities )
{
removeEntityState( entityId, connection );
}
=======
>>>>>>> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.