Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f503761
Initial implementation for a dedicated reference tool
michael-lazar Jan 9, 2025
7058ea1
Support dragging the reference image with mouse
michael-lazar Jan 10, 2025
9460693
Adding border around selected reference
michael-lazar Jan 10, 2025
b3fd6fc
Fix bug with initialization
michael-lazar Jan 11, 2025
88c2a3d
Adding reference opacity to tool
michael-lazar Jan 12, 2025
e7100cd
Adding width/angle controls
michael-lazar Jan 13, 2025
dc4b6a8
Cleanup, add reset button
michael-lazar Jan 13, 2025
33378f7
polish
michael-lazar Jan 13, 2025
1f0b715
polish
michael-lazar Jan 13, 2025
67c24fc
polish
michael-lazar Jan 13, 2025
b8f4257
polish
michael-lazar Jan 13, 2025
312968a
polish
michael-lazar Jan 13, 2025
4aeedf7
polish
michael-lazar Jan 14, 2025
aeee8e9
Merge pull request #1 from michael-lazar/reference_mode
michael-lazar Jan 16, 2025
7d2de28
Fix saving odd-column xbins and fix double-appending SAUCE records to…
michael-lazar Jan 22, 2025
ce08e0f
Fix the "Save Without Sauce Info" menu operation
michael-lazar Jan 22, 2025
a887f54
Add warning when attempting to save BIN with odd columns
michael-lazar Jan 22, 2025
23c1fb8
Change default columns for BIN from 160 to 80, make the warning dialo…
michael-lazar Jan 23, 2025
616eae3
Re-render drawing grid on font change
michael-lazar Jan 23, 2025
c9116dc
Initial implementation for drag and drop
michael-lazar Jan 25, 2025
67970f3
Adding confirmation dialogs to drag and drop.
michael-lazar Jan 25, 2025
6cbbf85
Merge branch 'drawing_grid2'
michael-lazar Jan 26, 2025
ac0d670
Merge branch 'fixes'
michael-lazar Jan 26, 2025
4a644f1
Merge branch 'drag_and_drop'
michael-lazar Jan 26, 2025
2ec43d6
Add ability to open reference images in separate windows
michael-lazar Jan 28, 2025
463c198
Add ability to open reference images in separate windows
michael-lazar Jan 28, 2025
5b1301f
Merge pull request #2 from michael-lazar/reference_window
michael-lazar Jan 29, 2025
104165a
Fixes scroll behavior for 200% zoom.
michael-lazar Jan 31, 2025
4703f7e
Fixes scroll behavior for 200% zoom.
michael-lazar Jan 31, 2025
8e44355
Merge pull request #3 from michael-lazar/zoom_fixes
michael-lazar Jan 31, 2025
91e92a5
Add outline/border to brush tool.
michael-lazar Feb 4, 2025
1cb96e2
Merge pull request #4 from michael-lazar/brush_outline
michael-lazar Feb 4, 2025
ffc4889
Add outline/border to brush tool.
michael-lazar Feb 4, 2025
d6cace8
Fixes mouse move events from not triggering on the cell that was most…
michael-lazar Feb 8, 2025
c8f97b9
Merge pull request #5 from michael-lazar/mouse_position_reset
michael-lazar Feb 8, 2025
82771ae
Add recent files menu feature
grymmjack Feb 26, 2025
19c7d1f
Improve recent files menu display
grymmjack Feb 26, 2025
2e0a055
Fix issue with opening files from the recent files menu
grymmjack Feb 26, 2025
74e51c9
Fix recent files menu functionality
grymmjack Feb 26, 2025
e41fa86
Fix menu error causing app crash
grymmjack Feb 26, 2025
7954a3b
Fix missing menu items in document windows
grymmjack Feb 26, 2025
abaa076
Fix menu persistence for document windows
grymmjack Feb 26, 2025
3c8524a
Merge pull request #23 from grymmjack/add-recent-files
grymmjack Feb 26, 2025
09f79d3
Merge pull request #16 from michael-lazar/master
grymmjack Feb 26, 2025
bc297e5
Merge pull request #20 from michael-lazar/reference_window_3
grymmjack Feb 26, 2025
7c62958
Merge pull request #21 from michael-lazar/zoom_fixes2
grymmjack Feb 26, 2025
abf391e
Merge pull request #22 from michael-lazar/brush_outline2
grymmjack Feb 26, 2025
582355c
Fixing missing menus for non macos
grymmjack Feb 27, 2025
5d567fc
Merge pull request #24 from grymmjack/fix-menus-for-non-macos
grymmjack Feb 27, 2025
1185a90
Adding grid and guide hotkey toggles, updating README
grymmjack Feb 27, 2025
c5abb28
Merge pull request #25 from grymmjack/add-grid-guide-toggles
grymmjack Feb 27, 2025
15dde43
Fixes #26
grymmjack Feb 28, 2025
7aa2191
Merge pull request #27 from grymmjack/fix-enter-esc-modal-exit-issue-#26
grymmjack Feb 28, 2025
7d8fb7c
Fixing all known issues re: keyboard handling and modals
grymmjack Feb 28, 2025
6858bfd
Fixed MacOS modals issues
grymmjack Feb 28, 2025
1464b25
Added arm64, and x64 targets for linux.
grymmjack Feb 28, 2025
9db7fe0
Adding github action
grymmjack Feb 28, 2025
e538e70
Update build.yml
grymmjack Feb 28, 2025
13d468e
Update build.yml
grymmjack Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build/release

