From 86be867fdd55055892366335d74572ae1701bb78 Mon Sep 17 00:00:00 2001 From: core Date: Fri, 14 Jul 2023 23:49:03 -0400 Subject: [PATCH] client base --- .gitignore | 118 +++++ LICENSE | 2 + build.gradle | 98 ++++ gradle.properties | 17 + gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 245 +++++++++ gradlew.bat | 92 ++++ settings.gradle | 9 + .../dev/coredoes/coreclient/CoreClient.java | 69 +++ .../dev/coredoes/coreclient/gui/Category.java | 108 ++++ .../dev/coredoes/coreclient/gui/ClickGUI.java | 496 ++++++++++++++++++ .../coreclient/gui/module/ClickGUIModule.java | 40 ++ .../gui/module/HUDEditorModule.java | 17 + .../coreclient/gui/module/LogoModule.java | 48 ++ .../coreclient/gui/module/Module.java | 62 +++ .../coreclient/gui/module/TabGUIModule.java | 49 ++ .../gui/module/WatermarkModule.java | 68 +++ .../gui/setting/BooleanSetting.java | 20 + .../coreclient/gui/setting/ColorSetting.java | 59 +++ .../coreclient/gui/setting/DoubleSetting.java | 39 ++ .../coreclient/gui/setting/EnumSetting.java | 60 +++ .../gui/setting/IntegerSetting.java | 38 ++ .../gui/setting/KeybindSetting.java | 30 ++ .../coreclient/gui/setting/Setting.java | 52 ++ .../coreclient/gui/setting/StringSetting.java | 10 + .../assets/coreclient/panelstudio.png | 1 + src/main/resources/coreclient.mixins.json | 13 + src/main/resources/fabric.mod.json | 30 ++ 28 files changed, 1896 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle create mode 100644 src/main/java/dev/coredoes/coreclient/CoreClient.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/Category.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/ClickGUI.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/ClickGUIModule.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/HUDEditorModule.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/Module.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/TabGUIModule.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/module/WatermarkModule.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/BooleanSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/ColorSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/DoubleSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/EnumSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/IntegerSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/KeybindSetting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/Setting.java create mode 100644 src/main/java/dev/coredoes/coreclient/gui/setting/StringSetting.java create mode 100644 src/main/resources/assets/coreclient/panelstudio.png create mode 100644 src/main/resources/coreclient.mixins.json create mode 100644 src/main/resources/fabric.mod.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c37caf --- /dev/null +++ b/.gitignore @@ -0,0 +1,118 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Cache of project +.gradletasknamecache + +**/build/ + +# Common working directory +run/ + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..03bf91a --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +Copyright (c) 2023 c0repwn3r +All rights reserved. diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..87faadb --- /dev/null +++ b/build.gradle @@ -0,0 +1,98 @@ +plugins { + id 'fabric-loom' version '1.2-SNAPSHOT' + id 'maven-publish' + id 'com.github.johnrengelman.shadow' version '8.1.1' +} + +version = project.mod_version +group = project.maven_group + +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. + maven { + name = "lukflug" + url = "https://lukflug.github.io/maven/" + } + maven { + name = "meteor-maven" + url = "https://maven.meteordev.org/releases" + } +} + +dependencies { + // To change the versions see the gradle.properties file + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + + // Fabric API. This is technically optional, but you probably want it anyway. + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + + implementation "com.lukflug:panelstudio:0.2.4" + implementation "com.lukflug:panelstudio-mc20:0.2.4" + implementation "meteordevelopment:orbit:0.2.3" +} + +processResources { + inputs.property "version", project.version + inputs.property "minecraft_version", project.minecraft_version + inputs.property "loader_version", project.loader_version + filteringCharset "UTF-8" + + filesMatching("fabric.mod.json") { + expand "version": project.version, + "minecraft_version": project.minecraft_version, + "loader_version": project.loader_version + } +} + +def targetJavaVersion = 17 +tasks.withType(JavaCompile).configureEach { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + it.options.encoding = "UTF-8" + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { + it.options.release = targetJavaVersion + } +} + +java { + def javaVersion = JavaVersion.toVersion(targetJavaVersion) + if (JavaVersion.current() < javaVersion) { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + } + archivesBaseName = project.archives_base_name + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() +} + +jar { + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } +} + +// configure the maven publication +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..740de46 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,17 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx1G + +# Fabric Properties + # check these on https://modmuss50.me/fabric.html + minecraft_version=1.20.1 + yarn_mappings=1.20.1+build.9 + loader_version=0.14.21 + +# Mod Properties + mod_version = 1.0-SNAPSHOT + maven_group = dev.coredoes + archives_base_name = coreclient + +# Dependencies + # check this on https://modmuss50.me/fabric.html + fabric_version=0.85.0+1.20.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..37aef8d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..aeb74cb --- /dev/null +++ b/gradlew @@ -0,0 +1,245 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..6689b85 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..f91a4fe --- /dev/null +++ b/settings.gradle @@ -0,0 +1,9 @@ +pluginManagement { + repositories { + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + gradlePluginPortal() + } +} diff --git a/src/main/java/dev/coredoes/coreclient/CoreClient.java b/src/main/java/dev/coredoes/coreclient/CoreClient.java new file mode 100644 index 0000000..e029358 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/CoreClient.java @@ -0,0 +1,69 @@ +package dev.coredoes.coreclient; + +import dev.coredoes.coreclient.gui.Category; +import dev.coredoes.coreclient.gui.ClickGUI; +import dev.coredoes.coreclient.gui.module.*; +import meteordevelopment.orbit.EventBus; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; +import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; +import net.minecraft.client.MinecraftClient; +import org.lwjgl.glfw.GLFW; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.invoke.MethodHandles; + +public class CoreClient implements ClientModInitializer { + public static final Logger LOGGER = LoggerFactory.getLogger("coreclient"); + + public static EventBus eventBus; + + private static ClickGUI gui; + private boolean inited=false; + private final boolean[] keys =new boolean[266]; + + @Override + public void onInitializeClient() { + LOGGER.info("Hello, world! CoreClient is loading up"); + + LOGGER.info("[Stage 1/4: BusInit] Creating plugin event bus"); + eventBus = new EventBus(); + eventBus.registerLambdaFactory("dev.coredoes.coreclient", ((lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()))); + + LOGGER.info("[Stage 2/4: GuiCategoryInit] Initializing Category"); + + Category.init(); + + LOGGER.info("[Stage 3/4: GuiModuleInit] Registering Modules"); + + Category.OTHER.modules.add(new ClickGUIModule()); + Category.OTHER.modules.add(new HUDEditorModule()); + Category.HUD.modules.add(new TabGUIModule()); + Category.HUD.modules.add(new WatermarkModule()); + Category.HUD.modules.add(new LogoModule()); + + LOGGER.info("[Stage 4/4: GuiEventInit] Registering GUI events"); + + ClientTickEvents.END_CLIENT_TICK.register(client -> { + if (!inited) { + for (int i=32;igui.render()); + inited=true; + } + for (int i=32;i modules=new ArrayList(); + public static Random random=new Random(); + + private Category (String displayName) { + this.displayName=displayName; + } + + public static void init() { + for (Category category: Category.values()) { + int count=random.nextInt(6)+5; + for (int i=0;i getModules() { + return modules.stream().map(module->module); + } + + public static IClient getClient() { + return new IClient() { + @Override + public Stream getCategories() { + return Arrays.stream(Category.values()); + } + }; + } + + public static Module generateRandomModule() { + Module module=new Module(generateRandomName(5,10),generateRandomName(10,20),()->true,random.nextInt(2)==0); + int count=random.nextInt(6)+5; + for (int i=0;i generateRandomSetting() { + String displayName=generateRandomName(5,10); + String description=generateRandomName(10,20); + int type=random.nextInt(6); + int min=random.nextInt(50),max=random.nextInt(50)+50; + boolean alpha=random.nextInt(2)==0; + boolean rainbow=random.nextInt(2)==0; + Color color=new Color(random.nextInt(256),random.nextInt(256),random.nextInt(256),alpha?random.nextInt(256):255); + switch (type) { + case 0: + return new BooleanSetting(displayName,displayName,description,()->true,random.nextInt(2)==0); + case 1: + return new ColorSetting(displayName,displayName,description,()->true,alpha,rainbow,color,rainbow?random.nextInt(2)==0:false); + case 2: + return new DoubleSetting(displayName,displayName,description,()->true,min,max,random.nextDouble()*(max-min)+min); + case 4: + return new IntegerSetting(displayName,displayName,description,()->true,min,max,random.nextInt(max-min+1)+min); + default: + return new StringSetting(displayName,displayName,description,()->true,generateRandomName(5,10)); + } + }; + + public static String generateRandomName (int min, int max) { + int length=random.nextInt(max-min+1)+min; + String s=""; + for (int i=0;i animation=()->new SettingsAnimation(()-> ClickGUIModule.animationSpeed.getValue(),()->inter.getTime()); + // Populating HUD ... + gui.addHUDComponent(TabGUIModule.getComponent(client,new IContainer() { + @Override + public boolean addComponent (IFixedComponent component) { + return gui.addHUDComponent(component,()->true); + } + + @Override + public boolean addComponent (IFixedComponent component, IBoolean visible) { + return gui.addHUDComponent(component,visible); + } + + @Override + public boolean removeComponent (IFixedComponent component) { + return gui.removeComponent(component); + } + },animation),TabGUIModule.getToggle(),animation.get(),theme,BORDER); + gui.addHUDComponent(WatermarkModule.getComponent(),WatermarkModule.getToggle(),animation.get(),theme,BORDER); + gui.addHUDComponent(LogoModule.getComponent(inter),LogoModule.getToggle(),animation.get(),theme,BORDER); + + // Creating popup types ... + BiFunction scrollHeight=(context,componentHeight)->Math.min(componentHeight,Math.max(HEIGHT*4,ClickGUI.this.height-context.getPos().y-HEIGHT)); + PopupTuple popupType=new PopupTuple(new PanelPositioner(new Point(0,0)),false,new IScrollSize() { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return scrollHeight.apply(context,componentHeight); + } + }); + PopupTuple colorPopup=new PopupTuple(new CenteredPositioner(()->new Rectangle(new Point(0,0),inter.getWindowSize())),true,new IScrollSize() { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return scrollHeight.apply(context,componentHeight); + } + }); + // Defining resize behavior ... + IntFunction resizable=width->new IResizable() { + Dimension size=new Dimension(width,320); + + @Override + public Dimension getSize() { + return new Dimension(size); + } + + @Override + public void setSize (Dimension size) { + this.size.width=size.width; + this.size.height=size.height; + if (size.width<75) this.size.width=75; + if (size.height<50) this.size.height=50; + } + }; + // Defining scroll behavior ... + Function resizableHeight=size->new IScrollSize() { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return size.getSize().height; + } + }; + // Defining function keys ... + IntPredicate keybindKey=scancode->scancode==GLFW.GLFW_KEY_DELETE; + IntPredicate charFilter=character->{ + return character>=' '; + }; + ITextFieldKeys keys=new ITextFieldKeys() { + @Override + public boolean isBackspaceKey (int scancode) { + return scancode==GLFW.GLFW_KEY_BACKSPACE; + } + + @Override + public boolean isDeleteKey (int scancode) { + return scancode==GLFW.GLFW_KEY_DELETE; + } + + @Override + public boolean isInsertKey (int scancode) { + return scancode==GLFW.GLFW_KEY_INSERT; + } + + @Override + public boolean isLeftKey (int scancode) { + return scancode==GLFW.GLFW_KEY_LEFT; + } + + @Override + public boolean isRightKey (int scancode) { + return scancode==GLFW.GLFW_KEY_RIGHT; + } + + @Override + public boolean isHomeKey (int scancode) { + return scancode==GLFW.GLFW_KEY_HOME; + } + + @Override + public boolean isEndKey (int scancode) { + return scancode==GLFW.GLFW_KEY_END; + } + + @Override + public boolean isCopyKey (int scancode) { + return scancode==GLFW.GLFW_KEY_C; + } + + @Override + public boolean isPasteKey (int scancode) { + return scancode==GLFW.GLFW_KEY_V; + } + + @Override + public boolean isCutKey (int scancode) { + return scancode==GLFW.GLFW_KEY_X; + } + + @Override + public boolean isAllKey (int scancode) { + return scancode==GLFW.GLFW_KEY_A; + } + }; + + // Normal generator + IComponentGenerator generator=new ComponentGenerator(keybindKey,charFilter,keys); + // Use cycle switches instead of buttons + IComponentGenerator cycleGenerator=new ComponentGenerator(keybindKey,charFilter,keys) { + @Override + public IComponent getEnumComponent (IEnumSetting setting, Supplier animation, IComponentAdder adder, ThemeTuple theme, int colorLevel, boolean isContainer) { + return new CycleSwitch(setting,theme.getCycleSwitchRenderer(isContainer)); + } + }; + // Use all the fancy widgets with text boxes + IComponentGenerator csgoGenerator=new ComponentGenerator(keybindKey,charFilter,keys) { + @Override + public IComponent getBooleanComponent (IBooleanSetting setting, Supplier animation, IComponentAdder adder, ThemeTuple theme, int colorLevel, boolean isContainer) { + return new ToggleSwitch(setting,theme.getToggleSwitchRenderer(isContainer)); + } + + @Override + public IComponent getEnumComponent (IEnumSetting setting, Supplier animation, IComponentAdder adder, ThemeTuple theme, int colorLevel, boolean isContainer) { + return new DropDownList(setting,theme,isContainer,false,keys,new IScrollSize(){},adder::addPopup) { + @Override + protected Animation getAnimation() { + return animation.get(); + } + + @Override + public boolean allowCharacter (char character) { + return charFilter.test(character); + } + + @Override + protected boolean isUpKey (int key) { + return key==GLFW.GLFW_KEY_UP; + } + + @Override + protected boolean isDownKey (int key) { + return key==GLFW.GLFW_KEY_DOWN; + } + + @Override + protected boolean isEnterKey (int key) { + return key==GLFW.GLFW_KEY_ENTER; + } + }; + } + + @Override + public IComponent getNumberComponent (INumberSetting setting, Supplier animation, IComponentAdder adder, ThemeTuple theme, int colorLevel, boolean isContainer) { + return new Spinner(setting,theme,isContainer,true,keys); + } + + @Override + public IComponent getColorComponent (IColorSetting setting, Supplier animation, IComponentAdder adder, ThemeTuple theme, int colorLevel, boolean isContainer) { + return new ColorPickerComponent(setting,new ThemeTuple(theme.theme,theme.logicalLevel,colorLevel)); + } + }; + + // Classic Panel + IComponentAdder classicPanelAdder=new PanelAdder(gui,false,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.ClassicPanel,title->"classicPanel_"+title) { + @Override + protected IResizable getResizable (int width) { + return resizable.apply(width); + } + + @Override + protected IScrollSize getScrollSize (IResizable size) { + return resizableHeight.apply(size); + } + }; + ILayout classicPanelLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->ChildMode.DOWN,level->ChildMode.DOWN,popupType); + classicPanelLayout.populateGUI(classicPanelAdder,generator,client,theme); + // Pop-up Panel + IComponentAdder popupPanelAdder=new PanelAdder(gui,false,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.PopupPanel,title->"popupPanel_"+title) { + @Override + protected IResizable getResizable (int width) { + return resizable.apply(width); + } + + @Override + protected IScrollSize getScrollSize (IResizable size) { + return resizableHeight.apply(size); + } + }; + ILayout popupPanelLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->ChildMode.POPUP,level->ChildMode.DOWN,popupType); + popupPanelLayout.populateGUI(popupPanelAdder,generator,client,theme); + // Draggable Panel + IComponentAdder draggablePanelAdder=new PanelAdder(gui,false,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.DraggablePanel,title->"draggablePanel_"+title) { + @Override + protected IResizable getResizable (int width) { + return resizable.apply(width); + } + + @Override + protected IScrollSize getScrollSize (IResizable size) { + return resizableHeight.apply(size); + } + }; + ILayout draggablePanelLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->level==0?ChildMode.DRAG_POPUP:ChildMode.DOWN,level->ChildMode.DOWN,popupType); + draggablePanelLayout.populateGUI(draggablePanelAdder,generator,client,theme); + // Single Panel + IComponentAdder singlePanelAdder=new SinglePanelAdder(gui,new Labeled("Example Menu",null,()->true),theme,new Point(10,10),WIDTH*Category.values().length,animation,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.SinglePanel,"singlePanel") { + @Override + protected IResizable getResizable (int width) { + return resizable.apply(width); + } + + @Override + protected IScrollSize getScrollSize (IResizable size) { + return resizableHeight.apply(size); + } + }; + ILayout singlePanelLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->ChildMode.DOWN,level->ChildMode.DOWN,popupType); + singlePanelLayout.populateGUI(singlePanelAdder,generator,client,theme); + // Panel Menu + IComponentAdder panelMenuAdder=new StackedPanelAdder(gui,new Labeled("Example Menu",null,()->true),theme,new Point(10,10),WIDTH,animation,ChildMode.POPUP,new PanelPositioner(new Point(0,0)),()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.PanelMenu,"panelMenu"); + ILayout panelMenuLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->ChildMode.POPUP,level->ChildMode.POPUP,popupType); + panelMenuLayout.populateGUI(panelMenuAdder,generator,client,theme); + // Color Panel + IComponentAdder colorPanelAdder=new PanelAdder(gui,false,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.ColorPanel,title->"colorPanel_"+title) { + @Override + protected IResizable getResizable (int width) { + return resizable.apply(width); + } + + @Override + protected IScrollSize getScrollSize (IResizable size) { + return resizableHeight.apply(size); + } + }; + ILayout colorPanelLayout=new PanelLayout(WIDTH,new Point(DISTANCE,DISTANCE),(WIDTH+DISTANCE)/2,HEIGHT+DISTANCE,animation,level->ChildMode.DOWN,level->ChildMode.POPUP,colorPopup); + colorPanelLayout.populateGUI(colorPanelAdder,cycleGenerator,client,theme); + // Horizontal CSGO + AtomicReference horizontalResizable=new AtomicReference(null); + IComponentAdder horizontalCSGOAdder=new PanelAdder(gui,true,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.CSGOHorizontal,title->"horizontalCSGO_"+title) { + @Override + protected IResizable getResizable (int width) { + horizontalResizable.set(resizable.apply(width)); + return horizontalResizable.get(); + } + }; + ILayout horizontalCSGOLayout=new CSGOLayout(new Labeled("Example",null,()->true),new Point(100,100),480,WIDTH,animation,"Enabled",true,true,2,ChildMode.POPUP,colorPopup) { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return resizableHeight.apply(horizontalResizable.get()).getScrollHeight(null,height); + } + }; + horizontalCSGOLayout.populateGUI(horizontalCSGOAdder,csgoGenerator,client,theme); + // Vertical CSGO + AtomicReference verticalResizable=new AtomicReference(null); + IComponentAdder verticalCSGOAdder=new PanelAdder(gui,true,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.CSGOVertical,title->"verticalCSGO_"+title) { + @Override + protected IResizable getResizable (int width) { + verticalResizable.set(resizable.apply(width)); + return verticalResizable.get(); + } + }; + ILayout verticalCSGOLayout=new CSGOLayout(new Labeled("Example",null,()->true),new Point(100,100),480,WIDTH,animation,"Enabled",false,true,2,ChildMode.POPUP,colorPopup) { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return resizableHeight.apply(verticalResizable.get()).getScrollHeight(null,height); + } + }; + verticalCSGOLayout.populateGUI(verticalCSGOAdder,csgoGenerator,client,theme); + // Category CSGO + AtomicReference categoryResizable=new AtomicReference(null); + IComponentAdder categoryCSGOAdder=new PanelAdder(gui,true,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.CSGOCategory,title->"categoryCSGO_"+title) { + @Override + protected IResizable getResizable (int width) { + categoryResizable.set(resizable.apply(width)); + return categoryResizable.get(); + } + }; + ILayout categoryCSGOLayout=new CSGOLayout(new Labeled("Example",null,()->true),new Point(100,100),480,WIDTH,animation,"Enabled",false,false,2,ChildMode.POPUP,colorPopup) { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return resizableHeight.apply(categoryResizable.get()).getScrollHeight(null,height); + } + }; + categoryCSGOLayout.populateGUI(categoryCSGOAdder,csgoGenerator,client,theme); + // Searchable CSGO + AtomicReference searchableResizable=new AtomicReference(null); + IComponentAdder searchableCSGOAdder=new PanelAdder(gui,true,()->ClickGUIModule.layout.getValue()==ClickGUIModule.Layout.SearchableCSGO,title->"searchableCSGO_"+title) { + @Override + protected IResizable getResizable (int width) { + searchableResizable.set(resizable.apply(width)); + return searchableResizable.get(); + } + }; + ILayout searchableCSGOLayout=new SearchableLayout(new Labeled("Example",null,()->true),new Labeled("Search",null,()->true),new Point(100,100),480,WIDTH,animation,"Enabled",2,ChildMode.POPUP,colorPopup,(a,b)->a.getDisplayName().compareTo(b.getDisplayName()),charFilter,keys) { + @Override + public int getScrollHeight (Context context, int componentHeight) { + return resizableHeight.apply(searchableResizable.get()).getScrollHeight(null,height); + } + }; + searchableCSGOLayout.populateGUI(searchableCSGOAdder,csgoGenerator,client,theme); + } + + @Override + protected HUDGUI getGUI() { + return gui; + } + + @Override + protected GUIInterface getInterface() { + return inter; + } + + @Override + protected int getScrollSpeed() { + return ClickGUIModule.scrollSpeed.getValue(); + } + + + private class ThemeSelector implements IThemeMultiplexer { + protected Map themes=new EnumMap(ClickGUIModule.Theme.class); + + public ThemeSelector (IInterface inter) { + BooleanSetting clearGradient=new BooleanSetting("Gradient","gradient","Whether the title bars should have a gradient.",()->ClickGUIModule.theme.getValue()==Theme.Clear,true); + BooleanSetting ignoreDisabled=new BooleanSetting("Ignore Disabled","ignoreDisabled","Have the rainbow drawn for disabled containers.",()->ClickGUIModule.theme.getValue()==Theme.Rainbow,false); + BooleanSetting buttonRainbow=new BooleanSetting("Button Rainbow","buttonRainbow","Have a separate rainbow for each component.",()->ClickGUIModule.theme.getValue()==Theme.Rainbow,false); + IntegerSetting rainbowGradient=new IntegerSetting("Rainbow Gradient","rainbowGradient","How fast the rainbow should repeat.",()->ClickGUIModule.theme.getValue()==Theme.Rainbow,150,50,300); + ClickGUIModule.theme.subSettings.add(clearGradient); + ClickGUIModule.theme.subSettings.add(ignoreDisabled); + ClickGUIModule.theme.subSettings.add(buttonRainbow); + ClickGUIModule.theme.subSettings.add(rainbowGradient); + addTheme(Theme.Clear,new ClearTheme(new ThemeScheme(Theme.Clear),()->clearGradient.getValue(),9,3,1,": "+Formatting.GRAY)); + addTheme(Theme.GameSense,new GameSenseTheme(new ThemeScheme(Theme.GameSense),9,4,5,": "+Formatting.GRAY)); + addTheme(Theme.Rainbow,new RainbowTheme(new ThemeScheme(Theme.Rainbow),()->ignoreDisabled.getValue(),()->buttonRainbow.getValue(),()->rainbowGradient.getValue(),9,3,": "+Formatting.GRAY)); + addTheme(Theme.Windows31,new Windows31Theme(new ThemeScheme(Theme.Windows31),9,2,9,": "+Formatting.DARK_GRAY)); + addTheme(Theme.Impact,new ImpactTheme(new ThemeScheme(Theme.Impact),9,4)); + } + + @Override + public ITheme getTheme() { + return themes.getOrDefault(ClickGUIModule.theme.getValue(),themes.get(Theme.GameSense)); + } + + private void addTheme (Theme key, ITheme value) { + themes.put(key,new OptimizedTheme(value)); + value.loadAssets(inter); + } + + + private class ThemeScheme implements IColorScheme { + private final Theme themeValue; + private final String themeName; + + public ThemeScheme (Theme themeValue) { + this.themeValue=themeValue; + this.themeName=themeValue.toString().toLowerCase(); + } + + @Override + public void createSetting (ITheme theme, String name, String description, boolean hasAlpha, boolean allowsRainbow, Color color, boolean rainbow) { + ClickGUIModule.theme.subSettings.add(new ColorSetting(name,themeName+"-"+name,description,()->ClickGUIModule.theme.getValue()==themeValue,hasAlpha,allowsRainbow,color,rainbow)); + } + + @Override + public Color getColor (String name) { + return ((ColorSetting)ClickGUIModule.theme.subSettings.stream().filter(setting->setting.configName.equals(themeName+"-"+name)).findFirst().orElse(null)).getValue(); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/ClickGUIModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/ClickGUIModule.java new file mode 100644 index 0000000..d910940 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/ClickGUIModule.java @@ -0,0 +1,40 @@ +package dev.coredoes.coreclient.gui.module; + +import org.lwjgl.glfw.GLFW; + +import dev.coredoes.coreclient.gui.setting.EnumSetting; +import dev.coredoes.coreclient.gui.setting.IntegerSetting; +import dev.coredoes.coreclient.gui.setting.KeybindSetting; + +public class ClickGUIModule extends Module { + public static final EnumSetting colorModel=new EnumSetting("Color Model","colorModel","Whether to use RGB or HSB.",()->true,ColorModel.RGB,ColorModel.class); + public static final IntegerSetting rainbowSpeed=new IntegerSetting("Rainbow Speed","rainbowSpeed","The speed of the color hue cycling.",()->true,1,100,32); + public static final IntegerSetting scrollSpeed=new IntegerSetting("Scroll Speed","scrollSpeed","The speed of scrolling.",()->true,0,20,10); + public static final IntegerSetting animationSpeed=new IntegerSetting("Animation Speed","animationSpeed","The speed of GUI animations.",()->true,0,1000,200); + public static final EnumSetting theme=new EnumSetting("Theme","theme","What theme to use.",()->true,Theme.GameSense,Theme.class); + public static final EnumSetting layout=new EnumSetting("Layout","layout","What layout to use.",()->true,Layout.ClassicPanel,Layout.class); + public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_O); + + public ClickGUIModule() { + super("ClickGUI","Module containing ClickGUI settings.",()->true,false); + settings.add(colorModel); + settings.add(rainbowSpeed); + settings.add(scrollSpeed); + settings.add(animationSpeed); + settings.add(theme); + settings.add(layout); + settings.add(keybind); + } + + public enum ColorModel { + RGB,HSB; + } + + public enum Theme { + Clear,GameSense,Rainbow,Windows31,Impact; + } + + public enum Layout { + ClassicPanel,PopupPanel,DraggablePanel,SinglePanel,PanelMenu,ColorPanel,CSGOHorizontal,CSGOVertical,CSGOCategory,SearchableCSGO; + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/HUDEditorModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/HUDEditorModule.java new file mode 100644 index 0000000..45ef0fa --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/HUDEditorModule.java @@ -0,0 +1,17 @@ +package dev.coredoes.coreclient.gui.module; + +import org.lwjgl.glfw.GLFW; + +import dev.coredoes.coreclient.gui.setting.BooleanSetting; +import dev.coredoes.coreclient.gui.setting.KeybindSetting; + +public class HUDEditorModule extends Module { + public static final BooleanSetting showHUD=new BooleanSetting("Show HUD Panels","showHUD","Whether to show the HUD panels in the ClickGUI.",()->true,true); + public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_P); + + public HUDEditorModule() { + super("HUDEditor","Module containing HUDEditor settings.",()->true,false); + settings.add(showHUD); + settings.add(keybind); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java new file mode 100644 index 0000000..0f81674 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java @@ -0,0 +1,48 @@ +package dev.coredoes.coreclient.gui.module; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; + +import dev.coredoes.coreclient.gui.setting.BooleanSetting; +import dev.coredoes.coreclient.gui.setting.ColorSetting; +import dev.coredoes.coreclient.gui.setting.IntegerSetting; +import com.lukflug.panelstudio.base.Context; +import com.lukflug.panelstudio.base.IInterface; +import com.lukflug.panelstudio.base.IToggleable; +import com.lukflug.panelstudio.component.IFixedComponent; +import com.lukflug.panelstudio.hud.HUDComponent; + +public class LogoModule extends Module { + private static LogoModule instance; + private static final IntegerSetting rotation=new IntegerSetting("Image Rotation","rotation","How to rotate the image.",()->true,0,3,0); + private static final BooleanSetting parity=new BooleanSetting("Flip Image","parity","Whether to flip the image or not.",()->true,false); + private static final ColorSetting color=new ColorSetting("Logo Color","color","The color to modulate the logo with.",()->true,true,true,new Color(255,255,255,128),true); + + public LogoModule() { + super("Logo","Module that displays the PanelStudio icon on HUD.",()->true,true); + instance=this; + settings.add(rotation); + settings.add(parity); + settings.add(color); + } + + public static IFixedComponent getComponent (IInterface inter) { + int image=inter.loadImage("panelstudio.png"); + return new HUDComponent(()->"Logo",new Point(300,300),"logo") { + @Override + public void render (Context context) { + super.render(context); + context.getInterface().drawImage(context.getRect(),rotation.getValue(),parity.getValue(),image,color.getValue()); + } + + @Override + public Dimension getSize (IInterface inter) { + return new Dimension(141,61); + } + }; + } + + public static IToggleable getToggle() { + return instance.isEnabled(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/Module.java b/src/main/java/dev/coredoes/coreclient/gui/module/Module.java new file mode 100644 index 0000000..7a803a4 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/Module.java @@ -0,0 +1,62 @@ +package dev.coredoes.coreclient.gui.module; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import dev.coredoes.coreclient.gui.setting.Setting; +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.base.IToggleable; +import com.lukflug.panelstudio.setting.IModule; +import com.lukflug.panelstudio.setting.ISetting; + +public class Module implements IModule { + public final String displayName,description; + public final IBoolean visible; + public final List> settings=new ArrayList>(); + public final boolean toggleable; + private boolean enabled=false; + + public Module (String displayName, String description, IBoolean visible, boolean toggleable) { + this.displayName=displayName; + this.description=description; + this.visible=visible; + this.toggleable=toggleable; + } + + @Override + public String getDisplayName() { + return displayName; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public IBoolean isVisible() { + return visible; + } + + @Override + public IToggleable isEnabled() { + if (!toggleable) return null; + return new IToggleable() { + @Override + public boolean isOn() { + return enabled; + } + + @Override + public void toggle() { + enabled=!enabled; + } + }; + } + + @Override + public Stream> getSettings() { + return settings.stream().filter(setting->setting instanceof ISetting).sorted((a,b)->a.displayName.compareTo(b.displayName)).map(setting->(ISetting)setting); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/TabGUIModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/TabGUIModule.java new file mode 100644 index 0000000..5b9fa3e --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/TabGUIModule.java @@ -0,0 +1,49 @@ +package dev.coredoes.coreclient.gui.module; + +import java.awt.Color; +import java.awt.Point; +import java.util.function.Supplier; + +import org.lwjgl.glfw.GLFW; + +import dev.coredoes.coreclient.gui.setting.ColorSetting; +import com.lukflug.panelstudio.base.Animation; +import com.lukflug.panelstudio.base.IToggleable; +import com.lukflug.panelstudio.component.IFixedComponent; +import com.lukflug.panelstudio.container.IContainer; +import com.lukflug.panelstudio.setting.IClient; +import com.lukflug.panelstudio.tabgui.ITabGUITheme; +import com.lukflug.panelstudio.tabgui.StandardTheme; +import com.lukflug.panelstudio.tabgui.TabGUI; +import com.lukflug.panelstudio.theme.IColorScheme; +import com.lukflug.panelstudio.theme.ITheme; + +public class TabGUIModule extends Module { + private static TabGUIModule instance; + private static ITabGUITheme theme; + + public TabGUIModule() { + super("TabGUI","HUD module that lets toggle modules.",()->true,true); + instance=this; + theme=new StandardTheme(new IColorScheme() { + @Override + public void createSetting(ITheme theme, String name, String description, boolean hasAlpha, boolean allowsRainbow, Color color, boolean rainbow) { + ColorSetting setting=new ColorSetting(name,name,description,()->true,allowsRainbow,hasAlpha,color,rainbow); + instance.settings.add(setting); + } + + @Override + public Color getColor (String name) { + return (Color)instance.settings.stream().filter(setting->setting.configName.equals(name)).findFirst().orElse(null).getValue(); + } + },75,9,2,5); + } + + public static IFixedComponent getComponent (IClient client, IContainer container, Supplier animation) { + return new TabGUI(()->"TabGUI",client,theme,container,animation,key->key==GLFW.GLFW_KEY_UP,key->key==GLFW.GLFW_KEY_DOWN,key->key==GLFW.GLFW_KEY_ENTER||key==GLFW.GLFW_KEY_RIGHT,key->key==GLFW.GLFW_KEY_LEFT,new Point(10,10),"tabGUI").getWrappedComponent(); + } + + public static IToggleable getToggle() { + return instance.isEnabled(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/WatermarkModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/WatermarkModule.java new file mode 100644 index 0000000..a5752f9 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/module/WatermarkModule.java @@ -0,0 +1,68 @@ +package dev.coredoes.coreclient.gui.module; + +import java.awt.Color; +import java.awt.Point; + +import dev.coredoes.coreclient.gui.setting.BooleanSetting; +import dev.coredoes.coreclient.gui.setting.ColorSetting; +import dev.coredoes.coreclient.gui.setting.StringSetting; +import com.lukflug.panelstudio.base.IToggleable; +import com.lukflug.panelstudio.component.IFixedComponent; +import com.lukflug.panelstudio.hud.HUDList; +import com.lukflug.panelstudio.hud.ListComponent; + +public class WatermarkModule extends Module { + private static WatermarkModule instance; + private static final ColorSetting color=new ColorSetting("Text Color","color","The color of the displayed text.",()->true,false,true,new Color(0,0,255),false); + private static final BooleanSetting sortUp=new BooleanSetting("Sort Up","sortUp","Whether to align the text from the bottom up.",()->true,false); + private static final BooleanSetting sortRight=new BooleanSetting("Sort Right","sortRight","Whether to align the text from right to left.",()->true,false); + private static final StringSetting line1=new StringSetting("First Line","line1","The first line of text.",()->true,"PanelStudio"); + private static final StringSetting line2=new StringSetting("Second Line","line2","The second line of text.",()->true,"Example Mod"); + private static final StringSetting line3=new StringSetting("Third Line","line3","The third line of text.",()->true,"made by lukflug"); + + public WatermarkModule() { + super("Watermark","Module that displays text on HUD.",()->true,true); + instance=this; + settings.add(color); + settings.add(sortUp); + settings.add(sortRight); + settings.add(line1); + settings.add(line2); + settings.add(line3); + } + + public static IFixedComponent getComponent() { + return new ListComponent(()->"Watermark",new Point(300,10),"watermark",new HUDList() { + @Override + public int getSize() { + return 3; + } + + @Override + public String getItem(int index) { + if (index==0) return line1.getValue(); + else if (index==1) return line2.getValue(); + else return line3.getValue(); + } + + @Override + public Color getItemColor(int index) { + return color.getValue(); + } + + @Override + public boolean sortUp() { + return sortUp.getValue(); + } + + @Override + public boolean sortRight() { + return sortRight.getValue(); + } + },9,2); + } + + public static IToggleable getToggle() { + return instance.isEnabled(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/BooleanSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/BooleanSetting.java new file mode 100644 index 0000000..a47c2da --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/BooleanSetting.java @@ -0,0 +1,20 @@ +package dev.coredoes.coreclient.gui.setting; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.IBooleanSetting; + +public class BooleanSetting extends Setting implements IBooleanSetting { + public BooleanSetting (String displayName, String configName, String description, IBoolean visible, Boolean value) { + super(displayName,configName,description,visible,value); + } + + @Override + public void toggle() { + setValue(!getValue()); + } + + @Override + public boolean isOn() { + return getValue(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/ColorSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/ColorSetting.java new file mode 100644 index 0000000..50b7ff8 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/ColorSetting.java @@ -0,0 +1,59 @@ +package dev.coredoes.coreclient.gui.setting; +import java.awt.Color; + +import dev.coredoes.coreclient.gui.module.ClickGUIModule; +import dev.coredoes.coreclient.gui.module.ClickGUIModule.ColorModel; +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.IColorSetting; +import com.lukflug.panelstudio.theme.ITheme; + +public class ColorSetting extends Setting implements IColorSetting { + public final boolean hasAlpha,allowsRainbow; + private boolean rainbow; + + public ColorSetting (String displayName, String configName, String description, IBoolean visible, boolean hasAlpha, boolean allowsRainbow, Color value, boolean rainbow) { + super(displayName,configName,description,visible,value); + this.hasAlpha=hasAlpha; + this.allowsRainbow=allowsRainbow; + this.rainbow=rainbow; + } + + @Override + public Color getValue() { + if (rainbow) { + int speed=ClickGUIModule.rainbowSpeed.getValue(); + return ITheme.combineColors(Color.getHSBColor((System.currentTimeMillis()%(360*speed))/(float)(360*speed),1,1),super.getValue()); + } + else return super.getValue(); + } + + @Override + public Color getColor() { + return super.getValue(); + } + + @Override + public boolean getRainbow() { + return rainbow; + } + + @Override + public void setRainbow (boolean rainbow) { + this.rainbow=rainbow; + } + + @Override + public boolean hasAlpha() { + return hasAlpha; + } + + @Override + public boolean allowsRainbow() { + return allowsRainbow; + } + + @Override + public boolean hasHSBModel() { + return ClickGUIModule.colorModel.getValue()==ColorModel.HSB; + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/DoubleSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/DoubleSetting.java new file mode 100644 index 0000000..16ef651 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/DoubleSetting.java @@ -0,0 +1,39 @@ +package dev.coredoes.coreclient.gui.setting; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.INumberSetting; + +public class DoubleSetting extends Setting implements INumberSetting { + public final double min,max; + + public DoubleSetting (String displayName, String configName, String description, IBoolean visible, double min, double max, double value) { + super(displayName,configName,description,visible,value); + this.min=min; + this.max=max; + } + + @Override + public double getNumber() { + return getValue(); + } + + @Override + public void setNumber (double value) { + setValue(value); + } + + @Override + public double getMaximumValue() { + return max; + } + + @Override + public double getMinimumValue() { + return min; + } + + @Override + public int getPrecision() { + return 2; + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/EnumSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/EnumSetting.java new file mode 100644 index 0000000..1109932 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/EnumSetting.java @@ -0,0 +1,60 @@ +package dev.coredoes.coreclient.gui.setting; +import java.util.Arrays; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.IEnumSetting; +import com.lukflug.panelstudio.setting.ILabeled; + +public class EnumSetting> extends Setting implements IEnumSetting { + private final Class settingClass; + private final ILabeled[] array; + + public EnumSetting (String displayName, String configName, String description, IBoolean visible, E value, Class settingClass) { + super(displayName,configName,description,visible,value); + this.settingClass=settingClass; + array=Arrays.stream(settingClass.getEnumConstants()).map(v->{ + return new ILabeled() { + @Override + public String getDisplayName() { + return v.toString(); + } + }; + }).toArray(ILabeled[]::new); + } + + @Override + public void increment() { + E[] array=settingClass.getEnumConstants(); + int index=getValue().ordinal()+1; + if (index>=array.length) index=0; + setValue(array[index]); + } + + @Override + public void decrement() { + E[] array=settingClass.getEnumConstants(); + int index=getValue().ordinal()-1; + if (index<0) index=array.length-1; + setValue(array[index]); + } + + @Override + public String getValueName() { + return getValue().toString(); + } + + @Override + public int getValueIndex() { + return getValue().ordinal(); + } + + @Override + public void setValueIndex(int index) { + setValue(settingClass.getEnumConstants()[index]); + } + + @Override + public ILabeled[] getAllowedValues() { + return array; + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/IntegerSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/IntegerSetting.java new file mode 100644 index 0000000..2927a5c --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/IntegerSetting.java @@ -0,0 +1,38 @@ +package dev.coredoes.coreclient.gui.setting; +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.INumberSetting; + +public class IntegerSetting extends Setting implements INumberSetting { + public final int min,max; + + public IntegerSetting (String displayName, String configName, String description, IBoolean visible, int min, int max, int value) { + super(displayName,configName,description,visible,value); + this.min=min; + this.max=max; + } + + @Override + public double getNumber() { + return getValue(); + } + + @Override + public void setNumber (double value) { + setValue((int)Math.round(value)); + } + + @Override + public double getMaximumValue() { + return max; + } + + @Override + public double getMinimumValue() { + return min; + } + + @Override + public int getPrecision() { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/KeybindSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/KeybindSetting.java new file mode 100644 index 0000000..20f00e1 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/KeybindSetting.java @@ -0,0 +1,30 @@ +package dev.coredoes.coreclient.gui.setting; +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.IKeybindSetting; + +import net.minecraft.client.util.InputUtil; +import net.minecraft.text.TranslatableTextContent; + +public class KeybindSetting extends Setting implements IKeybindSetting { + public KeybindSetting (String displayName, String configName, String description, IBoolean visible, Integer value) { + super(displayName,configName,description,visible,value); + } + + @Override + public int getKey() { + return getValue(); + } + + @Override + public void setKey (int key) { + setValue(key); + } + + @Override + public String getKeyName() { + String translationKey=InputUtil.Type.KEYSYM.createFromCode(getKey()).getTranslationKey(); + String translation=new TranslatableTextContent(translationKey,null,TranslatableTextContent.EMPTY_ARGUMENTS).toString(); + if (!translation.equals(translationKey)) return translation; + return InputUtil.Type.KEYSYM.createFromCode(getKey()).getLocalizedText().getString(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/Setting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/Setting.java new file mode 100644 index 0000000..1d41233 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/Setting.java @@ -0,0 +1,52 @@ +package dev.coredoes.coreclient.gui.setting; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.ILabeled; +import com.lukflug.panelstudio.setting.ISetting; + +public abstract class Setting implements ILabeled { + public final String displayName,configName,description; + public final IBoolean visible; + public final List> subSettings=new ArrayList>(); + private T value; + + public Setting (String displayName, String configName, String description, IBoolean visible, T value) { + this.displayName=displayName; + this.configName=configName; + this.description=description; + this.visible=visible; + this.value=value; + } + + public T getValue() { + return value; + } + + public void setValue (T value) { + this.value=value; + } + + @Override + public String getDisplayName() { + return displayName; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public IBoolean isVisible() { + return visible; + } + + public Stream> getSubSettings() { + if (subSettings.size()==0) return null; + return subSettings.stream().filter(setting->setting instanceof ISetting).sorted((a,b)->a.displayName.compareTo(b.displayName)).map(setting->(ISetting)setting); + } +} \ No newline at end of file diff --git a/src/main/java/dev/coredoes/coreclient/gui/setting/StringSetting.java b/src/main/java/dev/coredoes/coreclient/gui/setting/StringSetting.java new file mode 100644 index 0000000..51304fb --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/gui/setting/StringSetting.java @@ -0,0 +1,10 @@ +package dev.coredoes.coreclient.gui.setting; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.setting.IStringSetting; + +public class StringSetting extends Setting implements IStringSetting { + public StringSetting (String displayName, String configName, String description, IBoolean visible, String value) { + super(displayName,configName,description,visible,value); + } +} \ No newline at end of file diff --git a/src/main/resources/assets/coreclient/panelstudio.png b/src/main/resources/assets/coreclient/panelstudio.png new file mode 100644 index 0000000..d1fdefc --- /dev/null +++ b/src/main/resources/assets/coreclient/panelstudio.png @@ -0,0 +1 @@ +{"payload":{"allShortcutsEnabled":false,"fileTree":{"example-mod20/src/main/resources/assets/examplemod":{"items":[{"name":"panelstudio.png","path":"example-mod20/src/main/resources/assets/examplemod/panelstudio.png","contentType":"file"}],"totalCount":1},"example-mod20/src/main/resources/assets":{"items":[{"name":"examplemod","path":"example-mod20/src/main/resources/assets/examplemod","contentType":"directory"}],"totalCount":1},"example-mod20/src/main/resources":{"items":[{"name":"assets","path":"example-mod20/src/main/resources/assets","contentType":"directory"},{"name":"fabric.mod.json","path":"example-mod20/src/main/resources/fabric.mod.json","contentType":"file"}],"totalCount":2},"example-mod20/src/main":{"items":[{"name":"java","path":"example-mod20/src/main/java","contentType":"directory"},{"name":"resources","path":"example-mod20/src/main/resources","contentType":"directory"}],"totalCount":2},"example-mod20/src":{"items":[{"name":"main","path":"example-mod20/src/main","contentType":"directory"}],"totalCount":1},"example-mod20":{"items":[{"name":"gradle","path":"example-mod20/gradle","contentType":"directory"},{"name":"src","path":"example-mod20/src","contentType":"directory"},{"name":"build.gradle","path":"example-mod20/build.gradle","contentType":"file"},{"name":"gradle.properties","path":"example-mod20/gradle.properties","contentType":"file"},{"name":"gradlew","path":"example-mod20/gradlew","contentType":"file"},{"name":"gradlew.bat","path":"example-mod20/gradlew.bat","contentType":"file"},{"name":"settings.gradle","path":"example-mod20/settings.gradle","contentType":"file"}],"totalCount":7},"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"example-mod12","path":"example-mod12","contentType":"directory"},{"name":"example-mod16-fabric","path":"example-mod16-fabric","contentType":"directory"},{"name":"example-mod16-forge","path":"example-mod16-forge","contentType":"directory"},{"name":"example-mod17","path":"example-mod17","contentType":"directory"},{"name":"example-mod18","path":"example-mod18","contentType":"directory"},{"name":"example-mod19","path":"example-mod19","contentType":"directory"},{"name":"example-mod194","path":"example-mod194","contentType":"directory"},{"name":"example-mod20","path":"example-mod20","contentType":"directory"},{"name":"example-mod8-fabric","path":"example-mod8-fabric","contentType":"directory"},{"name":"example-mod8-forge","path":"example-mod8-forge","contentType":"directory"},{"name":"gradle","path":"gradle","contentType":"directory"},{"name":"panelstudio-mc12","path":"panelstudio-mc12","contentType":"directory"},{"name":"panelstudio-mc16-fabric","path":"panelstudio-mc16-fabric","contentType":"directory"},{"name":"panelstudio-mc16-forge","path":"panelstudio-mc16-forge","contentType":"directory"},{"name":"panelstudio-mc17","path":"panelstudio-mc17","contentType":"directory"},{"name":"panelstudio-mc19","path":"panelstudio-mc19","contentType":"directory"},{"name":"panelstudio-mc194","path":"panelstudio-mc194","contentType":"directory"},{"name":"panelstudio-mc20","path":"panelstudio-mc20","contentType":"directory"},{"name":"panelstudio-mc8-fabric","path":"panelstudio-mc8-fabric","contentType":"directory"},{"name":"panelstudio-mc8-forge","path":"panelstudio-mc8-forge","contentType":"directory"},{"name":"panelstudio","path":"panelstudio","contentType":"directory"},{"name":"screenshots","path":"screenshots","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"build.gradle","path":"build.gradle","contentType":"file"},{"name":"gradle.properties","path":"gradle.properties","contentType":"file"},{"name":"gradlew","path":"gradlew","contentType":"file"},{"name":"gradlew.bat","path":"gradlew.bat","contentType":"file"},{"name":"settings.gradle","path":"settings.gradle","contentType":"file"}],"totalCount":31}},"fileTreeProcessingTime":30.196659,"foldersToFetch":[],"reducedMotionEnabled":null,"repo":{"id":308924891,"defaultBranch":"main","name":"PanelStudio","ownerLogin":"lukflug","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2020-10-31T16:32:25.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/47392064?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"c37842afb75cb613aa0694cbc31ad98940486658","listCacheKey":"v0:1686429073.285436","canEdit":false,"refType":"tree","currentOid":"c37842afb75cb613aa0694cbc31ad98940486658"},"path":"example-mod20/src/main/resources/assets/examplemod/panelstudio.png","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/lukflug/PanelStudio/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null,"repoAlertsPath":"/lukflug/PanelStudio/security/dependabot","repoSecurityAndAnalysisPath":"/lukflug/PanelStudio/settings/security_analysis","repoOwnerIsOrg":false,"currentUserCanAdminRepo":false},"displayName":"panelstudio.png","displayUrl":"https://github.com/lukflug/PanelStudio/blob/c37842afb75cb613aa0694cbc31ad98940486658/example-mod20/src/main/resources/assets/examplemod/panelstudio.png?raw=true","headerInfo":{"blobSize":"21.1 KB","deleteInfo":{"deletePath":null,"deleteTooltip":"You must be signed in to make or propose changes"},"editInfo":{"editTooltip":"You must be signed in to make or propose changes"},"ghDesktopPath":null,"gitLfsPath":null,"onBranch":false,"shortPath":"5cf536a","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Flukflug%2FPanelStudio%2Fblob%2Fc37842afb75cb613aa0694cbc31ad98940486658%2Fexample-mod20%2Fsrc%2Fmain%2Fresources%2Fassets%2Fexamplemod%2Fpanelstudio.png","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":null,"truncatedSloc":null},"mode":"file"},"image":true,"isCodeownersFile":null,"isValidLegacyIssueTemplate":false,"issueTemplateHelpUrl":"https://docs.github.com/articles/about-issue-and-pull-request-templates","issueTemplate":null,"discussionTemplate":null,"language":null,"large":false,"loggedIn":false,"newDiscussionPath":"/lukflug/PanelStudio/discussions/new","newIssuePath":"/lukflug/PanelStudio/issues/new","planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/lukflug/PanelStudio/blob/c37842afb75cb613aa0694cbc31ad98940486658/example-mod20/src/main/resources/assets/examplemod/panelstudio.png","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","dismissStackNoticePath":"/settings/dismiss-notice/publish_stack_from_file","releasePath":"/lukflug/PanelStudio/releases/new?marketplace=true","showPublishActionBanner":false,"showPublishStackBanner":false},"renderImageOrRaw":true,"richText":null,"renderedFileInfo":null,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"repoOwner":"lukflug","repoName":"PanelStudio","showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","showDependabotConfigurationBanner":false,"actionsOnboardingTip":null},"truncated":false,"viewable":false,"workflowRedirectUrl":null,"symbols":null},"copilotUserAccess":null,"csrf_tokens":{"/lukflug/PanelStudio/branches":{"post":"Srunpz5lnX6FnTihPnYDbdZfXuWLELccRYyYZS5yQz6y6prbF7QOHGU3DL0nMT5V3lYQJlDf_c1Zp-x0WacILw"}}},"title":"PanelStudio/example-mod20/src/main/resources/assets/examplemod/panelstudio.png at c37842afb75cb613aa0694cbc31ad98940486658 · lukflug/PanelStudio","locale":"en"} \ No newline at end of file diff --git a/src/main/resources/coreclient.mixins.json b/src/main/resources/coreclient.mixins.json new file mode 100644 index 0000000..a6d5346 --- /dev/null +++ b/src/main/resources/coreclient.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "dev.coredoes.coreclient.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + ], + "client": [ + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..be49cac --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "coreclient", + "version": "${version}", + "name": "coreclient", + "description": "An epic client mod", + "authors": [ + "c0repwn3r" + ], + "contact": { + "website": "https://coredoes.dev/coreclient", + "repo": "https://git.e3t.cc/~core/coreclient" + }, + "license": "All-Rights-Reserved", + "icon": "assets/coreclient/icon.png", + "environment": "client", + "entrypoints": { + "client": [ + "dev.coredoes.coreclient.CoreClient" + ] + }, + "mixins": [ + "coreclient.mixins.json" + ], + "depends": { + "fabricloader": ">=${loader_version}", + "fabric": "*", + "minecraft": "${minecraft_version}" + } +}