Skip to content

Commit 4c0a51e

Browse files
committed
fix: use deprecated helper
1 parent 90bbe60 commit 4c0a51e

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

components/controller.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,15 @@ export class Controller {
476476
*
477477
* @param modId The mod's ID.
478478
* @returns If the mod is unavailable. You should probably abort initialization if true is returned. Also returns true if the `overrideFrameworkChecks` flag is set.
479-
* @deprecated since v5.5.0, use `!controller.smf.modIsInstalled`
479+
* @deprecated since v5.5.0, use `!controller.smf.modEnabledForUser` or `!controller.smf.modEnabledForGame`
480480
*/
481481
public addClientSideModDependency(modId: string): boolean {
482-
log(
483-
LogLevel.WARN,
484-
"controller.addClientSideModDependency is deprecated, use !controller.smf.modIsInstalled instead!",
485-
"plugins",
482+
deprecated(
483+
"controller.addClientSideModDependency",
484+
"controller.smf.modEnabledForUser or controller.smf.modEnabledForGame",
485+
"v9",
486486
)
487+
487488
return (
488489
getFlag("overrideFrameworkChecks") === true ||
489490
!this.smf.modIsInstalled(modId)
@@ -497,14 +498,15 @@ export class Controller {
497498
*
498499
* @param modId The mod's ID.
499500
* @returns If the mod is available (or the `overrideFrameworkChecks` flag is set). You should probably abort initialisation if false is returned.
500-
* @deprecated since v7.0.0, use `controller.smf.modIsInstalled`
501+
* @deprecated since v7.0.0, use `controller.smf.modEnabledForUser` or `controller.smf.modEnabledForGame`
501502
*/
502503
public modIsInstalled(modId: string): boolean {
503-
log(
504-
LogLevel.WARN,
505-
"controller.modIsInstalled is deprecated, use controller.smf.modIsInstalled instead!",
506-
"plugins",
504+
deprecated(
505+
"controller.modIsInstalled",
506+
"controller.smf.modEnabledForUser or controller.smf.modEnabledForGame",
507+
"v9",
507508
)
509+
508510
return this.smf.modIsInstalled(modId)
509511
}
510512

components/smfSupport.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import path, { basename, join } from "path"
3030
import { readFile } from "fs/promises"
3131
import { menuSystemDatabase } from "./menus/menuSystem"
3232
import { parse } from "json5"
33+
import { deprecated } from "./utils"
3334

3435
type LastServerSideData = SMFLastDeploy["lastServerSideStates"]
3536

@@ -224,6 +225,12 @@ export class SMFSupport {
224225
* @deprecated since v8.9.0, use `controller.smf.modEnabledForUser` or `controller.smf.modEnabledForGame`
225226
*/
226227
public modIsInstalled(modId: string): boolean {
228+
deprecated(
229+
"controller.smf.modIsInstalled",
230+
"controller.smf.modEnabledForUser or controller.smf.modEnabledForGame",
231+
"v9",
232+
)
233+
227234
return (
228235
this.lastDeploy?.loadOrder.includes(modId) ||
229236
getFlag("overrideFrameworkChecks") === true

0 commit comments

Comments
 (0)