2022-01-14 04:25:47 +00:00
|
|
|
import { App as VueApp, createApp } from "vue";
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
import App from "./App.vue";
|
|
|
|
import modInfo from "./data/modInfo.json";
|
2022-01-14 04:25:47 +00:00
|
|
|
import { GenericLayer } from "./game/layers";
|
|
|
|
import { PlayerData } from "./game/player";
|
|
|
|
import { Settings } from "./game/settings";
|
|
|
|
import { Transient } from "./game/state";
|
|
|
|
import Decimal, { DecimalSource } from "./lib/break_eternity";
|
|
|
|
import { load } from "./util/save";
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
|
|
|
vue: VueApp;
|
|
|
|
save: VoidFunction;
|
|
|
|
hardReset: VoidFunction;
|
|
|
|
hardResetSettings: VoidFunction;
|
2022-01-25 04:23:30 +00:00
|
|
|
layers: Record<string, Readonly<GenericLayer> | undefined>;
|
2022-01-14 04:25:47 +00:00
|
|
|
player: PlayerData;
|
|
|
|
state: Transient;
|
|
|
|
settings: Settings;
|
|
|
|
Decimal: typeof Decimal;
|
|
|
|
exponentialFormat: (num: DecimalSource, precision: number, mantissa: boolean) => string;
|
|
|
|
commaFormat: (num: DecimalSource, precision: number) => string;
|
|
|
|
regularFormat: (num: DecimalSource, precision: number) => string;
|
|
|
|
format: (num: DecimalSource, precision?: number, small?: boolean) => string;
|
|
|
|
formatWhole: (num: DecimalSource) => string;
|
|
|
|
formatTime: (s: number) => string;
|
|
|
|
toPlaces: (x: DecimalSource, precision: number, maxAccepted: DecimalSource) => string;
|
|
|
|
formatSmall: (x: DecimalSource, precision?: number) => string;
|
|
|
|
invertOOM: (x: DecimalSource) => Decimal;
|
2022-02-27 19:49:34 +00:00
|
|
|
modInfo: typeof modInfo;
|
2022-01-14 04:25:47 +00:00
|
|
|
}
|
|
|
|
}
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
|
|
|
|
requestAnimationFrame(async () => {
|
2022-02-27 19:49:34 +00:00
|
|
|
console.log(
|
|
|
|
"%cMade in TMT-X%c\nLearn more at www.moddingtree.com",
|
|
|
|
"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;",
|
|
|
|
"padding: 4px;"
|
|
|
|
);
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
await load();
|
2022-01-25 04:23:30 +00:00
|
|
|
const { globalBus, startGameLoop } = await require("./game/events");
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
|
|
|
|
// Create Vue
|
|
|
|
const vue = (window.vue = createApp({
|
|
|
|
...App
|
|
|
|
}));
|
2022-01-14 04:25:47 +00:00
|
|
|
globalBus.emit("setupVue", vue);
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
vue.mount("#app");
|
|
|
|
document.title = modInfo.title;
|
|
|
|
|
2022-01-14 04:25:47 +00:00
|
|
|
startGameLoop();
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
});
|
2022-02-27 19:49:34 +00:00
|
|
|
|
|
|
|
window.modInfo = modInfo;
|