on: push

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 23

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
server*.ans
Thumbs.db
moebius.code-workspace
.idea
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Moebius XBIN is an XBIN Editor for MacOS, Linux and Windows. This is a forked ve
- `Moebius XBIN GJ Edition` which originally was just me wanting to stop the function keys from re-mapping -- but now has become a bit more.

## Moebius XBIN GJ Edition:
- Recent files support
- Stops the function keys from being remapped when clicking in the character list.
- Makes default font IBM VGA instead of TOPAZ 437 (preference)
- Lets you use the character list picker to load the custom paint brush block.
Expand All @@ -15,6 +16,15 @@ Moebius XBIN is an XBIN Editor for MacOS, Linux and Windows. This is a forked ve
- Adds a 1x1 drawing grid
- Adds character code to status bar
- Smaller character list (actual size of font vs 2x zoom previously)
- Added hokey `CTRL+'` to toggle the drawing grid - Defaults to 1x1 grid when first toggled on
- Added hotkey `CTRL+;` to toggle guides - Defaults to Smallscale guide (80x25) when first toggled on
- Reference image tool by @michael-lazar
- Fixes for BIN / XBIN encoding by @michael-lazar
- Re-render drawing grid on font change by @michael-lazar
- Drag and drop files from desktop by @michael-lazar
- Add ability to open reference images in separate windows by @michael-lazar
- Fixes scrolling for 200% zoom. by @michael-lazar
- Add outline/border to the brush tool by @michael-lazar
- ... more things to come perhaps!

## Download packages
Expand Down
8 changes: 5 additions & 3 deletions app/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ require("./document/tools/ellipse_filled");
require("./document/tools/ellipse_outline");
require("./document/tools/fill");
require("./document/tools/sample");
require("./document/tools/reference");
require("./document/input/drag_and_drop");

