generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci] Remove splash screen and add suggestion text (#6)
* Re-organize code and disable splash overlay * Add suggestion text to search bar
- Loading branch information
Showing
9 changed files
with
91 additions
and
21 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/club/chachy/lazylanguageloader/client/impl/utils/Constants.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,7 @@ | ||
package club.chachy.lazylanguageloader.client.impl.utils; | ||
|
||
public class Constants { | ||
public static final String SUGGESTION_TEXT = "Search for a language"; | ||
|
||
public static final String TRUNCATION_MARKER = "..."; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...s/MixinReloadableResourceManagerImpl.java → ...g/MixinReloadableResourceManagerImpl.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
27 changes: 27 additions & 0 deletions
27
...lub/chachy/lazylanguageloader/client/mixin/optimizations/splash/MixinMinecraftClient.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,27 @@ | ||
package club.chachy.lazylanguageloader.client.mixin.optimizations.splash; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.Overlay; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.client.gui.screen.SplashOverlay; | ||
import net.minecraft.client.gui.screen.option.LanguageOptionsScreen; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(MinecraftClient.class) | ||
public class MixinMinecraftClient { | ||
@Shadow | ||
@Nullable | ||
public Screen currentScreen; | ||
|
||
@Inject(method = "setOverlay", at = @At("HEAD"), cancellable = true) | ||
private void lazyLanguageLoader$$setOverlay(Overlay overlay, CallbackInfo ci) { | ||
if (overlay instanceof SplashOverlay && currentScreen instanceof LanguageOptionsScreen) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...mixin/searchbar/MixinEntryListWidget.java → ...in/ui/searchbar/MixinEntryListWidget.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
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
2 changes: 1 addition & 1 deletion
2
...chbar/accessor/LanguageEntryAccessor.java → ...chbar/accessor/LanguageEntryAccessor.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
Empty file.
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