Skip to content

Commit

Permalink
Merge pull request #323 from FTBTeam/feature/icon-update
Browse files Browse the repository at this point in the history
[1.21.1] Update Icons
  • Loading branch information
desht authored Nov 4, 2024
2 parents 54cc9d7 + 6b70837 commit 9bb2bc6
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void addWidgets() {
@Override
public void alignWidgets() {
removeAllClaims.setPosAndSize(2, 2, 12, 12);
adminButton.setPosAndSize(18, 2, 12, 12);
adminButton.setPosAndSize(18, 1, 12, 12);

closeButton.setPosAndSize(width - 16, 2, 12, 12);
mouseReferenceButton.setPosAndSize(width - 32, 2, 12, 12);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import dev.ftb.mods.ftblibrary.icon.ImageIcon;
import dev.ftb.mods.ftblibrary.math.MathUtils;
import dev.ftb.mods.ftblibrary.math.XZ;
import dev.ftb.mods.ftblibrary.ui.*;
import dev.ftb.mods.ftblibrary.ui.Button;
import dev.ftb.mods.ftblibrary.ui.GuiHelper;
import dev.ftb.mods.ftblibrary.ui.Panel;
import dev.ftb.mods.ftblibrary.ui.ScreenWrapper;
import dev.ftb.mods.ftblibrary.ui.Theme;
import dev.ftb.mods.ftblibrary.ui.input.Key;
import dev.ftb.mods.ftblibrary.ui.input.MouseButton;
import dev.ftb.mods.ftblibrary.util.TimeUtils;
Expand All @@ -38,7 +42,15 @@
import net.minecraft.world.level.ChunkPos;
import org.lwjgl.glfw.GLFW;

import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static dev.ftb.mods.ftbchunks.net.RequestChunkChangePacket.ChunkChangeOp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import dev.ftb.mods.ftblibrary.ui.SimpleButton;
import dev.ftb.mods.ftblibrary.ui.TextField;
import dev.ftb.mods.ftblibrary.ui.Theme;
import dev.ftb.mods.ftblibrary.ui.ToggleableButton;
import dev.ftb.mods.ftblibrary.ui.misc.AbstractThreePanelScreen;
import dev.ftb.mods.ftblibrary.util.TooltipList;
import dev.ftb.mods.ftblibrary.util.client.ClientTextComponentUtils;
Expand Down Expand Up @@ -122,7 +123,7 @@ public class InfoEntry extends Panel {

public InfoEntry(MinimapInfoComponent infoComponent, Panel panel) {
super(panel);
hideButton = ToggleVisibilityButton.create(this, !isComponentDisabled(infoComponent), (enabled) -> setComponentEnabled(infoComponent, enabled));
hideButton = new ToggleableButton(this, !isComponentDisabled(infoComponent), Icons.VISIBILITY_SHOW, Icons.VISIBILITY_HIDE, (widget, newState) -> setComponentEnabled(infoComponent, newState));
down = new SortScreenButton(InfoEntry.this, Component.translatable("ftbchunks.gui.move_up"), Icons.UP, (widget, button) -> move(false, isShiftKeyDown()));
up = new SortScreenButton(InfoEntry.this, Component.translatable("ftbchunks.gui.move_down"), Icons.DOWN, (widget, button) -> move(true, isShiftKeyDown()));
configButton = new SimpleButton(InfoEntry.this, Component.translatable("gui.settings"), Icons.SETTINGS, (widget, button) -> {
Expand Down Expand Up @@ -169,7 +170,7 @@ public void addWidgets() {
public void alignWidgets() {
down.setPosAndSize(6, height / 6 + 1, 6, 8);
up.setPosAndSize(6, height / 6 + 11, 6, 8);
hideButton.setPosAndSize(width - 18, height / 6, 12, 12);
hideButton.setPosAndSize(width - 18, height / 6 + 2, 12, 12);
field.setPosAndSize(16, 8, width - 37, height);
field.setPosAndSize(16, 8, width - 37, height);
if(!infoComponent.getConfigComponents().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void draw(MapType mapType, GuiGraphics graphics, int x, int y, int w, int
Player player = Minecraft.getInstance().player;
graphics.pose().pushPose();
graphics.pose().translate(x + w / 2f, y + h / 2f, 0F);
graphics.pose().scale(2f, 2f, 2f);
float scale = mapType == MapType.LARGE_MAP ? 2.5F : 2F;
graphics.pose().scale(scale, scale, scale);
graphics.pose().mulPose(Axis.ZP.rotationDegrees(player.getYRot() + 180F));
POINTER.draw(graphics, - w / 2, -h / 2, w, h);
graphics.pose().popPose();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import dev.ftb.mods.ftblibrary.ui.SimpleButton;
import dev.ftb.mods.ftblibrary.ui.TextField;
import dev.ftb.mods.ftblibrary.ui.Theme;
import dev.ftb.mods.ftblibrary.ui.ToggleableButton;
import dev.ftb.mods.ftblibrary.ui.input.Key;
import dev.ftb.mods.ftblibrary.ui.input.MouseButton;
import dev.ftb.mods.ftblibrary.ui.misc.AbstractButtonListScreen;
Expand Down Expand Up @@ -88,7 +89,7 @@ private void computeWaypointTextWidth() {

private void toggleAll(boolean collapsed) {
boolean allOpen = this.collapsed.values().stream().noneMatch(b -> b);
//Don't try and re-render if everything is already open
// Don't try and re-render if everything is already open
if (allOpen && !collapsed) {
return;
}
Expand Down Expand Up @@ -272,7 +273,7 @@ public RowPanel(Panel panel, WaypointImpl wp) {

@Override
public void addWidgets() {
add(hideButton = ToggleVisibilityButton.create(this, !wp.isHidden(), hidden -> wp.setHidden(!hidden)));
add(hideButton = new ToggleableButton(this, !wp.isHidden(), (widget, newState) -> wp.setHidden(!newState)));

add(nameField = new TextField(this).setTrim().setColor(Color4I.rgb(wp.getColor())).addFlags(Theme.SHADOW));

Expand Down Expand Up @@ -306,8 +307,8 @@ public void setWidth(int newWidth) {

int yOff = (this.height - getTheme().getFontHeight()) / 2 + 1;

hideButton.setPosAndSize(farRight - 8 - 16, 1, 12, 12);
deleteButton.setPosAndSize(farRight - 8, 1, 12, 12);
hideButton.setPosAndSize(farRight - 8 - 16, 3, 12, 12);
deleteButton.setPosAndSize(farRight - 8, 3, 12, 12);

distField.setPos(hideButton.getPosX() - 5 - distField.width, yOff);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified common/src/main/resources/assets/ftbchunks/textures/player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"texture": {
"blur": true
"blur": false
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"texture": {
"blur": true
"blur": false
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"texture": {
"blur": true
"blur": false
}
}

0 comments on commit 9bb2bc6

Please sign in to comment.