forked from OverlayPlugin/cactbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.ts
46 lines (39 loc) · 1.62 KB
/
jobs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Lang } from '../../resources/languages';
import PartyTracker from '../../resources/party';
import UserConfig from '../../resources/user_config';
import { PartyTrackerOptions } from '../../types/party';
import { Bars } from './bars';
import { ComponentManager } from './components';
import { JobsEventEmitter } from './event_emitter';
import defaultOptions from './jobs_options';
import { Player } from './player';
import '../../resources/defaults.css';
import './jobs.css';
export type FfxivVersion = number;
UserConfig.getUserConfigLocation('jobs', defaultOptions, () => {
const options = { ...defaultOptions };
// Because CN and KO regions play an older version of FF14,
// set the game version here to change the behavior on older version.
// (Battle system changes will be merged in major update for CN/KO)
// (e.g. intl 6.38 job changes are merged in cn patch 6.3)
const ffxivlanguageToVersion: Record<Lang, FfxivVersion> = {
'en': 701,
'de': 701,
'fr': 701,
'ja': 701,
'cn': 650,
'ko': 650,
};
const ffxivVersion = ffxivlanguageToVersion[options.ParserLanguage];
const emitter = new JobsEventEmitter();
// Jobs doesn't have a need for PartyTracker.member support and so just passes in dummy options.
const dummyOptions: PartyTrackerOptions = {
...options,
DefaultPlayerLabel: 'nick',
PlayerNicks: {},
};
const partyTracker = new PartyTracker(dummyOptions);
const player = new Player(emitter, partyTracker, ffxivVersion);
const bars = new Bars(options, { emitter, player });
new ComponentManager({ bars, emitter, options, partyTracker, player, ffxivVersion });
});