mirror of
https://github.com/DarkKronicle/AdvancedChatHUD.git
synced 2026-11-05 09:00:22 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79e7212336 | ||
|
|
9db76f31c9 | ||
|
|
75935c7df0 | ||
|
|
bb49775203 | ||
|
|
0d81abefb4 | ||
|
|
f6a32e1ddd |
No files matched your search
@@ -11,9 +11,17 @@ jobs:
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 17
|
||||
- name: Change wrapper permissions
|
||||
run: chmod +x ./gradlew
|
||||
- name: Upload to Discord
|
||||
run: ./gradlew discord --stacktrace
|
||||
if: |
|
||||
!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
|
||||
env:
|
||||
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
action_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
- name: Capture build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Artifacts
|
||||
path: build/libs/
|
||||
@@ -0,0 +1,36 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
previousVersion:
|
||||
description: 'Previous Version (Do not include v prefix, must be same as the last version tag! Example: 1.4.1)'
|
||||
required: true
|
||||
version:
|
||||
description: 'Version (Do not include v prefix! Example: 1.4.2)'
|
||||
required: true
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- name: Fetch tags
|
||||
run: git fetch --tags
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 17
|
||||
- name: Change wrapper permissions
|
||||
run: chmod +x ./gradlew
|
||||
- name: Upload to websites
|
||||
run: ./gradlew publishThirdParty --stacktrace -PlastTag="v${{ github.event.inputs.previousVersion }}" -PcurrentTag="v${{ github.event.inputs.version }}"
|
||||
if: |
|
||||
!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
|
||||
env:
|
||||
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
curseforge_token: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||
github_token: ${{ secrets.GH_API_KEY }}
|
||||
discord_release_webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
|
||||
- name: Capture build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Artifacts
|
||||
path: build/libs/
|
||||
+4
-68
@@ -1,13 +1,11 @@
|
||||
import javax.net.ssl.HttpsURLConnection
|
||||
import java.nio.file.Files
|
||||
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.0-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
id "io.freefair.lombok" version "6.0.0-m2"
|
||||
id "com.diffplug.spotless" version "5.17.1"
|
||||
}
|
||||
|
||||
apply from: 'https://raw.githubusercontent.com/DarkKronicle/GradleScripts/main/gradle/publish.gradle'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
@@ -31,7 +29,7 @@ dependencies {
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
||||
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.19.0:${project.malilib_version}"
|
||||
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.19.3:${project.malilib_version}"
|
||||
modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}"
|
||||
}
|
||||
|
||||
@@ -60,19 +58,6 @@ jar {
|
||||
from "LICENSE.txt"
|
||||
}
|
||||
|
||||
spotless {
|
||||
ratchetFrom 'origin/main'
|
||||
format 'misc', {
|
||||
// define the files to apply `misc` to
|
||||
target '*.gradle', '*.md', '.gitignore'
|
||||
|
||||
// define the steps to apply to those files
|
||||
trimTrailingWhitespace()
|
||||
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
@@ -93,52 +78,3 @@ publishing {
|
||||
// mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
task discord {
|
||||
dependsOn build
|
||||
|
||||
doLast {
|
||||
String webhook
|
||||
if (additionalProperties["discord_webhook"] != null) {
|
||||
webhook = additionalProperties["discord_webhook"]
|
||||
} else if (System.getenv("discord_webhook") != null) {
|
||||
webhook = System.getenv("discord_webhook")
|
||||
} else {
|
||||
System.out.println("No webhook found...")
|
||||
return
|
||||
}
|
||||
|
||||
File file = remapJar.archiveFile.get().asFile
|
||||
String commitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()
|
||||
String fileName = "$project.archives_base_name}-${project.mod_version}-${commitHash}.jar"
|
||||
String text = "<:Kronos:799707832399691867> **${project.archives_base_name} v${project.mod_version}-${commitHash} for ${project.minecraft_version}**"
|
||||
URL url = new URL(webhook)
|
||||
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection()
|
||||
|
||||
def cmdLine = "git log --format=%B -n 1"
|
||||
def procCommit = cmdLine.execute()
|
||||
String changeLog = procCommit.in.getText()
|
||||
text = text + "\n" + changeLog
|
||||
|
||||
String boundary = UUID.randomUUID().toString()
|
||||
connection.setRequestMethod("POST")
|
||||
connection.setDoOutput(true)
|
||||
connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary)
|
||||
DataOutputStream stream = new DataOutputStream(connection.getOutputStream());
|
||||
|
||||
stream.writeBytes("--" + boundary + "\r\n")
|
||||
stream.writeBytes("Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n\r\n")
|
||||
stream.write(Files.readAllBytes(file.toPath()))
|
||||
stream.writeBytes("\r\n")
|
||||
stream.writeBytes("--" + boundary + "\r\n");
|
||||
stream.writeBytes('Content-Disposition: form-data; name="content"\r\n\r\n' + text + '\r\n')
|
||||
stream.writeBytes("--" + boundary + "--\r\n")
|
||||
|
||||
stream.flush()
|
||||
stream.close()
|
||||
|
||||
connection.getInputStream().close()
|
||||
connection.disconnect()
|
||||
}
|
||||
|
||||
}
|
||||
+24
-8
@@ -1,13 +1,29 @@
|
||||
minecraft_version=1.19
|
||||
yarn_mappings=1.19+build.4
|
||||
loader_version=0.14.8
|
||||
fabric_api_version=0.57.0+1.19
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.2
|
||||
loader_version=0.14.11
|
||||
fabric_api_version=0.68.1+1.19.3
|
||||
|
||||
mod_version=1.3.3
|
||||
mod_version=1.3.7
|
||||
maven_group=io.github.darkkronicle
|
||||
archives_base_name=AdvancedChatHUD
|
||||
|
||||
malilib_version = 0.13.0
|
||||
startParameter.excludedTaskNames=spotlessCheck
|
||||
malilib_version = 0.14.0
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
advancedchat_version=1.5.3-build1
|
||||
advancedchat_version=v1.5.9
|
||||
|
||||
# Uploading data
|
||||
curseforge_slug=advancedchathud
|
||||
curseforge_id=541708
|
||||
|
||||
modrinth_slug=advancedchathud
|
||||
modrinth_id=lBFvglCF
|
||||
|
||||
# default_release_type can be stable, beta, or alpha
|
||||
default_release_type=stable
|
||||
project_name=AdvancedChatHUD
|
||||
project_url=https://modrinth.com/mod/advancedchathud
|
||||
project_logo=https://raw.githubusercontent.com/Prospector/images/master/modmenu-logo.png
|
||||
project_color=0x134bff
|
||||
changelog_hide_unimportant_commits=true
|
||||
changelog_max_commit_search=200
|
||||
discord_webhook_changelog_line_limit=10
|
||||
@@ -128,6 +128,7 @@ public class ChatWindow {
|
||||
for (int i = messages.size() - 1; i >= 0; i--) {
|
||||
addMessage(messages.get(i), false, false);
|
||||
}
|
||||
WindowManager.getInstance().setSelected(this);
|
||||
}
|
||||
|
||||
public void addMessage(HudChatMessage message) {
|
||||
|
||||
@@ -24,7 +24,11 @@ import io.github.darkkronicle.advancedchathud.itf.IChatHud;
|
||||
import io.github.darkkronicle.advancedchathud.tabs.AbstractChatTab;
|
||||
import io.github.darkkronicle.advancedchathud.tabs.CustomChatTab;
|
||||
import io.github.darkkronicle.advancedchathud.tabs.MainChatTab;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -38,7 +42,7 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
|
||||
private static final WindowManager INSTANCE = new WindowManager();
|
||||
private final MinecraftClient client;
|
||||
private LinkedList<ChatWindow> windows = new LinkedList<>();
|
||||
private final List<ChatWindow> windows = new ArrayList<>(8);
|
||||
private int dragX = 0;
|
||||
private int dragY = 0;
|
||||
private ChatWindow drag = null;
|
||||
@@ -56,13 +60,19 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
windows.clear();
|
||||
}
|
||||
|
||||
private void addWindow(ChatWindow window) {
|
||||
// Remove duplicates being spawned from somewhere
|
||||
windows.removeIf(w -> w == window);
|
||||
windows.add(window);
|
||||
}
|
||||
|
||||
public void loadFromJson(JsonArray array) {
|
||||
reset();
|
||||
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
|
||||
if (array == null || array.size() == 0) {
|
||||
ChatWindow base = new ChatWindow(AdvancedChatHud.MAIN_CHAT_TAB);
|
||||
base.setSelected(true);
|
||||
windows.add(base);
|
||||
addWindow(base);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -85,7 +95,7 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
AdvancedChatHud.LOGGER.error("Error while loading in ChatWindow ", err);
|
||||
continue;
|
||||
}
|
||||
windows.add(w);
|
||||
addWindow(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +184,8 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
for (ChatWindow w : windows) {
|
||||
w.setSelected(window.equals(w));
|
||||
}
|
||||
windows.remove(window);
|
||||
windows.addFirst(window);
|
||||
windows.removeIf(w -> w == window);
|
||||
windows.add(0, window);
|
||||
|
||||
if (!HudConfigStorage.General.CHANGE_START_MESSAGE.config.getBooleanValue() || !(client.currentScreen instanceof AdvancedChatScreen screen)) {
|
||||
return;
|
||||
@@ -297,7 +307,7 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
sel = window;
|
||||
}
|
||||
window.setPosition(sel.getConvertedX() + 15, sel.getConvertedY() + 15);
|
||||
windows.add(window);
|
||||
// windows.add(window);
|
||||
setSelected(window);
|
||||
}
|
||||
|
||||
@@ -353,7 +363,6 @@ public class WindowManager implements IRenderer, ResolutionEventHandler {
|
||||
window.setRelativeDimensions(hovered.getWidthPercent(), hovered.getHeightPercent());
|
||||
window.setVisibility(hovered.getVisibility());
|
||||
window.setPosition(x, y);
|
||||
windows.add(window);
|
||||
setSelected(window);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
public abstract class MixinChatHud implements IChatHud {
|
||||
|
||||
@Shadow @Final private MinecraftClient client;
|
||||
@Shadow @Final private List<ChatHudLine<Text>> messages;
|
||||
@Shadow @Final private List<ChatHudLine<OrderedText>> visibleMessages;
|
||||
@Shadow @Final private List<ChatHudLine> messages;
|
||||
@Shadow @Final private List<ChatHudLine.Visible> visibleMessages;
|
||||
|
||||
@Shadow private int scrolledLines;
|
||||
@Shadow private boolean hasUnreadNewMessages;
|
||||
@@ -72,7 +72,7 @@ public abstract class MixinChatHud implements IChatHud {
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "render", cancellable = true)
|
||||
private void render(MatrixStack stack, int delta, CallbackInfo ci) {
|
||||
private void render(MatrixStack stack, int delta, int mouseX, int mouseY, CallbackInfo ci) {
|
||||
// Ignore rendering vanilla chat if disabled
|
||||
if (!HudConfigStorage.General.VANILLA_HUD.config.getBooleanValue()) {
|
||||
ci.cancel();
|
||||
@@ -136,8 +136,7 @@ public abstract class MixinChatHud implements IChatHud {
|
||||
OrderedText orderedText;
|
||||
for (Iterator<OrderedText> text = list.iterator();
|
||||
text.hasNext();
|
||||
this.visibleMessages.add(
|
||||
0, new ChatHudLine<>(msg.getCreationTick(), orderedText, msg.getId()))) {
|
||||
this.visibleMessages.add(0, new ChatHudLine.Visible(msg.getCreationTick(), orderedText, msg.getIndicator(), !text.hasNext()))) {
|
||||
orderedText = text.next();
|
||||
if (this.isChatFocused() && this.scrolledLines > 0) {
|
||||
this.hasUnreadNewMessages = true;
|
||||
@@ -150,8 +149,7 @@ public abstract class MixinChatHud implements IChatHud {
|
||||
this.visibleMessages.remove(this.visibleMessages.size() - 1);
|
||||
}
|
||||
|
||||
this.messages.add(
|
||||
0, new ChatHudLine<>(msg.getCreationTick(), msg.getDisplayText(), msg.getId()));
|
||||
this.messages.add(0, new ChatHudLine(msg.getCreationTick(), msg.getDisplayText(), msg.getSignature(), msg.getIndicator()));
|
||||
while (this.messages.size()
|
||||
> HudConfigStorage.General.STORED_LINES.config.getIntegerValue()) {
|
||||
this.messages.remove(this.messages.size() - 1);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.8.9+build.204",
|
||||
"fabric": "*",
|
||||
"minecraft": ">=1.19",
|
||||
"minecraft": ">=1.19.3",
|
||||
"malilib": ">=0.13.0",
|
||||
"advancedchatcore": ">=1.5.2-1.19"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user