1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-15 20:47:11 +00:00

Split some textures into sprite sheets

- Split buttons.png into individual textures.
 - Split corners_xyz.png into the following:

   - borders_xyz.png: A nine-sliced texture of the computer borders.
   - pocket_bottom_xyz.png: A horizontally 3-sliced texture of the
     bottom part of a pocket computer.
   - sidebar_xyz.png: A vertically 3-sliced texture of the computer
     sidebar.

While not splitting the sliced textures into smaller ones may seem a
little odd, it's consistent with what vanilla does in 1.20.2, and I
think will make editing them easier than juggling 9 textures.

I do want to make this more data-driven in the future, but that will
have to wait until the changes in 1.20.2.

This also adds a tools/update-resources.py program, which performs this
transformation on a given resource pack.
This commit is contained in:
Jonathan Coates
2023-08-27 18:02:51 +01:00
parent 6dfdeb9321
commit 53546b9f57
37 changed files with 556 additions and 161 deletions

View File

@@ -6,8 +6,10 @@ package dan200.computercraft.client;
import dan200.computercraft.api.ComputerCraftAPI;
import dan200.computercraft.client.model.turtle.TurtleModelLoader;
import net.minecraft.client.Minecraft;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.client.event.RegisterClientReloadListenersEvent;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.client.event.RegisterShadersEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@@ -44,6 +46,11 @@ public final class ForgeClientRegistry {
ClientRegistry.registerItemColours(event::register);
}
@SubscribeEvent
public static void registerReloadListeners(RegisterClientReloadListenersEvent event) {
ClientRegistry.registerReloadListeners(event::registerReloadListener, Minecraft.getInstance());
}
@SubscribeEvent
public static void setupClient(FMLClientSetupEvent event) {
ClientRegistry.register();

View File

@@ -0,0 +1,20 @@
{
"sources": [
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/turned_off"},
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/turned_off_hover"},
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/turned_on"},
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/turned_on_hover"},
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/terminate"},
{"type": "minecraft:single", "resource": "computercraft:gui/buttons/terminate_hover"},
{"type": "minecraft:single", "resource": "computercraft:gui/border_normal"},
{"type": "minecraft:single", "resource": "computercraft:gui/pocket_bottom_normal"},
{"type": "minecraft:single", "resource": "computercraft:gui/sidebar_normal"},
{"type": "minecraft:single", "resource": "computercraft:gui/border_advanced"},
{"type": "minecraft:single", "resource": "computercraft:gui/pocket_bottom_advanced"},
{"type": "minecraft:single", "resource": "computercraft:gui/sidebar_advanced"},
{"type": "minecraft:single", "resource": "computercraft:gui/border_command"},
{"type": "minecraft:single", "resource": "computercraft:gui/sidebar_command"},
{"type": "minecraft:single", "resource": "computercraft:gui/border_colour"},
{"type": "minecraft:single", "resource": "computercraft:gui/pocket_bottom_colour"}
]
}