Skip to content

Commit

Permalink
project: Merge upstream (open-osrs#4)
Browse files Browse the repository at this point in the history
project: Merge upstream
  • Loading branch information
Owain94 authored Dec 23, 2019
2 parents f99b024 + 15e314d commit 79d0f90
Show file tree
Hide file tree
Showing 57 changed files with 1,276 additions and 437 deletions.
2 changes: 1 addition & 1 deletion bank/bank.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.1"
version = "0.0.2"

project.extra["PluginName"] = "Bank"
project.extra["PluginDescription"] = "Modifications to the banking interface"
Expand Down
118 changes: 104 additions & 14 deletions bank/src/main/java/net/runelite/client/plugins/bank/BankConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,50 @@
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigSection;

@ConfigGroup("bank")
public interface BankConfig extends Config
{
@ConfigSection(
name = "Show Values",
description = "",
position = 0,
keyName = "ValueSection"
)
default boolean ValueSection()
{
return false;
}

@ConfigSection(
name = "Disable Left Click",
description = "",
position = 1,
keyName = "DisableLClickSection"
)
default boolean DisableLClickSection()
{
return false;
}

@ConfigSection(
name = "Bank Pin",
description = "",
position = 2,
keyName = "BankPinSection"
)
default boolean BankPinSection()
{
return false;
}

@ConfigItem(
keyName = "showGE",
name = "Show Grand Exchange price",
description = "Show grand exchange price total (GE)",
position = 1
position = 0,
section = "ValueSection"
)
default boolean showGE()
{
Expand All @@ -47,7 +82,8 @@ default boolean showGE()
keyName = "showHA",
name = "Show high alchemy price",
description = "Show high alchemy price total (HA)",
position = 2
position = 2,
section = "ValueSection"
)
default boolean showHA()
{
Expand All @@ -58,18 +94,32 @@ default boolean showHA()
keyName = "showExact",
name = "Show exact bank value",
description = "Show exact bank value",
position = 3
position = 3,
section = "ValueSection"
)
default boolean showExact()
{
return false;
}

@ConfigItem(
keyName = "seedVaultValue",
name = "Show seed vault value",
description = "Adds the total value of all seeds inside the seed vault to the title",
position = 4,
section = "ValueSection"
)
default boolean seedVaultValue()
{
return true;
}

@ConfigItem(
keyName = "rightClickBankInventory",
name = "Disable left click bank inventory",
description = "Configures whether the bank inventory button will bank your inventory on left click",
position = 4
position = 0,
section = "DisableLClickSection"
)
default boolean rightClickBankInventory()
{
Expand All @@ -80,7 +130,8 @@ default boolean rightClickBankInventory()
keyName = "rightClickBankEquip",
name = "Disable left click bank equipment",
description = "Configures whether the bank equipment button will bank your equipment on left click",
position = 5
position = 1,
section = "DisableLClickSection"
)
default boolean rightClickBankEquip()
{
Expand All @@ -91,32 +142,71 @@ default boolean rightClickBankEquip()
keyName = "rightClickBankLoot",
name = "Disable left click bank looting bag",
description = "Configures whether the bank looting bag button will bank your looting bag contents on left click",
position = 6
position = 2,
section = "DisableLClickSection"
)
default boolean rightClickBankLoot()
{
return false;
}

@ConfigItem(
keyName = "seedVaultValue",
name = "Show seed vault value",
description = "Adds the total value of all seeds inside the seed vault to the title",
position = 7
keyName = "rightClickSetPlaceholders",
name = "Disable left click set placeholders",
description = "Configures whether the set bank placeholder button will be on left click",
position = 3,
section = "DisableLClickSection"
)
default boolean seedVaultValue()
default boolean rightClickSetPlaceholders()
{
return true;
return false;
}

@ConfigItem(
keyName = "rightClickReleasePlaceholders",
name = "Disable left click release placeholder",
description = "Configures whether the release bank placeholder button will be on left click",
position = 4,
section = "DisableLClickSection"
)
default boolean rightClickReleasePlaceholders()
{
return false;
}

@ConfigItem(
keyName = "rightClickFillBankFiller",
name = "Disable left click fill bank fillers",
description = "Configures whether the fill bank fillers button will be on left click",
position = 5,
section = "DisableLClickSection"
)
default boolean rightClickFillBankFiller()
{
return false;
}

@ConfigItem(
keyName = "rightClickSearch",
name = "Disable left click search",
description = "Configures whether the search button will search on left click",
position = 6,
section = "DisableLClickSection"
)
default boolean rightClickSearch()
{
return false;
}

@ConfigItem(
keyName = "largePinNumbers",
name = "Large bank pin numbers",
description = "Enlarges and centers the numbers inside the bank pin buttons",
position = 8
position = 0,
section = "BankPinSection"
)
default boolean largePinNumbers()
{
return false;
}
}
}
51 changes: 38 additions & 13 deletions bank/src/main/java/net/runelite/client/plugins/bank/BankPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ public class BankPlugin extends Plugin
private static final String DEPOSIT_WORN = "Deposit worn items";
private static final String DEPOSIT_INVENTORY = "Deposit inventory";
private static final String DEPOSIT_LOOT = "Deposit loot";
private static final String DISABLE = "Disable";
private static final String ENABLE = "Enable";
private static final String RELEASE_ALL_PLACEHOLDERS = "Release all placeholders";
private static final String SEARCH = "Search";
private static final String FILL = "Fill";

private static final String SEED_VAULT_TITLE = "Seed Vault";
private static final int PIN_FONT_OFFSET = 5;

Expand Down Expand Up @@ -152,13 +158,6 @@ public class BankPlugin extends Plugin
private boolean largePinNumbers;
private Multiset<Integer> itemQuantities; // bank item quantities for bank value search
private String searchString;

