aboutsummaryrefslogtreecommitdiff
path: root/features/stat_next_to_name/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-14 15:07:28 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-14 15:07:28 +0800
commitd7c90e5a10ec1518974cdb1ee85506c28d31b2a1 (patch)
tree070b7d1c63740c71455bf98f8d89f4f0970d4119 /features/stat_next_to_name/index.js
parent35b89852096c48945e55e9d550a417a963a9ad74 (diff)
downloadSoopyV2-d7c90e5a10ec1518974cdb1ee85506c28d31b2a1.tar.gz
SoopyV2-d7c90e5a10ec1518974cdb1ee85506c28d31b2a1.tar.bz2
SoopyV2-d7c90e5a10ec1518974cdb1ee85506c28d31b2a1.zip
dropdown setting + stat next to name choose stat type + dragon wings fix
Diffstat (limited to 'features/stat_next_to_name/index.js')
-rw-r--r--features/stat_next_to_name/index.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/features/stat_next_to_name/index.js b/features/stat_next_to_name/index.js
index 586c4ba..1c1b2ab 100644
--- a/features/stat_next_to_name/index.js
+++ b/features/stat_next_to_name/index.js
@@ -4,6 +4,7 @@ import Feature from "../../featureClass/class";
import soopyV2Server from "../../socketConnection";
import SettingBase from "../settings/settingThings/settingBase";
import * as numberUtils from "../../utils/numberUtils";
+import DropdownSetting from "../settings/settingThings/dropdownSetting";
class StatNextToName extends Feature {
constructor() {
@@ -11,15 +12,25 @@ class StatNextToName extends Feature {
}
onEnable(){
- new SettingBase("(ONLY WEIGHT ATM) NOTE: A pink star thing (&d⚝§0)", "Means that player is also using SoopyV2", true, "stat_next_to_name_description", this)
+ new SettingBase("NOTE: A pink star thing (&d⚝§0)", "Means that player is also using SoopyV2", true, "stat_next_to_name_description", this)
+ this.statToShow = new DropdownSetting("Stat to show", "", "weight", "stat_selected_nexttoname", this, {
+ "weight": "Weight",
+ "catacombsLevel": "Catacombs Level",
+ "skillAvg": "Skill Average",
+ "totalSlayer": "Total Slayer Exp"
+ })
+
+ this.decimals = {
+ "weight": 0,
+ "catacombsLevel": 2,
+ "skillAvg": 2,
+ "totalSlayer": 0
+ }
this.userStats = {}
this.loadingStats = []
- this.statsThing = "weight"
- this.decimalPlaces = 0
-
soopyV2Server.onPlayerStatsLoaded = (stats)=>{this.playerStatsLoaded.call(this, stats)}
this.registerStep(false, 5, this.loadPlayerStatsTick)
@@ -66,8 +77,8 @@ class StatNextToName extends Feature {
nameTagString += " &2["
if(stats.usingSoopyv2) nameTagString += "&d⚝&2"
- if(stats.exists && stats[this.statsThing]){
- nameTagString += numberUtils.numberWithCommas(stats[this.statsThing].toFixed(this.decimalPlaces))
+ if(stats.exists && stats[this.statToShow.getValue()]){
+ nameTagString += numberUtils.numberWithCommas(stats[this.statToShow.getValue()].toFixed(this.decimals[this.statToShow.getValue()]))
}else{
nameTagString += "?"
}
@@ -84,6 +95,7 @@ class StatNextToName extends Feature {
playerStatsLoaded(stats){
// console.log(JSON.stringify(stats, undefined, 2))
this.userStats[stats.uuid] = stats
+
}
onDisable(){