Skip to content

Commit

Permalink
Update README on release, Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
McAJBen committed Jun 27, 2020
1 parent 26f4d65 commit 0991dbf
Show file tree
Hide file tree
Showing 25 changed files with 395 additions and 467 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The main use case is for the DM to show 'loading tips' to distract the players a

## Running Dungeon Board

[Download 3.0.1](https://github.com/McAJBen/DungeonBoard/releases/download/v3.0.1/Dungeon.Board.v3.0.1.jar)
[Download v3.0.2](https://github.com/McAJBen/DungeonBoard/releases/download/v3.0.2/DungeonBoard.v3.0.2.jar)

*Caution, web browsers do not like .jar files. They can be used to give viruses. Do your research before downloading (Don't take my word for it).*

Expand All @@ -73,4 +73,4 @@ The next time you run Dungeon Board it will automatically load these on startup.

If you want to run Dungeon Board with more memory allocated you have to run the .jar file from the command line.

java -jar -Xmx2000m "Dungeon Board v3.0.1.jar"
java -jar -Xmx2000m DungeonBoard.v3.0.2.jar
16 changes: 14 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ group = "mcajben.dungeonboard"

version = "dev"

val releaseVersion = "3.0.1"
val releaseVersion = "3.0.2"

val resourcesDir = File(buildDir, "resources/main")

Expand All @@ -20,7 +20,9 @@ val jarFile: File
get() = File(jarDir, "${rootProject.name}-$version.jar")

val releaseFile: File
get() = File("${rootProject.name}-$releaseVersion.jar")
get() = File("${rootProject.name}.v$releaseVersion.jar")

val readMeFile = File("README.md")

repositories {
jcenter()
Expand Down Expand Up @@ -79,5 +81,15 @@ val buildRelease by tasks.registering {
releaseFile.delete()
jarFile.copyTo(releaseFile)
jarFile.delete()

readMeFile.writeText(
readMeFile.readText().replace(
Regex("""\[Download v.*]\(https://github.com/McAJBen/DungeonBoard/releases/download/v.*/DungeonBoard\.v.*\.jar\)"""),
"[Download v$releaseVersion](https://github.com/McAJBen/DungeonBoard/releases/download/v$releaseVersion/DungeonBoard.v$releaseVersion.jar)"
).replace(
Regex("""java -jar -Xmx2000m DungeonBoard\.v.*\.jar"""),
"java -jar -Xmx2000m DungeonBoard.v$releaseVersion.jar"
)
)
}
}
18 changes: 8 additions & 10 deletions src/main/kotlin/control/Control.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,20 @@ abstract class Control: JPanel() {
get() {
return JPanel().apply {
background = Colors.CONTROL_BACKGROUND
layout =
BoxLayout(
this,
BoxLayout.X_AXIS
)
layout = BoxLayout(
this,
BoxLayout.X_AXIS
)
repaint()
}
}

init {
layout = BorderLayout()
border =
BorderFactory.createLineBorder(
Colors.BACKGROUND,
1
)
border = BorderFactory.createLineBorder(
Colors.BACKGROUND,
1
)
}

/**
Expand Down
39 changes: 18 additions & 21 deletions src/main/kotlin/control/ControlLoading.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,25 @@ class ControlLoading(
horizontalAlignment = SwingConstants.CENTER
}

val timeSlider =
JSlider(
SwingConstants.HORIZONTAL,
1,
20,
8
).apply {
background = Colors.CONTROL_BACKGROUND
minimumSize =
Dimension(
100,
0
)
addChangeListener {
timeLabel.text =
String.format(
"%02d",
value
)
displayLoading.setTotalWait(value)
}
val timeSlider = JSlider(
SwingConstants.HORIZONTAL,
1,
20,
8
).apply {
background = Colors.CONTROL_BACKGROUND
minimumSize = Dimension(
100,
0
)
addChangeListener {
timeLabel.text = String.format(
"%02d",
value
)
displayLoading.setTotalWait(value)
}
}

val createTimerButton = createButton(Labels.CREATE_TIMER).apply {
addActionListener {
Expand Down
106 changes: 48 additions & 58 deletions src/main/kotlin/control/ControlPaint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,25 @@ class ControlPaint(
/**
* the text field for changing zoom
*/
private val zoomText =
JTextField(
"1.00",
1
).apply {
maximumSize =
Dimension(
5000,
25
)
}
private val zoomText = JTextField(
"1.00",
1
).apply {
maximumSize = Dimension(
5000,
25
)
}

/**
* the slider for changing zoom
*/
private val zoomSlider =
JSlider(
SwingConstants.VERTICAL,
1,
(maxZoom * 100).toInt(),
100
)
private val zoomSlider = JSlider(
SwingConstants.VERTICAL,
1,
(maxZoom * 100).toInt(),
100
)

/**
* the `JPanel` holding options for which file in a folder to display
Expand Down Expand Up @@ -132,21 +129,19 @@ class ControlPaint(
} catch (nfe: NumberFormatException) {
zoom = zoomSlider.value / 100.0
}
zoomText.text =
String.format(
"%.2f",
zoom
)
zoomText.text = String.format(
"%.2f",
zoom
)
zoomSlider.value = (zoom * 100).toInt()
}

zoomSlider.addChangeListener {
val zoom = (zoomSlider.value / 100.0).boundZoom()
zoomText.text =
String.format(
"%.2f",
zoom
)
zoomText.text = String.format(
"%.2f",
zoom
)
paintRef?.setDisplayZoom(zoom)
drawPanel.repaint()
displayListener.repaint()
Expand Down Expand Up @@ -200,24 +195,22 @@ class ControlPaint(
addActionListener { drawPanel.hideAll() }
}

val sizeSlider =
JSlider(
SwingConstants.HORIZONTAL,
10,
100,
25
).apply {
background = Colors.CONTROL_BACKGROUND
addChangeListener { drawPanel.setRadius(value) }
}
val sizeSlider = JSlider(
SwingConstants.HORIZONTAL,
10,
100,
25
).apply {
background = Colors.CONTROL_BACKGROUND
addChangeListener { drawPanel.setRadius(value) }
}

add(
JPanel().apply {
layout =
BoxLayout(
this,
BoxLayout.Y_AXIS
)
layout = BoxLayout(
this,
BoxLayout.Y_AXIS
)
background = Colors.CONTROL_BACKGROUND
add(
JLabel(
Expand All @@ -232,11 +225,10 @@ class ControlPaint(
)
add(
JPanel().apply {
layout =
BoxLayout(
this,
BoxLayout.Y_AXIS
)
layout = BoxLayout(
this,
BoxLayout.Y_AXIS
)
add(folderControlPanel)
add(northPanel.apply {
add(fileBox)
Expand Down Expand Up @@ -288,11 +280,10 @@ class ControlPaint(
)
zoomSlider.maximum = (maxZoom * 100).toInt()
zoomSlider.value = (paintRef.paintData.displayZoom * 100).toInt()
zoomText.text =
String.format(
"%.2f",
paintRef.paintData.displayZoom
)
zoomText.text = String.format(
"%.2f",
paintRef.paintData.displayZoom
)

paintRef.updateDisplayMask()

Expand All @@ -311,11 +302,10 @@ class ControlPaint(
private fun setFolderControlPanel(paintRef: PaintFolderReference) {
folderControlPanel.removeAll()
paintRef.getImageFileNames().forEach { imageName ->
val toggleButton =
ToggleButton(
imageName,
this
)
val toggleButton = ToggleButton(
imageName,
this
)
toggleButton.setEnabled(paintRef.getImageVisibility(imageName))
folderControlPanel.add(toggleButton.button)
}
Expand Down
9 changes: 4 additions & 5 deletions src/main/kotlin/control/ControlPictures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ class ControlPictures(
init {
val scaleComboBox: JComboBox<Scale> = JComboBox<Scale>(Scale.values()).apply {
background = Colors.CONTROL_BACKGROUND
maximumSize =
Dimension(
100,
5000
)
maximumSize = Dimension(
100,
5000
)
selectedItem = Scale.UP_SCALE
addActionListener { display.setScaleMode(selectedItem as Scale) }
}
Expand Down
27 changes: 12 additions & 15 deletions src/main/kotlin/control/ControlWindow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,25 @@ class ControlWindow(
private fun createButtonGroup(title: String, buttons: List<JButton>): JPanel {
val buttonPanel = JPanel().apply {
background = Colors.CONTROL_BACKGROUND
layout =
GridLayout(
1,
buttons.size
)
layout = GridLayout(
1,
buttons.size
)
for (i in buttons.indices) {
add(buttons[i])
}
}

return JPanel().apply {
background = Colors.CONTROL_BACKGROUND
layout =
GridLayout(
2,
1
)
border =
BorderFactory.createLineBorder(
Colors.BACKGROUND,
2
)
layout = GridLayout(
2,
1
)
border = BorderFactory.createLineBorder(
Colors.BACKGROUND,
2
)
add(
JLabel(
title,
Expand Down
Loading

0 comments on commit 0991dbf

Please sign in to comment.