Skip to content

Commit

Permalink
MapTool 1.4.5.0
Browse files Browse the repository at this point in the history
* #49: Add proper pathfinding taking VBL into account

	- Total WIP POC

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 - Cleaned up code a bit, Tweaked heuristic
 - Currently avoids any cell that has any VBL in it... to be tweaked
later

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 - Buildable version...

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* Bug Fix

 - Preference Diaglog would error if launched from JAR or IDE as it
would be missing native libs for JVMPreferences. StartUp tab is now
disabled if not launched from native executable/missing packager lib.

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 - More progress on A*
 - Added Terrain Modifiers calculation and option on Token properties
 - WIP on multi threading...

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* Bug Fix - Inno Setup

 - Restored iss prop so directory will always populate during windows
install
 -

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 - Token Properties UI changes

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* Enhancement - FoW optimization!

 - Changed circles to 'fake' circles (removing curves from geometry) for
faster Area.add calculations
 - WIP new "GRID" vision/light type!

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 - WIP A* Pathfinding
 - WIP new "GRID" vision/light type!

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* com.github.jai-imageio:jai-imageio-core bumped to 1.4.0 to support Java
9

Signed-off-by: Jamz <Jamz@Nerps.net>

* Changed Sentry.IO to not log in Development envrionments.

Signed-off-by: Jamz <Jamz@Nerps.net>

* Fixes Z Order Violation

Pulled from upstream: RPTools#179

Signed-off-by: Jamz <Jamz@Nerps.net>

* Enhancement - Video Backgrounds

 * POC to add video as a background map

49: Add proper pathfinding taking VBL into account

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* Enhancement - #49: Add proper pathfinding taking VBL into account

 * Finished POC for ASTar Pathfinding, code cleanup
 * Spotless Applied
 * Had to remove grgit.branch.current().name for now, getting errors for
unknown reason

Signed-off-by: Jamz <Jamz@Nerps.net>

* Updated Gradle Build

 * Removed JFX-Plugin
 * Updated Spotless version to 3.13

Signed-off-by: Jamz <Jamz@Nerps.net>

* Updated for Spotless

 * Current spotless can not handle <pre> tags in comment section. Open
issue in github: diffplug/spotless#191

Signed-off-by: Jamz <Jamz@Nerps.net>

* Enhancement - Java 10!

 * Updated packaged JRE to Java 10.

Signed-off-by: Jamz <Jamz@Nerps.net>

* Update .appveyor.yml

Added Linux build

* Update .travis.yml

Removed Linux from the matrix

* Moving linux build to appveyor

 * Setting JAVA_HOME for windows only per matrix

Signed-off-by: Jamz <Jamz@Nerps.net>

* Moving linux build to appveyor

 * Setting JAVA_HOME for windows only per matrix

Signed-off-by: Jamz <Jamz@Nerps.net>

* Another appveyor test

Signed-off-by: Jamz <Jamz@Nerps.net>

* YAT

Signed-off-by: Jamz <Jamz@Nerps.net>

* YAT

Signed-off-by: Jamz <Jamz@Nerps.net>

* Update .appveyor.yml

Trigger appveyor $%$@#%#

* Appveyor not kicking off...

Signed-off-by: Jamz <Jamz@Nerps.net>

* Enhancement - AutoUpdate

 * Added tag name to Auto Update message
 * Appveyor environment var bug fix

Signed-off-by: Jamz <Jamz@Nerps.net>

* YAT

Signed-off-by: Jamz <Jamz@Nerps.net>

* YAT

Appveyor not kicking off if only yml chnaged?


Signed-off-by: Jamz <Jamz@Nerps.net>

* YAT 2

Signed-off-by: Jamz <Jamz@Nerps.net>

* WTF

Signed-off-by: Jamz <Jamz@Nerps.net>

* Attempt #12

Signed-off-by: Jamz <Jamz@Nerps.net>

* Attempt #13

Signed-off-by: Jamz <Jamz@Nerps.net>

* looking for java...

Signed-off-by: Jamz <Jamz@Nerps.net>

* Attempt #15

