Remove to staxie
parent
b557272c04
commit
95f6509d35
14
app.go
14
app.go
|
@ -6,7 +6,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"spriteStackist/pkg/data"
|
|
||||||
|
"github.com/kettek/staxie/pkg/data"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
@ -27,16 +28,11 @@ func (a *App) startup(ctx context.Context) {
|
||||||
a.ctx = ctx
|
a.ctx = ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
// Greet returns a greeting for the given name
|
func (a *App) Load(name string) *data.StaxieFileV1 {
|
||||||
func (a *App) Greet(name string) string {
|
return &data.StaxieFileV1{}
|
||||||
return fmt.Sprintf("Hello %s, It's show time!", name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) Load(name string) *data.StackistFileV1 {
|
func (a *App) Save(name string, file *data.StaxieFileV1) error {
|
||||||
return &data.StackistFileV1{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *App) Save(name string, file *data.StackistFileV1) error {
|
|
||||||
b, err := json.Marshal(file)
|
b, err := json.Marshal(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
<title>spriteStackist</title>
|
<title>Staxie</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
f001f3ad84549a4a16ef6303845139bd
|
6370e69c73297099c048eead390477f3
|
|
@ -87,7 +87,7 @@
|
||||||
let showExport: boolean = false
|
let showExport: boolean = false
|
||||||
let showNew: boolean = false
|
let showNew: boolean = false
|
||||||
let importValid: boolean = false
|
let importValid: boolean = false
|
||||||
let importFile: data.StackistFileV1 = null
|
let importFile: data.StaxieFileV1 = null
|
||||||
let importFilepath: string = ''
|
let importFilepath: string = ''
|
||||||
let importCanvas: Canvas = null
|
let importCanvas: Canvas = null
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
let width: number = 16
|
let width: number = 16
|
||||||
let height: number = 16
|
let height: number = 16
|
||||||
let rowBasedFrames: boolean = true
|
let rowBasedFrames: boolean = true
|
||||||
export let file: data.StackistFileV1
|
export let file: data.StaxieFileV1
|
||||||
export let filepath: string = ''
|
export let filepath: string = ''
|
||||||
export let canvas: Canvas
|
export let canvas: Canvas
|
||||||
let img: HTMLImageElement
|
let img: HTMLImageElement
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function remakeFile() {
|
function remakeFile() {
|
||||||
file = data.StackistFileV1.createFrom({
|
file = data.StaxieFileV1.createFrom({
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
groups: {}
|
groups: {}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
let width: number = 64
|
let width: number = 64
|
||||||
let height: number = 64
|
let height: number = 64
|
||||||
let indexed: boolean = true
|
let indexed: boolean = true
|
||||||
export let file: data.StackistFileV1
|
export let file: data.StaxieFileV1
|
||||||
export let canvas: Canvas
|
export let canvas: Canvas
|
||||||
export let open: boolean = false
|
export let open: boolean = false
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
canvas = new Canvas(width, height)
|
canvas = new Canvas(width, height)
|
||||||
canvas.addNewPaletteColor(0, 0, 0, 0)
|
canvas.addNewPaletteColor(0, 0, 0, 0)
|
||||||
canvas.isIndexed = indexed
|
canvas.isIndexed = indexed
|
||||||
file = data.StackistFileV1.createFrom({
|
file = data.StaxieFileV1.createFrom({
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
groups: {}
|
groups: {}
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
canvas = new Canvas(width, height)
|
canvas = new Canvas(width, height)
|
||||||
canvas.addNewPaletteColor(0, 0, 0, 0)
|
canvas.addNewPaletteColor(0, 0, 0, 0)
|
||||||
canvas.isIndexed = indexed
|
canvas.isIndexed = indexed
|
||||||
file = data.StackistFileV1.createFrom({
|
file = data.StaxieFileV1.createFrom({
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
groups: {}
|
groups: {}
|
||||||
|
|
|
@ -8,7 +8,7 @@ export interface LoadedFileOptions {
|
||||||
filepath: string
|
filepath: string
|
||||||
title: string
|
title: string
|
||||||
canvas: Canvas
|
canvas: Canvas
|
||||||
data: data.StackistFileV1
|
data: data.StaxieFileV1
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LoadedFile extends UndoableStack<LoadedFile> {
|
export class LoadedFile extends UndoableStack<LoadedFile> {
|
||||||
|
@ -17,7 +17,7 @@ export class LoadedFile extends UndoableStack<LoadedFile> {
|
||||||
canvas: Canvas
|
canvas: Canvas
|
||||||
selection: SelectionArea
|
selection: SelectionArea
|
||||||
preview: Preview
|
preview: Preview
|
||||||
data: data.StackistFileV1
|
data: data.StaxieFileV1
|
||||||
|
|
||||||
constructor(options: LoadedFileOptions) {
|
constructor(options: LoadedFileOptions) {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -4,15 +4,13 @@ import {data} from '../models';
|
||||||
|
|
||||||
export function GetFilePath():Promise<string>;
|
export function GetFilePath():Promise<string>;
|
||||||
|
|
||||||
export function Greet(arg1:string):Promise<string>;
|
export function Load(arg1:string):Promise<data.StaxieFileV1>;
|
||||||
|
|
||||||
export function Load(arg1:string):Promise<data.StackistFileV1>;
|
|
||||||
|
|
||||||
export function OpenFileBytes(arg1:string):Promise<Array<number>>;
|
export function OpenFileBytes(arg1:string):Promise<Array<number>>;
|
||||||
|
|
||||||
export function ReadBytes(arg1:string):Promise<Array<number>>;
|
export function ReadBytes(arg1:string):Promise<Array<number>>;
|
||||||
|
|
||||||
export function Save(arg1:string,arg2:data.StackistFileV1):Promise<void>;
|
export function Save(arg1:string,arg2:data.StaxieFileV1):Promise<void>;
|
||||||
|
|
||||||
export function SaveFileBytes(arg1:string,arg2:Array<number>):Promise<void>;
|
export function SaveFileBytes(arg1:string,arg2:Array<number>):Promise<void>;
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,6 @@ export function GetFilePath() {
|
||||||
return window['go']['main']['App']['GetFilePath']();
|
return window['go']['main']['App']['GetFilePath']();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Greet(arg1) {
|
|
||||||
return window['go']['main']['App']['Greet'](arg1);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Load(arg1) {
|
export function Load(arg1) {
|
||||||
return window['go']['main']['App']['Load'](arg1);
|
return window['go']['main']['App']['Load'](arg1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,14 +110,14 @@ export namespace data {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class StackistFileV1 {
|
export class StaxieFileV1 {
|
||||||
version: string;
|
version: string;
|
||||||
groups: {[key: string]: Group};
|
groups: {[key: string]: Group};
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
|
|
||||||
static createFrom(source: any = {}) {
|
static createFrom(source: any = {}) {
|
||||||
return new StackistFileV1(source);
|
return new StaxieFileV1(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(source: any = {}) {
|
constructor(source: any = {}) {
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module spriteStackist
|
module github.com/kettek/staxie
|
||||||
|
|
||||||
go 1.21
|
go 1.21
|
||||||
|
|
||||||
|
|
2
main.go
2
main.go
|
@ -17,7 +17,7 @@ func main() {
|
||||||
|
|
||||||
// Create application with options
|
// Create application with options
|
||||||
err := wails.Run(&options.App{
|
err := wails.Run(&options.App{
|
||||||
Title: "spriteStackist",
|
Title: "Staxie",
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
AssetServer: &assetserver.Options{
|
AssetServer: &assetserver.Options{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package data
|
package data
|
||||||
|
|
||||||
type StackistFileV1 struct {
|
type StaxieFileV1 struct {
|
||||||
Version string `json:"version"` // The version of the file format.
|
Version string `json:"version"` // The version of the file format.
|
||||||
Groups map[string]Group `json:"groups"`
|
Groups map[string]Group `json:"groups"`
|
||||||
Width int `json:"width"`
|
Width int `json:"width"`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://wails.io/schemas/config.v2.json",
|
"$schema": "https://wails.io/schemas/config.v2.json",
|
||||||
"name": "spriteStackist",
|
"name": "Staxie",
|
||||||
"outputfilename": "spriteStackist",
|
"outputfilename": "Staxie",
|
||||||
"frontend:install": "npm install",
|
"frontend:install": "npm install",
|
||||||
"frontend:build": "npm run build",
|
"frontend:build": "npm run build",
|
||||||
"frontend:dev:watcher": "npm run dev",
|
"frontend:dev:watcher": "npm run dev",
|
||||||
|
|
Loading…
Reference in New Issue