Skip to content

Commit

Permalink
Merge pull request #715 from FTBTeam/1.20.1/dev
Browse files Browse the repository at this point in the history
1.20.1/dev
  • Loading branch information
desht authored Mar 18, 2024
2 parents 0d27e2e + 3fbda75 commit a9e7064
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2001.3.5]

### Fixed
* Fixed crash under some circumstances (not always reproducible) when opening the Key Reference panel
* Fixed images rendering over and hiding quest dependency lines (bug introduced in last release)

## [2001.3.4]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public void addMouseOverText(TooltipList list) {
chapterImage.addHoverText(list);
}

@Override
public boolean shouldDraw() {
// return false here, we'll handle rendering the images ourselves in QuestPanel#drawOffsetBackground
return false;
}

@Override
public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) {
Icon image = chapterImage.getImage();
Expand All @@ -140,7 +146,6 @@ public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h)
image = image.withColor(chapterImage.getColor().withAlpha(chapterImage.getAlpha()));
}

// GuiHelper.setupDrawing();
PoseStack poseStack = graphics.pose();
poseStack.pushPose();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentContents;
import net.minecraft.util.FormattedCharSequence;
import org.apache.commons.lang3.tuple.Pair;

Expand Down Expand Up @@ -150,17 +149,19 @@ private void reflowText() {
int maxWidth = getParent().getWidth() - GUTTER_SIZE * 2;
reflowed.clear();
for (var entry : data) {
if (entry.getRight().getContents().equals(ComponentContents.EMPTY)) {
if (entry.getRight().getString().isEmpty()) {
// header line
reflowed.add(Pair.of(entry.getLeft(), null));
h += theme.getFontHeight() + 3;
} else {
var l = theme.getFont().split(entry.getRight(), maxWidth - 10 - widestL);
reflowed.add(Pair.of(entry.getLeft(), l.get(0)));
for (int i = 1; i < l.size(); i++) {
reflowed.add(Pair.of(Component.empty(), l.get(i)));
if (!l.isEmpty()) {
reflowed.add(Pair.of(entry.getLeft(), l.get(0)));
for (int i = 1; i < l.size(); i++) {
reflowed.add(Pair.of(Component.empty(), l.get(i)));
}
h += (theme.getFontHeight() + 1) * l.size();
}
h += (theme.getFontHeight() + 1) * l.size();
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod_id=ftbquests
archives_base_name=ftb-quests
minecraft_version=1.20.1
# Build time
mod_version=2001.3.4
mod_version=2001.3.5
maven_group=dev.ftb.mods
mod_author=FTB Team
# Curse release
Expand Down

0 comments on commit a9e7064

Please sign in to comment.