Signed-off-by: Jamz <Jamz@Nerps.net>

* Attempt #16

Signed-off-by: Jamz <Jamz@Nerps.net>

* Sigh... manually install jdk 10

Signed-off-by: Jamz <Jamz@Nerps.net>

* Hrm

Signed-off-by: Jamz <Jamz@Nerps.net>

* Well, can we go with java 9 then?

Signed-off-by: Jamz <Jamz@Nerps.net>

* Update .appveyor.yml

Adding manual install of Open JDK 10

* Update .appveyor.yml

Checking gradle version

* Update .appveyor.yml

change to unix gradle wrapper

* Update .appveyor.yml

Attempting to install oracle's JDK 10...

* Update .appveyor.yml

sigh...will this ever work...

* Update .appveyor.yml

one more try, why not...

* Update .appveyor.yml

Getting closer... now setting JAVA_HOME

* Update .appveyor.yml

adding fakeroot...

* Update .appveyor.yml

learn to type...

* Update .appveyor.yml

Finally working version for linux, Final tweaks...

* Update .appveyor.yml

Adding windows back.
 * Note sh: commands should only run on linux, build scripts should run on both

* Update build.gradle

Updated vendor to Nerps from Nerps-BETA.

* Update .appveyor.yml

Attempt to fix false spotless fails on windows VM

* Update .appveyor.yml

Adding init stage

* Update .appveyor.yml

added tag: $(APPVEYOR_REPO_TAG_NAME)

* Update .appveyor.yml

Test if linux/windows order matters

* Update .appveyor.yml

Uppercased APPVEYOR_REPO_TAG for Linux

* Enhancement #68 - Changing Language

 * Added JVM User Option to change default MapTool language via Edit ->
Preferences -> Startup tab
 * Moved MAPTOOL_DATADIR from JvmOptions to userJvmOptions and enabled
user setting in Edit -> Preferences -> Startup tab

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 * Pathfinding now properly works for Hex grid!
 * Refactored and cleaned up code for AStar Pathfinding

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>

* #63 Restore default behavior of spacebar+left mouse click

 * Spacebar functionality has been restored to it's original behavior
including ctrl+spacebar & shift+spacebar as well.
 * A new shift+ctrl+spacebar command along with a new pointer image is
now available. When this keystroke combo is pressed, and you are a GM,
the pointer will center & zoom all connected clients to that point. When
it is released, all clients will return to their previous view point &
zoom.

Task-Url: #63

Signed-off-by: Jamz <Jamz@Nerps.net>

* Spotless...

Signed-off-by: Jamz <Jamz@Nerps.net>

* #67: New Vision/Light type: GRID

 * Clear gridShapeCache on grid change
 * Instatiante footprint field to prevent null pointer on measuring
tool.

Task-Url: #67

Signed-off-by: Jamz <Jamz@Nerps.net>

* #49: Add proper pathfinding taking VBL into account

 * When token movement is done (left click released) we now wait for the
final background thread for A* Pathfinding is to either finish or time
out so quick or long moves get a chance to render a path.

Task-Url: #49

Signed-off-by: Jamz <Jamz@Nerps.net>
  • Loading branch information
