Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Dec 31, 2023
2 parents 78b27f8 + b1f75e6 commit 7072c74
Show file tree
Hide file tree
Showing 24 changed files with 746 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
sed -i 's/debug="false"/debug="true"/' build.xml
ant -noinput -buildfile build.xml
- name: Upload artifact
if: ${{ github.actor != 'NearInfinityBrowser' }}
if: ${{ github.repository == 'Argent77/NearInfinity' }}
uses: pyTooling/Actions/releaser@r0
with:
tag: nightly
Expand Down
138 changes: 138 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# This workflow will build a Java project with Apache Ant and upload the created artifacts
# on pushes to the master branch.

name: Java CD with Apache Ant

on:
push:
branches: [ "master" ]
workflow_dispatch:
branches: [ "master", "devel" ]

permissions:
contents: read

jobs:
# Build and upload NearInfinity.jar
deploy-jar:
if: ${{ github.repository == 'Argent77/NearInfinity' }}
runs-on: ubuntu-latest
name: Build NearInfinity.jar
outputs:
ni_version: ${{ steps.ni-build.outputs.NI_VERSION }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Build with Ant
id: ni-build
run: |
ant -noinput -buildfile build.xml
echo "NI_VERSION=$(java -jar "NearInfinity.jar" -version 2>/dev/null | grep -Eo '[0-9]{8}')" >> "$GITHUB_OUTPUT"
- name: Upload JAR artifact
uses: actions/upload-artifact@v3
with:
name: NearInfinity-${{ steps.ni-build.outputs.NI_VERSION }}
path: NearInfinity.jar

# Build and upload installer versions for Windows and macOS
deploy-installer:
if: ${{ github.repository == 'Argent77/NearInfinity' }}
needs: deploy-jar
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]
java: [ '21' ]
runs-on: ${{ matrix.os }}
name: Create installer for ${{ matrix.os }}, JDK ${{ matrix.java }}
steps:
# Initializations
- name: Git checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Echo JAVA_HOME (windows)
if: (matrix.os == 'windows-latest')
run: |
echo $env:JAVA_HOME
java -version
- name: Echo JAVA_HOME (macos)
if: (matrix.os != 'windows-latest')
run: |
echo $JAVA_HOME
java -version
# Preparations
- name: Download JAR artifact
uses: actions/download-artifact@v3
with:
name: NearInfinity-${{ needs.deploy-jar.outputs.ni_version }}
path: jar

- name: Set up installer data
uses: actions/checkout@v4
with:
repository: NearInfinityBrowser/NearInfinity-assets
path: assets

# Building
- name: Build portable archive and installer (windows)
if: (matrix.os == 'windows-latest')
run: |
move assets\redistributable\windows\package .
move assets\redistributable\windows\build-image.cmd .
move assets\redistributable\windows\build-installer.cmd .
.\build-image.cmd
.\build-installer.cmd
- name: Build installer (macos)
if: (matrix.os == 'macos-latest')
run: |
mv assets/redistributable/macos/package .
mv assets/redistributable/macos/build.command .
chmod +x build.command
./build.command
# Validation
- name: List built files (windows)
if: (matrix.os == 'windows-latest')
run: dir

- name: List built files (macos)
if: (matrix.os == 'macos-latest')
run: ls -l

# Uploading
- name: Upload portable artifact (windows)
if: (matrix.os == 'windows-latest')
uses: actions/upload-artifact@v3
with:
name: portable-windows
path: NearInfinity-*.zip

- name: Upload exe artifact (windows)
if: (matrix.os == 'windows-latest')
uses: actions/upload-artifact@v3
with:
name: installer-windows
path: NearInfinity-*.exe

