-
-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: HUD Editor, Native Theme and Mixing Components and Wallpapers #3884
base: nextgen
Are you sure you want to change the base?
Conversation
get detekted |
If detekt complaints, the code probably sucks ;) |
🔥 |
detekt will complain at any code, no matter who writes it. one time detekt just shouted at me because i didn't make 17 new lines for this one really easy to use function. |
stop dickriding izuna |
"Draft", yk that? |
Detekt will give you warnings about symptoms of bad code style (= code smells). 99% of the complaints are legit - even though we only care about 95% because the rest is just too minor. I added it to prevent people from writing code like this which might work great but is a pain to understand and debug. I know it is annoying, but it works The number of if statements with 6 conditions, lines longer than the line limit, 4x nested loops and functions longer than two screens went down drastically. |
I know it's a draft, but he should stop dickriding in general |
2e58af1
to
35824fa
Compare
### Drawing Support - Added Web Drawer - Added Native Drawer - Implemented Drawer Reference System ### Component Overlay - Established Component Standards - Built Component Factory - Added Editor Boundaries Support - Enabled Creation and Deletion of Components via REST API ### Editor - Enabled Dragging of Components ### Wallpaper - Added File Support (.png, .frag formats) - Enabled Wallpaper Selection via REST API ### Generic Theme (Native) - Implemented Native Theme System
# Conflicts: # src-theme/src/routes/hud/Hud.svelte # src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/client/MixinMinecraftClient.java # src/main/kotlin/net/ccbluex/liquidbounce/integration/interop/protocol/rest/v1/InteropFunctionRegistry.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/ComponentSerializer.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/component/types/TextComponent.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/type/native/components/minimap/MinimapTextureAtlasManager.kt
# Conflicts: # config/detekt/baseline.xml # src-theme/src/routes/clickgui/ClickGui.svelte # src/main/kotlin/net/ccbluex/liquidbounce/LiquidBounce.kt # src/main/kotlin/net/ccbluex/liquidbounce/api/IpInfoApi.kt # src/main/kotlin/net/ccbluex/liquidbounce/config/types/ChoiceConfigurable.kt # src/main/kotlin/net/ccbluex/liquidbounce/config/types/Configurable.kt # src/main/kotlin/net/ccbluex/liquidbounce/config/types/Value.kt # src/main/kotlin/net/ccbluex/liquidbounce/event/events/ClientEvents.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/command/commands/client/CommandLocalConfig.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/misc/HideAppearance.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/crystalaura/ModuleCrystalAura.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/crystalaura/SubmoduleCrystalPlacer.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/movement/speed/modes/intave/SpeedIntave14.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleClickGui.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleHoleESP.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleHud.kt # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/ModuleScaffold.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/browser/supports/JcefBrowser.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/interop/protocol/rest/v1/client/ProxyFunctions.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/interop/protocol/rest/v1/client/SessionFunctions.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/interop/protocol/rest/v1/game/PlayerFunctions.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/interop/protocol/rest/v1/game/ServerListFunctions.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/ThemeManager.kt # src/main/kotlin/net/ccbluex/liquidbounce/utils/aiming/PointTracker.kt # src/main/kotlin/net/ccbluex/liquidbounce/utils/block/BlockExtensions.kt # src/main/kotlin/net/ccbluex/liquidbounce/utils/block/placer/BlockPlacerRotationModes.kt # src/main/kotlin/net/ccbluex/liquidbounce/utils/client/NetworkUtils.kt # src/main/kotlin/net/ccbluex/liquidbounce/utils/validation/HashValidator.kt
# Conflicts: # src/main/kotlin/net/ccbluex/liquidbounce/config/gson/GsonInstance.kt
|
||
} | ||
|
||
fun update(route: RouteType) { |
Check warning
Code scanning / detekt
Prefer splitting up complex methods into smaller, easier to understand methods. Warning
val availableThemes = arrayOf( | ||
NativeTheme, | ||
*themesFolder.listFiles()?.filter(File::isDirectory)?.map(::WebTheme)?.toTypedArray() ?: emptyArray() | ||
) |
Check warning
Code scanning / detekt
In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty. Warning
var activeComponents: MutableList<Component> = mutableListOf( | ||
// Weather we support web themes, it might also load native theme defaults instead | ||
*fallbackTheme.components | ||
// Check if the component is enabled by default | ||
.filter { factory -> factory.default } | ||
// Create a new component instance | ||
.map { factory -> factory.new(fallbackTheme) }.toTypedArray()) |
Check warning
Code scanning / detekt
In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty. Warning
} | ||
|
||
abstract fun load(): Boolean | ||
abstract fun draw(context: DrawContext, width: Int, height: Int, mouseX: Int, mouseY: Int, delta: Float): Boolean |
Check warning
Code scanning / detekt
The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists. Warning
} | ||
|
||
val matStack = MatrixStack() | ||
override fun render(context: DrawContext, delta: Float) { |
Check warning
Code scanning / detekt
One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand. Warning
import net.minecraft.client.gui.DrawContext | ||
|
||
class EmptyDrawableRoute : NativeDrawableRoute() { | ||
override fun render(context: DrawContext, delta: Float) {} |
Check warning
Code scanning / detekt
Empty block of code detected. As they serve no purpose they should be removed. Warning
* | ||
* @param jsonObject JsonObject | ||
*/ | ||
private fun configureConfigurable(configurable: Configurable, jsonObject: JsonObject) { |
Check warning
Code scanning / detekt
One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand. Warning
// todo: might replace this with serious deserialization | ||
when (type) { | ||
"BOOLEAN" -> { | ||
val default = jsonObject["default"].asBoolean |
Check warning
Code scanning / detekt
Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant. Warning
|
||
"INT" -> { | ||
val default = jsonObject["default"].asInt | ||
val min = jsonObject["range"].asJsonObject["min"].asInt |
Check warning
Code scanning / detekt
Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant. Warning
name.endsWith(".png") | ||
}?.associateBy { it.nameWithoutExtension }?.mapValues { (name, file) -> | ||
lazy { | ||
val identifier = Identifier.of("liquidbounce", "theme-${this.name.lowercase()}-texture-${name.lowercase()}") |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
# Conflicts: # src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/entity/MixinClientPlayerEntity.java # src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleRotations.kt
# Conflicts: # src/main/kotlin/net/ccbluex/liquidbounce/config/gson/serializer/ComponentSerializer.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/component/ComponentType.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/component/types/IntegratedComponent.kt # src/main/kotlin/net/ccbluex/liquidbounce/integration/theme/component/types/TextComponent.kt
Theme Sytem
Drawing Support
Component Overlay
Editor (Assign @SenkJu)
Wallpaper
LiquidBounce Theme
Generic Theme (Native)