Skip to content

Commit c0606fd

Browse files
committed
0.0.2
1 parent 81d3fa8 commit c0606fd

15 files changed

Lines changed: 154 additions & 46 deletions

File tree

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
</div>
55
<br>
66

7-
Flex 2 is a multi-purpose art and mapping editor for the Sega Megadrive. The original Flex was a web app, which gave it several limitations. A full rewrite for desktop opens up the ability to use real project files, as well as various other niceties.
7+
Flex 2 is a multi-purpose art and mapping editor for the Sega Megadrive. The original Flex was a web app, which gave it several limitations. A full rewrite for desktop opens up the ability to use real project files, as well as various other improvements.
88

9-
Much inspiration has come from the tools SonMapEd, SpritePlotter, and SonikSprite - with ideas being combined and improved upon.
9+
Much inspiration has come from the tools SonMapEd, SpritePlotter, and SonikSprite.
1010

11-
Because of hidden behaviour in this application, reading this document is recommended before use.
11+
# [download](https://github.com/kirjavascript/Flex2/releases)
1212

13+
[//]: # (__docs__)
1314

1415
## Controls
1516

16-
Most of the keyboard shortcuts (and indeed, behaviours for the application) are listed on the Mappings tab at the bottom. Some commands take a multiplier, so <kbd>32</kbd> + <kbd>Up</kbd> will move the selected mappings 32 pixels up, or <kbd>8</kbd> + <kbd>n t</kbd> will add eight new tiles.
17+
Most of the keyboard shortcuts (and indeed, behaviours for the application) are listed on the Mappings tab at the bottom. Some commands take a multiplier, so <kbd>32</kbd> + <kbd>Up</kbd> will move the selected mappings 32 pixels up, or <kbd>8</kbd> + <kbd>nt</kbd> will add eight new tiles.
1718

1819
### Inputs
1920

@@ -29,6 +30,8 @@ Project files serve as definitions for all the objects in your project. They sho
2930

3031
A key change from version 1 is that Flex no longer has a game mode. Data is saved and loaded as whatever the definition for the object says. This means you can mix formats (like S1 Mappings and S2 DPLCs for editing Sonic CD data), or even provide custom definitions.
3132

33+
The 'label' specified in the mapping and DPLC definitions is to use as the main label if one is required without the output.
34+
3235
## Mapping Editor
3336

3437
The mapping editor has the following mouse interactions;
@@ -51,26 +54,22 @@ When entering drawing mode by pressing <kbd>m</kbd>, dragging over the sprite wi
5154

5255
### Raw Editor
5356

54-
When doing actions like deleting a mapping, Flex 2 will attempt to remove corresponding unused DPLCs. The raw editor gives you access to modify the raw data for mappings and DPLCs without performing any of these optimisations if you need it. It can also be used to change the draw order by reordering mappings.
57+
When doing actions like deleting a mapping, Flex 2 will attempt to remove corresponding unused DPLCs. The raw editor allows you to modify the raw data for mappings and DPLCs without performing any of these optimisations. It can also be used to change the draw order by reordering mappings.
5558

5659
## Palettes
5760

58-
Palette input will be normalised into Megadrive colours. To change the order of palette lines, you can drag the numbers to different positions.
61+
Palette input will be normalised to Megadrive colours. To change the order of palette lines, you can drag the numbers to different positions.
5962

6063
## Sprites
6164

6265
The Sprites tab gives an overview of your full object's data, allowing you to change sprites or reorder them by dragging and dropping.
6366

6467
## Importing
6568

66-
When importing an image over the current frame this is no limitation on image dimensions.
69+
When importing an image over the current frame there is no limitation on image dimensions.
6770

6871
For importing a spritesheet, either the alpha channel or the top left pixel color will serve as transparency.
6972

7073
Mapping output can be configured to either reduce the number of tiles, or the number of mappings. The algorithm favours fewer horizontal sprites over vertical ones.
7174

7275
Both methods of importing use CIEDE2000 nearest colour matching to the current palette.
73-
74-
## Download
75-
76-
The latest version can be found at: https://github.com/kirjavascript/Flex2/releases

development/icon.ico

-133 KB
Binary file not shown.

development/webpack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ module.exports = (env={}, args={}) => {
3434
},
3535
{
3636
test: /\.json$/,
37-
loader: 'json-loader'
37+
loader: 'json-loader',
38+
},
39+
{
40+
test: /\.md$/,
41+
loader: 'raw-loader',
3842
},
3943
{
4044
test: /\.js$/,

flex2.idea

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
modern mapping manipulation
2-
==
31
desktop version
42
project files
53
sexy flexible UI layout
@@ -8,13 +6,7 @@ undo / redo
86
draw directly on sprites
97
import reduce mappings/tiles
108
full access to dplc/mapping data
11-
influences; sonmaped, spriteplotter, soniksprite
12-
==
13-
raw editor doesn't clean up anything (explain deleting)
149
to optimise all dplcs, toggle on/off
15-
SCD 23:39 <+flamewing> Mappings is S1; DPLC is S2 -> ?scd flag
16-
project autosaves
17-
for_window [title="Flex 2"] floating enable border normal
1810
==
1911
V2: sprite rotation http://forums.sonicretro.org/index.php?showtopic=8848&st=0&p=159754&#entry159754
2012
https://yarnpkg.com/en/package/node-vibrant
@@ -26,6 +18,4 @@ add flex.json to sonic 2 disassembly
2618
create new file | newFactory={(path)=>{}}
2719
==
2820

29-
check version in documentation tab (move code)
30-
logo / have default as logo?
31-
describle what label is used for in asm
21+
logo
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { shell } from 'electron';
2+
3+
import React, { Component } from 'react';
4+
5+
export class A extends Component {
6+
7+
onClick = (e) => {
8+
e.preventDefault();
9+
shell.openExternal(this.props.href);
10+
};
11+
12+
render() {
13+
return <a {...this.props} href="#" onClick={this.onClick}/>;
14+
}
15+
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React, { Component } from 'react';
2+
import README from '../../../README.md';
3+
import marked from 'marked';
4+
import { Version } from './version';
5+
import { shell } from 'electron';
6+
7+
const docs = {__html: marked(README.split('(__docs__)').pop())};
8+
9+
export class Documentation extends Component {
10+
11+
render() {
12+
return <div className="documentation">
13+
<h1>Flex 2</h1>
14+
<Version/>
15+
<br/>
16+
<div
17+
dangerouslySetInnerHTML={docs}
18+
/>
19+
</div>;
20+
}
21+
22+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import packageJson from '../../../package.json';
2+
import React, { Component } from 'react';
3+
import { A } from './a.js';
4+
5+
function semvarToInt(str) {
6+
// currently just a rough calculation
7+
return +str.split`.`.map((d) => d.padStart(3, '0')).join``;
8+
}
9+
10+
export class Version extends Component {
11+
12+
state = { newVersion: void 0, error: false };
13+
14+
componentDidMount() {
15+
fetch('https://raw.githubusercontent.com/kirjavascript/Flex2/master/package.json')
16+
.then((response) => response.json())
17+
.then(({version}) => {
18+
const currentVersion = semvarToInt(packageJson.version);
19+
const githubVersion = semvarToInt(version);
20+
if (githubVersion > currentVersion) {
21+
this.setState({newVersion: version});
22+
}
23+
})
24+
.catch((err) => {
25+
console.error(err);
26+
});
27+
}
28+
29+
render() {
30+
const { error, newVersion } = this.state;
31+
32+
return <div>
33+
version {packageJson.version}
34+
{newVersion && (
35+
<span>
36+
{' - '}
37+
<A href="https://github.com/kirjavascript/Flex2/releases" className="magenta">
38+
a new version ({newVersion}) is available
39+
</A>
40+
</span>
41+
)}
42+
{' ★ '}
43+
<A href="https://www.github.com/kirjavascript/Flex2">
44+
Source code
45+
</A>
46+
{error && <div className="red">{error}</div>}
47+
</div>;
48+
}
49+
50+
}

modules/components/layout/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Palettes } from '#components/palettes';
88
import { Art } from '#components/art/index';
99
import { Sprites } from '#components/sprites';
1010
import { Mappings } from '#components/mappings';
11+
import { Documentation } from '#components/documentation';
1112

1213
export class Layout extends Component {
1314

@@ -31,6 +32,9 @@ export class Layout extends Component {
3132
else if (component == 'mappings') {
3233
<Mappings node={node}/>;
3334
}
35+
else if (component == 'documentation') {
36+
<Documentation node={node}/>;
37+
}
3438
};
3539
}
3640

modules/components/layout/model.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ const DEFAULT_LAYOUT = {
4848
'component': 'mappings',
4949
'id': '#7',
5050
},
51+
{
52+
'type': 'tab',
53+
'name': 'Documentation',
54+
'component': 'documentation',
55+
'id': '#8',
56+
},
5157
],
5258
'active': true
5359
},

modules/root.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { render } from 'react-dom';
33
import { Layout } from '#components/layout';
44

5-
import '#util/check-version';
65
import './controls/keyboard';
76
import './components/import';
87

0 commit comments

Comments
 (0)