- name: Upload pkg artifact (macos)
if: (matrix.os == 'macos-latest')
uses: actions/upload-artifact@v3
with:
name: installer-macos
path: NearInfinity-*.pkg
3 changes: 3 additions & 0 deletions src/org/infinity/AppOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ public class AppOption {
public static final AppOption BCS_INDENT = new AppOption(OptionsMenuItem.OPTION_BCS_INDENT, "Indentation", 1);

// Category: Misc. Types
/** Menu Options > Misc. Types: AutoAlign2da (Integer, Default: 0) */
public static final AppOption AUTO_ALIGN_2DA = new AppOption(OptionsMenuItem.OPTION_2DA_AUTOALIGN,
"Auto-Align 2DA Columns", 0);
/** Menu Options > Misc. Types: GlslColorScheme (Integer, Default: 0) */
public static final AppOption GLSL_COLOR_SCHEME = new AppOption(OptionsMenuItem.OPTION_GLSL_COLORSCHEME,
"GLSL Color Scheme", 0);
Expand Down
9 changes: 7 additions & 2 deletions src/org/infinity/NearInfinity.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

public final class NearInfinity extends JFrame implements ActionListener, ViewableContainer {
// the current Near Infinity version
private static final String VERSION = "v2.4-20230729";
private static final String VERSION = "v2.4-20231231";

// the minimum supported Java version
private static final int JAVA_VERSION_MIN = 8;
Expand Down Expand Up @@ -247,6 +247,7 @@ private static Path findKeyfile() {
} else {
chooser = new JFileChooser(Profile.getGameRoot().toFile());
}
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle("Open game: Locate keyfile");
chooser.setFileFilter(new FileFilter() {
@Override
Expand Down Expand Up @@ -888,7 +889,11 @@ public boolean removeViewable() {
}

public void showResourceEntry(ResourceEntry resourceEntry) {
tree.select(resourceEntry);
showResourceEntry(resourceEntry, null);
}

public void showResourceEntry(ResourceEntry resourceEntry, Operation doneOperation) {
tree.select(resourceEntry, doneOperation);
}

public void quit() {
Expand Down
7 changes: 4 additions & 3 deletions src/org/infinity/check/BCSIDSChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ public void actionPerformed(ActionEvent event) {
int row = table.getSelectedRow();
if (row != -1) {
ResourceEntry resourceEntry = (ResourceEntry) table.getValueAt(row, 0);
NearInfinity.getInstance().showResourceEntry(resourceEntry);
BcsResource bcsfile = (BcsResource) NearInfinity.getInstance().getViewable();
bcsfile.highlightText(((Integer) table.getValueAt(row, 2)), null);
NearInfinity.getInstance().showResourceEntry(resourceEntry, () -> {
final BcsResource bcsfile = (BcsResource) NearInfinity.getInstance().getViewable();
bcsfile.highlightText(((Integer) table.getValueAt(row, 2)), null);
});
}
} else if (event.getSource() == bopennew) {
int row = table.getSelectedRow();
Expand Down
6 changes: 3 additions & 3 deletions src/org/infinity/check/CreInvChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void actionPerformed(ActionEvent event) {
int row = table.getSelectedRow();
if (row != -1) {
ResourceEntry resourceEntry = (ResourceEntry) table.getValueAt(row, 0);
NearInfinity.getInstance().showResourceEntry(resourceEntry);
((AbstractStruct) NearInfinity.getInstance().getViewable()).getViewer()
.selectEntry(((Item) table.getValueAt(row, 2)).getName());
NearInfinity.getInstance().showResourceEntry(resourceEntry,
() -> ((AbstractStruct)NearInfinity.getInstance().getViewable()).getViewer()
.selectEntry(((Item)table.getValueAt(row, 2)).getName()));
}
} else if (event.getSource() == bopennew) {
int row = table.getSelectedRow();
Expand Down
7 changes: 4 additions & 3 deletions src/org/infinity/check/DialogChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ public void actionPerformed(ActionEvent event) {
int row = table.getSelectedRow();
if (row != -1) {
ResourceEntry resourceEntry = (ResourceEntry) table.getValueAt(row, 0);
NearInfinity.getInstance().showResourceEntry(resourceEntry);
((AbstractStruct) NearInfinity.getInstance().getViewable()).getViewer()
.selectEntry((String) table.getValueAt(row, 1));
final SortableTable tableCapture = table;
NearInfinity.getInstance().showResourceEntry(resourceEntry,
() -> ((AbstractStruct)NearInfinity.getInstance().getViewable()).getViewer()
.selectEntry((String)tableCapture.getValueAt(row, 1)));
}
} else if (event.getSource() == bopennew) {
int row = table.getSelectedRow();
Expand Down
7 changes: 4 additions & 3 deletions src/org/infinity/check/ScriptChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ public void actionPerformed(ActionEvent event) {
int row = table.getSelectedRow();
if (row != -1) {
ResourceEntry resourceEntry = (ResourceEntry) table.getValueAt(row, 0);
NearInfinity.getInstance().showResourceEntry(resourceEntry);
((BcsResource) NearInfinity.getInstance().getViewable()).highlightText(((Integer) table.getValueAt(row, 2)),
null);
final SortableTable tableCapture = table;
NearInfinity.getInstance().showResourceEntry(resourceEntry,
() -> ((BcsResource)NearInfinity.getInstance().getViewable())
.highlightText(((Integer)tableCapture.getValueAt(row, 2)), null));
}
} else if (event.getSource() == bopennew) {
int row = table.getSelectedRow();
Expand Down
Loading

0 comments on commit 7072c74

Please sign in to comment.