mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 21:02:15 +00:00
Stop hardcoding some translations (#2049)
This commit is contained in:
1 parent
2f64fef6a6
commit
e6bbd155da
10 files changed
+37
-53
No files matched your search
@@ -29,7 +29,7 @@ public class Zoom {
|
||||
private static long zoomLerpLastNano = 0L;
|
||||
|
||||
@Getter
|
||||
private static final KeyBinding zoomKey = new KeyBinding("Zoom", 0, "key.categories.misc");
|
||||
private static final KeyBinding zoomKey = new KeyBinding("angelica.keybind.zoom", 0, "key.categories.misc");
|
||||
|
||||
private static boolean zoomEnabled = false;
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ public class NotFineConfig {
|
||||
private static final String CATEGORY_TOGGLE = "toggle";
|
||||
private static final String CATEGORY_UNFINISHED = "unfinished";
|
||||
|
||||
public static boolean allowAdvancedOpenGL;
|
||||
public static boolean allowToggle3DAnaglyph;
|
||||
public static boolean allowToggleFBO;
|
||||
|
||||
public static boolean betterBlockFaceCulling;
|
||||
public static boolean renderPass;
|
||||
@@ -23,12 +21,7 @@ public class NotFineConfig {
|
||||
File configFile = new File(Launch.minecraftHome + File.separator + "config" + File.separator + NotFine.MODID + File.separator + "notfine.cfg");
|
||||
Configuration config = new Configuration(configFile);
|
||||
|
||||
allowAdvancedOpenGL = config.getBoolean("allowAdvancedOpenGL", CATEGORY_GENERAL, false,
|
||||
"Allow Advanced OpenGL to be enabled when it might be supported.");
|
||||
allowToggle3DAnaglyph = config.getBoolean("allowToggle3DAnaglyph", CATEGORY_GENERAL, true,
|
||||
"Allow 3D Anaglyph to be enabled.");
|
||||
allowToggleFBO = config.getBoolean("allowToggleFBO", CATEGORY_GENERAL, false,
|
||||
"Allow FBOs to be disabled.");
|
||||
allowToggle3DAnaglyph = config.getBoolean("allowToggle3DAnaglyph", CATEGORY_GENERAL, true, "Allow 3D Anaglyph to be enabled.");
|
||||
|
||||
config.setCategoryComment(CATEGORY_TOGGLE, "Toggle mod features.");
|
||||
betterBlockFaceCulling = config.getBoolean("betterBlockFaceCulling", CATEGORY_TOGGLE, true,
|
||||
@@ -43,10 +36,7 @@ public class NotFineConfig {
|
||||
config.save();
|
||||
}
|
||||
|
||||
//These will probably break hard with Angelica.
|
||||
//AdvancedOpenGL even breaks hard on its own.
|
||||
allowAdvancedOpenGL = false;
|
||||
allowToggleFBO = false;
|
||||
//This will probably break hard with Angelica.
|
||||
renderPass = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,21 +243,6 @@ public class NotFineGameOptionPages {
|
||||
List<OptionGroup> groups = new ArrayList<>();
|
||||
|
||||
groups.add(OptionGroup.createBuilder()
|
||||
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
|
||||
.setName(I18n.format("options.advancedOpengl"))
|
||||
.setTooltip(I18n.format("sodium.options.advanced_opengl.tooltip"))
|
||||
.setControl(TickBoxControl::new)
|
||||
.setBinding((opts, value) -> opts.advancedOpengl = value, opts -> opts.advancedOpengl)
|
||||
.setImpact(OptionImpact.VARIES)
|
||||
.setEnabled(NotFineConfig.allowAdvancedOpenGL)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
|
||||
.setName(I18n.format("options.fboEnable"))
|
||||
.setTooltip(I18n.format("sodium.options.fbo.tooltip"))
|
||||
.setControl(TickBoxControl::new)
|
||||
.setBinding((opts, value) -> opts.fboEnable = value, opts -> opts.fboEnable)
|
||||
.setEnabled(NotFineConfig.allowToggleFBO)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
|
||||
.setName(I18n.format("options.anaglyph"))
|
||||
.setTooltip(I18n.format("sodium.options.anaglyph.tooltip"))
|
||||
|
||||
@@ -18,15 +18,9 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
if(!NotFineConfig.allowAdvancedOpenGL) {
|
||||
Minecraft.getMinecraft().gameSettings.advancedOpengl = false;
|
||||
}
|
||||
if(!NotFineConfig.allowToggle3DAnaglyph) {
|
||||
Minecraft.getMinecraft().gameSettings.anaglyph = false;
|
||||
}
|
||||
if(!NotFineConfig.allowToggleFBO) {
|
||||
Minecraft.getMinecraft().gameSettings.fboEnable = true;
|
||||
}
|
||||
|
||||
for(Settings setting : Settings.values()) {
|
||||
setting.ready();
|
||||
|
||||
+3
-3
@@ -105,9 +105,9 @@ public class ReeseSodiumVideoOptionsScreen extends SodiumOptionsGUI {
|
||||
final Dim2i applyButtonDim = new Dim2i(tabFrameDim.getLimitX() - 134, tabFrameDim.getLimitY() + 5, 65, 20);
|
||||
final Dim2i closeButtonDim = new Dim2i(tabFrameDim.getLimitX() - 65, tabFrameDim.getLimitY() + 5, 65, 20);
|
||||
|
||||
this.undoButton = new FlatButtonWidget(undoButtonDim, "Undo", this::undoChanges);
|
||||
this.applyButton = new FlatButtonWidget(applyButtonDim, "Apply", this::applyChanges);
|
||||
this.closeButton = new FlatButtonWidget(closeButtonDim, "Close", this::onClose);
|
||||
this.undoButton = new FlatButtonWidget(undoButtonDim, I18n.format("sodium.options.buttons.undo"), this::undoChanges);
|
||||
this.applyButton = new FlatButtonWidget(applyButtonDim, I18n.format("sodium.options.buttons.apply"), this::applyChanges);
|
||||
this.closeButton = new FlatButtonWidget(closeButtonDim, I18n.format("gui.done"), this::onClose);
|
||||
|
||||
// Pre-compute button text and widths to avoid duplicate calculations
|
||||
final String irisText = Iris.enabled ? I18n.format(IrisApi.getInstance().getMainScreenLanguageKey()) : null;
|
||||
|
||||
+1
-5
@@ -93,11 +93,7 @@ public class SearchTextFieldComponent extends AbstractWidget {
|
||||
return;
|
||||
}
|
||||
if (!this.isFocused() && this.text.isEmpty()) {
|
||||
final String key = "rso.search_bar_empty";
|
||||
String text = I18n.format(key);
|
||||
if (text.equals(key))
|
||||
text = "Search options...";
|
||||
this.textRenderer.drawString(text, this.dim.getOriginX() + 6, this.dim.getOriginY() + 6, 0xFFAAAAAA);
|
||||
this.textRenderer.drawString(I18n.format("rso.search_bar_empty"), this.dim.getOriginX() + 6, this.dim.getOriginY() + 6, 0xFFAAAAAA);
|
||||
}
|
||||
|
||||
drawRect(this.dim.getOriginX(), this.dim.getOriginY(), this.dim.getLimitX(), this.dim.getLimitY(), this.isFocused() ? 0xE0000000 : 0x90000000);
|
||||
|
||||
@@ -303,9 +303,10 @@ public class SodiumGameOptionPages {
|
||||
.add(OptionImpl.createBuilder(StreamingUploader.UploadStrategy.class, sodiumOpts)
|
||||
.setName(I18n.format("sodium.options.upload_method.name"))
|
||||
.setTooltip(I18n.format("sodium.options.upload_method.tooltip"))
|
||||
.setControl(o ->
|
||||
new CyclingControl<>(o, StreamingUploader.UploadStrategy.class, StreamingUploader.UploadStrategy.values())
|
||||
)
|
||||
.setControl(o -> new CyclingControl<>(o, StreamingUploader.UploadStrategy.class, new String[]{
|
||||
I18n.format("sodium.options.upload_method.buffer_data"),
|
||||
I18n.format("sodium.options.upload_method.buffer_subdata"),
|
||||
I18n.format("sodium.options.upload_method.map_buffer") }))
|
||||
.setBinding((opts, value) -> opts.advanced.streamingUploadStrategy = value, opts -> opts.advanced.streamingUploadStrategy)
|
||||
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
|
||||
.setImpact(OptionImpact.VARIES)
|
||||
@@ -409,7 +410,10 @@ public class SodiumGameOptionPages {
|
||||
.add(OptionImpl.createBuilder(AsyncOcclusionMode.class, sodiumOpts)
|
||||
.setName(I18n.format("sodium.options.async_occlusion_mode.name"))
|
||||
.setTooltip(I18n.format("sodium.options.async_occlusion_mode.tooltip"))
|
||||
.setControl(o -> new CyclingControl<>(o, AsyncOcclusionMode.class, new String[]{"None", "Only Shadow", "Everything"}))
|
||||
.setControl(o -> new CyclingControl<>(o, AsyncOcclusionMode.class, new String[]{
|
||||
I18n.format("sodium.options.async_occlusion_mode.none"),
|
||||
I18n.format("sodium.options.async_occlusion_mode.only_shadow"),
|
||||
I18n.format("sodium.options.async_occlusion_mode.everything") }))
|
||||
.setImpact(OptionImpact.MEDIUM)
|
||||
.setBinding((opts, value) -> opts.performance.asyncOcclusionMode = value, opts -> opts.performance.asyncOcclusionMode)
|
||||
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
|
||||
|
||||
@@ -343,11 +343,11 @@ public class Iris {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
try {
|
||||
reload();
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText("Shaders Reloaded!"));
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.reloaded")));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error while reloading Shaders for Iris!", e);
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText( "Failed tgo reload shaders! Reason: " + Throwables.getRootCause(e).getMessage()));
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.reloaded.failure", Throwables.getRootCause(e).getMessage())));
|
||||
}
|
||||
} else if (toggleShadersKeybind.isPressed()) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
@@ -356,7 +356,7 @@ public class Iris {
|
||||
} catch (Exception e) {
|
||||
logger.error("Error while toggling shaders!", e);
|
||||
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText( "Failed tgo toggle shaders! Reason: " + Throwables.getRootCause(e).getMessage()));
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.toggled.failure", Throwables.getRootCause(e).getMessage())));
|
||||
setShadersDisabled();
|
||||
fallback = true;
|
||||
}
|
||||
@@ -974,9 +974,9 @@ public class Iris {
|
||||
|
||||
public void fmlInitEvent() {
|
||||
IRIS_VERSION = Tags.VERSION;
|
||||
reloadKeybind = new KeyBinding("Reload Shaders", 0, "Iris Keybinds");
|
||||
toggleShadersKeybind = new KeyBinding("Toggle Shaders", 0, "Iris Keybinds");
|
||||
shaderpackScreenKeybind = new KeyBinding("Shaderpack Selection Screen", 0, "Iris Keybinds");
|
||||
reloadKeybind = new KeyBinding("iris.keybind.reload", 0, "key.category.iris.keybinds");
|
||||
toggleShadersKeybind = new KeyBinding("iris.keybind.toggleShaders", 0, "key.category.iris.keybinds");
|
||||
shaderpackScreenKeybind = new KeyBinding("iris.keybind.shaderPackSelection", 0, "key.category.iris.keybinds");
|
||||
|
||||
ClientRegistry.registerKeyBinding(reloadKeybind);
|
||||
ClientRegistry.registerKeyBinding(toggleShadersKeybind);
|
||||
|
||||
Reference in new issue
Block a user