v6.0
This commit is contained in:
1 parent
3010b164ab
commit
0bd31971a0
14 files changed
+141
-18
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# jenny's mod 2 100% real
|
||||
|
||||
mod para Minecraft Fabric 26.1.2 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
||||
mod para Minecraft Fabric 26.2 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
||||
|
||||
## instalación
|
||||
|
||||
@@ -10,7 +10,7 @@ mod para Minecraft Fabric 26.1.2 que añade algunas cosas QOL, mayormente relaci
|
||||
3. descargar el .jar
|
||||
4. moverlo a tu directorio de mods (probablemente `%appdata%/.minecraft/mods`)
|
||||
|
||||
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC `26.1.2`; Fabric `0.19.2`)
|
||||
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC `26.2`; Fabric `0.19.3`)
|
||||
es posible que haya problemas al usarlo junto a otros mods, especialmente junto a otros clientes, pues pueden conflictar entre ellos.
|
||||
|
||||
### para frikis de 200 de iq
|
||||
@@ -56,7 +56,7 @@ algunos módulos tienen teclas asignadas por defecto, asígnales `ESC` para desa
|
||||
<img src="screenshots/hudeditor.png" alt="editor de HUD">
|
||||
<img src="screenshots/colorpicker.png" alt="selector de colores">
|
||||
|
||||
## contibuciones
|
||||
## contribuciones
|
||||
|
||||
sí por favor
|
||||
|
||||
|
||||
+6
-5
@@ -1,4 +1,4 @@
|
||||
# v5.9
|
||||
# v6.0
|
||||
|
||||
## novedades
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- killaura: ataca a todo dios
|
||||
- imán de items: recoge items distantes rápidamente mediante paquetes de movimiento
|
||||
|
||||
#### comandos nuevos:
|
||||
|
||||
#### elementos del HUD nuevos:
|
||||
|
||||
- imagen custom: imagen custom.
|
||||
|
||||
### arreglos / mejoras
|
||||
|
||||
- agregado las claves de traducción restantes
|
||||
- ahora se guardan correctamente los ajustes de archivo
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ discord_rpc_version=1.0.3
|
||||
neutrino_version=1.1.0
|
||||
jdk_version=25
|
||||
|
||||
mod_version=5.9
|
||||
mod_version=6.0
|
||||
maven_group=me.retucio
|
||||
archives_base_name=sputnik
|
||||
@@ -84,6 +84,7 @@ public class ClientConfig {
|
||||
case ListSetting l: value = l.getConfigValues(); break;
|
||||
case ColorSetting c: value = c.getConfigValue(); break;
|
||||
case OptionSetting o: value = o.getConfigName(); break;
|
||||
case FileSetting f: value = f.getValue(); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
||||
@@ -362,6 +362,7 @@ public class ConfigManager {
|
||||
case ListSetting listSetting -> applyListSetting(listSetting, value);
|
||||
case ColorSetting colorSetting -> applyColorSetting(colorSetting, value);
|
||||
case OptionSetting optionSetting -> applyOptionSetting(optionSetting, value);
|
||||
case FileSetting fileSetting -> applyFileSetting(fileSetting, value);
|
||||
default -> Sputnik.LOGGER.warn(I18nUtil.fmt("sputnik.config.warn.unknownsetting",
|
||||
"watafac queseso: %s", setting.getClass().getSimpleName()));
|
||||
}
|
||||
@@ -477,8 +478,8 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
private static void applyStringSetting(StringSetting setting, Object value) {
|
||||
if (value instanceof String) {
|
||||
setting.setValue((String) value);
|
||||
if (value instanceof String v) {
|
||||
setting.setValue(v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,6 +540,12 @@ public class ConfigManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static void applyFileSetting(FileSetting setting, Object value) {
|
||||
if (value instanceof String v) {
|
||||
setting.setValue(v);
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> void applyOptionalProperty(Map<?, ?> map, String key, Class<T> type, Consumer<T> setter) {
|
||||
Object value = map.get(key);
|
||||
if (type.isInstance(value)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import me.retucio.sputnik.module.setting.settings.*;
|
||||
import me.retucio.sputnik.ui.hud.HudElement;
|
||||
import me.retucio.sputnik.ui.hud.HudRenderer;
|
||||
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||
import me.retucio.sputnik.ui.hud.elements.CustomImageElement;
|
||||
import me.retucio.sputnik.ui.hud.elements.DynoElement;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
@@ -126,6 +127,12 @@ public class Hud extends Module {
|
||||
Dynosaurs.class, Dynosaurs.SPINOSAURUS
|
||||
));
|
||||
|
||||
public FileSetting customImagePath = sgElements.add(new FileSetting(
|
||||
"ruta de imagen",
|
||||
"ruta de la imagen a renderizar en el elemento de imagen custom",
|
||||
""
|
||||
));
|
||||
|
||||
public Hud() {
|
||||
super("HUD",
|
||||
"superposición de la pantalla con info. adicional",
|
||||
@@ -137,6 +144,11 @@ public class Hud extends Module {
|
||||
DynoElement element = (DynoElement) HudRenderer.INSTANCE.getElement(DynoElement.class);
|
||||
if (element != null) element.reloadTexture();
|
||||
});
|
||||
|
||||
customImagePath.onUpdate(v -> {
|
||||
CustomImageElement element = (CustomImageElement) HudRenderer.INSTANCE.getElement(CustomImageElement.class);
|
||||
if (element != null) element.reloadTexture();
|
||||
});
|
||||
}
|
||||
|
||||
public enum TimeFormat {
|
||||
|
||||
@@ -143,7 +143,8 @@ public abstract class Setting<T> {
|
||||
|
||||
public void fireUpdateEvent() {
|
||||
Sputnik.EVENT_BUS.post(
|
||||
new UpdateSettingEvent(this, getModule().shouldSaveSettings()));
|
||||
new UpdateSettingEvent(this, getModule().shouldSaveSettings())
|
||||
);
|
||||
}
|
||||
|
||||
public void onUpdate(Consumer<T> listener) {
|
||||
|
||||
@@ -88,9 +88,7 @@ public class OptionSetting<T> extends Setting<T> {
|
||||
return displayNames;
|
||||
}
|
||||
|
||||
// OJO: nombre interno de la opción, o sea la clave de la config. (ver ClientConfig
|
||||
// #onUpdateSetting). igual que en ListSetting, para las listas del juego es la clave
|
||||
// de traducción. no traducir
|
||||
// no traducir.
|
||||
public String getConfigName(T key) {
|
||||
if (displayNames != null && displayNames.containsKey(key)) return displayNames.get(key);
|
||||
return key != null ? key.toString() : "?";
|
||||
|
||||
@@ -49,6 +49,7 @@ public class HudRenderer {
|
||||
addElement(new EchestElement(), positions, visibilities);
|
||||
addElement(new TotemsElement(), positions, visibilities);
|
||||
addElement(new ArmorElement(), positions, visibilities);
|
||||
addElement(new CustomImageElement(), positions, visibilities);
|
||||
|
||||
HudEditor.INSTANCE.setElements(elements);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package me.retucio.sputnik.ui.hud;
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.module.modules.client.Hud;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.Colors;
|
||||
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||
import net.minecraft.client.renderer.RenderPipelines;
|
||||
@@ -35,7 +36,9 @@ public abstract class ImageHudElement extends HudElement {
|
||||
public void reloadTexture() {
|
||||
textureLoaded = false;
|
||||
String imagePath = getImagePath();
|
||||
if (imagePath == null || imagePath.isEmpty()) return;
|
||||
if (imagePath == null || imagePath.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// cargar
|
||||
@@ -65,12 +68,18 @@ public abstract class ImageHudElement extends HudElement {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Sputnik.LOGGER.error(Component.translatable("sputnik.hud.error.texture", getId(), e.getMessage()).getString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInGame(GuiGraphicsExtractor gui, float delta, Hud hud) {
|
||||
if (!textureLoaded || !isVisible()) return;
|
||||
if (getImagePath() == null || getImagePath().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (!textureLoaded || !isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
gui.blit(
|
||||
RenderPipelines.GUI_TEXTURED,
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package me.retucio.sputnik.ui.hud.elements;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.client.Hud;
|
||||
import me.retucio.sputnik.ui.hud.ImageHudElement;
|
||||
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
public class CustomImageElement extends ImageHudElement {
|
||||
|
||||
public CustomImageElement() {
|
||||
super("customimage", 200, 200);
|
||||
reloadTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getImagePath() {
|
||||
Hud hud = ModuleManager.INSTANCE.getModuleByClass(Hud.class);
|
||||
if (hud != null && hud.customImagePath != null && !hud.customImagePath.getValue().isEmpty()) {
|
||||
return hud.customImagePath.getValue();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadTexture() {
|
||||
textureLoaded = false;
|
||||
String imagePath = getImagePath();
|
||||
if (imagePath == null || imagePath.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
File file = new File(imagePath);
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
Sputnik.LOGGER.error(Component.translatable(
|
||||
"sputnik.hud.error.texture", getId(), "file not found: " + imagePath).getString()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try (InputStream stream = new FileInputStream(file)) {
|
||||
NativeImage image = NativeImage.read(stream);
|
||||
|
||||
if (texture != null) texture.close();
|
||||
mc.getTextureManager().getTexture(textureId);
|
||||
mc.getTextureManager().release(textureId);
|
||||
|
||||
Supplier<String> nameSupplier = () -> textureId.toString();
|
||||
texture = new DynamicTexture(nameSupplier, image);
|
||||
|
||||
this.imageWidth = image.getWidth();
|
||||
this.imageHeight = image.getHeight();
|
||||
this.w = imageWidth;
|
||||
this.h = imageHeight;
|
||||
|
||||
mc.getTextureManager().register(textureId, texture);
|
||||
textureLoaded = true;
|
||||
|
||||
Sputnik.LOGGER.info(Component.translatable("sputnik.hud.info.textureloaded", getId()).getString());
|
||||
} catch (Exception e) {
|
||||
Sputnik.LOGGER.error(Component.translatable(
|
||||
"sputnik.hud.error.texture", getId(), e.getMessage()).getString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Component> getTooltip() {
|
||||
return List.of(
|
||||
Component.translatable("sputnik.hud.element.customimage.name"),
|
||||
Component.translatable("sputnik.hud.element.customimage.desc")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,9 @@ public class CustomTextElement extends TextHudElement {
|
||||
@Override
|
||||
public String getPreviewText() {
|
||||
Hud hud = ModuleManager.INSTANCE.getModuleByClass(Hud.class);
|
||||
if (hud != null && hud.customText != null && !hud.customText.getValue().isEmpty())
|
||||
if (hud != null && hud.customText != null && !hud.customText.getValue().isEmpty()) {
|
||||
return hud.customText.getValue();
|
||||
}
|
||||
|
||||
return "texto custom";
|
||||
}
|
||||
|
||||
@@ -298,6 +298,8 @@
|
||||
"sputnik.hud.editor.title": "HUD editor",
|
||||
"sputnik.hud.element.armor.desc": "armor status",
|
||||
"sputnik.hud.element.coords.desc": "shows your XYZ position in the world",
|
||||
"sputnik.hud.element.customimage.desc": "an image of your choosing",
|
||||
"sputnik.hud.element.customimage.name": "custom image",
|
||||
"sputnik.hud.element.customtext.desc": "text of your choosing",
|
||||
"sputnik.hud.element.customtext.name": "custom text",
|
||||
"sputnik.hud.element.dyno.desc": "long live autism goddamn",
|
||||
@@ -952,6 +954,8 @@
|
||||
"sputnik.setting.hud.elementos.formatodelahora.name": "time format",
|
||||
"sputnik.setting.hud.elementos.mododecoordenadas.desc": "which coordinates to show",
|
||||
"sputnik.setting.hud.elementos.mododecoordenadas.name": "coords mode",
|
||||
"sputnik.setting.hud.elementos.rutadeimagen.name": "path",
|
||||
"sputnik.setting.hud.elementos.rutadeimagen.desc": "path to custom image",
|
||||
"sputnik.setting.hud.elementos.textocustom.desc": "watermark (leave empty to remove)",
|
||||
"sputnik.setting.hud.elementos.textocustom.name": "custom text",
|
||||
"sputnik.setting.hud.elementos.zonahoraria.desc": "timezone as UTC+n",
|
||||
|
||||
@@ -298,6 +298,8 @@
|
||||
"sputnik.hud.editor.title": "editor del HUD",
|
||||
"sputnik.hud.element.armor.desc": "estado de la armadura",
|
||||
"sputnik.hud.element.coords.desc": "te muestra tu posición XYZ en el mundo",
|
||||
"sputnik.hud.element.customimage.desc": "imagen que tú eliges",
|
||||
"sputnik.hud.element.customimage.name": "imagen custom",
|
||||
"sputnik.hud.element.customtext.desc": "texto que tú eliges",
|
||||
"sputnik.hud.element.customtext.name": "texto custom",
|
||||
"sputnik.hud.element.dyno.desc": "que viva el autismo joder",
|
||||
@@ -952,6 +954,8 @@
|
||||
"sputnik.setting.hud.elementos.formatodelahora.name": "formato de la hora",
|
||||
"sputnik.setting.hud.elementos.mododecoordenadas.desc": "qué coordenadas mostrar",
|
||||
"sputnik.setting.hud.elementos.mododecoordenadas.name": "modo de coordenadas",
|
||||
"sputnik.setting.hud.elementos.rutadeimagen.name": "ruta de imagen",
|
||||
"sputnik.setting.hud.elementos.rutadeimagen.desc": "ruta de la imagen a renderizar en el elemento de imagen custom",
|
||||
"sputnik.setting.hud.elementos.textocustom.desc": "marca de agua (dejar vacío para quitar)",
|
||||
"sputnik.setting.hud.elementos.textocustom.name": "texto custom",
|
||||
"sputnik.setting.hud.elementos.zonahoraria.desc": "zona horaria en UTC+n",
|
||||
|
||||
Reference in new issue
Block a user