JamzTheMan authored Jun 9, 2018
1 parent e3c1957 commit 287472b
Show file tree
Hide file tree
Showing 63 changed files with 1,855 additions and 688 deletions.
31 changes: 22 additions & 9 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,44 @@ version: '{branch}.{build}'
pull_requests:
do_not_increment_build_number: true
skip_non_tags: false
image: Visual Studio 2017
platform: x64
image:
- Ubuntu
- Visual Studio 2017
init:
- cmd: git config --global core.autocrlf true
install:
- SET JAVA_HOME="C:\Program Files\Java\jdk9"
- SET PATH=%JAVA_HOME%\bin;%PATH%
- sh: echo oracle-java10-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
- sh: sudo add-apt-repository ppa:linuxuprising/java
- sh: sudo apt update
- sh: sudo apt install -y oracle-java10-installer
- sh: sudo apt install -y oracle-java10-set-default
- sh: export JAVA_HOME=/usr/lib/jvm/java-10-oracle
- sh: echo java home is $JAVA_HOME
- sh: sudo apt install -y fakeroot
- ./gradlew -version
build_script:
- ./gradlew build -x spotlessCheck
- ./gradlew build -x test
after_build:
- ./gradlew deploy
artifacts:
- path: releases\release-*\MapTool-*.exe
name: MapTool-Install
- path: build\libs\MapTool-*.jar
name: MapTool-Jar
- path: releases\release-*\MapTool-*.exe
name: MapTool-Windows
- path: releases\release-*\MapTool-*.deb
name: MapTool-Linux
deploy:
- provider: GitHub
description: Windows release from AppVeyor
auth_token:
secure: HXIHe/F7K2yGOZ0I56DW5PevrQDe+zjyunjORGKYaUGxFtvPYPcmOdjZT69tzHcS
artifact: MapTool-Install, MapTool-Jar
artifact: MapTool-Jar, MapTool-Windows, MapTool-Linux
draft: true
prerelease: true
force_update: false
force_update: true
on:
appveyor_repo_tag: true
APPVEYOR_REPO_TAG: true
notifications:
- provider: Webhook
url:
Expand Down
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ language: java
sudo: false
matrix:
include:
- os: linux
jdk: oraclejdk9
addons:
apt:
packages:
- oracle-java9-installer
- fakeroot
- os: osx
osx_image: xcode9.2
before_install:
Expand Down
48 changes: 24 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import org.gradle.plugins.ide.eclipse.model.AccessRule

buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.8.0"
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.13.0"
}