doc.on("start_rendering", () => send_sync("show_rendering_modal"));
doc.on("end_rendering", () => send("close_modal"));
doc.on("end_rendering", () => send("close_modal", {}));
doc.on("connecting", () => send_sync("show_connecting_modal"));
doc.on("connected", () => send("close_modal"));
doc.on("connected", () => send("close_modal", {}));
doc.on("unable_to_connect", () => {
const choice = msg_box("Connect to Server", "Cannot connect to Server", { buttons: ["Retry", "Cancel"], defaultId: 0, cancelId: 1 });
if (choice == 1) send("destroy");
Expand Down Expand Up @@ -95,7 +97,7 @@ async function save_without_sauce() {
doc.edited = false;
save(false, true);
} else {
await doc.save_backup(file)
await doc.save_backup_without_sauce(file)
await doc.open(file);
}
}
Expand Down
34 changes: 30 additions & 4 deletions app/css/document.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
--preview-width: 300px;
--charlist-width: 128px;
--chat-height: 0px;
--reference-control-opacity: 0.4;
}
#sidebar {
float: left;
Expand Down Expand Up @@ -78,6 +79,9 @@ body.dark .tool.selected {
#sample_mode {
background-image: url("../img/sample.png");
}
#reference_mode {
background-image: url("../img/reference.png");
}
#sidebar, #toolbar {
background-color: var(--mid-color);
}
Expand Down Expand Up @@ -161,6 +165,12 @@ body.dark #current_colors > canvas {
touch-action: none;
cursor: -webkit-image-set(url("../img/crosshair.png") 1x, url("../img/crosshair_2x.png") 2x) 15 15, crosshair;
}
#viewport.reference-tool {
cursor: grab;
}
#viewport.reference-tool.grabbing {
cursor: grabbing;
}
#chat {
width: calc(100% - var(--sidebar-width) - var(--preview-width) - var(--charlist-width));
height: var(--chat-height);
Expand Down Expand Up @@ -344,7 +354,8 @@ body.dark #preview {
}
#canvas_container.canvas_zoom {
transform: scale(2);
transform-origin: top;
transform-origin: top left;
margin: 0;
}
.hidden {
display: none !important;
Expand Down Expand Up @@ -427,12 +438,27 @@ body.dark #statusbar > div > div {
#editing_layer > canvas.selection.operation {
border-image-source: url("../img/selection_border_operation.gif");
}
#reference_layer {
position: relative;
}
#reference_image {
background-size: 100%;
background-repeat: no-repeat;
opacity: 0.4;
image-rendering: pixelated;
position: absolute;
top: 0;
left: 0;
height: auto;
object-fit: cover;
}

#reference_image.selected {
outline: 1px solid;
outline-style: dashed;
}

#reference_image.closed {
display: none;
}

#guide.hidden {
display: none;
}
Expand Down
80 changes: 80 additions & 0 deletions app/css/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,86 @@ body.dark .panel > div {
cursor: pointer;
}

.label {
float: left;
line-height: 1.1em;
text-align: center !important;
margin: 8px;
margin-right: 0px;
height: 30px;
display: inline-flex !important;
justify-content: center;
align-items: center;
}

.number-input {
float: left;
gap: 10px;
margin: 8px 0;
padding: 1px;
color: rgba(255, 255, 255, 0.3);
background-image: -webkit-linear-gradient(top, rgb(34, 37, 43), rgb(30, 31, 35));
border: 1px solid rgba(0, 0, 0, 0.6);
text-align: center;
width: 4ch;
height: 28px;
}

.number-input:focus {
outline: 1px solid rgba(0, 0, 0, 0.3);
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

.reference-control {
opacity: var(--reference-control-opacity);
}

.reference-control.button-left {
margin-right: 0px;
border-right: none;
padding: 0 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}

.reference-control.button-right {
border-left: none;
margin-left: 0px;
padding: 0 6px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}

#reference_show {
margin-right: 0px;
border-right: none;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}

#reference_hide {
border-left: none;
margin-left: 0px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}

#reference_open, #reference_reset {
border-radius: 4px;
}

#reference_open:active, #reference_reset:active {
border-color: rgba(255, 255, 255, 0.4);
color: rgba(255, 255, 255, 0.8);
text-shadow: 0px -1px rgba(0, 0, 0, 0.2);
background-image: -webkit-linear-gradient(top, rgba(96, 108, 136, 0.6), rgba(83, 96, 127, 0.6));
}

