Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
okx-code committed May 10, 2024
1 parent 675b841 commit 436a98d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package sh.okx.civmodern.common.gui.screen;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import java.text.DecimalFormat;
import java.util.regex.Pattern;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
Expand All @@ -23,6 +19,9 @@
import sh.okx.civmodern.common.gui.widget.HsbColourPicker;
import sh.okx.civmodern.common.gui.widget.ImageButton;

import java.text.DecimalFormat;
import java.util.regex.Pattern;

public class CompactedConfigScreen extends Screen {
private static final DecimalFormat FORMAT = new DecimalFormat("##%");

Expand Down Expand Up @@ -102,8 +101,6 @@ protected void init() {

@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
super.renderBackground(guiGraphics, mouseX, mouseY, delta);

drawCentredText(guiGraphics, this.title, 0, 15, 0xffffff);

drawItem(guiGraphics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ protected void init() {

@Override
public void render(GuiGraphics guiGraphics, int i, int j, float f) {
super.renderBackground(guiGraphics, i, j, f);
super.render(guiGraphics, i, j, f);

guiGraphics.drawString(font, this.title, (int) (this.width / 2f - font.width(this.title) / 2f), 15, 0xffffff);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package sh.okx.civmodern.common.gui.screen;

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
Expand Down Expand Up @@ -35,8 +34,6 @@ protected void init() {

@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
super.renderBackground(guiGraphics, mouseX, mouseY, delta);

guiGraphics.drawString(this.font, this.title, (int) (this.width / 2f - this.font.width(this.title) / 2f), 15, 0xffffff);
super.render(guiGraphics, mouseX, mouseY, delta);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ protected void init() {
int offset = this.height / 6 - 18;

ColourProvider colourProvider = mod.getColourProvider();
bgPicker = addColourPicker(left, 220, CivMapConfig.DEFAULT_RADAR_BG_COLOUR, config::getRadarBgColour, config::setRadarBgColour,
bgPicker = addColourPicker(left, offset + 178, CivMapConfig.DEFAULT_RADAR_BG_COLOUR, config::getRadarBgColour, config::setRadarBgColour,
colourProvider::setTemporaryRadarBackgroundColour);
fgPicker = addColourPicker(right, 220, CivMapConfig.DEFAULT_RADAR_FG_COLOUR, config::getRadarColour, config::setRadarColour,
fgPicker = addColourPicker(right, offset + 178, CivMapConfig.DEFAULT_RADAR_FG_COLOUR, config::getRadarColour, config::setRadarColour,
colourProvider::setTemporaryRadarForegroundColour);

addRenderableWidget(Button.builder(getRadarToggleMessage(), button -> {
Expand Down
16 changes: 7 additions & 9 deletions common/src/main/java/sh/okx/civmodern/common/radar/Radar.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.player.RemotePlayer;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
Expand All @@ -33,14 +30,11 @@
import net.minecraft.network.chat.Style;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.Boat;
import net.minecraft.world.entity.vehicle.Minecart;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
Expand All @@ -53,7 +47,11 @@
import sh.okx.civmodern.common.events.PostRenderGameOverlayEvent;

import java.net.URL;
import java.util.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.UUID;

import static org.lwjgl.opengl.GL11.*;

Expand Down Expand Up @@ -340,9 +338,9 @@ private void renderPlayers(GuiGraphics guiGraphics, float delta) {
PlayerInfo entry = minecraft.player.connection.getPlayerInfo(player.getUUID());
guiGraphics.pose().scale(config.getIconSize(), config.getIconSize(), 0);
if (config.isNorthUp()) {
guiGraphics.pose().mulPose(Axis.ZP.rotationDegrees(minecraft.player.getViewYRot(delta)));
} else {
guiGraphics.pose().mulPose(Axis.ZP.rotationDegrees(180));
} else {
guiGraphics.pose().mulPose(Axis.ZP.rotationDegrees(minecraft.player.getViewYRot(delta)));
}
ResourceLocation location;
if (entry != null) {
Expand Down

0 comments on commit 436a98d

Please sign in to comment.