aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-03-29 23:10:54 +0100
committerGitHub <noreply@github.com>2024-03-29 23:10:54 +0100
commitd54e1bb0625c8d786a687707371f31e4ac62c9d0 (patch)
tree1bea05a5f63b2c810a504c669c11a9a0b53ea03d /src/main/java/at/hannibal2/skyhanni
parent0c0740a5c224e6ac815339b01a31f9c528c4feff (diff)
downloadskyhanni-d54e1bb0625c8d786a687707371f31e4ac62c9d0.tar.gz
skyhanni-d54e1bb0625c8d786a687707371f31e4ac62c9d0.tar.bz2
skyhanni-d54e1bb0625c8d786a687707371f31e4ac62c9d0.zip
Add persian SkyHanni support (#1310)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/dev/DebugConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt7
3 files changed, 27 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index 5b44c1b12..7da53c5a2 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -18,10 +18,13 @@ import at.hannibal2.skyhanni.config.features.rift.RiftConfig;
import at.hannibal2.skyhanni.config.features.skillprogress.SkillProgressConfig;
import at.hannibal2.skyhanni.config.features.slayer.SlayerConfig;
import at.hannibal2.skyhanni.config.storage.Storage;
+import at.hannibal2.skyhanni.utils.LorenzUtils;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.Config;
import io.github.moulberry.moulconfig.Social;
import io.github.moulberry.moulconfig.annotations.Category;
+import io.github.moulberry.moulconfig.gui.HorizontalAlign;
+import io.github.moulberry.moulconfig.processor.ProcessedCategory;
import net.minecraft.util.ResourceLocation;
import java.util.Arrays;
@@ -39,6 +42,13 @@ public class Features extends Config {
}
@Override
+ public HorizontalAlign alignCategory(ProcessedCategory category, boolean isSelected) {
+ if (LorenzUtils.INSTANCE.isAprilFoolsDay())
+ return HorizontalAlign.RIGHT;
+ return super.alignCategory(category, isSelected);
+ }
+
+ @Override
public List<Social> getSocials() {
return Arrays.asList(
Social.forLink("Discord", DISCORD, "https://discord.com/invite/skyhanni-997079228510117908"),
@@ -54,7 +64,11 @@ public class Features extends Config {
@Override
public String getTitle() {
- return "SkyHanni " + SkyHanniMod.getVersion() + " by §channibal2§r, config by §5Moulberry §rand §5nea89";
+ String modName = "SkyHanni";
+ if (LorenzUtils.INSTANCE.isAprilFoolsDay())
+ modName = new StringBuilder().append("اسکای هانی").reverse().toString(); // Minecraft does not render RTL strings very nicely, so we reverse the string here. Not authentic, but close enough.
+
+ return modName + " " + SkyHanniMod.getVersion() + " by §channibal2§r, config by §5Moulberry §rand §5nea89";
}
/*
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DebugConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DebugConfig.java
index 97d378e2d..ba57d123c 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DebugConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DebugConfig.java
@@ -119,5 +119,10 @@ public class DebugConfig {
public boolean currentAreaDebug = true;
@Expose
+ @ConfigOption(name = "Always April Fools", desc = "Always show april fools jokes.")
+ @ConfigEditorBoolean
+ public boolean alwaysFunnyTime = false;
+
+ @Expose
public Position trackSoundPosition = new Position(0, 0);
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index de6793c10..6249ec54a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -28,6 +28,8 @@ import net.minecraft.util.ChatComponentText
import net.minecraftforge.fml.common.FMLCommonHandler
import java.text.DecimalFormat
import java.text.SimpleDateFormat
+import java.time.LocalDate
+import java.time.Month
import java.util.Timer
import java.util.TimerTask
import java.util.regex.Matcher
@@ -67,6 +69,11 @@ object LorenzUtils {
val lastWorldSwitch get() = HypixelData.joinedWorld
+ val isAprilFoolsDay: Boolean
+ get() = SkyHanniMod.feature.dev.debug.alwaysFunnyTime || LocalDate.now().let {
+ it.month == Month.APRIL && it.dayOfMonth == 1
+ }
+
fun SimpleDateFormat.formatCurrentTime(): String = this.format(System.currentTimeMillis())
fun stripVanillaMessage(originalMessage: String): String {