Skip to content

Commit

Permalink
chore: full cleanup of the pttr legacy tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Trap committed Dec 11, 2024
1 parent d13cd74 commit b74d067
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 412 deletions.
178 changes: 0 additions & 178 deletions configs/PathToTarkovReloaded/Tooltips.json

This file was deleted.

122 changes: 0 additions & 122 deletions scripts/extract-legacy-tooltips.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,6 @@ export type Config = Omit<RawConfig, 'hideout_secondary_stashes' | 'infiltration
infiltrations_config: InfiltrationsConfig;
};

export type PathToTarkovReloadedTooltipsConfig = {
language?: string;
moddedTraderCompat?: boolean;
additionalLocalesToggle?: boolean;
moddedTraderExtracts?: string[];
localesToChangeAdditional?: string[];
localesToChange?: string[];
};

export type UserConfig = {
selectedConfig: string;
};
Expand Down
24 changes: 3 additions & 21 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path';
import type { DependencyContainer } from 'tsyringe';

import type { IPostSptLoadMod } from '@spt/models/external/IPostSptLoadMod';
Expand All @@ -9,7 +10,7 @@ import type { SaveServer } from '@spt/servers/SaveServer';
import type { StaticRouterModService } from '@spt/services/mod/staticRouter/StaticRouterModService';

import { createPathToTarkovAPI } from './api';
import type { Config, PathToTarkovReloadedTooltipsConfig, SpawnConfig, UserConfig } from './config';
import type { Config, SpawnConfig } from './config';
import {
CONFIG_FILENAME,
CONFIGS_DIR,
Expand All @@ -28,26 +29,14 @@ import type { PackageJson } from './utils';
import { getModDisplayName, noop, readJsonFile } from './utils';
import { EndOfRaidController } from './end-of-raid-controller';
import { fixRepeatableQuests } from './fix-repeatable-quests';
import { pathToTarkovReloadedTooltipsConfigCompat } from './pttr-tooltips';
import path from 'path';

import { analyzeConfig } from './config-analysis';
import { TradersAvailabilityService } from './services/TradersAvailabilityService';

const getTooltipsConfig = (
userConfig: UserConfig,
): PathToTarkovReloadedTooltipsConfig | undefined => {
try {
return require(path.join(CONFIGS_DIR, userConfig.selectedConfig, 'Tooltips.json'));
} catch (_err) {
return undefined;
}
};

class PathToTarkov implements IPreSptLoadMod, IPostSptLoadMod {
private packageJson: PackageJson;
private config: Config;
private spawnConfig: SpawnConfig;
private tooltipsConfig: PathToTarkovReloadedTooltipsConfig | undefined;
public logger: ILogger;
public debug: (data: string) => void;
public container: DependencyContainer;
Expand All @@ -67,8 +56,6 @@ class PathToTarkov implements IPreSptLoadMod, IPostSptLoadMod {
this.config,
);

this.tooltipsConfig = getTooltipsConfig(userConfig);

this.logger = container.resolve<ILogger>('WinstonLogger');
this.debug = this.config.debug
? (data: string) => this.logger.debug(`Path To Tarkov: ${data}`, true)
Expand Down Expand Up @@ -164,11 +151,6 @@ class PathToTarkov implements IPreSptLoadMod, IPostSptLoadMod {

this.pathToTarkovController.tradersAvailabilityService.init(quests);

if (this.tooltipsConfig) {
pathToTarkovReloadedTooltipsConfigCompat(db, this.tooltipsConfig);
this.debug('injected legacy PTTR Tooltips.json file');
}

const [api, executeOnStartAPICallbacks] = createPathToTarkovAPI(
this.pathToTarkovController,
this.logger,
Expand Down
Loading

0 comments on commit b74d067

Please sign in to comment.