-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'hannibal002/beta' into petapi-v2
- Loading branch information
Showing
174 changed files
with
3,219 additions
and
2,221 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
34 changes: 34 additions & 0 deletions
34
buildSrc/src/main/kotlin/skyhannibuildsystem/DownloadBackupRepo.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package skyhannibuildsystem | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import java.net.URL | ||
|
||
// Code taken from NotEnoughUpdates | ||
abstract class DownloadBackupRepo : DefaultTask() { | ||
|
||
@get:OutputDirectory | ||
abstract val outputDirectory: DirectoryProperty | ||
|
||
@get:Input | ||
abstract var branch: String | ||
|
||
@get:Internal | ||
val repoFile get() = outputDirectory.get().asFile.resolve("assets/skyhanni/repo.zip") | ||
|
||
@TaskAction | ||
fun downloadRepo() { | ||
val downloadUrl = URL("https://github.com/hannibal002/SkyHanni-Repo/archive/refs/heads/$branch.zip") | ||
val file = repoFile | ||
file.parentFile.mkdirs() | ||
file.outputStream().use { out -> | ||
downloadUrl.openStream().use { inp -> | ||
inp.copyTo(out) | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
19 changes: 19 additions & 0 deletions
19
src/main/java/at/hannibal2/skyhanni/config/core/elements/GuiElement.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package at.hannibal2.skyhanni.config.core.elements | ||
|
||
import net.minecraft.client.gui.Gui | ||
|
||
abstract class GuiElement : Gui() { | ||
abstract fun render(x: Int, y: Int) | ||
|
||
abstract val width: Int | ||
|
||
abstract val height: Int | ||
|
||
open fun mouseClicked(mouseX: Int, mouseY: Int, mouseButton: Int) {} | ||
|
||
fun mouseClickMove(mouseX: Int, mouseY: Int, clickedMouseButton: Int, timeSinceLastClick: Long) {} | ||
|
||
fun otherComponentClick() {} | ||
|
||
fun keyTyped(typedChar: Char, keyCode: Int) {} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/at/hannibal2/skyhanni/config/core/elements/GuiElementButton.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package at.hannibal2.skyhanni.config.core.elements | ||
|
||
import java.awt.Color | ||
|
||
class GuiElementButton(text: String, colour: Int, private val callback: Runnable) : GuiElementText(text, colour) { | ||
|
||
override val height: Int | ||
get() = super.height + 5 | ||
|
||
override val width: Int | ||
get() = super.width + 10 | ||
|
||
override fun mouseClicked(mouseX: Int, mouseY: Int, mouseButton: Int) { | ||
callback.run() | ||
} | ||
|
||
override fun render(x: Int, y: Int) { | ||
drawRect(x, y, x + width, y + super.height, Color.WHITE.rgb) | ||
drawRect(x + 1, y + 1, x + width - 1, y + super.height - 1, Color.BLACK.rgb) | ||
super.render(x + 5, y - 1) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/at/hannibal2/skyhanni/config/core/elements/GuiElementText.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package at.hannibal2.skyhanni.config.core.elements | ||
|
||
import net.minecraft.client.Minecraft | ||
|
||
open class GuiElementText(var text: String, private val colour: Int) : GuiElement() { | ||
|
||
override val height: Int | ||
get() = 18 | ||
|
||
override val width: Int | ||
get() { | ||
val fr = Minecraft.getMinecraft().fontRendererObj | ||
return fr.getStringWidth(text) | ||
} | ||
|
||
override fun render(x: Int, y: Int) { | ||
val fr = Minecraft.getMinecraft().fontRendererObj | ||
|
||
fr.drawString(text, x, y + 6, colour) | ||
} | ||
} |
This file contains 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
This file contains 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
20 changes: 20 additions & 0 deletions
20
src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWarpMenuConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package at.hannibal2.skyhanni.config.features.event.hoppity; | ||
|
||
import at.hannibal2.skyhanni.config.FeatureToggle; | ||
import com.google.gson.annotations.Expose; | ||
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; | ||
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; | ||
|
||
public class HoppityWarpMenuConfig { | ||
|
||
@Expose | ||
@ConfigOption(name = "Show uniques in Warp Menu", desc = "Shows your unique eggs in the Warp Menu during the hoppity event.") | ||
@ConfigEditorBoolean | ||
@FeatureToggle | ||
public boolean enabled = true; | ||
|
||
@Expose | ||
@ConfigOption(name = "Hide when maxed", desc = "Stops the above feature from working when the island is complete.") | ||
@ConfigEditorBoolean | ||
public boolean hideWhenMaxed = true; | ||
} |
This file contains 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
Oops, something went wrong.