Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RacoonDog authored and C10udburst committed Jul 26, 2022
1 parent cda7eef commit 12f2ecd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Meteor
modImplementation "meteordevelopment:meteor-client:SNAPSHOT"
modImplementation "meteordevelopment:meteor-client:0.5.0-SNAPSHOT"

// Required for loading logo hud element images
modImplementation "net.fabricmc.fabric-api:fabric-resource-loader-v0:+"
include "net.fabricmc.fabric-api:fabric-resource-loader-v0:+"
}

processResources {
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/me/ghosttypes/orion/Orion.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.ghosttypes.orion;


import com.mojang.logging.LogUtils;
import me.ghosttypes.orion.modules.chat.*;
import me.ghosttypes.orion.modules.hud.Logo;
import me.ghosttypes.orion.modules.hud.OrionHud;
Expand All @@ -24,7 +25,7 @@


public class Orion extends MeteorAddon {
public static final Logger LOG = LoggerFactory.getLogger("Orion");
public static final Logger LOG = LogUtils.getLogger();
public static final Category CATEGORY = new Category("Orion", Items.OBSIDIAN.getDefaultStack());
public static final HudGroup HUD_GROUP = new HudGroup("Orion");
public static final String VERSION = "0.1";
Expand All @@ -33,8 +34,6 @@ public class Orion extends MeteorAddon {
public void onInitialize() {
LOG.info("Initializing Orion");

MeteorClient.EVENT_BUS.registerLambdaFactory("me.ghosttypes.orion", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));

//Modules
Modules.get().add(new AutoBedCraft());
Modules.get().add(new AutoCityPlus());
Expand Down Expand Up @@ -66,6 +65,11 @@ public void onRegisterCategories() {
Modules.registerCategory(CATEGORY);
}

@Override
public String getPackage() {
return "me.ghosttypes.orion";
}

@Override
public String getWebsite() {
return "https://github.com/AntiCope/orion";
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/me/ghosttypes/orion/modules/hud/Logo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ public class Logo extends HudElement {

private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder().name("scale").description("The scale.").defaultValue(2).min(1).sliderMin(1).sliderMax(5).build());
private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder().name("scale").description("The scale.").defaultValue(2).min(1).sliderMin(1).sliderMax(5).onChanged(setting -> update()).build());
public final Setting<Boolean> chroma = sgGeneral.add(new BoolSetting.Builder().name("chroma").description("Chroma logo animation.").defaultValue(false).build());
private final Setting<Double> chromaSpeed = sgGeneral.add(new DoubleSetting.Builder().name("chroma-speed").description("Speed of the chroma animation.").defaultValue(0.09).min(0.01).sliderMax(5).decimalPlaces(2).build());
private final Setting<SettingColor> color = sgGeneral.add(new ColorSetting.Builder().name("background-color").description("Color of the background.").defaultValue(new SettingColor(255, 255, 255)).build());
private final Setting<Double> chromaSpeed = sgGeneral.add(new DoubleSetting.Builder().name("chroma-speed").description("Speed of the chroma animation.").defaultValue(0.09).min(0.01).sliderMax(5).decimalPlaces(2).onChanged(setting -> RAINBOW.setSpeed(setting / 100)).build());
private final Setting<SettingColor> color = sgGeneral.add(new ColorSetting.Builder().name("logo-color").description("Color of the logo.").defaultValue(new SettingColor(255, 255, 255)).build());

public Logo() {
super(INFO);
update();
RAINBOW.setSpeed(chromaSpeed.get() / 100);
}

public void update() {
setSize(78 * scale.get(), 96 * scale.get());
}
Expand All @@ -47,7 +48,6 @@ public void render(HudRenderer renderer) {
}
Renderer2D.TEXTURE.begin();
if (chroma.get()) {
RAINBOW.setSpeed(chromaSpeed.get() / 100);
Renderer2D.TEXTURE.texQuad(x, y, getWidth(), getHeight(), RAINBOW.getNext());
} else {
Renderer2D.TEXTURE.texQuad(x, y, getWidth(), getHeight(), color.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class OrionHud {
KILLS = addPreset("Kills", "Kills: #1{stats.kills}");
DEATHS = addPreset("Deaths", "Deaths: #1{stats.deaths}");
HIGHSCORE = addPreset("Highscore", "Highscore: #1{stats.highscore}");
KDRATIO = addPreset("KD", "K/D: : #1{stats.deaths == 0 ? stats.kills : round(stats.kills / stats.deaths, 2)}");
KDRATIO = addPreset("KD", "K/D: #1{stats.deaths == 0 ? stats.kills : round(stats.kills / stats.deaths, 2)}");
KILLSTREAK = addPreset("Kill Streak", "Kill Streak: #1{stats.kill_streak}");
}

Expand Down

0 comments on commit 12f2ecd

Please sign in to comment.