repositories {
Expand All @@ -17,7 +16,7 @@ buildscript {

// Access Git info from build script
plugins {
id "org.ajoberstar.grgit" version "2.1.0"
id "org.ajoberstar.grgit" version "2.2.0"
}

// Apply the java plugin to add support for Java
Expand All @@ -26,15 +25,14 @@ apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'javafx-gradle-plugin'

// Current Build version
version = '1.4.4.2'
version = '1.4.5.0'

// Definitions
defaultTasks 'clean', 'build'
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 10
targetCompatibility = 10

// Don't fail build if tests fail until tests are cleaned up
test.ignoreFailures = true
Expand All @@ -49,10 +47,10 @@ ext {
git = org.ajoberstar.grgit.Grgit.open(currentDir: file('.'))
revision = git.head().abbreviatedId
revisionFull = git.head().id
branch = git.branch.getCurrent().getName()
// branch = grgit.branch.current().name
gdxVersion = '1.9.6'
box2DLightsVersion = '1.4'
//aiVersion = '1.8.0'
aiVersion = '1.8.1'
}

run {
Expand Down Expand Up @@ -199,7 +197,7 @@ dependencies {
compile 'org.apache.pdfbox:pdfbox:2.0.0'
compile 'org.apache.pdfbox:pdfbox-tools:2.0.0' // Dependency for pdfbox
compile 'org.bouncycastle:bcmail-jdk15on:1.54' // To decrypt passworded/secured pdf's
compile 'com.github.jai-imageio:jai-imageio-core:1.3.1' // For pdf image extraction, specifically for jpeg2000 (jpx) support.
compile 'com.github.jai-imageio:jai-imageio-core:1.4.0' // For pdf image extraction, specifically for jpeg2000 (jpx) support.
compile 'com.github.jai-imageio:jai-imageio-jpeg2000:1.3.0' // For pdf image extraction, specifically for jpeg2000 (jpx) support.

// For syntax highlighting in macro editor
Expand All @@ -219,11 +217,17 @@ dependencies {
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"

// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
// https://locationtech.github.io/jts/jts-features.html
compile group: 'org.locationtech.jts', name: 'jts-core', version: '1.15.0'
// https://mvnrepository.com/artifact/org.locationtech.jts/jts
//compile group: 'org.locationtech.jts', name: 'jts', version: '1.15.0', ext: 'pom'

// Not in use at this time, left for easy reference later...
//compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
//compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
//compile "com.badlogicgames.ashley:ashley:$ashleyVersion"
//compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
//compile "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"

// Declare the dependency for your favourite test framework you want to use in your tests.
Expand All @@ -245,7 +249,7 @@ task uberJar(type: Jar) {
'Implementation-Vendor': vendor,
'Git-Commit': revision,
'Git-Commit-SHA': revisionFull,
'Git-Branch': branch,
// 'Git-Branch': branch,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
Expand All @@ -266,7 +270,7 @@ task uberJar(type: Jar) {
// For logging Git Commit during CI
task displayGitInfo {
doLast {
println 'Git-Branch: ' + branch
// println 'Git-Branch: ' + branch
println 'Git-Commit-SHA: ' + revisionFull
}
}
Expand Down Expand Up @@ -316,7 +320,7 @@ task deploy(dependsOn: [displayGitInfo, uberJar, copyPackageExtras, prepareInnoS
"-appclass", mainClassName,
"-srcdir", "build/libs",
"-outdir", "releases/release-"+version,
"-outfile", project.name,
"-outfile", vendor + "-" + project.name,
"-name", project.name,
"-title", project.name,
"-vendor", vendor,
Expand All @@ -328,24 +332,20 @@ task deploy(dependsOn: [displayGitInfo, uberJar, copyPackageExtras, prepareInnoS
"-Bwin.menuGroup=" + vendor,
"-BshortcutHint=true",
"-BappVersion=" + version,
"-Bwin.msi.productVersion=1.4.4",
"-Bwin.msi.productVersion=1.4.5",
"-BlicenseFile=COPYING.AFFERO",
"-BlicenseType=GNU AFFERO GENERAL PUBLIC LICENSE",
"-BlicenseType='GNU AFFERO GENERAL PUBLIC LICENSE'",
"-Bcategory=Games",
"-Bemail=maptool@nerps.net",
"-BjvmProperties=MAPTOOL_DATADIR=.maptool-" + vendor
"-BuserJvmOptions=-DMAPTOOL_DATADIR\\==.maptool-" + vendor
// "-BjvmProperties=MAPTOOL_DATADIR=.maptool-" + vendor
//"-BuserJvmOptions=-Xss=4M"

println commandLine
}
}
}

jfx {
// minimal requirement for jfxJar-task
mainClass = mainClassName
}

task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}
gradleVersion = '4.7'
}
51 changes: 51 additions & 0 deletions change-log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
MapTool 1.4.5.0 - _Infused with Nerps!_
=====
I'm excited to bring to you the next version of MapTool Nerps! I have some new exciting features to showcase, namely automated Pathfinding for tokens! There is also a huge improvement to performance for Lights as well as several other bug fixes. A new vision/light type of GRID has also been added, which is a circle of the specified size but only lights up the affected grid cells within range, much like using the template tool.

The packaged JRE has also been updated to Java 10 to stay current, although you shouldn't see any changes over Java 9.

___

Enhancements
-----
* [#49][i49] - Pathfinding! When activated (via new 'AI' toggle button), tokens will find the shortest path to it's destination as you drag them on the token or hidden layers, taking VBL into account. Yes, this means your tokens will no longer walk thru VBL! If no path can be found (or found within several seconds) no path will be shown, however you can still move your token to that location. This can happen because the area is blocked off or you are working with a very complicated or large map. With MapTool allowing unbounded/nearly infinite map space, I had to include a timeout to prevent an infinite search.
A new token config value is also now available called Terrain Modifier. This multiplies the cost of moving into that tokens cell and taken into account with Pathfinding is used. Some examples are:
Setting the multiplier to 2 will cost 10 feet of movement vs 5 feet acting like difficult terrain.
Setting the multiplier to a sufficiently high number, like 99999, will effectively block the movement and make the token go around the obstacle. Useful for things like an arrow slit, window, lava, etc.
Any token can have this modifier, NPC tokens to make PC tokens go around them vs through them, or stamp tokens on the object layer like oil or water. You could also place tokens on the hidden layer over rocky terrain to denote difficult terrain.
Please note, at this time no macros are available to access these new feature, nor server options to force players to use this mode of moving tokens. Due to the complexity of this feature, I felt it better to get this out to you, the user, to play with and use (or not use) and provide feedback. Therefore the Terrain Modifier *could* change in the future or expand in functionality. There could be performance related hits as well, although I did my best to mitigate this, as well as you can turn this feature off and revert to basic movement.
Also note, currently fractional modifiers are not supported at this time nor straight addition modifiers. I plan to expand this functionality over time.
* [#45][i45] - Lighting has been improved to greatly reduce lag when multiple light sources are on a map. It also helps alleviate the slowness you encounter as you reveal more and more FoW.
* [#63][i63] - Spacebar functionality has been restored to it's original behavior, including ctrl+spacebar & shift+spacebar.
A new shift+ctrl+spacebar command along with a new pointer image is now available. When this keystroke combo is pressed, and you are a GM, the pointer will center & zoom all connected clients to that point. When it is released, all clients will return to their previous view point & zoom.
* [#67][i67] - A new vision/light type of GRID has also been added, which is a circle of the specified size but only lights up the affected grid cells within range, much like using the template tool. This is useful in systems like Pathfinder if you want to see exactly which grid cells (squares) are affected by a Light/Aura or can be seen. Aura for Channel Energy for instance, or seeing which grid cells are in dim light for concealment.
* [#71][i71] - The default data directory (USER_HOME/.maptool-{Vendor}, so for Nerps fork, .maptool-Nerps) can now be overridden in Edit -> Preferences -> Startup tab.
* [#43][i43] - Spotless and .appveyor.yml updated. This is purely a build process enhancement to make deployment of the releases better.
* [#66][i66] - Update packaged JRE to Java 10 and verify MapTool runs under Java 10. *Note: Java 9 was a short term release hence the update to Java 10.

Bug Fixes
-----
* [#68][i68] - MapTool's i18n language override enabled via Edit -> Preferences -> Startup tab. This will override your default language set by your OS.
* [#41][i41] - Allow player owned tokens without "sight" to move within currently exposed FoW, e.g. areas other PC token can currently see.
* [#44][i44] - If running the JAR version with your own JRE installed, Edit -> Preferences will no longer throw and error and blow up! Instead the Startup tab will be grayed out (as those values will not be used and you must make your own startup script to set memory settings when using the JAR format)
* [#27][i27] - Code cleanup, .pdf & .por files will no longer throw errors to the log file.
* [#65][i65] - Gradle will once again build and deploy vs throw an error getting the branch name.
* [#179][i179] - Pulled in @Jaggeroth change from main RPTool's Repo; ZOrder sort violation problem by restoring the original comparator and only using the new figure comparator when sorting figure only.


[i49]: https://github.com/JamzTheMan/MapTool/issues/49
[i45]: https://github.com/JamzTheMan/MapTool/issues/45
[i44]: https://github.com/JamzTheMan/MapTool/issues/44
[i43]: https://github.com/JamzTheMan/MapTool/issues/43
[i41]: https://github.com/JamzTheMan/MapTool/issues/41
[i27]: https://github.com/JamzTheMan/MapTool/issues/27
[i63]: https://github.com/JamzTheMan/MapTool/issues/63
[i65]: https://github.com/JamzTheMan/MapTool/issues/65
[i66]: https://github.com/JamzTheMan/MapTool/issues/66
[i67]: https://github.com/JamzTheMan/MapTool/issues/67
[i68]: https://github.com/JamzTheMan/MapTool/issues/68
[i71]: https://github.com/JamzTheMan/MapTool/issues/71
[i179]: https://github.com/RPTools/maptool/pull/179

___

MapTool 1.4.4.2 - _Infused with Nerps!_
=====
This is a hotfix release to correct issues with Java 9 and macOS as reported via github as well as fixing the auto update check.
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion package/windows/MapTool.iss.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ AppSupportURL=http://forums.rptools.net/viewtopic.php?f=60&t=23681
;AppUpdatesURL=http://java.com/
DefaultDirName={localappdata}/${AppName}
DisableStartupPrompt=Yes
DisableDirPage=Auto
DisableDirPage=No
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/net/rptools/maptool/client/AppPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public class AppPreferences {
private static final String KEY_FORCE_FACING_ARROW = "forceFacingArrow";
private static final boolean DEFAULT_FORCE_FACING_ARROW = false;

private static final String KEY_USE_ASTAR_PATHFINDING = "useAstarPathfinding";
private static final boolean DEFAULT_USE_ASTAR_PATHFINDING = true;

public static void setFillSelectionBox(boolean fill) {
prefs.putBoolean(KEY_FILL_SELECTION_BOX, fill);
}
Expand Down Expand Up @@ -1067,4 +1070,12 @@ public static boolean isShowInitGainMessage() {
public static void setShowInitGainMessage(boolean flag) {
prefs.putBoolean(KEY_SHOW_INIT_GAIN_MESSAGE, flag);
}

public static boolean isUsingAstarPathfinding() {
return prefs.getBoolean(KEY_USE_ASTAR_PATHFINDING, DEFAULT_USE_ASTAR_PATHFINDING);
}

public static void setUseAstarPathfinding(boolean show) {
prefs.putBoolean(KEY_USE_ASTAR_PATHFINDING, show);
}
}
4 changes: 4 additions & 0 deletions src/main/java/net/rptools/maptool/client/AppStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class AppStyle {
public static BufferedImage tokenInvisible;

public static BufferedImage cellWaypointImage;
public static BufferedImage validMoveImage;
public static BufferedImage blockMoveImage;

public static BufferedImage stackImage;

Expand Down Expand Up @@ -94,6 +96,8 @@ public class AppStyle {
// Set defaults
tokenInvisible = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/icon_invisible.png");
cellWaypointImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/redDot.png");
validMoveImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/valid-move-arrow.png");
blockMoveImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/block_move.png");
stackImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/stack.png");
markerImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/marker.png");
chatImage = ImageUtil.getCompatibleImage("net/rptools/maptool/client/image/chat-blue.png");
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/net/rptools/maptool/client/AppUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static boolean gitHubReleases() {
String response = null;
String jarCommit = null;
String latestGitHubReleaseCommit = "";
String latestGitHubReleaseTagName = "";

// Default for Linux?
String DOWNLOAD_EXTENSION = ".deb";
Expand Down Expand Up @@ -65,6 +66,8 @@ else if (AppUtil.MAC_OS_X)
releases = JSONObject.fromObject(response);
latestGitHubReleaseCommit = releases.get("target_commitish").toString();
log.info("target_commitish from GitHub: " + latestGitHubReleaseCommit);
latestGitHubReleaseTagName = releases.get("tag_name").toString();
log.info("tag_name from GitHub: " + latestGitHubReleaseTagName);
} catch (Exception e) {
log.error("Unable to parse JSON payload from GitHub...", e);
return false;
Expand Down Expand Up @@ -93,8 +96,9 @@ else if (AppUtil.MAC_OS_X)
try {
URL url = new URL(assetDownloadURL);
String commit = latestGitHubReleaseCommit;
String tagName = latestGitHubReleaseTagName;
SwingUtilities.invokeLater(() -> {
if (showMessage("New Update Found", commit))
if (showMessage("New Update Found", commit, tagName))
downloadFile(url, assetDownloadSize);
});
} catch (MalformedURLException e) {
Expand Down Expand Up @@ -132,12 +136,12 @@ public static String getCommitSHA() {
return jarCommit;
}

private static boolean showMessage(String aTitle, String commit) {
private static boolean showMessage(String aTitle, String commit, String tagName) {
JCheckBox dontAskCheckbox = new JCheckBox("Never check for updates again!");

String title = "Update Available";
String msg1 = "A new version of MapTool infused with Nerps is available!";
String msg2 = "Would you like to download it?";
String msg2 = "Would you like to download " + tagName + "?";
String blankLine = " ";

Object[] msgContent = { msg1, msg2, blankLine, dontAskCheckbox };
Expand Down
Loading

0 comments on commit 287472b

Please sign in to comment.