Add more view models
This commit is contained in:
parent
1367acb05f
commit
308cb7927b
92
src/view/model/Characters.ts
Normal file
92
src/view/model/Characters.ts
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import { NameInfo } from "./NameInfo";
|
||||||
|
|
||||||
|
type NameInfoMap = {
|
||||||
|
[key: string]: NameInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class Characters {
|
||||||
|
private static readonly DEFAULT_COLOR: number = 0xFFC0C0C0;
|
||||||
|
|
||||||
|
private names: NameInfoMap;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.names = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
public contains(shortName: string): boolean {
|
||||||
|
return shortName in this.names;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get(shortName: string): NameInfo {
|
||||||
|
return this.names[shortName];
|
||||||
|
}
|
||||||
|
|
||||||
|
public setName(shortName: string, fullName: string, color: number = Characters.DEFAULT_COLOR): boolean {
|
||||||
|
if (shortName in this.names) {
|
||||||
|
const info = this.names[shortName];
|
||||||
|
info.name = fullName;
|
||||||
|
info.color = color;
|
||||||
|
} else {
|
||||||
|
this.names[shortName] = new NameInfo(fullName, color);
|
||||||
|
}
|
||||||
|
return shortName in this.names;
|
||||||
|
}
|
||||||
|
|
||||||
|
public makeNamesUnknown(): void {
|
||||||
|
// https://github.com/yakui-lover/eroge-dopil/blob/master/media.rpy#L365
|
||||||
|
this.names["me"] = new NameInfo("Семён", 0xFFE1DD7D);
|
||||||
|
this.names["un"] = new NameInfo("Пионерка", 0xFFB956FF);
|
||||||
|
this.names["dv"] = new NameInfo("Пионерка", 0xFFFFAA00);
|
||||||
|
this.names["sl"] = new NameInfo("Пионерка", 0xFFFFD200);
|
||||||
|
this.names["us"] = new NameInfo("Пионерка", 0xFFFF3200);
|
||||||
|
this.names["mt"] = new NameInfo("Вожатая", 0xFF00EA32);
|
||||||
|
this.names["cs"] = new NameInfo("Медсестра", 0xFFA5A5FF);
|
||||||
|
this.names["mz"] = new NameInfo("Пионерка", 0xFF4A86FF);
|
||||||
|
this.names["mi"] = new NameInfo("Пионерка", 0xFF00DEFF);
|
||||||
|
this.names["uv"] = new NameInfo("Странная девочка", 0xFF4EFF00);
|
||||||
|
this.names["lk"] = new NameInfo("Луркмор-кун", 0xFFFF8080);
|
||||||
|
this.names["sh"] = new NameInfo("Пионер", 0xFFFFF226);
|
||||||
|
this.names["el"] = new NameInfo("Пионер", 0xFFFFFF00);
|
||||||
|
this.names["pi"] = new NameInfo("Пионер", 0xFFE60101);
|
||||||
|
|
||||||
|
this.names["dy"] = new NameInfo("Голос из динамика", 0xFFC0C0C0);
|
||||||
|
this.names["voice"] = new NameInfo("Голос", 0xFFE1DD7D);
|
||||||
|
this.names["voices"] = new NameInfo("Голоса", 0xFFC0C0C0);
|
||||||
|
this.names["message"] = new NameInfo("Сообщение", 0xFFC0C0C0);
|
||||||
|
this.names["all"] = new NameInfo("Пионеры", 0xFFED4444);
|
||||||
|
this.names["kids"] = new NameInfo("Малышня", 0xFFEB7883);
|
||||||
|
this.names["dreamgirl"] = new NameInfo("...", 0xFFC0C0C0);
|
||||||
|
this.names["bush"] = new NameInfo("Голос", 0xFFC0C0C0);
|
||||||
|
this.names["FIXME_voice"] = new NameInfo("Голос", 0xFFC0C0C0);
|
||||||
|
this.names["odn"] = new NameInfo("Одногруппник", 0xFFC0C0C0);
|
||||||
|
this.names["mt_voice"] = new NameInfo("Голос", 0xFF00EA32);
|
||||||
|
}
|
||||||
|
|
||||||
|
public makeNamesKnown(): void {
|
||||||
|
this.setName("me", "Семён");
|
||||||
|
this.setName("un", "Лена");
|
||||||
|
this.setName("dv", "Алиса");
|
||||||
|
this.setName("sl", "Славя");
|
||||||
|
this.setName("us", "Ульяна");
|
||||||
|
this.setName("mt", "Ольга Дмитриевна");
|
||||||
|
this.setName("cs", "Виола");
|
||||||
|
this.setName("mz", "Женя");
|
||||||
|
this.setName("mi", "Мику");
|
||||||
|
this.setName("uv", "Юля");
|
||||||
|
this.setName("lk", "Луркмор-кун");
|
||||||
|
this.setName("sh", "Шурик");
|
||||||
|
this.setName("el", "Электроник");
|
||||||
|
this.setName("pi", "Пионер");
|
||||||
|
this.setName("dy", "Голос из динамика");
|
||||||
|
this.setName("voice", "Голос");
|
||||||
|
this.setName("voices", "Голоса");
|
||||||
|
this.setName("message", "Сообщение");
|
||||||
|
this.setName("all", "Пионеры");
|
||||||
|
this.setName("kids", "Малышня");
|
||||||
|
this.setName("dreamgirl", "...");
|
||||||
|
this.setName("bush", "Голос");
|
||||||
|
this.setName("FIXME_voice", "Голос");
|
||||||
|
this.setName("odn", "Одногруппник");
|
||||||
|
this.setName("mt_voice", "Голос");
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import { MenuItem } from "./MenuItem";
|
import { MenuItem } from "./MenuItem";
|
||||||
|
|
||||||
export class Menu {
|
export class Menu {
|
||||||
items: MenuItem[];
|
private items: MenuItem[];
|
||||||
|
|
||||||
constructor(private title: string) {
|
constructor(private title: string) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
6
src/view/model/NameInfo.ts
Normal file
6
src/view/model/NameInfo.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export class NameInfo {
|
||||||
|
constructor(
|
||||||
|
public name: string,
|
||||||
|
public color: number
|
||||||
|
) { }
|
||||||
|
}
|
45
src/view/model/Transition.ts
Normal file
45
src/view/model/Transition.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { TransitionType } from "./TransitionType";
|
||||||
|
|
||||||
|
export class Transition {
|
||||||
|
public static readonly DEFAULT = {
|
||||||
|
"fade": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 500,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 500
|
||||||
|
},
|
||||||
|
"fade2": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 1000,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 1000
|
||||||
|
},
|
||||||
|
"fade3": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 1500,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 1500
|
||||||
|
},
|
||||||
|
|
||||||
|
"dspr": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 200,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 200
|
||||||
|
},
|
||||||
|
"dissolve": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 1000,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 1000
|
||||||
|
},
|
||||||
|
"dissolve2": {
|
||||||
|
"type": TransitionType.TYPE_FADE,
|
||||||
|
"outTime": 2000,
|
||||||
|
"holdTime": 0,
|
||||||
|
"inTime": 2000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(public type: string) { }
|
||||||
|
}
|
1
src/view/model/TransitionType.ts
Normal file
1
src/view/model/TransitionType.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export enum TransitionType { TYPE_FADE, TYPE_DISSOLVE };
|
Loading…
Reference in New Issue
Block a user