2022-08-20 13:36:46 +01:00
|
|
|
import { inject, injectable } from "tsyringe";
|
|
|
|
|
|
|
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
|
|
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
|
|
|
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
|
|
|
|
|
2022-10-19 17:27:45 +01:00
|
|
|
import { CwxConfigHandler } from "./configHandler";
|
|
|
|
import { InraidConfig } from "models/IConfig";
|
2022-08-20 13:36:46 +01:00
|
|
|
|
|
|
|
@injectable()
|
2022-10-19 17:27:45 +01:00
|
|
|
export class CwxInraidConfig
|
2022-08-20 13:36:46 +01:00
|
|
|
{
|
|
|
|
private tables: IInRaidConfig;
|
2022-10-19 17:27:45 +01:00
|
|
|
private config: InraidConfig;
|
2022-08-20 13:36:46 +01:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
@inject("ConfigServer") private configServer: ConfigServer,
|
2022-10-19 17:27:45 +01:00
|
|
|
@inject("CwxConfigHandler") private configHandler: CwxConfigHandler
|
2022-08-20 13:36:46 +01:00
|
|
|
)
|
|
|
|
{}
|
|
|
|
|
|
|
|
public applyChanges(): void
|
|
|
|
{
|
|
|
|
this.config = this.configHandler.getConfig().inraidConfig;
|
|
|
|
this.tables = this.configServer.getConfig(ConfigTypes.IN_RAID);
|
|
|
|
|
2022-10-19 17:27:45 +01:00
|
|
|
this.turnPVEOff();
|
2022-08-20 13:36:46 +01:00
|
|
|
}
|
|
|
|
|
2022-10-19 17:27:45 +01:00
|
|
|
private turnPVEOff(): void
|
2022-08-20 13:36:46 +01:00
|
|
|
{
|
|
|
|
if (this.config.turnPVEOff)
|
|
|
|
{
|
|
|
|
this.tables.raidMenuSettings.enablePve = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|