Simple Galaxy Gate: Updates and fixes.#124
Merged
dm94 merged 5 commits intoDarkbot-Plugins:mainfrom Apr 10, 2026
Merged
Conversation
Contributor
Reviewer's GuideRefactors the Simple Galaxy Gate feature’s user instructions from a string-based provider into reusable HTML-based config editors, and adjusts gate refresh logic to support gates without portals (notably Low gate). Class diagram for HTML-based instructions and related config changesclassDiagram
class OptionEditor {
<<interface>>
+getEditorComponent(setting)
}
class HtmlInstructions {
<<abstract>>
+getEditorComponent(setting)
+buildList(title, items)
}
OptionEditor <|.. HtmlInstructions
class SimpleGalaxyGateConfig {
}
class SimpleGalaxyGateConfig_Instructions {
+getEditorValue()
}
class AnyGateSettings {
+instructions
+npcRadius
+minNpcMapAmount
}
class AnyGateSettings_Instructions {
+getEditorValue()
}
class KamikazeSettings {
+instructions
+enabled
+maxRange
+minNpcAmount
+minNpcHealthPercent
+minPetHealthPercent
+maxHeroHealthPercent
}
class KamikazeSettings_Instructions {
+getEditorValue()
}
HtmlInstructions <|-- SimpleGalaxyGateConfig_Instructions
HtmlInstructions <|-- AnyGateSettings_Instructions
HtmlInstructions <|-- KamikazeSettings_Instructions
SimpleGalaxyGateConfig *-- SimpleGalaxyGateConfig_Instructions
SimpleGalaxyGateConfig *-- AnyGateSettings
AnyGateSettings *-- AnyGateSettings_Instructions
SimpleGalaxyGateConfig *-- KamikazeSettings
KamikazeSettings *-- KamikazeSettings_Instructions
class Module {
<<interface>>
}
class Task {
<<interface>>
}
class Configurable {
<<interface>>
+setConfig(config)
}
class NpcExtraProvider {
<<interface>>
}
class SimpleGalaxyGate {
-config
-hero
-movement
-facade
-backpage
-stats
-entities
-mapManager
-eventBroker
-attackModule
-lootModule
-collectorModule
-petModule
-safetyModule
-drive
-gateHandler
-gateBuilder
+setConfig(config)
}
Module <|.. SimpleGalaxyGate
Task <|.. SimpleGalaxyGate
Configurable <|.. SimpleGalaxyGate
NpcExtraProvider <|.. SimpleGalaxyGate
Class diagram for GateHandler and LowGate safe refresh logicclassDiagram
class GateHandler {
-skipFarTargets : boolean
-fetchServerOffset : boolean
-safeRefreshInGate : boolean
-noPortalsInGate : boolean
-statusDetails : String
-useGuardableNpcAsSearchLocation : boolean
-cachedGuardableNpc
+canSafeRefreshInGate() boolean
}
class LowGate {
+defaultNpcParam
+jumpToNextMap : boolean
+moveToCenter : boolean
+approachToCenter : boolean
+skipFarTargets : boolean
+noPortalsInGate : boolean
+repairRadius
+farTargetDistance
}
GateHandler <|-- LowGate
Flow diagram for canSafeRefreshInGate with noPortalsInGate supportflowchart TD
A[Check canSafeRefreshInGate] --> B{safeRefreshInGate is true?}
B -- no --> Z[Return false]
B -- yes --> C{module.isMapGG is true?}
C -- no --> Z
C -- yes --> D{lootModule has no NPCs?}
D -- no --> Z
D -- yes --> E{collectorModule has no box?}
E -- no --> Z
E -- yes --> F{noPortalsInGate is true?}
F -- yes --> Y[Return true]
F -- no --> G{any portal distanceTo hero < 1000?}
G -- yes --> Y
G -- no --> Z
Z --> H[Result: safe refresh not allowed]
Y --> I[Result: safe refresh allowed]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
HtmlInstructions,getEditorComponentcallsthis.getEditorValue()but the method isn’t declared in the base class—add an abstractprotected String getEditorValue();(or similar) toHtmlInstructionsand annotate subclasses with@Overrideto avoid compilation issues and make the contract explicit. - The
JScrollPanereturned fromHtmlInstructions#getEditorComponentwill show default scrollbars and borders even for short texts; consider disabling scrollbars or borders (or setting a preferred size) to better integrate these instruction blocks visually with the rest of the config UI.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `HtmlInstructions`, `getEditorComponent` calls `this.getEditorValue()` but the method isn’t declared in the base class—add an abstract `protected String getEditorValue();` (or similar) to `HtmlInstructions` and annotate subclasses with `@Override` to avoid compilation issues and make the contract explicit.
- The `JScrollPane` returned from `HtmlInstructions#getEditorComponent` will show default scrollbars and borders even for short texts; consider disabling scrollbars or borders (or setting a preferred size) to better integrate these instruction blocks visually with the rest of the config UI.
## Individual Comments
### Comment 1
<location path="src/main/java/dev/shared/do_gamer/module/simple_galaxy_gate/config/SimpleGalaxyGateConfig.java" line_range="117-122" />
<code_context>
+ @Override
+ public String getEditorValue() {
+ return this.buildList(null,
+ "This setting used for any Galaxy Gate if no specific selected.",
+ "NPC radius overrides any attack radius. Set to 0 to use custom radius.");
+ }
</code_context>
<issue_to_address>
**suggestion (typo):** Polish the instruction string for clearer grammar.
Consider updating the text to: `"This setting is used for any Galaxy Gate if no specific gate is selected."` for more natural grammar.
```suggestion
@Override
public String getEditorValue() {
return this.buildList(null,
"This setting is used for any Galaxy Gate if no specific gate is selected.",
"NPC radius overrides any attack radius. Set to 0 to use custom radius.");
}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Contributor
Author
|
@dm94 Tested and ready to merge. |
|
dm94
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary by Sourcery
Add HTML-based configuration instructions for Simple Galaxy Gate and adjust gate handling behavior for maps without portals.
New Features:
Enhancements: