MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / setToggle

Method setToggle

src/main/java/cc/slack/features/modules/api/Module.java:58–82  ·  view source on GitHub ↗
(boolean toggle)

Source from the content-addressed store, hash-verified

56 }
57
58 public void setToggle(boolean toggle) {
59 if (this.toggle == toggle) return;
60
61 try {
62 if (Slack.getInstance().getModuleManager().getInstance(Hud.class).sound.getValue())
63 PlaySound();
64 } catch (Exception ignored) {
65
66 }
67
68 this.toggle = toggle;
69
70 if (toggle) {
71 enabledTime.reset();
72 EventUtil.register(this);
73 onEnable();
74 Slack.getInstance().addNotification("Enabled module: " + name + ".", " ", 2000L, Slack.NotificationStyle.SUCCESS);
75 } else {
76 disabledTime.reset();
77 EventUtil.unRegister(this);
78 onDisable();
79 Slack.getInstance().addNotification("Disabled module: " + name + ".", " ", 2000L, Slack.NotificationStyle.FAIL);
80 }
81 onToggled();
82 }
83
84 public Value getValueByName(String n) {
85 for (Value m : setting) {

Callers 4

toggleMethod · 0.95
onEnableMethod · 0.80
onUpdateMethod · 0.80
readMethod · 0.80

Calls 10

PlaySoundMethod · 0.95
registerMethod · 0.95
onEnableMethod · 0.95
unRegisterMethod · 0.95
onDisableMethod · 0.95
onToggledMethod · 0.95
getValueMethod · 0.65
resetMethod · 0.65
getInstanceMethod · 0.45
addNotificationMethod · 0.45

Tested by

no test coverage detected