Skip to content

Commit 0991dbf

Browse files
committed
Update README on release, Fix formatting
1 parent 26f4d65 commit 0991dbf

25 files changed

+395
-467
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The main use case is for the DM to show 'loading tips' to distract the players a
6464

6565
## Running Dungeon Board
6666

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

6969
*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).*
7070

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

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

76-
java -jar -Xmx2000m "Dungeon Board v3.0.1.jar"
76+
java -jar -Xmx2000m DungeonBoard.v3.0.2.jar

build.gradle.kts

+14-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ group = "mcajben.dungeonboard"
1010

1111
version = "dev"
1212

13-
val releaseVersion = "3.0.1"
13+
val releaseVersion = "3.0.2"
1414

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

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

2222
val releaseFile: File
23-
get() = File("${rootProject.name}-$releaseVersion.jar")
23+
get() = File("${rootProject.name}.v$releaseVersion.jar")
24+
25+
val readMeFile = File("README.md")
2426

2527
repositories {
2628
jcenter()
@@ -79,5 +81,15 @@ val buildRelease by tasks.registering {
7981
releaseFile.delete()
8082
jarFile.copyTo(releaseFile)
8183
jarFile.delete()
84+
85+
readMeFile.writeText(
86+
readMeFile.readText().replace(
87+
Regex("""\[Download v.*]\(https://github.com/McAJBen/DungeonBoard/releases/download/v.*/DungeonBoard\.v.*\.jar\)"""),
88+
"[Download v$releaseVersion](https://github.com/McAJBen/DungeonBoard/releases/download/v$releaseVersion/DungeonBoard.v$releaseVersion.jar)"
89+
).replace(
90+
Regex("""java -jar -Xmx2000m DungeonBoard\.v.*\.jar"""),
91+
"java -jar -Xmx2000m DungeonBoard.v$releaseVersion.jar"
92+
)
93+
)
8294
}
8395
}

src/main/kotlin/control/Control.kt

