mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-05 15:28:29 +08:00
Tweaked theme and started working on porting quest editor to the new UI system.
This commit is contained in:
parent
3185737cd9
commit
dbd5dba682
@ -3,7 +3,7 @@ import { writeFileSync } from "fs";
|
|||||||
import "isomorphic-fetch";
|
import "isomorphic-fetch";
|
||||||
import Logger from "js-logger";
|
import Logger from "js-logger";
|
||||||
import { ASSETS_DIR } from ".";
|
import { ASSETS_DIR } from ".";
|
||||||
import { Difficulty, SectionId, SectionIds } from "../src/old/core/domain";
|
import { Difficulty, SectionId, SectionIds } from "../src/core/domain";
|
||||||
import { BoxDropDto, EnemyDropDto, ItemTypeDto } from "../src/old/core/dto";
|
import { BoxDropDto, EnemyDropDto, ItemTypeDto } from "../src/old/core/dto";
|
||||||
import {
|
import {
|
||||||
name_and_episode_to_npc_type,
|
name_and_episode_to_npc_type,
|
||||||
|
@ -5,7 +5,7 @@ import { BufferCursor } from "../src/core/data_formats/cursor/BufferCursor";
|
|||||||
import { ItemPmt, parse_item_pmt } from "../src/core/data_formats/parsing/itempmt";
|
import { ItemPmt, parse_item_pmt } from "../src/core/data_formats/parsing/itempmt";
|
||||||
import { parse_quest } from "../src/core/data_formats/parsing/quest";
|
import { parse_quest } from "../src/core/data_formats/parsing/quest";
|
||||||
import { parse_unitxt, Unitxt } from "../src/core/data_formats/parsing/unitxt";
|
import { parse_unitxt, Unitxt } from "../src/core/data_formats/parsing/unitxt";
|
||||||
import { Difficulties, Difficulty, SectionId, SectionIds } from "../src/old/core/domain";
|
import { Difficulties, Difficulty, SectionId, SectionIds } from "../src/core/domain";
|
||||||
import { BoxDropDto, EnemyDropDto, ItemTypeDto, QuestDto } from "../src/old/core/dto";
|
import { BoxDropDto, EnemyDropDto, ItemTypeDto, QuestDto } from "../src/old/core/dto";
|
||||||
import { update_drops_from_website } from "./update_drops_ephinea";
|
import { update_drops_from_website } from "./update_drops_ephinea";
|
||||||
import { Episode, EPISODES } from "../src/core/data_formats/parsing/quest/Episode";
|
import { Episode, EPISODES } from "../src/core/data_formats/parsing/quest/Episode";
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
import { create_el } from "../../core/gui/dom";
|
import { create_el } from "../../core/gui/dom";
|
||||||
import { View } from "../../core/gui/View";
|
|
||||||
import { gui_store, GuiTool } from "../../core/stores/GuiStore";
|
import { gui_store, GuiTool } from "../../core/stores/GuiStore";
|
||||||
import { LazyView } from "../../core/gui/LazyView";
|
import { LazyView } from "../../core/gui/LazyView";
|
||||||
import { Resizable } from "../../core/gui/Resizable";
|
|
||||||
import { ResizableView } from "../../core/gui/ResizableView";
|
import { ResizableView } from "../../core/gui/ResizableView";
|
||||||
|
|
||||||
const TOOLS: [GuiTool, () => Promise<View & Resizable>][] = [
|
const TOOLS: [GuiTool, () => Promise<ResizableView>][] = [
|
||||||
[GuiTool.Viewer, async () => new (await import("../../viewer/gui/ViewerView")).ViewerView()],
|
[GuiTool.Viewer, async () => new (await import("../../viewer/gui/ViewerView")).ViewerView()],
|
||||||
|
[
|
||||||
|
GuiTool.QuestEditor,
|
||||||
|
async () => new (await import("../../quest_editor/gui/QuestEditorView")).QuestEditorView(),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
export class MainContentView extends ResizableView {
|
export class MainContentView extends ResizableView {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
background-color: hsl(0, 0%, 12%);
|
background-color: hsl(0, 0%, 10%);
|
||||||
border-bottom: solid 2px var(--bg-color);
|
border-bottom: solid 2px var(--bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,18 +14,19 @@
|
|||||||
.application_ToolButton label {
|
.application_ToolButton label {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
line-height: 40px;
|
line-height: 29px;
|
||||||
|
color: hsl(0, 0%, 65%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.application_ToolButton label:hover {
|
.application_ToolButton label:hover {
|
||||||
color: hsl(200, 25%, 85%);
|
color: hsl(0, 0%, 85%);
|
||||||
background-color: hsl(0, 0%, 16%);
|
background-color: hsl(0, 0%, 12%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.application_ToolButton input:checked + label {
|
.application_ToolButton input:checked + label {
|
||||||
color: hsl(200, 50%, 85%);
|
color: hsl(0, 0%, 85%);
|
||||||
background-color: hsl(0, 0%, 20%);
|
background-color: var(--bg-color);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const TOOLS: [GuiTool, string][] = [
|
|||||||
|
|
||||||
export class NavigationView extends View {
|
export class NavigationView extends View {
|
||||||
element = create_el("div", "application_NavigationView");
|
element = create_el("div", "application_NavigationView");
|
||||||
height = 40;
|
height = 30;
|
||||||
|
|
||||||
private buttons = new Map<GuiTool, ToolButton>(
|
private buttons = new Map<GuiTool, ToolButton>(
|
||||||
TOOLS.map(([value, text]) => [value, this.disposable(new ToolButton(value, text))]),
|
TOOLS.map(([value, text]) => [value, this.disposable(new ToolButton(value, text))]),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { enum_values } from "../../../core/enums";
|
import { enum_values } from "../enums";
|
||||||
|
|
||||||
export const RARE_ENEMY_PROB = 1 / 512;
|
export const RARE_ENEMY_PROB = 1 / 512;
|
||||||
export const KONDRIEU_PROB = 1 / 10;
|
export const KONDRIEU_PROB = 1 / 10;
|
@ -1,21 +1,30 @@
|
|||||||
.core_Button {
|
.core_Button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #404040;
|
padding: 0;
|
||||||
height: 26px;
|
border: solid 1px hsl(0, 0%, 10%);
|
||||||
padding: 2px 8px;
|
color: hsl(0, 0%, 80%);
|
||||||
border: solid 1px #606060;
|
|
||||||
color: #f0f0f0;
|
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_Button:hover {
|
.core_Button .core_Button_inner {
|
||||||
background-color: #505050;
|
display: inline-block;
|
||||||
border-color: #707070;
|
box-sizing: border-box;
|
||||||
|
background-color: hsl(0, 0%, 20%);
|
||||||
|
height: 24px;
|
||||||
|
line-height: 17px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border: solid 1px hsl(0, 0%, 35%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_Button:active {
|
.core_Button:hover .core_Button_inner {
|
||||||
background-color: #404040;
|
background-color: hsl(0, 0%, 25%);
|
||||||
border-color: #606060;
|
border-color: hsl(0, 0%, 40%);
|
||||||
color: #e0e0e0;
|
color: hsl(0, 0%, 90%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.core_Button:active .core_Button_inner {
|
||||||
|
background-color: hsl(0, 0%, 20%);
|
||||||
|
border-color: hsl(0, 0%, 30%);
|
||||||
|
color: hsl(0, 0%, 75%);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,10 @@ export class Button extends View {
|
|||||||
constructor(text: string) {
|
constructor(text: string) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.element.textContent = text;
|
const inner_element = create_el("span", "core_Button_inner");
|
||||||
|
inner_element.textContent = text;
|
||||||
|
|
||||||
|
this.element.append(inner_element);
|
||||||
|
|
||||||
this.element.onclick = (e: MouseEvent) => this._click.emit(e, undefined);
|
this.element.onclick = (e: MouseEvent) => this._click.emit(e, undefined);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,9 @@ export class FileButton extends View {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.element.textContent = text;
|
const inner_element = create_el("span", "core_FileButton_inner core_Button_inner");
|
||||||
this.element.append(this.input);
|
inner_element.textContent = text;
|
||||||
|
|
||||||
|
this.element.append(inner_element, this.input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,32 @@
|
|||||||
.core_Input {
|
.core_Input {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 26px;
|
border: solid 1px hsl(0, 0%, 25%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.core_Input .core_Input_inner {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
height: 24px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
border: solid 1px var(--border-color);
|
border: solid 1px hsl(0, 0%, 0%);
|
||||||
background-color: var(--input-bg-color);
|
background-color: hsl(0, 0%, 12%);
|
||||||
color: var(--text-color);
|
color: hsl(0, 0%, 75%);
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_Input:hover {
|
.core_Input:hover {
|
||||||
border: solid 1px var(--border-color-hover);
|
border-color: hsl(0, 0%, 35%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_Input:focus {
|
.core_Input:focus-within {
|
||||||
border: solid 1px var(--border-color-focus);
|
border-color: hsl(0, 0%, 45%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_Input:disabled {
|
.core_Input.disabled {
|
||||||
|
border: solid 1px hsl(0, 0%, 20%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.core_Input.disabled .core_Input_inner {
|
||||||
|
background-color: hsl(0, 0%, 15%);
|
||||||
color: var(--text-color-disabled);
|
color: var(--text-color-disabled);
|
||||||
background-color: var(--input-bg-color-disabled);
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
.core_NumberInput {
|
.core_NumberInput .core_NumberInput_inner {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
@ -7,12 +7,17 @@ import { LabelledControl } from "./LabelledControl";
|
|||||||
import { is_any_property, Property } from "../observable/Property";
|
import { is_any_property, Property } from "../observable/Property";
|
||||||
|
|
||||||
export class NumberInput extends LabelledControl {
|
export class NumberInput extends LabelledControl {
|
||||||
readonly element: HTMLInputElement = create_el("input", "core_NumberInput core_Input");
|
readonly element = create_el("span", "core_NumberInput core_Input");
|
||||||
|
|
||||||
readonly value: WritableProperty<number> = property(0);
|
readonly value: WritableProperty<number> = property(0);
|
||||||
|
|
||||||
readonly preferred_label_position = "left";
|
readonly preferred_label_position = "left";
|
||||||
|
|
||||||
|
private readonly input: HTMLInputElement = create_el(
|
||||||
|
"input",
|
||||||
|
"core_NumberInput_inner core_Input_inner",
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
value = 0,
|
value = 0,
|
||||||
label?: string,
|
label?: string,
|
||||||
@ -22,29 +27,40 @@ export class NumberInput extends LabelledControl {
|
|||||||
) {
|
) {
|
||||||
super(label);
|
super(label);
|
||||||
|
|
||||||
this.element.type = "number";
|
this.input.type = "number";
|
||||||
this.element.valueAsNumber = value;
|
this.input.valueAsNumber = value;
|
||||||
this.element.style.width = "50px";
|
|
||||||
|
|
||||||
this.set_prop("min", min);
|
this.set_prop("min", min);
|
||||||
this.set_prop("max", max);
|
this.set_prop("max", max);
|
||||||
this.set_prop("step", step);
|
this.set_prop("step", step);
|
||||||
|
|
||||||
this.element.onchange = () => this.value.set(this.element.valueAsNumber);
|
this.input.onchange = () => this.value.set(this.input.valueAsNumber);
|
||||||
|
|
||||||
|
this.element.append(this.input);
|
||||||
|
|
||||||
this.disposables(
|
this.disposables(
|
||||||
this.value.observe(value => (this.element.valueAsNumber = value)),
|
this.value.observe(value => (this.input.valueAsNumber = value)),
|
||||||
|
|
||||||
this.enabled.observe(enabled => (this.element.disabled = !enabled)),
|
this.enabled.observe(enabled => {
|
||||||
|
this.input.disabled = !enabled;
|
||||||
|
|
||||||
|
if (enabled) {
|
||||||
|
this.element.classList.remove("disabled");
|
||||||
|
} else {
|
||||||
|
this.element.classList.add("disabled");
|
||||||
|
}
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.element.style.width = "50px";
|
||||||
}
|
}
|
||||||
|
|
||||||
private set_prop<T>(prop: "min" | "max" | "step", value: T | Property<T>): void {
|
private set_prop<T>(prop: "min" | "max" | "step", value: T | Property<T>): void {
|
||||||
if (is_any_property(value)) {
|
if (is_any_property(value)) {
|
||||||
this.element[prop] = String(value.get());
|
this.input[prop] = String(value.get());
|
||||||
this.disposable(value.observe(v => (this.element[prop] = String(v))));
|
this.disposable(value.observe(v => (this.input[prop] = String(v))));
|
||||||
} else {
|
} else {
|
||||||
this.element[prop] = String(value);
|
this.input[prop] = String(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
.core_TabContainer_Bar {
|
.core_TabContainer_Bar {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: hsl(0, 0%, 16%);
|
|
||||||
padding: 3px 0 0 0;
|
padding: 3px 0 0 0;
|
||||||
border-bottom: solid 1px var(--border-color);
|
border-bottom: solid 1px var(--border-color);
|
||||||
}
|
}
|
||||||
@ -13,7 +12,8 @@
|
|||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border: solid 1px var(--border-color);
|
border: solid 1px var(--border-color);
|
||||||
margin: 0 1px -1px 1px;
|
margin: 0 1px -1px 1px;
|
||||||
color: #c0c0c0;
|
background-color: hsl(0, 0%, 12%);
|
||||||
|
color: hsl(0, 0%, 75%);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,10 +7,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.core_ToolBar > * {
|
.core_ToolBar > * {
|
||||||
margin: 2px 4px;
|
margin: 2px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_ToolBar > .core_ToolBar_group {
|
.core_ToolBar > .core_ToolBar_group {
|
||||||
|
margin: 2px 3px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -19,19 +20,3 @@
|
|||||||
.core_ToolBar > .core_ToolBar_group > * {
|
.core_ToolBar > .core_ToolBar_group > * {
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.core_ToolBar .core_Button {
|
|
||||||
background-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.core_ToolBar .core_Button:hover {
|
|
||||||
background-color: #404040;
|
|
||||||
border-color: #505050;
|
|
||||||
}
|
|
||||||
|
|
||||||
.core_ToolBar .core_Button:active {
|
|
||||||
background-color: #383838;
|
|
||||||
border-color: #404040;
|
|
||||||
color: #d0d0d0;
|
|
||||||
}
|
|
||||||
|
@ -5,7 +5,7 @@ import { LabelledControl } from "./LabelledControl";
|
|||||||
|
|
||||||
export class ToolBar extends View {
|
export class ToolBar extends View {
|
||||||
readonly element = create_el("div", "core_ToolBar");
|
readonly element = create_el("div", "core_ToolBar");
|
||||||
readonly height = 35;
|
readonly height = 33;
|
||||||
|
|
||||||
constructor(...children: View[]) {
|
constructor(...children: View[]) {
|
||||||
super();
|
super();
|
||||||
|
@ -15,12 +15,11 @@ export abstract class View implements Disposable {
|
|||||||
private disposer = new Disposer();
|
private disposer = new Disposer();
|
||||||
|
|
||||||
protected disposable<T extends Disposable>(disposable: T): T {
|
protected disposable<T extends Disposable>(disposable: T): T {
|
||||||
this.disposer.add(disposable);
|
return this.disposer.add(disposable);
|
||||||
return disposable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected disposables(...disposables: Disposable[]): void {
|
protected disposables(...disposables: Disposable[]): void {
|
||||||
this.disposer.add(...disposables);
|
this.disposer.add_all(...disposables);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
|
@ -6,7 +6,12 @@ const logger = Logger.get("core/observable/Disposer");
|
|||||||
export class Disposer implements Disposable {
|
export class Disposer implements Disposable {
|
||||||
private readonly disposables: Disposable[] = [];
|
private readonly disposables: Disposable[] = [];
|
||||||
|
|
||||||
add(...disposable: Disposable[]): this {
|
add<T extends Disposable>(disposable: T): T {
|
||||||
|
this.disposables.push(disposable);
|
||||||
|
return disposable;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_all(...disposable: Disposable[]): this {
|
||||||
this.disposables.push(...disposable);
|
this.disposables.push(...disposable);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Logger from "js-logger";
|
import Logger from "js-logger";
|
||||||
import { Server } from "./domain";
|
import { Server } from "./domain";
|
||||||
|
|
||||||
const logger = Logger.get("persistence/Persister");
|
const logger = Logger.get("core/persistence/Persister");
|
||||||
|
|
||||||
export abstract class Persister {
|
export abstract class Persister {
|
||||||
protected persist_for_server(server: Server, key: string, data: any): void {
|
protected persist_for_server(server: Server, key: string, data: any): void {
|
@ -1,16 +1,11 @@
|
|||||||
:root {
|
:root {
|
||||||
--bg-color: hsl(0, 0%, 20%);
|
--bg-color: hsl(0, 0%, 15%);
|
||||||
--text-color: hsl(0, 0%, 85%);
|
--text-color: hsl(0, 0%, 80%);
|
||||||
--text-color-disabled: hsl(0, 0%, 55%);
|
--text-color-disabled: hsl(0, 0%, 55%);
|
||||||
--border-color: hsl(0, 0%, 30%);
|
--border-color: hsl(0, 0%, 25%);
|
||||||
--border-color-hover: hsl(0, 0%, 40%);
|
|
||||||
--border-color-focus: hsl(0, 0%, 50%);
|
|
||||||
|
|
||||||
--scrollbar-color: hsl(0, 0%, 17%);
|
--scrollbar-color: hsl(0, 0%, 13%);
|
||||||
--scrollbar-thumb-color: hsl(0, 0%, 23%);
|
--scrollbar-thumb-color: hsl(0, 0%, 17%);
|
||||||
|
|
||||||
--input-bg-color: hsl(0, 0%, 15%);
|
|
||||||
--input-bg-color-disabled: hsl(0, 0%, 20%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
import { Loadable } from "../Loadable";
|
import { Loadable } from "../Loadable";
|
||||||
import { ServerMap } from "./ServerMap";
|
import { ServerMap } from "./ServerMap";
|
||||||
import { ItemTypeDto } from "../dto";
|
import { ItemTypeDto } from "../dto";
|
||||||
import { Server } from "../domain";
|
import { Server } from "../../../core/domain";
|
||||||
|
|
||||||
export class ItemTypeStore {
|
export class ItemTypeStore {
|
||||||
private id_to_item_type: ItemType[] = [];
|
private id_to_item_type: ItemType[] = [];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import { Server } from "../domain";
|
import { Server } from "../../../core/domain";
|
||||||
import { EnumMap } from "../../../core/enums";
|
import { EnumMap } from "../../../core/enums";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { SectionId } from "../domain";
|
import { SectionId } from "../../../core/domain";
|
||||||
|
|
||||||
export function SectionIdIcon({
|
export function SectionIdIcon({
|
||||||
section_id,
|
section_id,
|
||||||
|
@ -2,7 +2,7 @@ import { Episode } from "../../../core/data_formats/parsing/quest/Episode";
|
|||||||
import { NpcType } from "../../../core/data_formats/parsing/quest/npc_types";
|
import { NpcType } from "../../../core/data_formats/parsing/quest/npc_types";
|
||||||
import { computed, observable } from "mobx";
|
import { computed, observable } from "mobx";
|
||||||
import { ItemType } from "../../core/domain/items";
|
import { ItemType } from "../../core/domain/items";
|
||||||
import { Difficulty, SectionId } from "../../core/domain";
|
import { Difficulty, SectionId } from "../../../core/domain";
|
||||||
|
|
||||||
export class HuntMethod {
|
export class HuntMethod {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Persister } from "../../core/persistence";
|
import { Persister } from "../../../core/persistence";
|
||||||
import { Server } from "../../core/domain";
|
import { Server } from "../../../core/domain";
|
||||||
import { HuntMethod } from "../domain";
|
import { HuntMethod } from "../domain";
|
||||||
|
|
||||||
const METHOD_USER_TIMES_KEY = "HuntMethodStore.methodUserTimes";
|
const METHOD_USER_TIMES_KEY = "HuntMethodStore.methodUserTimes";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Server } from "../../core/domain";
|
import { Server } from "../../../core/domain";
|
||||||
import { WantedItem } from "../stores/HuntOptimizerStore";
|
import { WantedItem } from "../stores/HuntOptimizerStore";
|
||||||
import { item_type_stores } from "../../core/stores/ItemTypeStore";
|
import { item_type_stores } from "../../core/stores/ItemTypeStore";
|
||||||
import { Persister } from "../../core/persistence";
|
import { Persister } from "../../../core/persistence";
|
||||||
|
|
||||||
const WANTED_ITEMS_KEY = "HuntOptimizerStore.wantedItems";
|
const WANTED_ITEMS_KEY = "HuntOptimizerStore.wantedItems";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Logger from "js-logger";
|
import Logger from "js-logger";
|
||||||
import { autorun, IReactionDisposer, observable } from "mobx";
|
import { autorun, IReactionDisposer, observable } from "mobx";
|
||||||
import { Server } from "../../core/domain";
|
import { Server } from "../../../core/domain";
|
||||||
import { QuestDto } from "../../core/dto";
|
import { QuestDto } from "../../core/dto";
|
||||||
import { Loadable } from "../../core/Loadable";
|
import { Loadable } from "../../core/Loadable";
|
||||||
import { hunt_method_persister } from "../persistence/HuntMethodPersister";
|
import { hunt_method_persister } from "../persistence/HuntMethodPersister";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
SectionId,
|
SectionId,
|
||||||
SectionIds,
|
SectionIds,
|
||||||
Server,
|
Server,
|
||||||
} from "../../core/domain";
|
} from "../../../core/domain";
|
||||||
import { hunt_optimizer_persister } from "../persistence/HuntOptimizerPersister";
|
import { hunt_optimizer_persister } from "../persistence/HuntOptimizerPersister";
|
||||||
import { hunt_method_store } from "./HuntMethodStore";
|
import { hunt_method_store } from "./HuntMethodStore";
|
||||||
import { item_drop_stores } from "./ItemDropStore";
|
import { item_drop_stores } from "./ItemDropStore";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { observable } from "mobx";
|
import { observable } from "mobx";
|
||||||
import { Difficulties, Difficulty, SectionId, SectionIds, Server } from "../../core/domain";
|
import { Difficulties, Difficulty, SectionId, SectionIds, Server } from "../../../core/domain";
|
||||||
import { EnemyDropDto } from "../../core/dto";
|
import { EnemyDropDto } from "../../core/dto";
|
||||||
import { Loadable } from "../../core/Loadable";
|
import { Loadable } from "../../core/Loadable";
|
||||||
import { item_type_stores } from "../../core/stores/ItemTypeStore";
|
import { item_type_stores } from "../../core/stores/ItemTypeStore";
|
||||||
|
@ -2,7 +2,7 @@ import { computed } from "mobx";
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import React, { Component, ReactNode } from "react";
|
import React, { Component, ReactNode } from "react";
|
||||||
import { AutoSizer, Index } from "react-virtualized";
|
import { AutoSizer, Index } from "react-virtualized";
|
||||||
import { Difficulty, SectionId } from "../../core/domain";
|
import { Difficulty, SectionId } from "../../../core/domain";
|
||||||
import { hunt_optimizer_store, OptimalMethod } from "../stores/HuntOptimizerStore";
|
import { hunt_optimizer_store, OptimalMethod } from "../stores/HuntOptimizerStore";
|
||||||
import { BigTable, Column } from "../../core/ui/BigTable";
|
import { BigTable, Column } from "../../core/ui/BigTable";
|
||||||
import { SectionIdIcon } from "../../core/ui/SectionIdIcon";
|
import { SectionIdIcon } from "../../core/ui/SectionIdIcon";
|
||||||
|
@ -2,7 +2,7 @@ import GoldenLayout, { ContentItem, ItemConfigType } from "golden-layout";
|
|||||||
import Logger from "js-logger";
|
import Logger from "js-logger";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import React, { Component, createRef, FocusEvent, ReactNode } from "react";
|
import React, { Component, createRef, FocusEvent, ReactNode } from "react";
|
||||||
import { quest_editor_ui_persister } from "../persistence/QuestEditorUiPersister";
|
import { quest_editor_ui_persister } from "../../../quest_editor/persistence/QuestEditorUiPersister";
|
||||||
import { quest_editor_store } from "../stores/QuestEditorStore";
|
import { quest_editor_store } from "../stores/QuestEditorStore";
|
||||||
import { AssemblyEditorComponent } from "./AssemblyEditorComponent";
|
import { AssemblyEditorComponent } from "./AssemblyEditorComponent";
|
||||||
import { EntityInfoComponent } from "./EntityInfoComponent";
|
import { EntityInfoComponent } from "./EntityInfoComponent";
|
||||||
|
88
src/quest_editor/gui/QuestEditorView.ts
Normal file
88
src/quest_editor/gui/QuestEditorView.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import { ResizableView } from "../../core/gui/ResizableView";
|
||||||
|
import { create_el } from "../../core/gui/dom";
|
||||||
|
import { ToolBarView } from "./ToolBarView";
|
||||||
|
import GoldenLayout, { ContentItem } from "golden-layout";
|
||||||
|
import { quest_editor_ui_persister } from "../persistence/QuestEditorUiPersister";
|
||||||
|
import { AssemblyEditorComponent } from "../../old/quest_editor/ui/AssemblyEditorComponent";
|
||||||
|
import { quest_editor_store } from "../../old/quest_editor/stores/QuestEditorStore";
|
||||||
|
import Logger = require("js-logger");
|
||||||
|
|
||||||
|
const logger = Logger.get("quest_editor/gui/QuestEditorView");
|
||||||
|
|
||||||
|
const DEFAULT_LAYOUT_CONFIG = {
|
||||||
|
settings: {
|
||||||
|
showPopoutIcon: false,
|
||||||
|
},
|
||||||
|
dimensions: {
|
||||||
|
headerHeight: 28,
|
||||||
|
},
|
||||||
|
labels: {
|
||||||
|
close: "Close",
|
||||||
|
maximise: "Maximise",
|
||||||
|
minimise: "Minimise",
|
||||||
|
popout: "Open in new window",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export class QuestEditorView extends ResizableView {
|
||||||
|
readonly element = create_el("div");
|
||||||
|
|
||||||
|
private readonly tool_bar_view = this.disposable(new ToolBarView());
|
||||||
|
|
||||||
|
private layout_element = create_el("div");
|
||||||
|
// private layout: GoldenLayout;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
// const content = await quest_editor_ui_persister.load_layout_config(
|
||||||
|
// [...CMP_TO_NAME.values()],
|
||||||
|
// DEFAULT_LAYOUT_CONTENT,
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// const config: GoldenLayout.Config = {
|
||||||
|
// ...DEFAULT_LAYOUT_CONFIG,
|
||||||
|
// content,
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// this.layout = new GoldenLayout(config, this.layout_element);
|
||||||
|
// } catch (e) {
|
||||||
|
// logger.warn("Couldn't initialize golden layout with persisted layout.", e);
|
||||||
|
//
|
||||||
|
// this.layout = new GoldenLayout(
|
||||||
|
// {
|
||||||
|
// ...DEFAULT_LAYOUT_CONFIG,
|
||||||
|
// content: DEFAULT_LAYOUT_CONTENT,
|
||||||
|
// },
|
||||||
|
// this.layout_element,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (const [component, name] of CMP_TO_NAME) {
|
||||||
|
// this.layout.registerComponent(name, component);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// this.layout.on("stateChanged", () => {
|
||||||
|
// if (this.layout) {
|
||||||
|
// quest_editor_ui_persister.persist_layout_config(this.layout.toConfig().content);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// this.layout.on("stackCreated", (stack: ContentItem) => {
|
||||||
|
// stack.on("activeContentItemChanged", (item: ContentItem) => {
|
||||||
|
// if ("component" in item.config) {
|
||||||
|
// if (item.config.component === CMP_TO_NAME.get(AssemblyEditorComponent)) {
|
||||||
|
// quest_editor_store.script_undo.make_current();
|
||||||
|
// } else {
|
||||||
|
// quest_editor_store.undo.make_current();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// this.layout.init();
|
||||||
|
|
||||||
|
this.element.append(this.tool_bar_view.element, this.layout_element);
|
||||||
|
}
|
||||||
|
}
|
24
src/quest_editor/gui/ToolBarView.ts
Normal file
24
src/quest_editor/gui/ToolBarView.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { View } from "../../core/gui/View";
|
||||||
|
import { ToolBar } from "../../core/gui/ToolBar";
|
||||||
|
import { FileButton } from "../../core/gui/FileButton";
|
||||||
|
import { Button } from "../../core/gui/Button";
|
||||||
|
|
||||||
|
export class ToolBarView extends View {
|
||||||
|
private readonly open_file_button = new FileButton("Open file...", ".qst");
|
||||||
|
private readonly save_as_button = new Button("Save as...");
|
||||||
|
private readonly undo_button = new Button("Undo");
|
||||||
|
private readonly redo_button = new Button("Redo");
|
||||||
|
|
||||||
|
private readonly tool_bar = new ToolBar(
|
||||||
|
this.open_file_button,
|
||||||
|
this.save_as_button,
|
||||||
|
this.undo_button,
|
||||||
|
this.redo_button,
|
||||||
|
);
|
||||||
|
|
||||||
|
readonly element = this.tool_bar.element;
|
||||||
|
|
||||||
|
get height(): number {
|
||||||
|
return this.tool_bar.height;
|
||||||
|
}
|
||||||
|
}
|
@ -16,11 +16,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.viewer_ModelSelectListView li:hover {
|
.viewer_ModelSelectListView li:hover {
|
||||||
color: hsl(200, 25%, 85%);
|
color: hsl(0, 0%, 90%);
|
||||||
background-color: hsl(0, 0%, 25%);
|
background-color: hsl(0, 0%, 18%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.viewer_ModelSelectListView li.active {
|
.viewer_ModelSelectListView li.active {
|
||||||
color: hsl(200, 50%, 85%);
|
color: hsl(0, 0%, 90%);
|
||||||
background-color: hsl(0, 0%, 30%);
|
background-color: hsl(0, 0%, 21%);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ export class ModelRenderer extends Renderer implements Disposable {
|
|||||||
|
|
||||||
this.perspective_camera = this.camera as PerspectiveCamera;
|
this.perspective_camera = this.camera as PerspectiveCamera;
|
||||||
|
|
||||||
this.disposer.add(
|
this.disposer.add_all(
|
||||||
model_store.current_nj_data.observe(this.nj_data_or_xvm_changed),
|
model_store.current_nj_data.observe(this.nj_data_or_xvm_changed),
|
||||||
model_store.current_xvm.observe(this.nj_data_or_xvm_changed),
|
model_store.current_xvm.observe(this.nj_data_or_xvm_changed),
|
||||||
model_store.current_nj_motion.observe(this.nj_motion_changed),
|
model_store.current_nj_motion.observe(this.nj_motion_changed),
|
||||||
|
@ -31,7 +31,7 @@ export class TextureRenderer extends Renderer implements Disposable {
|
|||||||
this.controls.azimuthRotateSpeed = 0;
|
this.controls.azimuthRotateSpeed = 0;
|
||||||
this.controls.polarRotateSpeed = 0;
|
this.controls.polarRotateSpeed = 0;
|
||||||
|
|
||||||
this.disposer.add(
|
this.disposer.add_all(
|
||||||
texture_store.current_xvm.observe(xvm => {
|
texture_store.current_xvm.observe(xvm => {
|
||||||
this.scene.remove(...this.quad_meshes);
|
this.scene.remove(...this.quad_meshes);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user