mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-13 10:00:19 -07:00
Final cleanup for 2.1 + Chatbox helms
This commit is contained in:
parent
f61852660a
commit
8de4f8d097
15 changed files with 4 additions and 43 deletions
|
|
@ -113,7 +113,7 @@ class plugin : Plugin() {
|
|||
private fun getConfig() {
|
||||
val cleanUsername = getCleanUserName()
|
||||
|
||||
println(cleanUsername)
|
||||
//println(cleanUsername)
|
||||
|
||||
// Abort if we are pre-login
|
||||
if (cleanUsername.isEmpty()) return
|
||||
|
|
|
|||
BIN
plugin-playground/src/main/kotlin/KondoKit/.DS_Store
vendored
BIN
plugin-playground/src/main/kotlin/KondoKit/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,15 +1,11 @@
|
|||
package KondoKit.pluginmanager
|
||||
|
||||
/**
|
||||
* Configuration object for GitLab API settings that can be shared between
|
||||
* GitLabPluginFetcher and PluginDownloadManager
|
||||
*/
|
||||
object GitLabConfig {
|
||||
const val GITLAB_PROJECT_ID = "38297322"
|
||||
const val GITLAB_PROJECT_PATH = "2009scape/tools/client-plugins" // Using path from DownloadManager
|
||||
const val GITLAB_PROJECT_PATH = "2009scape/tools/client-plugins"
|
||||
const val GITLAB_BRANCH = "master"
|
||||
|
||||
const val DEBUG = true // Set to false to disable debug logging
|
||||
const val DEBUG = false // Spams pretty hard
|
||||
|
||||
fun getGitLabApiBaseUrl(): String = "https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID"
|
||||
|
||||
|
|
@ -18,8 +14,7 @@ object GitLabConfig {
|
|||
|
||||
fun getRawFileUrl(filePath: String): String =
|
||||
"${getGitLabApiBaseUrl()}/repository/files/${filePath.replace("/", "%2F")}/raw?ref=${GITLAB_BRANCH}"
|
||||
|
||||
// Archive URL helper
|
||||
|
||||
fun getArchiveBaseUrl(): String =
|
||||
"https://gitlab.com/$GITLAB_PROJECT_PATH/-/archive/$GITLAB_BRANCH/${GITLAB_PROJECT_PATH.replace("/", "-")}-$GITLAB_BRANCH.zip"
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ object PluginDownloadManager {
|
|||
GitLabConfig.getArchiveUrlWithRefType(plugin.path),
|
||||
// Format 2: Using ref parameter
|
||||
GitLabConfig.getArchiveUrl(plugin.path),
|
||||
// Format 3: Direct archive URL without path parameter (we'll filter later)
|
||||
GitLabConfig.getArchiveBaseUrl()
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
package KondoKit.pluginmanager
|
||||
|
||||
/**
|
||||
* Shared lightweight logger so pluginmanager classes don't each redefine
|
||||
* their own debug helper tied to GitLabConfig.DEBUG.
|
||||
*/
|
||||
object PluginLogger {
|
||||
fun debug(tag: String, message: String) {
|
||||
if (GitLabConfig.DEBUG) {
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@ package KondoKit.ui
|
|||
|
||||
import javax.swing.JPanel
|
||||
|
||||
/**
|
||||
* Contract implemented by UI views; kept in a dedicated UI package to avoid tangling with concrete implementations.
|
||||
*/
|
||||
interface View {
|
||||
val name: String
|
||||
val iconSpriteId: Int
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ package KondoKit.ui
|
|||
import java.awt.Dimension
|
||||
import java.awt.Font
|
||||
|
||||
/**
|
||||
* Shared constants for fonts, dimensions, and colors across the entire KondoKit plugin.
|
||||
*/
|
||||
object ViewConstants {
|
||||
val FONT_RUNESCAPE_SMALL_16 = Font("RuneScape Small", Font.TRUETYPE_FONT, 16)
|
||||
val FONT_RUNESCAPE_SMALL_14 = Font("RuneScape Small", Font.PLAIN, 14)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@ package KondoKit.util
|
|||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* File-related helpers shared across the plugin to avoid ad-hoc copies.
|
||||
*/
|
||||
object FileUtils {
|
||||
fun deleteRecursively(file: File): Boolean {
|
||||
if (file.isDirectory) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import java.util.Timer
|
|||
import javax.swing.*
|
||||
|
||||
object Helpers {
|
||||
// Convenience helper for loading resources relative to the KondoKit plugin class
|
||||
fun openResource(path: String) = plugin::class.java.getResourceAsStream(path)
|
||||
|
||||
// Read a bundled resource as text using the given charset (UTF-8 by default)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ import java.io.IOException
|
|||
import java.net.HttpURLConnection
|
||||
import java.net.URL
|
||||
|
||||
/**
|
||||
* Lightweight helper for opening GET connections with shared defaults so callers don't repeat header setup.
|
||||
*/
|
||||
object HttpFetcher {
|
||||
const val DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ package KondoKit.util
|
|||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
|
||||
/**
|
||||
* Centralizes JSON parsing to reuse the same Gson configuration everywhere.
|
||||
*/
|
||||
object JsonParser {
|
||||
val gson: Gson = Gson()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import rt4.SoftwareSprite
|
|||
import java.awt.Color
|
||||
import java.awt.image.BufferedImage
|
||||
|
||||
// Define interfaces for common sprite types
|
||||
interface BaseSprite {
|
||||
val width: Int
|
||||
val height: Int
|
||||
|
|
@ -22,7 +21,6 @@ interface NonIndexedSprite : BaseSprite {
|
|||
val pixels: IntArray?
|
||||
}
|
||||
|
||||
// Adapter functions for existing sprite types
|
||||
fun adaptSoftwareSprite(sprite: SoftwareSprite): NonIndexedSprite {
|
||||
return object : NonIndexedSprite {
|
||||
override val width: Int = sprite.width
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package KondoKit.util
|
||||
|
||||
/**
|
||||
* Utility for mapping XP values to levels and vice versa.
|
||||
*/
|
||||
object XPTable {
|
||||
private val xpForLevels: IntArray = IntArray(100)
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import kotlin.math.ceil
|
|||
if it is implemented. Check GroundItems plugin for an example.
|
||||
*/
|
||||
|
||||
|
||||
object ReflectiveEditorView : View {
|
||||
var reflectiveEditorView: JPanel? = null
|
||||
const val VIEW_NAME = "REFLECTIVE_EDITOR_VIEW"
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ import javax.swing.Box
|
|||
import javax.swing.BoxLayout
|
||||
import javax.swing.JPanel
|
||||
|
||||
/**
|
||||
* Utility helpers shared across view implementations to avoid duplicating
|
||||
* common UI wiring such as search rows and vertical panel setup.
|
||||
*/
|
||||
object ViewLayoutHelpers {
|
||||
|
||||
data class SearchFieldSection(
|
||||
|
|
@ -63,9 +59,6 @@ object ViewLayoutHelpers {
|
|||
return SearchFieldSection(wrapper = wrapper, searchField = searchField)
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a BoxLayout.Y_AXIS panel with the default view background.
|
||||
*/
|
||||
fun createVerticalPanel(background: Color = VIEW_BACKGROUND_COLOR): JPanel {
|
||||
return JPanel().apply {
|
||||
layout = BoxLayout(this, BoxLayout.Y_AXIS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue