Skip to content

Commit

Permalink
#124 - Add config for deathpile contingency
Browse files Browse the repository at this point in the history
  • Loading branch information
Thource committed Apr 12, 2023
1 parent 6b99a14 commit 91464d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;

/** DudeWheresMyStuffConfig manages the config for the plugin. */
@SuppressWarnings("SameReturnValue")
Expand Down Expand Up @@ -69,6 +70,19 @@ default boolean csvCombineItems() {
return false;
}

@Range(
min = 1,
max = 59
)
@ConfigItem(
keyName = "deathpileContingencyMinutes",
name = "Deathpile contingency (minutes)",
description = "This amount of minutes is removed from the deathpile timer. If set to 15, any "
+ "new deathpiles will start with 45 minutes until expiry.")
default int deathpileContingencyMinutes() {
return 1;
}

@ConfigItem(
keyName = "itemSortMode",
name = "Item Sort Mode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,10 @@ private void clearCarryableStorage() {
}

void createDeathpile(WorldPoint location, List<ItemStack> items) {
int deathpileDuration = 60 - plugin.getConfig().deathpileContingencyMinutes();
boolean useAccountPlayTime = deathpilesUseAccountPlayTime();
int expiryTime = useAccountPlayTime ? getPlayedMinutes() + 59 : 5900;
int expiryTime =
useAccountPlayTime ? getPlayedMinutes() + deathpileDuration : deathpileDuration * 100;
Deathpile deathpile = new Deathpile(plugin, useAccountPlayTime, expiryTime, location, this,
items);
SwingUtilities.invokeLater(() -> deathpile.createStoragePanel(this));
Expand Down

0 comments on commit 91464d6

Please sign in to comment.