Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0b6c834
Feat: Color Picker rewrite & alpha slider/presets
Superkat32 Jul 17, 2026
f4d7170
Feat: Re-add Color Picker confirm/cancel buttons, allow color picker …
Superkat32 Jul 17, 2026
9899ead
Feat: Improve color picker button scaling & precise preview alpha bac…
Superkat32 Jul 17, 2026
00bf779
Feat: Better Color Picker cursor shenanigans
Superkat32 Jul 17, 2026
c037cf7
Feat: Add color pickers to Sprite, Outline, Popup, and Text Block Pro…
Superkat32 Jul 17, 2026
0643f17
Chore: Sweep sweep
Superkat32 Jul 17, 2026
2f48750
Chore: Extra cleanup
Superkat32 Jul 17, 2026
3327dfb
Feat: Add background color into main screen for Text Block
Superkat32 Jul 17, 2026
e61b0c8
Chore: Optimize imports for various classes updated in the Color Pick…
Superkat32 Jul 17, 2026
bb1e544
Feat: Begin GlowcaseMultilineEditBox
Superkat32 Jul 28, 2026
e8cf50b
Feat: Begin GlowcaseMultilineEditBox (but also include these in case …
Superkat32 Jul 28, 2026
1fb1bf8
Feat: To-done: Multi-character selection (in Text Block screen) at th…
Superkat32 Jul 28, 2026
e69f2e5
Feat: Some cleanup and comments, before I work on the note edit screen
Superkat32 Jul 28, 2026
d394529
Feat: Beginning of overflow editing within GlowcaseMultilineEditBox
Superkat32 Jul 30, 2026
fb3fc7d
Feat: Better text overflow handling, break word selection/moving at tags
Superkat32 Aug 1, 2026
a15d17d
Chore: Comment cleanup
Superkat32 Aug 1, 2026
58a6d0e
Fix: Fix horizontal scrolling not being capped properly, inserting a …
Superkat32 Aug 1, 2026
b5eccdb
Chore: Little bit of cleanup & docs
Superkat32 Aug 1, 2026
b077971
Feat: Use new GlowcaseMultilineEditBox in NoteEditScreen
Superkat32 Aug 2, 2026
cb7a2b2
Chore: The great NoteEditScreen comment cleanup
Superkat32 Aug 2, 2026
d0e2834
Feat: Make PopupBlockEditScreen use new GlowcaseMultilineEditBox
Superkat32 Aug 2, 2026
2330682
Chore: Popup block edit screen comment cleanup
Superkat32 Aug 2, 2026
c8f3518
Feat: Show Popup Block's Title on PopupBlockViewScreen, and vertical …
Superkat32 Aug 3, 2026
30e4136
Chore: Optimize imports I think I did this like 5 hours ago
Superkat32 Aug 3, 2026
9b584a4
Feat: Begin Text Block ribbon tabs
Superkat32 Aug 5, 2026
858217c
Chore: Comment cleanup & some JavaDocs
Superkat32 Aug 5, 2026
d56811b
Feat: Continue work on Text Block tabs
Superkat32 Aug 6, 2026
243538b
Refactor: TextWidgets List isn't needed anymore
Superkat32 Aug 6, 2026
08e252e
Feat: Continue work on View Tab widgets
Superkat32 Aug 8, 2026
08394b7
Feat: Update Vec3FieldsWidget with builder & options, add DegreeRotat…
Superkat32 Aug 9, 2026
5961a48
Chore: Cleanup comments
Superkat32 Aug 9, 2026
a456a15
Feat: Insert Font tag button
Superkat32 Aug 9, 2026
eac6cdb
Feat: Fix some issues with SuggestionListWidget for the Text Screen, …
Superkat32 Aug 9, 2026
3a2e500
Feat: EditableSliderWidget (A slider which can be right-clicked to be…
Superkat32 Aug 10, 2026
fc71e08
Feat: Add text block offsets & rotations, allow InputFilter prefix to…
Superkat32 Aug 10, 2026
e575031
Feat: Creature of Whimsy
Superkat32 Aug 11, 2026
923d758
TODO (Anchor Controls) - Leave comments for future TODOs on the ancho…
Superkat32 Aug 11, 2026
db3a057
Fix: Ensure the edit box becomes focused after inserting a tag
Superkat32 Aug 11, 2026
9ce8174
Chore: Remove TextBlockOptionsScreen.java and cleanup other stuff lik…
Superkat32 Aug 11, 2026
1db6e9d
Feat: NumberEditBox(es), with ability to scroll to increment/decremen…
Superkat32 Aug 14, 2026
e3cf694
Chore: Some cleanup and fix integer box stack overflowing
Superkat32 Aug 14, 2026
beb3b6e
Feat: Add sounds to the number edit box for action feedback
Superkat32 Aug 14, 2026
ada7af0
Float point errors ruining my day!
Superkat32 Aug 15, 2026
26fa16b
Chore: Some extra cleanup & notes
Superkat32 Aug 17, 2026
8322584
Fix: Ensure the note item always has 10 lines, even if they are empty
Superkat32 Sep 7, 2026
79d15dc
Feat: Allow minimum alpha on Color Picker's alpha slider
Superkat32 Sep 7, 2026
135fae0
Separate Anchor, TextJustify (prev. TextAlignment), ZOffset from Text…
Ampflower Oct 4, 2026
bec1e8f
Implement Anchor, migrate legacy alignments & Z-offset
Ampflower Oct 4, 2026
0d42dc7
Sync offset to anchor (can be suppressed by holding shift)
Ampflower Oct 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/main/java/dev/hephaestus/glowcase/block/RecipeBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.mojang.serialization.MapCodec;
import dev.hephaestus.glowcase.Glowcase;
import dev.hephaestus.glowcase.block.entity.RecipeBlockEntity;
import dev.hephaestus.glowcase.block.entity.TextBlockEntity;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -76,7 +75,7 @@ public void appendTooltip(ItemStack stack, Item.TooltipContext context, TooltipD
public VoxelShape targetedOutlineShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
if (!(world.getBlockEntity(pos) instanceof RecipeBlockEntity be)) return Shapes.empty();
float rotation = -(state.getValue(BlockStateProperties.ROTATION_16) * 360) / 16.0F;
Vector3f offset = new Vector3f(0, 0, be.zOffset == TextBlockEntity.ZOffset.CENTER ? 0.01F : be.zOffset == TextBlockEntity.ZOffset.FRONT ? 0.4F : -0.4F).rotate(Axis.YP.rotationDegrees(rotation));
Vector3f offset = new Vector3f(0, 0, be.zOffset.offset).rotate(Axis.YP.rotationDegrees(rotation));
return HALF_CUBED.move(offset.x, offset.y, offset.z);
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/dev/hephaestus/glowcase/block/TextBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.serialization.MapCodec;
import dev.hephaestus.glowcase.Glowcase;
import dev.hephaestus.glowcase.block.entity.TextBlockEntity;
import dev.hephaestus.glowcase.util.ZOffset;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.core.component.DataComponents;
Expand Down Expand Up @@ -44,12 +45,11 @@ public boolean openEditScreen(BlockPos pos) {
public void setPlacedBy(Level world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {

if (world.getBlockEntity(pos) instanceof TextBlockEntity be) { // Wish we had ctx.side right now...
if (be.zOffset == TextBlockEntity.ZOffset.CENTER && Math.abs(placer.getXRot()) < 30) {
be.zOffset = TextBlockEntity.ZOffset.BACK;
} else if (be.zOffset == TextBlockEntity.ZOffset.BACK && Math.abs(placer.getXRot()) > 60) {
be.zOffset = TextBlockEntity.ZOffset.CENTER;
final var offset = be.offset;
be.offset = ZOffset.adjustPlacement(be.offset, placer.getXRot());
if (offset != be.offset) {
be.setChanged();
}
be.setChanged();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
package dev.hephaestus.glowcase.block.entity;

import dev.hephaestus.glowcase.Glowcase;
import eu.pb4.placeholders.api.ParserContext;
import eu.pb4.placeholders.api.parsers.NodeParser;
import eu.pb4.placeholders.api.parsers.TagParser;
import java.util.ArrayList;
import java.util.List;
import dev.hephaestus.glowcase.util.TextJustify;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentSerialization;
import net.minecraft.network.chat.Style;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.ValueInput;
import net.minecraft.world.level.storage.ValueOutput;

import java.util.ArrayList;
import java.util.List;

public class PopupBlockEntity extends GlowcaseBlockEntity {
public static final NodeParser PARSER = TagParser.DEFAULT;
public String title = "";
public List<Component> lines = new ArrayList<>();
public TextBlockEntity.TextAlignment textAlignment = TextBlockEntity.TextAlignment.CENTER;
public TextJustify textAlignment = TextJustify.CENTER;
public int color = 0xFFFFFFFF;
public boolean renderDirty = true;
public boolean viewScreenTitle = true;

public PopupBlockEntity(BlockPos pos, BlockState state) {
super(Glowcase.POPUP_BLOCK_ENTITY.get(), pos, state);
Expand All @@ -32,9 +30,10 @@ protected void saveAdditional(ValueOutput view) {
super.saveAdditional(view);

view.putString("title", this.title);
view.putBoolean("view_screen_title", this.viewScreenTitle);
view.putInt("color", this.color);

view.store("text_alignment", TextBlockEntity.TextAlignment.CODEC, this.textAlignment);
view.store("text_alignment", TextJustify.CODEC, this.textAlignment);

view.store("lines", ComponentSerialization.CODEC.listOf(), this.lines);
}
Expand All @@ -44,47 +43,13 @@ protected void loadAdditional(ValueInput view) {
super.loadAdditional(view);

this.title = view.getStringOr("title", "");
this.viewScreenTitle = view.getBooleanOr("view_screen_title", true);
this.color = view.getIntOr("color", 0xFFFFFF);

this.textAlignment = view.read("text_alignment", TextBlockEntity.TextAlignment.CODEC).orElse(TextBlockEntity.TextAlignment.CENTER);
this.textAlignment = view.read("text_alignment", TextJustify.CODEC).orElse(TextJustify.CENTER);

this.lines = new ArrayList<>(view.read("lines", ComponentSerialization.CODEC.listOf()).orElse(List.of(Component.empty())));

this.renderDirty = true;
}

public String getRawLine(int i) {
var line = this.lines.get(i);

if (line.getStyle() == null) {
return line.getString();
}

var insert = line.getStyle().getInsertion();

if (insert == null) {
return line.getString();
}
return insert;
}

public void addRawLine(int i, String string) {
var parsed = PARSER.parseComponent(string, ParserContext.of());

if (parsed.getString().equals(string)) {
this.lines.add(i, Component.literal(string));
} else {
this.lines.add(i, Component.empty().append(parsed).setStyle(Style.EMPTY.withInsertion(string)));
}
}

public void setRawLine(int i, String string) {
var parsed = PARSER.parseComponent(string, ParserContext.of());

if (parsed.getString().equals(string)) {
this.lines.set(i, Component.literal(string));
} else {
this.lines.set(i, Component.empty().append(parsed).setStyle(Style.EMPTY.withInsertion(string)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.hephaestus.glowcase.Glowcase;
import dev.hephaestus.glowcase.client.GlowcaseClient;
import dev.hephaestus.glowcase.client.util.RRVClientUtils;
import dev.hephaestus.glowcase.util.ZOffset;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.core.BlockPos;
Expand All @@ -14,7 +15,7 @@

public class RecipeBlockEntity extends GlowcaseBlockEntity {
public String recipe = "diamond_sword";
public TextBlockEntity.ZOffset zOffset = TextBlockEntity.ZOffset.CENTER;
public ZOffset zOffset = ZOffset.CENTER;

//TODO: maybe move XYZ rotation to nbt? or use vec2f
public float rotationX = 0f;
Expand Down Expand Up @@ -42,7 +43,7 @@ protected void saveAdditional(ValueOutput view) {
super.saveAdditional(view);

view.putString("recipe", this.recipe);
view.store("z_offset", TextBlockEntity.ZOffset.CODEC, this.zOffset);
view.store("z_offset", ZOffset.CODEC, this.zOffset);
view.putFloat("rotationX", this.rotationX);
view.putFloat("rotationY", this.rotationY);
}
Expand All @@ -57,7 +58,7 @@ protected void loadAdditional(ValueInput view) {
super.loadAdditional(view);

this.recipe = view.getStringOr("recipe", "diamond_sword");
this.zOffset = view.read("z_offset", TextBlockEntity.ZOffset.CODEC).orElse(TextBlockEntity.ZOffset.CENTER);
this.zOffset = view.read("z_offset", ZOffset.CODEC).orElse(ZOffset.CENTER);
this.rotationX = view.getFloatOr("rotationX", 0);
this.rotationY = view.getFloatOr("rotationY", 0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package dev.hephaestus.glowcase.block.entity;

import dev.hephaestus.glowcase.Glowcase;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;
import dev.hephaestus.glowcase.util.ZOffset;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.Identifier;
Expand All @@ -12,12 +10,15 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.ValueInput;
import net.minecraft.world.level.storage.ValueOutput;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;

public class SpriteBlockEntity extends GlowcaseBlockEntity {
protected String sprite = "arrow";
protected @Nullable ItemStack renderItem = null;
public int rotation = 0;
public TextBlockEntity.ZOffset zOffset = TextBlockEntity.ZOffset.BACK;
public ZOffset zOffset = ZOffset.BACK;
public int color = 0xFFFFFF;
public float scale = 1;

Expand Down Expand Up @@ -50,7 +51,7 @@ protected void saveAdditional(ValueOutput view) {

view.putString("sprite", this.sprite);
view.putInt("rotation", this.rotation);
view.store("z_offset", TextBlockEntity.ZOffset.CODEC, this.zOffset);
view.store("z_offset", ZOffset.CODEC, this.zOffset);
view.putInt("color", this.color);
view.putFloat("scale", this.scale);
}
Expand All @@ -61,7 +62,7 @@ protected void loadAdditional(ValueInput view) {

setSprite(view.getStringOr("sprite", "arrow"));
this.rotation = view.getIntOr("rotation", 0);
this.zOffset = view.read("z_offset", TextBlockEntity.ZOffset.CODEC).orElse(TextBlockEntity.ZOffset.BACK);
this.zOffset = view.read("z_offset", ZOffset.CODEC).orElse(ZOffset.BACK);
this.color = view.getIntOr("color", 0xFFFFFF);
this.scale = view.getFloatOr("scale", 1);
}
Expand Down
Loading
Loading