+8-10
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,20 @@ abstract class Control: JPanel() {
4242
get() {
4343
return JPanel().apply {
4444
background = Colors.CONTROL_BACKGROUND
45-
layout =
46-
BoxLayout(
47-
this,
48-
BoxLayout.X_AXIS
49-
)
45+
layout = BoxLayout(
46+
this,
47+
BoxLayout.X_AXIS
48+
)
5049
repaint()
5150
}
5251
}
5352

5453
init {
5554
layout = BorderLayout()
56-
border =
57-
BorderFactory.createLineBorder(
58-
Colors.BACKGROUND,
59-
1
60-
)
55+
border = BorderFactory.createLineBorder(
56+
Colors.BACKGROUND,
57+
1
58+
)
6159
}
6260

6361
/**

src/main/kotlin/control/ControlLoading.kt

+18-21
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,25 @@ class ControlLoading(
5656
horizontalAlignment = SwingConstants.CENTER
5757
}
5858

59-
val timeSlider =
60-
JSlider(
61-
SwingConstants.HORIZONTAL,
62-
1,
63-
20,
64-
8
65-
).apply {
66-
background = Colors.CONTROL_BACKGROUND
67-
minimumSize =
68-
Dimension(
69-
100,
70-
0
71-
)
72-
addChangeListener {
73-
timeLabel.text =
74-
String.format(
75-
"%02d",
76-
value
77-
)
78-
displayLoading.setTotalWait(value)
79-
}
59+
val timeSlider = JSlider(
60+
SwingConstants.HORIZONTAL,
61+
1,
62+
20,
63+
8
64+
).apply {
65+
background = Colors.CONTROL_BACKGROUND
66+
minimumSize = Dimension(
67+
100,
68+
0
69+
)
70+
addChangeListener {
71+
timeLabel.text = String.format(
72+
"%02d",
73+
value
74+
)
75+
displayLoading.setTotalWait(value)
8076
}
77+
}
8178

8279
val createTimerButton = createButton(Labels.CREATE_TIMER).apply {
8380
addActionListener {

src/main/kotlin/control/ControlPaint.kt

+48-58
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,25 @@ class ControlPaint(
4949
/**
5050
* the text field for changing zoom
5151
*/
52-
private val zoomText =
53-
JTextField(
54-
"1.00",
55-
1
56-
).apply {
57-
maximumSize =
58-
Dimension(
59-
5000,
60-
25
61-
)
62-
}
52+
private val zoomText = JTextField(
53+
"1.00",
54+
1
55+
).apply {
56+
maximumSize = Dimension(
57+
5000,
58+
25
59+
)
60+
}
6361

6462
/**
6563
* the slider for changing zoom
6664
*/
67-
private val zoomSlider =
68-
JSlider(
69-
SwingConstants.VERTICAL,
70-
1,
71-
(maxZoom * 100).toInt(),
72-
100
73-
)
65+
private val zoomSlider = JSlider(
66+
SwingConstants.VERTICAL,
67+
1,
68+
(maxZoom * 100).toInt(),
69+
100
70+
)
7471

7572
/**
7673
* the `JPanel` holding options for which file in a folder to display
@@ -132,21 +129,19 @@ class ControlPaint(
132129
} catch (nfe: NumberFormatException) {
133130
zoom = zoomSlider.value / 100.0
134131
}
135-
zoomText.text =
136-
String.format(
137-
"%.2f",
138-
zoom
139-
)
132+
zoomText.text = String.format(
133+
"%.2f",
134+
zoom
135+
)
140136
zoomSlider.value = (zoom * 100).toInt()
141137
}
142138

143139
zoomSlider.addChangeListener {
144140
val zoom = (zoomSlider.value / 100.0).boundZoom()
145-
zoomText.text =
146-
String.format(
147-
"%.2f",
148-
zoom
149-
)
141+
zoomText.text = String.format(
142+
"%.2f",
143+
zoom
144+
)
150145
paintRef?.setDisplayZoom(zoom)
151146
drawPanel.repaint()
152147
displayListener.repaint()
@@ -200,24 +195,22 @@ class ControlPaint(
200195
addActionListener { drawPanel.hideAll() }
201196
}
202197

203-
val sizeSlider =
204-
JSlider(
205-
SwingConstants.HORIZONTAL,
206-
10,
207-
100,
208-
25
209-
).apply {
210-
background = Colors.CONTROL_BACKGROUND
211-
addChangeListener { drawPanel.setRadius(value) }
212-
}
198+
val sizeSlider = JSlider(
199+
SwingConstants.HORIZONTAL,
200+
10,
201+
100,
202+
25
203+
).apply {
204+
background = Colors.CONTROL_BACKGROUND
205+
addChangeListener { drawPanel.setRadius(value) }
206+
}
213207

214208
add(
215209
JPanel().apply {
216-
layout =
217-
BoxLayout(
218-
this,
219-
BoxLayout.Y_AXIS
220-
)
210+
layout = BoxLayout(
211+
this,
212+
BoxLayout.Y_AXIS
213+
)
221214
background = Colors.CONTROL_BACKGROUND
222215
add(
223216
JLabel(
@@ -232,11 +225,10 @@ class ControlPaint(
232225
)
233226
add(
234227
JPanel().apply {
235-
layout =
236-
BoxLayout(
237-
this,
238-
BoxLayout.Y_AXIS
239-
)
228+
layout = BoxLayout(
229+
this,
230+
BoxLayout.Y_AXIS
231+
)
240232
add(folderControlPanel)
241233
add(northPanel.apply {
242234
add(fileBox)
@@ -288,11 +280,10 @@ class ControlPaint(
288280
)
289281
zoomSlider.maximum = (maxZoom * 100).toInt()
290282
zoomSlider.value = (paintRef.paintData.displayZoom * 100).toInt()
291-
zoomText.text =
292-
String.format(
293-
"%.2f",
294-
paintRef.paintData.displayZoom
295-
)
283+
zoomText.text = String.format(
284+
"%.2f",
285+
paintRef.paintData.displayZoom
286+
)
296287

297288
paintRef.updateDisplayMask()
298289

@@ -311,11 +302,10 @@ class ControlPaint(
311302
private fun setFolderControlPanel(paintRef: PaintFolderReference) {
312303
folderControlPanel.removeAll()
313304
paintRef.getImageFileNames().forEach { imageName ->
314-
val toggleButton =
315-
ToggleButton(
316-
imageName,
317-
this
318-
)
305+
val toggleButton = ToggleButton(
306+
imageName,
307+
this
308+
)
319309
toggleButton.setEnabled(paintRef.getImageVisibility(imageName))
320310
folderControlPanel.add(toggleButton.button)
321311
}

src/main/kotlin/control/ControlPictures.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ class ControlPictures(
6262
init {
6363
val scaleComboBox: JComboBox<Scale> = JComboBox<Scale>(Scale.values()).apply {
6464
background = Colors.CONTROL_BACKGROUND
65-
maximumSize =
66-
Dimension(
67-
100,
68-
5000
69-
)
65+
maximumSize = Dimension(
66+
100,
67+
5000
68+
)
7069
selectedItem = Scale.UP_SCALE
7170
addActionListener { display.setScaleMode(selectedItem as Scale) }
7271
}

src/main/kotlin/control/ControlWindow.kt

+12-15
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,25 @@ class ControlWindow(
9898
private fun createButtonGroup(title: String, buttons: List<JButton>): JPanel {
9999
val buttonPanel = JPanel().apply {
100100
background = Colors.CONTROL_BACKGROUND
101-
layout =
102-
GridLayout(
103-
1,
104-
buttons.size
105-
)
101+
layout = GridLayout(
102+
1,
103+
buttons.size
104+
)
106105
for (i in buttons.indices) {
107106
add(buttons[i])
108107
}
109108
}
110109

111110
return JPanel().apply {
112111
background = Colors.CONTROL_BACKGROUND
113-
layout =
114-
GridLayout(
115-
2,
116-
1
117-
)
118-
border =
119-
BorderFactory.createLineBorder(
120-
Colors.BACKGROUND,
121-
2
122-
)
112+
layout = GridLayout(
113+
2,
114+
1
115+
)
116+
border = BorderFactory.createLineBorder(
117+
Colors.BACKGROUND,
118+
2
119+
)
123120
add(
124121
JLabel(
125122
title,

0 commit comments

Comments
 (0)