#half_block {
margin-right: 0px;
border-right: none;
Expand Down
37 changes: 37 additions & 0 deletions app/css/warning.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
body {
user-select: none;
font-size: 14px;
color: #aaaaaa;
background-color: var(--dark-mid-color);
overflow: hidden;
padding: 1em;
}

button {
position: absolute;
bottom: 4px;
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 4px;
background: none;
color: var(--text);
padding: 6px 10px;
margin: 6px;
outline: none;
transition-property: background-color;
transition-duration: 20ms;
transition-timing-function: linear;
}

button:active {
border: 1px solid white;
background-color: var(--status);
color: var(--text);
}

#content {
width: 450px;
}

#cancel {
right: 0px;
}
50 changes: 44 additions & 6 deletions app/document/doc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const libtextmode = require("../libtextmode/libtextmode");
const { on, send, send_sync } = require("../senders");
const { on, send, send_sync, open_box} = require("../senders");
const events = require("events");
const chat = require("./ui/chat");
const path = require("path");
const fs = require("fs");
let doc, render;
const actions = { CONNECTED: 0, REFUSED: 1, JOIN: 2, LEAVE: 3, CURSOR: 4, SELECTION: 5, RESIZE_SELECTION: 6, OPERATION: 7, HIDE_CURSOR: 8, DRAW: 9, CHAT: 10, STATUS: 11, SAUCE: 12, ICE_COLORS: 13, USE_9PX_FONT: 14, CHANGE_FONT: 15, SET_CANVAS_SIZE: 16, PASTE_AS_SELECTION: 17, ROTATE: 18, FLIP_X: 19, FLIP_Y: 20, SET_BG: 21, CHANGE_PALETTE: 22 };
const statuses = { ACTIVE: 0, IDLE: 1, AWAY: 2, WEB: 3 };
Expand Down Expand Up @@ -1124,6 +1125,10 @@ class TextModeDoc extends events.EventEmitter {
await libtextmode.write_file(this, file);
}

async save_backup_without_sauce(file) {
await libtextmode.write_file(this, file, { save_without_sauce: true });
}

async export_as_utf8(file) {
await libtextmode.write_file(this, file, { utf8: true });
}
Expand Down Expand Up @@ -1154,11 +1159,39 @@ class TextModeDoc extends events.EventEmitter {
this.start_rendering().then(() => this.emit("change_font", doc.font_name));
}

async load_custom_font() {
const { bytes, filename } = await libtextmode.load_custom_font();
doc.font_name = path.parse(filename).name;
doc.font_bytes = bytes;
this.start_rendering().then(() => this.emit("change_font", doc.font_name));
async load_custom_font(options = {}) {
let file = options.file;
if (!file) {
const files = open_box({
filters: [{
name: "Custom Font",
extensions: [
"f06", "f07", "f08", "f09", "f10", "f11", "f12", "f13",
"f14", "f15","f16", "f17", "f18", "f19", "f20", "f21",
"f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29",
"f30", "f31", "f32"
]
}]
});
if (!files || files.length === 0) return;
file = files[0];
}

// Show loading dialog
const id = send_sync("show_loading_dialog", { title: "Loading Custom Font", message: "Please wait while the font is being loaded..." });

try {
const { bytes, filename } = await libtextmode.load_custom_font(file);
doc.font_name = path.parse(filename).name;
doc.font_bytes = bytes;
await this.start_rendering();
this.emit("change_font", doc.font_name);
} catch (error) {
send("show_warning", { title: "Font Loading Error", content: `Failed to load font: ${error.message || error}` });
} finally {
// Hide loading dialog
send("close_modal", { id });
}
}

constructor() {
Expand All @@ -1182,4 +1215,9 @@ class TextModeDoc extends events.EventEmitter {
}
}

function save_file(bytes, filename) {
fs.writeFileSync(filename, bytes);
add_to_recent_files(filename);
}

module.exports = new TextModeDoc();
Loading
Loading