Compare commits

...
Author SHA1 Message Date
miozune e8d8c1994b Add tooltip pagination (#343) 2023-02-03 15:35:03 +01:00
Raven Szewczyk 195b47944f There is no more 1.7.10- in the gha urls (#342) 2023-01-31 19:21:17 +01:00
Raven Szewczyk 3224fdef7d [ci skip] upgraded build system 2023-01-31 09:54:53 +00:00
6 changed files with 67 additions and 18 deletions

No files matched your search

+8 -14
View File
@@ -1,4 +1,4 @@
//version: 1675074449
//version: 1675173326
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -66,7 +66,7 @@ plugins {
id 'com.diffplug.spotless' version '6.7.2' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.18'
id 'com.gtnewhorizons.retrofuturagradle' version '1.1.3'
}
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
@@ -166,6 +166,9 @@ pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
"kaptMcLauncherKotlin",
"kaptPatchedMcKotlin",
"kaptInjectedTagsKotlin",
"kspMcLauncherKotlin",
"kspPatchedMcKotlin",
"kspInjectedTagsKotlin",
]
tasks.configureEach { task ->
if (task.name in disabledKotlinTaskList) {
@@ -334,7 +337,7 @@ if (identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
}
group = modGroup
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
} else {
@@ -711,16 +714,6 @@ if (usesShadowedDependencies.toBoolean()) {
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar
tasks.named('extractForgeUserdev', Copy).configure { efu ->
doLast {
// Fix CoFH-repackaged CCL not finding mappings
project.copy {
from(mcpTasks.userdevDir("conf"))
into(new File(project.buildDir, "unpacked/conf"))
}
}
}
tasks.register('apiJar', Jar) {
from(sourceSets.main.allSource) {
include modGroupPath + "/" + apiPackagePath + '/**'
@@ -750,6 +743,7 @@ idea {
module {
downloadJavadoc = true
downloadSources = true
inheritOutputDirs = true
}
project {
settings {
@@ -825,7 +819,7 @@ publishing {
artifact apiJar
}
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
// Using the identified version, not project.version as it has the prepended 1.7.10
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
@@ -221,6 +221,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
return true;
}
if (NEIClientConfig.isKeyHashDown("gui.next_tooltip")) {
GuiContainerManager.incrementTooltipPage();
return true;
}
if (isEnabled() && !isHidden()) {
for (Widget widget : controlWidgets) if (inputFocused == null) widget.lastKeyTyped(keyID, keyChar);
}
@@ -345,6 +345,7 @@ public class NEIClientConfig {
API.addHashBind("gui.hide_bookmarks", Keyboard.KEY_B);
API.addKeyBind("gui.getprevioussearch", Keyboard.KEY_UP);
API.addKeyBind("gui.getnextsearch", Keyboard.KEY_DOWN);
API.addKeyBind("gui.next_tooltip", Keyboard.KEY_Z);
API.addKeyBind("world.chunkoverlay", Keyboard.KEY_F9);
API.addKeyBind("world.moboverlay", Keyboard.KEY_F7);
@@ -5,7 +5,7 @@ import static codechicken.lib.gui.GuiDraw.fontRenderer;
import static codechicken.lib.gui.GuiDraw.getMousePosition;
import static codechicken.lib.gui.GuiDraw.renderEngine;
import java.awt.Point;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -32,6 +32,7 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.recipe.StackInfo;
@@ -497,7 +498,49 @@ public class GuiContainerManager {
if (tooltip.size() > 0) tooltip.set(0, tooltip.get(0) + GuiDraw.TOOLTIP_LINESPACE); // add space after 'title'
drawMultilineTip(font, mousex + 12, mousey - 12, tooltip);
drawPagedTooltip(font, mousex + 12, mousey - 12, tooltip);
}
private static int tooltipPage;
public static void drawPagedTooltip(FontRenderer font, int x, int y, List<String> list) {
if (list.isEmpty()) return;
List<List<String>> tooltips = splitTooltipByPage(list);
tooltipPage = tooltipPage < tooltips.size() ? tooltipPage : 0;
if (tooltips.size() > 1) {
tooltips.get(tooltipPage).add(
EnumChatFormatting.ITALIC + NEIClientUtils.translate(
"inventory.tooltip.page",
tooltipPage + 1,
tooltips.size(),
Keyboard.getKeyName(NEIClientConfig.getKeyBinding("gui.next_tooltip"))));
}
drawMultilineTip(font, x, y, tooltips.get(tooltipPage));
}
public static List<List<String>> splitTooltipByPage(List<String> list) {
List<List<String>> ret = new ArrayList<>();
List<String> tmp = new ArrayList<>();
int height = -2;
for (int i = 0; i < list.size(); i++) {
String text = list.get(i);
GuiDraw.ITooltipLineHandler line = GuiDraw.getTipLine(text);
int lineHeight = line != null ? line.getSize().height
: text.endsWith(GuiDraw.TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10;
if (height + lineHeight <= GuiDraw.displaySize().height - 8 * 2 - 10) {
// top & bottom 8px + last line for showing page
height += lineHeight;
} else {
ret.add(new ArrayList<>(tmp));
tmp.clear();
height = -2;
}
tmp.add(text);
}
if (!tmp.isEmpty()) {
ret.add(tmp);
}
return ret;
}
public static boolean shouldShowTooltip(GuiContainer window) {
@@ -516,6 +559,10 @@ public class GuiContainerManager {
}
}
public static void incrementTooltipPage() {
tooltipPage++;
}
public void renderSlotUnderlay(Slot slot) {
for (IContainerDrawHandler drawHandler : drawHandlers) drawHandler.renderSlotUnderlay(window, slot);
}
@@ -56,6 +56,7 @@ nei.inventory.current.gamemode.0=Current gamemode: survival
nei.inventory.current.gamemode.1=Current gamemode: creative
nei.inventory.current.gamemode.2=Current gamemode: creative+
nei.inventory.current.gamemode.3=Current gamemode: adventure
nei.inventory.tooltip.page=Page: %s / %s [Press %s to see next page]
nei.inventory.gamemode.0=Click: Set gamemode to survival
nei.inventory.gamemode.1=Click: Set gamemode to creative
@@ -108,6 +109,7 @@ nei.options.keys.gui.overlay_hide=Hide Overlay Recipe
nei.options.keys.gui.overlay_use=Use Overlay Recipe
nei.options.keys.gui.getprevioussearch=Previous Search
nei.options.keys.gui.getnextsearch=Next Search
nei.options.keys.gui.next_tooltip=Next Tooltip
nei.options.keys.world=World
nei.options.keys.world.chunkoverlay=Chunk Boundary Overlay
nei.options.keys.world.moboverlay=Mob Spawn Overlay
+2 -2
View File
@@ -1,7 +1,7 @@
{
"repo": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.1.6/",
"file": "CodeChickenLib-1.7.10-1.1.6.jar",
"dev": "CodeChickenLib-1.7.10-1.1.6-dev.jar",
"file": "CodeChickenLib-1.1.6.jar",
"dev": "CodeChickenLib-1.1.6-dev.jar",
"class": "codechicken.lib.asm.ASMHelper",
"coreLib": true
}