Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,55 @@ public interface CollectionLogMasterConfig extends Config
{
String CONFIG_GROUP = "collection-log-master";

String TASK_APP_SECTION = "taskApp";
String TASK_APP_USERNAME = TASK_APP_SECTION + ".username";
String TASK_APP_PASSWORD = TASK_APP_SECTION + ".password";

String GENERAL_SECTION = "general";

String PLUGIN_VERSION_KEY = "plugin-version";
String IS_LMS_ENABLED_KEY = "isLMSEnabled";
String IS_COMMAND_ENABLED_KEY = "isCommandEnabled";

@ConfigSection(
name = "TaskApp Credentials",
description = "The credentials for your account in TaskApp (osrstaskapp.com)",
position = 10
)
String taskAppSection = TASK_APP_SECTION;

@ConfigItem(
keyName = TASK_APP_USERNAME,
name = "Username",
description = "Your account's username in TaskApp (osrstaskapp.com)",
section = taskAppSection,
position = 11
)
default String username()
{
return "";
}

@ConfigItem(
keyName = TASK_APP_PASSWORD,
name = "Password",
description = "Your account's password in TaskApp (osrstaskapp.com)",
section = taskAppSection,
secret = true,
position = 12
)
default String password()
{
return "";
}
Comment thread
rmobis marked this conversation as resolved.


@ConfigSection(
name = "General",
description = "General settings to control the plugin's behavior and appearance",
position = 20
)
String generalSection = GENERAL_SECTION;

@Range(
min = 1000,
max = 10000
Expand All @@ -24,7 +69,8 @@ public interface CollectionLogMasterConfig extends Config
keyName = "rollTime",
name = "Roll Time",
description = "How long new tasks will take to roll",
position = 1
section = generalSection,
position = 21
)
default int rollTime()
{
Expand All @@ -34,8 +80,9 @@ default int rollTime()
@ConfigItem(
keyName = "rollPastCompleted",
name = "Roll past completed",
description = "When rolling tasks, include those you've already completed in the roll animation. Helpful when you're getting to the end of a tier!",
position = 2
description = "Include tasks you've already completed in the roll animation. Helpful when you're getting to the end of a tier!",
section = generalSection,
position = 22
)
default boolean rollPastCompleted()
{
Expand All @@ -46,7 +93,8 @@ default boolean rollPastCompleted()
keyName = "hideBelow",
name = "Hide Tasks Below",
description = "Disabled the showing up/assigning of tasks at or below the specified tier",
position = 3
section = generalSection,
position = 23
)
default TaskTier hideBelow()
{
Expand All @@ -57,7 +105,8 @@ default TaskTier hideBelow()
keyName = "displayCurrentTaskOverlay",
name = "Display current task overlay",
description = "Enable an overlay showing the currently assigned task (when one exists)",
position = 5
section = generalSection,
position = 24
)
default boolean displayCurrentTaskOverlay()
{
Expand All @@ -68,37 +117,27 @@ default boolean displayCurrentTaskOverlay()
keyName = "dynamicTaskImages",
name = "Dynamic task images",
description = "Display dynamic task images based on required/acquired items",
position = 6
section = generalSection,
position = 25
)
default DynamicTaskImages dynamicTaskImages()
{
return DynamicTaskImages.COMPLETE;
}

@ConfigItem(
keyName = IS_LMS_ENABLED_KEY,
name = "Enable LMS tasks",
description = "Whether to include LMS tasks in the list.",
position = 7
)
default boolean isLMSEnabled()
{
return true;
}

@ConfigSection(
name = "!taskman Command",
description = "Configuration options for the !taskman command",
position = 8
position = 30
)
String command = "command";
String commandSection = "command";

@ConfigItem(
keyName = IS_COMMAND_ENABLED_KEY,
name = "Enable command",
description = "When you or others type !taskman in the chat, it will be replaced by your current task status",
section = command,
position = 0
section = commandSection,
position = 31
)
default boolean isCommandEnabled()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.collectionlogmaster;

import com.collectionlogmaster.command.DevCommandsManager;
import com.collectionlogmaster.command.TaskmanCommandManager;
import com.collectionlogmaster.input.MouseManager;
import com.collectionlogmaster.synchronization.clog.CollectionLogService;
import com.collectionlogmaster.task.TaskService;
import com.collectionlogmaster.taskapp.TaskService;
import com.collectionlogmaster.ui.InterfaceManager;
import com.collectionlogmaster.ui.TaskOverlay;
import com.collectionlogmaster.util.GsonOverride;
Expand Down Expand Up @@ -54,9 +53,6 @@ public class CollectionLogMasterPlugin extends Plugin {
@Inject
public TaskmanCommandManager taskmanCommand;

@Inject
public DevCommandsManager devCommands;

@Override
protected void startUp() {
CollectionLogMasterPlugin.staticInjector = getInjector();
Expand All @@ -67,7 +63,6 @@ protected void startUp() {
pluginUpdateNotifier.startUp();
interfaceManager.startUp();
taskmanCommand.startUp();
devCommands.startUp();
this.taskOverlay.setResizable(true);
this.overlayManager.add(this.taskOverlay);
}
Expand All @@ -80,7 +75,6 @@ protected void shutDown() {
pluginUpdateNotifier.shutDown();
interfaceManager.shutDown();
taskmanCommand.shutDown();
devCommands.shutDown();
this.overlayManager.remove(this.taskOverlay);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.collectionlogmaster.domain.TaskTier;
import com.collectionlogmaster.domain.command.CommandRequest;
import com.collectionlogmaster.domain.command.CommandResponse;
import com.collectionlogmaster.task.TaskService;
import com.collectionlogmaster.taskapp.TaskService;
import com.collectionlogmaster.util.EventBusSubscriber;
import com.collectionlogmaster.util.HttpClient;
import com.collectionlogmaster.util.SimpleDebouncer;
Expand Down Expand Up @@ -112,7 +112,7 @@ private void executeCommand(ChatMessage chatMessage, String message) {
}

HttpUrl url = baseApiUrl.newBuilder().addPathSegment(senderName).build();
httpClient.getHttpRequestAsync(url.toString(), CommandResponse.class)
httpClient.get(url, CommandResponse.class)
.thenAccept(res ->
clientThread.invokeLater(() -> replaceChatMessage(chatMessage, res))
);
Expand Down Expand Up @@ -145,7 +145,8 @@ public void updateServerImmediately() {
float currentProgress = taskService.getProgress().get(currentTier) * 100;

CommandRequest data = new CommandRequest(taskId, taskService.getCurrentTier().displayName, (int) currentProgress);
httpClient.putHttpRequestAsync(url.toString(), GSON.toJson(data), null);

httpClient.put(url, data, null);
}

private void replaceChatMessage(ChatMessage chatMessage, CommandResponse res) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.collectionlogmaster.domain.command;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.RequiredArgsConstructor;

@Data
@RequiredArgsConstructor
public class CommandRequest {
@SerializedName("taskId")
private final String taskId;
private final String tier;
@SerializedName("progressPercentage")
private final int progressPercentage;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.collectionlogmaster.domain.command;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

@Data
public class CommandResponse {
private CommandTask task;
private String tier;
@SerializedName("progressPercentage")
private int progressPercentage;
}

This file was deleted.

This file was deleted.

Loading
Loading