Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'development' into npefix
Browse files Browse the repository at this point in the history
  • Loading branch information
DevScyu committed Sep 13, 2023
2 parents 0215784 + f28c584 commit c5b1127
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 66 deletions.
33 changes: 17 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
## [1.15.1-beta.3](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.2...v1.15.1-beta.3) (2023-05-16)
## [1.15.1-beta.7](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.6...v1.15.1-beta.7) (2023-09-13)


### New Features
### Bug Fixes

* Add K and M to convertEmeraldPrice ([#661](https://github.com/Wynntils/Wynntils/issues/661)) ([8a295f0](https://github.com/Wynntils/Wynntils/commit/8a295f0e5e67f2b66305fa730d2db8a6b274fde9))
* Fix Guild Map Crashing ([#689](https://github.com/Wynntils/Wynntils/issues/689)) ([e5cc971](https://github.com/Wynntils/Wynntils/commit/e5cc9718dad93581000783c1a298862e6da91c99))

## [1.15.1-beta.2](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.1...v1.15.1-beta.2) (2023-04-17)
## [1.15.1-beta.6](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.5...v1.15.1-beta.6) (2023-08-12)


### Bug Fixes

* The mod can now load Artemis (1.19.3) lootruns ([#675](https://github.com/Wynntils/Wynntils/issues/675)) ([cc98eb1](https://github.com/Wynntils/Wynntils/commit/cc98eb12022bf752acdd359883a9254ae35d192c))
* Fixed TAB_EFFECT_PATTERN regex ([#686](https://github.com/Wynntils/Wynntils/issues/686)) ([46408de](https://github.com/Wynntils/Wynntils/commit/46408de7d589c2dc5ef6dcabe54eb4bfe27d39bf))


### Miscellaneous Chores

* **release:** v1.15.1-beta.2 [skip ci] ([28538a3](https://github.com/Wynntils/Wynntils/commit/28538a36d44442a94940193c981a00604b4fa9d0))
* **release:** v1.15.1-beta.6 [skip ci] ([71bf7fe](https://github.com/Wynntils/Wynntils/commit/71bf7fee9698345af1b61eb7f3b39c57b51fb497))

## [1.15.1-beta.1](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.0...v1.15.1-beta.1) (2023-04-01)
## [1.15.1-beta.5](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.4...v1.15.1-beta.5) (2023-07-24)


### New Features

* Add Artemis export button for waypoint manager GUI ([#673](https://github.com/Wynntils/Wynntils/issues/673)) ([1ea89ce](https://github.com/Wynntils/Wynntils/commit/1ea89ce88cb334233387bc971c9218cd5c1d5ee1))
* Export favorites via command ([#681](https://github.com/Wynntils/Wynntils/issues/681)) ([103a8b8](https://github.com/Wynntils/Wynntils/commit/103a8b8614f27e8381c01599ca9d35ad68451193))


### Miscellaneous Chores

* **release:** v1.15.1-beta.1 [skip ci] ([bf060a2](https://github.com/Wynntils/Wynntils/commit/bf060a250ebddac1a4139d5ae312a96316bafe0a))
* **release:** v1.15.1-beta.5 [skip ci] ([1677480](https://github.com/Wynntils/Wynntils/commit/1677480cf1d047e1e131f11a5b9f56a052a110d9))

## [1.15.1-beta.0](https://github.com/Wynntils/Wynntils/compare/v1.15.0...v1.15.1-beta.0) (2023-04-01)
## [1.15.1-beta.4](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.3...v1.15.1-beta.4) (2023-07-18)


### Bug Fixes
### Miscellaneous Chores

* Fix party finder crash on housing island ([#669](https://github.com/Wynntils/Wynntils/issues/669)) ([f97f5ad](https://github.com/Wynntils/Wynntils/commit/f97f5ad803fba62e3a38c31b74e027c0214ed41d))
* **release:** v1.15.1-beta.4 [skip ci] ([b0e0d5b](https://github.com/Wynntils/Wynntils/commit/b0e0d5b34ce26d519a26c8cef32b3be8c645bd88))
* Remove broken quest book ([#679](https://github.com/Wynntils/Wynntils/issues/679)) ([b9d15f5](https://github.com/Wynntils/Wynntils/commit/b9d15f51efbecfead2afaf9cbac4569ecbf651bb))

## [1.15.1-beta.3](https://github.com/Wynntils/Wynntils/compare/v1.15.1-beta.2...v1.15.1-beta.3) (2023-05-16)

### Miscellaneous Chores

* **release:** v1.15.1-beta.0 [skip ci] ([d60803c](https://github.com/Wynntils/Wynntils/commit/d60803cf7ac832394fc9c981217b2331ccf51821))
### New Features

## [1.15.0](https://github.com/Wynntils/Wynntils/compare/v1.14.1-beta.14...v1.15.0) (2023-02-21)
* Add K and M to convertEmeraldPrice ([#661](https://github.com/Wynntils/Wynntils/issues/661)) ([8a295f0](https://github.com/Wynntils/Wynntils/commit/8a295f0e5e67f2b66305fa730d2db8a6b274fde9))


### Miscellaneous Chores

* **release:** v1.15.0 [skip ci] ([1a93a1e](https://github.com/Wynntils/Wynntils/commit/1a93a1eb9decc0acf497c7f923a3032c00c5e65b))
* **release:** v1.15.1-beta.3 [skip ci] ([ffab244](https://github.com/Wynntils/Wynntils/commit/ffab244e16a0ab9c3613b11f732ae0e1d2be7719))

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CG3 is the duration string (eg. "1:23")
https://regexr.com/729qc
*/
private static final Pattern TAB_EFFECT_PATTERN = Pattern.compile("(.+?§7 ?(?:\\d+(?:\\.\\d+)?%)?) ?([%\\-+\\/\\da-zA-Z\\s]+?) §[84a]\\((.+?)\\).*");
private static final Pattern TAB_EFFECT_PATTERN = Pattern.compile("(.+?§7 ?(?:\\d+(?:\\.\\d+)?%)?) ?(['%\\-+\\/\\da-zA-Z\\s]+?) §[84a]\\((.+?)\\).*");

/**
* Updates the ConsumableTimerOverlay with the effects from the tab list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@
import com.wynntils.core.framework.rendering.colors.CommonColors;
import com.wynntils.core.framework.rendering.colors.CustomColor;
import com.wynntils.core.framework.rendering.textures.Textures;
import com.wynntils.core.utils.StringUtils;
import com.wynntils.core.utils.objects.Storage;
import com.wynntils.modules.map.configs.MapConfig;
import com.wynntils.modules.map.instances.GuildResourceContainer;
import com.wynntils.modules.map.instances.MapProfile;
import com.wynntils.modules.map.managers.GuildResourceManager;
import com.wynntils.modules.map.overlays.renderer.MapInfoUI;
import com.wynntils.webapi.WebManager;
import com.wynntils.webapi.profiles.TerritoryProfile;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.text.TextFormatting;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

public class MapTerritory {

private static final CustomColor territoryNameColour = new CustomColor(CommonColors.WHITE);
private static final HashMap<String, CustomColor> backupGuildColors = new HashMap<>();

ScreenRenderer renderer = null;

Expand Down Expand Up @@ -64,7 +68,7 @@ public MapTerritory(TerritoryProfile territory) {
description.add(TextFormatting.GRAY + "✦ Treasury: " + resources.getTreasury());
description.add(TextFormatting.GRAY + "Territory Defences: " + resources.getDefences());
description.add("");

String treasuryColor = resources.getTreasury().substring(0, 2);
description.add(TextFormatting.GRAY + "Time held: " + treasuryColor + territory.getReadableRelativeTimeAcquired());

Expand Down Expand Up @@ -160,12 +164,26 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks, boolean terri
}

private CustomColor getTerritoryColor(boolean resourceColor) {
if (!resourceColor) {
return territory.getGuildColor() == null ? StringUtils.colorFromString(territory.getGuild()) :
StringUtils.colorFromHex(territory.getGuildColor());
} else {
return resources.getColor();
if (resourceColor) return resources.getColor();

if (WebManager.getGuildColors().containsKey(territory.getGuild())) {
return WebManager.getGuildColors().get(territory.getGuild());
}

// Guild not found in the list, check backup list and add a random color if not found
if (!backupGuildColors.containsKey(territory.getGuild())) {
Random random = new Random();
backupGuildColors.put(
territory.getGuild(),
CustomColor.fromHSV(
random.nextFloat(),
random.nextFloat(),
0.5f + random.nextFloat() * 0.5f,
1f
)
);
}
return backupGuildColors.get(territory.getGuild());
}

public void postDraw(int mouseX, int mouseY, float partialTicks, int width, int height) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import com.wynntils.core.framework.instances.Module;
import com.wynntils.core.framework.interfaces.annotations.ModuleInfo;
import com.wynntils.modules.questbook.commands.CommandExportDiscoveries;
import com.wynntils.modules.questbook.commands.CommandExportFavorites;
import com.wynntils.modules.questbook.configs.QuestBookConfig;
import com.wynntils.modules.questbook.enums.Guides;
import com.wynntils.modules.questbook.enums.QuestBookPages;
import com.wynntils.modules.questbook.events.ClientEvents;
import com.wynntils.modules.questbook.managers.QuestManager;
import com.wynntils.modules.questbook.overlays.hud.TrackedQuestOverlay;
import net.minecraftforge.client.settings.KeyConflictContext;
import org.lwjgl.input.Keyboard;
Expand All @@ -31,6 +31,7 @@ public void onEnable() {
registerOverlay(new TrackedQuestOverlay(), Priority.HIGHEST);

registerCommand(new CommandExportDiscoveries());
registerCommand(new CommandExportFavorites());

registerKeyBinding("Open Quest Book", Keyboard.KEY_K, "Wynntils", KeyConflictContext.IN_GAME, true, () -> QuestBookPages.QUESTS.getPage().open(true));
registerKeyBinding("Open Discoveries", Keyboard.KEY_U, "Wynntils", KeyConflictContext.IN_GAME, true, () -> QuestBookPages.DISCOVERIES.getPage().open(true));
Expand All @@ -39,7 +40,7 @@ public void onEnable() {
registerKeyBinding("Open HUD configuration", Keyboard.KEY_NONE, "Wynntils", KeyConflictContext.IN_GAME, true, () -> QuestBookPages.HUDCONFIG.getPage().open(true));
registerKeyBinding("Open Menu", Keyboard.KEY_I, "Wynntils", KeyConflictContext.IN_GAME, true, () -> {
QuestBookPages.MAIN.getPage().open(true);
QuestManager.readQuestBook();
//QuestManager.readQuestBook();
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* * Copyright © Wynntils - 2022.
*/

package com.wynntils.modules.questbook.commands;

import com.wynntils.McIf;
import com.wynntils.core.utils.Utils;
import com.wynntils.modules.utilities.configs.UtilitiesConfig;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.event.ClickEvent;
import net.minecraftforge.client.IClientCommand;

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

public class CommandExportFavorites extends CommandBase implements IClientCommand {


@Override
public String getName() {
return "exportfavorites";
}

@Override
public boolean allowUsageWithoutPrefix(ICommandSender sender, String message) {
return false;
}

@Override
public String getUsage(ICommandSender sender) {
return "exportfavorites";
}

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
ITextComponent command = new TextComponentString("/exportfavorites");
command.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/exportfavorites"));

List<String> combinedList = new ArrayList<>();
combinedList.addAll(UtilitiesConfig.INSTANCE.favoriteItems);
combinedList.addAll(UtilitiesConfig.INSTANCE.favoriteIngredients);
combinedList.addAll(UtilitiesConfig.INSTANCE.favoritePowders);
combinedList.addAll(UtilitiesConfig.INSTANCE.favoriteEmeraldPouches);

Utils.copyToClipboard("wynntilsFavorites," + String.join(",", combinedList));
McIf.player().sendMessage(new TextComponentString(TextFormatting.GREEN + "Copied favorites to clipboard! Open the guide list and click the + button on Artemis to import them."));
}

@Override
public int getRequiredPermissionLevel() {
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void updateQuestBook(TickEvent.ClientTickEvent e) {

QuestBookPages.MAIN.getPage().open(true);

QuestManager.readQuestBook();
//QuestManager.readQuestBook();
}

private int tickCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
import com.wynntils.core.framework.rendering.ScreenRenderer;
import com.wynntils.core.framework.rendering.SmartFontRenderer;
import com.wynntils.core.framework.rendering.colors.CommonColors;
import com.wynntils.modules.questbook.overlays.ui.DialoguePage;
import com.wynntils.modules.questbook.overlays.ui.DiscoveriesPage;
import com.wynntils.modules.questbook.overlays.ui.QuestsPage;
import net.minecraft.client.gui.ScaledResolution;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
Expand Down Expand Up @@ -49,49 +53,54 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
{
preEntries(mouseX, mouseY, partialTicks);

// Page Text
render.drawString(currentPage + " / " + pages, x + 80, y + 88, CommonColors.BLACK, SmartFontRenderer.TextAlignment.MIDDLE, SmartFontRenderer.TextShadow.NONE);
if (this instanceof QuestsPage || this instanceof DiscoveriesPage || this instanceof DialoguePage) {
// Page Text
render.drawString(currentPage + " / " + pages, x + 80, y + 88, CommonColors.BLACK, SmartFontRenderer.TextAlignment.MIDDLE, SmartFontRenderer.TextShadow.NONE);
List<String> textLines = Arrays.asList("The Wynntils quest book is", "no longer available on 1.12.2.", "", "Wynntils 1.12.2 is being", "sunset in favour of newer", "Minecraft versions.", "", "Please download the latest", "version of the mod at", "https://wynntils.com");
drawTextLines(textLines, x + 10, y - 40, 1);

//Forward and backward button
drawForwardAndBackButtons(x, y, posX, posY, currentPage, pages);

// Draw all Search Results
if (search.size() > 0) {
List<T> page = search.get(currentPage - 1);

if (page.size() > 0) {
for (int i = 0; i < page.size(); i++) {
T currentItem = page.get(i);

if (isHovered(i, posX, posY) && !showAnimation) {
//hovered
drawEntry(currentItem, i, true);

selectedEntry = currentItem;
//selected is set relative to the page
selected = i;
hoveredText = getHoveredText(selectedEntry);
} else {
if (selected == i) {
selectedEntry = null;
} else {
//Forward and backward button
drawForwardAndBackButtons(x, y, posX, posY, currentPage, pages);

// Draw all Search Results
if (search.size() > 0) {
List<T> page = search.get(currentPage - 1);

if (page.size() > 0) {
for (int i = 0; i < page.size(); i++) {
T currentItem = page.get(i);

if (isHovered(i, posX, posY) && !showAnimation) {
//hovered
drawEntry(currentItem, i, true);

selectedEntry = currentItem;
//selected is set relative to the page
selected = i;
hoveredText = getHoveredText(selectedEntry);
} else {
if (selected == i) {
selectedEntry = null;
}

//not hovered
drawEntry(currentItem, i, false);
}

//not hovered
drawEntry(currentItem, i, false);
}
}
}
} else {
String textToDisplay = getEmptySearchString();
int currentY = 12;
} else {
String textToDisplay = getEmptySearchString();
int currentY = 12;

for (String line : textToDisplay.split("\n")) {
currentY += render.drawSplitString(line, 120, x + 26, y - 95 + currentY, 10, CommonColors.BLACK, SmartFontRenderer.TextAlignment.LEFT_RIGHT, SmartFontRenderer.TextShadow.NONE) * 10 + 2;
}
for (String line : textToDisplay.split("\n")) {
currentY += render.drawSplitString(line, 120, x + 26, y - 95 + currentY, 10, CommonColors.BLACK, SmartFontRenderer.TextAlignment.LEFT_RIGHT, SmartFontRenderer.TextShadow.NONE) * 10 + 2;
}

updateSearch();
updateSearch();
}
postEntries(mouseX, mouseY, partialTicks);
}
postEntries(mouseX, mouseY, partialTicks);
}
ScreenRenderer.endGL();
renderHoveredText(mouseX, mouseY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void updateAnalysis(Collection<AnalysePosition> position, boolean
}

if (immediate) {
readQuestBook();
//readQuestBook();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<String> getHoveredDescription() {
public void open(boolean showAnimation) {
super.open(showAnimation);

QuestManager.readQuestBook();
//QuestManager.readQuestBook();
}

@Override
Expand Down
Loading

0 comments on commit c5b1127

Please sign in to comment.