Set version 1.3.0, update about.
This commit is contained in:
parent
9ae48ec944
commit
cfb70b14e8
|
@ -5,9 +5,11 @@ This application was developed in order to make the production of written books
|
|||
|
||||
## Using Block Book Binder
|
||||
|
||||
To get started, look for the [**Releases**](https://github.com/andrewlalis/BlockBookBinder/releases) section on this page, and find the latest release. Download the executable JAR file and you're ready to go. Simply paste some plain text into the _Source_ panel on the right-hand side, and press the button _Convert to Book_ to process that text into a series of pages which will appear on the left-hand side.
|
||||
To get started, look for the [**Releases**](https://github.com/andrewlalis/BlockBookBinder/releases) section on this page, and find the latest release. Download the executable JAR file, and make sure you have Java version 17 or higher installed to run it.
|
||||
|
||||
Once you're happy with how the pages are formatted, you can click the _Export_ button to begin exporting pages to your clipboard. Once you give an affirmative response to the confirmation popup that appears, the first page will be loaded into your clipboard. You can then use `CTRL + V` to paste the page into your book. Each time you do, the program will take about a second to load the next page into your clipboard, so that you can paste it without even having to leave your game.
|
||||
Start the program, and you'll be greeted with a window that has **Book Preview** and **Source Text** panels. Enter the text you'd like to work with into the **Source Text** panel. In the top menu under **Book**, you'll find a **Clean Source** button, which will remove extra whitespace from the text to make it more friendly for Minecraft's cramped style. You'll also find **Compile from Source**, which will compile your source text into a book in the **Book Preview** panel.
|
||||
|
||||
Once you're happy with how the pages are formatted, you can click the **Export to Minecraft** button to begin exporting pages to your clipboard.
|
||||
|
||||
## Demo Video on YouTube
|
||||
https://youtu.be/Mu7Hv1na7Sw
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>nl.andrewlalis</groupId>
|
||||
<artifactId>BlockBookBinder</artifactId>
|
||||
<version>1.3.0-SNAPSHOT</version>
|
||||
<version>1.3.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
|
|
@ -1,14 +1,27 @@
|
|||
package nl.andrewlalis.blockbookbinder.control.source;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import nl.andrewlalis.blockbookbinder.BlockBookBinder;
|
||||
import nl.andrewlalis.blockbookbinder.view.SourceTextPanel;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
public class ImportSourceAction extends AbstractAction {
|
||||
@Getter
|
||||
private static final ImportSourceAction instance = new ImportSourceAction();
|
||||
|
||||
@Setter
|
||||
private SourceTextPanel sourceTextPanel;
|
||||
|
||||
public ImportSourceAction() {
|
||||
super("Import Source");
|
||||
this.putValue(SHORT_DESCRIPTION, "Import source text from a file.");
|
||||
|
@ -16,6 +29,24 @@ public class ImportSourceAction extends AbstractAction {
|
|||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
Preferences prefs = Preferences.userNodeForPackage(BlockBookBinder.class);
|
||||
String dir = prefs.get("source-import-dir", ".");
|
||||
JFileChooser fileChooser = new JFileChooser(dir);
|
||||
fileChooser.setFileFilter(new FileNameExtensionFilter("Text files", ".txt"));
|
||||
fileChooser.setAcceptAllFileFilterUsed(true);
|
||||
fileChooser.setMultiSelectionEnabled(false);
|
||||
final Component parent = SwingUtilities.getWindowAncestor((Component) e.getSource());
|
||||
int result = fileChooser.showOpenDialog(parent);
|
||||
if (result == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fileChooser.getSelectedFile();
|
||||
try {
|
||||
Path filePath = file.toPath();
|
||||
sourceTextPanel.setSourceText(Files.readString(filePath));
|
||||
prefs.put("source-import-dir", filePath.getParent().toAbsolutePath().toString());
|
||||
} catch (IOException exc) {
|
||||
exc.printStackTrace();
|
||||
JOptionPane.showMessageDialog(parent, "Failed to read file:\n" + exc.getMessage(), "Read Failed", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,14 +44,13 @@ public class MainFrame extends JFrame {
|
|||
BookPreviewPanel bookPreviewPanel = new BookPreviewPanel();
|
||||
doublePanel.add(bookPreviewPanel);
|
||||
CompileFromSourceAction.getInstance().setBookPreviewPanel(bookPreviewPanel);
|
||||
CompileFromSourceAction.getInstance().setBookPreviewPanel(bookPreviewPanel);
|
||||
ExportBookToMinecraftAction.getInstance().setBookPreviewPanel(bookPreviewPanel);
|
||||
|
||||
SourceTextPanel sourceTextPanel = new SourceTextPanel();
|
||||
doublePanel.add(sourceTextPanel);
|
||||
CompileFromSourceAction.getInstance().setSourceTextPanel(sourceTextPanel);
|
||||
CompileFromSourceAction.getInstance().setSourceTextPanel(sourceTextPanel);
|
||||
CleanSourceAction.getInstance().setSourceTextPanel(sourceTextPanel);
|
||||
ImportSourceAction.getInstance().setSourceTextPanel(sourceTextPanel);
|
||||
|
||||
mainPanel.add(doublePanel, BorderLayout.CENTER);
|
||||
|
||||
|
@ -70,7 +69,6 @@ public class MainFrame extends JFrame {
|
|||
|
||||
JMenu bookMenu = new JMenu("Book");
|
||||
bookMenu.add(CompileFromSourceAction.getInstance());
|
||||
bookMenu.add(CompileFromSourceAction.getInstance());
|
||||
bookMenu.add(CleanSourceAction.getInstance());
|
||||
bookMenu.add(ExportBookToMinecraftAction.getInstance());
|
||||
menuBar.add(bookMenu);
|
||||
|
|
|
@ -9,15 +9,15 @@
|
|||
<h1>About BlockBookBinder</h1>
|
||||
|
||||
<p>
|
||||
The <em>BlockBookBinder</em> is a simple application that gives you the power to write books faster than ever before! All you need to do is copy and paste some text into the <em>Source</em> panel on the right-hand side of the application, and click <strong>Convert to Book</strong>. Your text will be transformed so that it can fit onto written books in Minecraft, and you can preview the book in the <em>Book Preview</em> panel on the left-hand side of the application, using the navigation buttons below.
|
||||
The <em>BlockBookBinder</em> is a simple application that gives you the power to write books faster than ever before! All you need to do is copy and paste some text into the <em>Source</em> panel on the right-hand side of the application, and click <strong>Compile from Source</strong>. Your text will be transformed so that it can fit onto written books in Minecraft, and you can preview the book in the <em>Book Preview</em> panel on the left-hand side of the application, using the navigation buttons below.
|
||||
</p>
|
||||
|
||||
<p><em>
|
||||
Note that your text might benefit from the <strong>Clean</strong> functionality, where extra new-line and other unnecessary whitespace characters are removed so that the text can be better compressed into Minecraft's limited format.
|
||||
Note that your text might benefit from the <strong>Clean Source</strong> functionality, where extra new-line and other unnecessary whitespace characters are removed so that the text can be better compressed into Minecraft's limited format.
|
||||
</em></p>
|
||||
|
||||
<p>
|
||||
Once you've prepared a book and you want to actually copy it into Minecraft, click on <strong>Export to Book</strong>. This will open up a popup with a few different buttons:
|
||||
Once you've prepared a book and you want to actually copy it into Minecraft, click on <strong>Export to Minecraft</strong>. This will open up a popup with a few different buttons:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
@ -38,6 +38,17 @@
|
|||
When all pages have been exported, you'll be prompted with a little popup, after which the export popup closes and you have the option to export again, or simply close the application if you're done.
|
||||
</p>
|
||||
|
||||
<h3>Troubleshooting</h3>
|
||||
|
||||
<p>
|
||||
This program works by hijacking your PC's input system to automatically transfer text to the system's clipboard, and then paste it by pressing <em>CTRL+V</em> for you. Because of the nature of such applications, there's no guarantee that this process will work on every computer. Here are some tips to try and get things working.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Try to increase the auto-paste delay to 1 second or more, if you notice some pages being skipped during the export process.</li>
|
||||
<li>If the automated approach fails, you can always select and copy each page from the book preview.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue