修改主对象的名称

This commit is contained in:
AncTe committed 2023-09-06 11:59:44 +08:00
1 parent e6d96f6e2a
commit 7073ac92c6
35 files changed
+122 -134

No files matched your search

+2 -2
View File
@@ -35,7 +35,7 @@ interface AncTePlugin {
frag: ReturnType<typeof import('../plugin/fx/frag').default>;
}
export interface AncTe {
export interface Mota {
sound: SoundController;
/** 游戏资源 */
resource: ResourceStore<Exclude<ResourceType, 'zip'>>;
@@ -53,7 +53,7 @@ export interface AncTe {
}
function ready() {
window.ancTe = {
window.mota = {
bgm: new BgmController(),
resource: new ResourceStore(),
zipResource: new ResourceStore(),
+5 -5
View File
@@ -19,9 +19,9 @@ export function readyAllResource() {
info.resource.forEach(v => {
const type = getTypeByResource(v);
if (type === 'zip') {
ancTe.zipResource.set(v, new Resource(v, 'zip'));
mota.zipResource.set(v, new Resource(v, 'zip'));
} else {
ancTe.resource.set(v, new Resource(v, type));
mota.resource.set(v, new Resource(v, type));
}
});
}
@@ -35,13 +35,13 @@ export function readyAllResource() {
loadData.forEach(v => {
const type = getTypeByResource(v);
if (type !== 'zip') {
ancTe.resource.set(v, new Resource(v, type));
mota.resource.set(v, new Resource(v, type));
}
});
ancTe.resource.forEach(v => v.active());
mota.resource.forEach(v => v.active());
loading.once('coreInit', () => {
const animates = new Resource('__all_animates__', 'text');
ancTe.resource.set('__all_animates__', animates);
mota.resource.set('__all_animates__', animates);
animates.active();
});
}
+3 -3
View File
@@ -52,7 +52,7 @@ export class Resource<
protected onLoadStart(v?: ResourceData[T]) {
if (this.format === 'bgm') {
// bgm 单独处理,因为它可以边播放边加载
ancTe.bgm.add(this.uri, v!);
mota.bgm.add(this.uri, v!);
}
}
@@ -61,7 +61,7 @@ export class Resource<
if (this.type === 'fonts') {
document.fonts.add(new FontFace(this.name, v as ArrayBuffer));
} else if (this.type === 'sounds') {
ancTe.sound.add(this.uri, v as ArrayBuffer);
mota.sound.add(this.uri, v as ArrayBuffer);
} else if (this.type === 'images') {
const name = `${this.name}${this.ext}` as ImageIds;
loading.on(
@@ -109,7 +109,7 @@ export class Resource<
const id = `${base}.${name}`;
const type = getTypeByResource(id) as NonZipResource;
const format = getZipFormatByType(type);
ancTe.resource.set(
mota.resource.set(
id,
new Resource(id, type).setData(file.async(format))
);
+8 -8
View File
@@ -37,7 +37,7 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
constructor(id: string, storage: boolean = true) {
super();
if (storage) {
this.storage = new GameStorage(GameStorage.fromAuthor('AncTe', id));
this.storage = new GameStorage(GameStorage.fromAuthor('Mota', id));
}
}
@@ -274,12 +274,12 @@ hotkey
if (block.event.cls.startsWith('enemy')) {
const id = block.event.id as EnemyIds;
const name = core.material.enemys[id].name;
if (ancTe.plugin.mark.hasMarkedEnemy(id)) {
if (mota.plugin.mark.hasMarkedEnemy(id)) {
tip('success', `已取消标记${name}!`);
ancTe.plugin.mark.unmarkEnemy(id);
mota.plugin.mark.unmarkEnemy(id);
} else {
tip('success', `已标记${name}!`);
ancTe.plugin.mark.checkMarkedEnemy(false);
mota.plugin.mark.checkMarkedEnemy(false);
}
}
}
@@ -303,8 +303,8 @@ hotkey
const [mx, my] = getLocFromMouseLoc(x, y);
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'special';
ancTe.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true;
mota.plugin.fixed.showFixed.value = false;
mota.plugin.ui.fixedDetailOpened.value = true;
}
}
})
@@ -315,8 +315,8 @@ hotkey
const [mx, my] = getLocFromMouseLoc(x, y);
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'critical';
ancTe.plugin.fixed.showFixed.value = false;
ancTe.plugin.ui.fixedDetailOpened.value = true;
mota.plugin.fixed.showFixed.value = false;
mota.plugin.ui.fixedDetailOpened.value = true;
}
}
})
+1 -1
View File
@@ -248,7 +248,7 @@ export class UiController extends Focus<IndexedGameUi> {
* 根据ui的唯一标识符进行聚焦
* @param num 要聚焦于的ui的唯一标识符
*/
focusByNum(num: number, add?: boolean) {
focusByNum(num: number) {
const ui = this.stack.find(v => v.num === num);
if (!ui) return;
this.focus(ui);
+1 -1
View File
@@ -403,7 +403,7 @@ interface SettingStorage {
}
const storage = new GameStorage<SettingStorage>(
GameStorage.fromAuthor('AncTe', 'setting')
GameStorage.fromAuthor('Mota', 'setting')
);
loading.once('coreInit', () => {
+3 -3
View File
@@ -19,10 +19,10 @@ import gameCanvas from '../plugin/fx/gameCanvas';
import noise from '../plugin/fx/noise';
import smooth from '../plugin/fx/smoothView';
import frag from '../plugin/fx/frag';
import { AncTe } from '.';
import { Mota } from '.';
export function resolvePlugin() {
const toForward: [keyof AncTe['plugin'], any][] = [
const toForward: [keyof Mota['plugin'], any][] = [
['pop', pop()],
['ui', ui()],
['use', use()],
@@ -47,7 +47,7 @@ export function resolvePlugin() {
];
for (const [key, obj] of toForward) {
ancTe.plugin[key] = obj;
mota.plugin[key] = obj;
}
// 完成度相关