@Provides
BankConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(BankConfig.class);
}

@Getter(AccessLevel.PACKAGE)
private boolean showGE;
@Getter(AccessLevel.PACKAGE)
Expand All @@ -167,6 +166,17 @@ BankConfig getConfig(ConfigManager configManager)
private boolean rightClickBankInventory;
private boolean rightClickBankEquip;
private boolean rightClickBankLoot;
private boolean seedVaultValue;
private boolean rightClickSetPlaceholders;
private boolean rightClickReleasePlaceholders;
private boolean rightClickSearch;
private boolean rightClickFillBankFiller;

@Provides
BankConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(BankConfig.class);
}

@Override
protected void startUp()
Expand Down Expand Up @@ -197,7 +207,12 @@ private void onMenuShouldLeftClick(MenuShouldLeftClick event)
{
if ((entry.getOption().equals(DEPOSIT_WORN) && this.rightClickBankEquip)
|| (entry.getOption().equals(DEPOSIT_INVENTORY) && this.rightClickBankInventory)
|| (entry.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot))
|| (entry.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot)
|| (entry.getOption().startsWith(DISABLE) && this.rightClickSetPlaceholders)
|| (entry.getOption().startsWith(ENABLE) && this.rightClickSetPlaceholders)
|| (entry.getOption().equals(RELEASE_ALL_PLACEHOLDERS) && this.rightClickReleasePlaceholders)
|| (entry.getOption().equals(SEARCH) && this.rightClickSearch)
|| (entry.getOption().equals(FILL) && this.rightClickFillBankFiller))
{
event.setForceRightClick(true);
return;
Expand All @@ -210,7 +225,12 @@ private void onMenuEntryAdded(MenuEntryAdded event)
{
if ((event.getOption().equals(DEPOSIT_WORN) && this.rightClickBankEquip)
|| (event.getOption().equals(DEPOSIT_INVENTORY) && this.rightClickBankInventory)
|| (event.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot))
|| (event.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot)
|| (event.getOption().startsWith(DISABLE) && this.rightClickSetPlaceholders)
|| (event.getOption().startsWith(ENABLE) && this.rightClickSetPlaceholders)
|| (event.getOption().equals(RELEASE_ALL_PLACEHOLDERS) && this.rightClickReleasePlaceholders)
|| (event.getOption().equals(SEARCH) && this.rightClickSearch)
|| (event.getOption().equals(FILL) && this.rightClickFillBankFiller))
{
forceRightClickFlag = true;
}
Expand Down Expand Up @@ -264,7 +284,7 @@ private void onScriptCallbackEvent(ScriptCallbackEvent event)
@Subscribe
private void onWidgetLoaded(WidgetLoaded event)
{
if (event.getGroupId() != WidgetID.SEED_VAULT_GROUP_ID || !config.seedVaultValue())
if (event.getGroupId() != WidgetID.SEED_VAULT_GROUP_ID || !this.seedVaultValue)
{
return;
}
Expand Down Expand Up @@ -309,7 +329,7 @@ public void onItemContainerChanged(ItemContainerChanged event)
{
itemQuantities = null;
}
else if (containerId == InventoryID.SEED_VAULT.getId() && config.seedVaultValue())
else if (containerId == InventoryID.SEED_VAULT.getId() && this.seedVaultValue)
{
updateSeedVaultTotal();
}
Expand All @@ -321,7 +341,7 @@ private String createValueText(final ContainerPrices prices)
final long haPrice = prices.getHighAlchPrice();

String strCurrentTab = "";
if (config.showGE() && gePrice != 0)
if (this.showGE && gePrice != 0)
{
strCurrentTab += " (";

Expand Down Expand Up @@ -480,6 +500,11 @@ private void updateConfig()
this.rightClickBankInventory = config.rightClickBankInventory();
this.rightClickBankEquip = config.rightClickBankEquip();
this.rightClickBankLoot = config.rightClickBankLoot();
this.seedVaultValue = config.seedVaultValue();
this.rightClickSetPlaceholders = config.rightClickSetPlaceholders();
this.rightClickReleasePlaceholders = config.rightClickReleasePlaceholders();
this.rightClickSearch = config.rightClickSearch();
this.rightClickFillBankFiller = config.rightClickFillBankFiller();
}

@VisibleForTesting
Expand Down Expand Up @@ -576,4 +601,4 @@ private Multiset<Integer> getBankItemSet()
}
return set;
}
}
}
2 changes: 1 addition & 1 deletion blackjack/blackjack.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.1"
version = "0.0.2"

project.extra["PluginName"] = "Blackjack"
project.extra["PluginDescription"] = "Allows for one-click blackjacking, both knocking out and pickpocketing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ private BJComparableEntry(final String npc, final boolean pickpocket)
@Override
public boolean matches(MenuEntry entry)
{
return
Text.removeTags(entry.getTarget(), true).equalsIgnoreCase(this.getTarget()) &&
entry.getOption().equalsIgnoreCase(this.getOption());
return entry.getOption().equalsIgnoreCase(this.getOption()) &&
Text.removeTags(entry.getTarget(), true).equalsIgnoreCase(this.getTarget());
}
}
}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ subprojects {
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

object ProjectVersions {
const val rlVersion = "1.5.43-SNAPSHOT"
const val rlVersion = "1.5.44-SNAPSHOT"
const val apiVersion = "0.0.1"
}

Expand Down
2 changes: 1 addition & 1 deletion cannon/cannon.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.1"
version = "0.0.2"

project.extra["PluginName"] = "Cannon"
project.extra["PluginDescription"] = "Show information about cannon placement and/or amount of cannonballs"
Expand Down
Loading

0 comments on commit 79d0f90

Please sign in to comment.