diff --git a/electron/settings/settings-default.ts b/electron/settings/settings-default.ts index d81c0b9f..d2871da5 100644 --- a/electron/settings/settings-default.ts +++ b/electron/settings/settings-default.ts @@ -166,6 +166,7 @@ export const SettingsDefault: SettingsInterface = { party_member_on_map: true, monster_tooltip: false, monster_tooltip_shortcut: '', + autoprivate: false, }, auto_group: { active: false, diff --git a/electron/settings/settings.interface.ts b/electron/settings/settings.interface.ts index d2182668..7c094eb7 100644 --- a/electron/settings/settings.interface.ts +++ b/electron/settings/settings.interface.ts @@ -93,6 +93,7 @@ export interface SettingsInterface { party_member_on_map: boolean; monster_tooltip: boolean; monster_tooltip_shortcut: string; + autoprivate: boolean; }, auto_group: { active: boolean; diff --git a/locale/en.json b/locale/en.json index 472e5b96..16f07f11 100644 --- a/locale/en.json +++ b/locale/en.json @@ -88,7 +88,8 @@ "monster-tooltip": "Display monsters groups informations on the map", "monster-tooltip-shortcut": "Shortcut for show/hide monsters tooltip", "vertical-timeline": "Show fighters timeline vertically", - "chall-percent": "Show challenge XP/Drop bonus" + "chall-percent": "Show challenge XP/Drop bonus", + "autoprivate": "Automatically activate private mode (between 25s and 60s after connection)" }, "groups": { "header": "Groups" diff --git a/locale/es.json b/locale/es.json index 048f5712..482244bb 100644 --- a/locale/es.json +++ b/locale/es.json @@ -88,7 +88,8 @@ "harvest-indicator" : "Activar la visualización del tiempo restante de recolección debajo de los recursos", "party-member-on-map" : "Añadir un indicador para saber si los miembros de un grupo están en el mismo mapa", "vertical-timeline": "Mostrar línea de tiempo de los luchadores verticalmente", - "chall-percent": "Mostrar bonificación XP/Drop de desafío" + "chall-percent": "Mostrar bonificación XP/Drop de desafío", + "autoprivate": "Activar automáticamente el modo privado (entre 25s y 60s después de la conexión)" }, "groups": { "header": "Grupo" diff --git a/locale/fr.json b/locale/fr.json index fd6f02b9..fc3ca0da 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -88,7 +88,8 @@ "monster-tooltip": "Affiche les informations des groupes de monstres sur la carte", "monster-tooltip-shortcut": "Raccourci pour les informations des groupes de monstres", "vertical-timeline": "Afficher la barre des combatants de manière verticale", - "chall-percent": "Afficher le bonus XP/Drop du challenge" + "chall-percent": "Afficher le bonus XP/Drop du challenge", + "autoprivate": "Activer automatiquement le mode privé (entre 25s et 60s après la connexion)" }, "groups": { "header": "Groupe" diff --git a/locale/it.json b/locale/it.json index cd72a20f..8fec8ae1 100644 --- a/locale/it.json +++ b/locale/it.json @@ -87,7 +87,8 @@ "party-member-on-map" : "Aggiungi un indicatore per sapere se i membri di un gruppo si trovano sulla stessa mappa", "monster-tooltip": "Visualizza le informazioni sui gruppi di mostri sulla mappa", "vertical-timeline": "Mostra la cronologia dei combattenti in verticale", - "chall-percent": "Mostra XP sfida/bonus drop" + "chall-percent": "Mostra XP sfida/bonus drop", + "autoprivate": "Attiva automaticamente la modalità privata (tra 25 e 60 secondi dopo la connessione)" }, "groups": { "header": "Gruppi" diff --git a/locale/pl.json b/locale/pl.json index 80849be3..a19f0d12 100644 --- a/locale/pl.json +++ b/locale/pl.json @@ -87,7 +87,8 @@ "party-member-on-map" : "Dodaj wskaźnik, aby wiedzieć, czy członkowie grupy znajdują się na tej samej mapie", "monster-tooltip": "Wyświetlaj informacje o grupach potworów na mapie", "vertical-timeline": "Pokaż oś czasu bojowników w pionie", - "chall-percent": "Pokaż premię XP/Drop wyzwania" + "chall-percent": "Pokaż premię XP/Drop wyzwania", + "autoprivate": "Automatycznie aktywuj tryb prywatny (między 25 a 60 s po połączeniu)" }, "groups": { "header": "Grupy" diff --git a/locale/tr.json b/locale/tr.json index 96c4feb7..def02e6c 100644 --- a/locale/tr.json +++ b/locale/tr.json @@ -87,7 +87,8 @@ "party-member-on-map" : "Bir grubun üyelerinin aynı haritada olup olmadığını öğrenmek için bir gösterge ekleyin", "monster-tooltip": "Canavar grupları bilgilerini haritada göster", "vertical-timeline": "Savaşçıların zaman çizelgesini dikey olarak göster", - "chall-percent": "Meydan okuma XP/Bırakma bonusunu göster" + "chall-percent": "Meydan okuma XP/Bırakma bonusunu göster", + "autoprivate": "Özel modu otomatik olarak etkinleştir (bağlantıdan sonra 25s ile 60s arasında)" }, "groups": { "header": "Gruplar" diff --git a/src/app/mods/auto-private/auto-private.ts b/src/app/mods/auto-private/auto-private.ts new file mode 100644 index 00000000..1c99df09 --- /dev/null +++ b/src/app/mods/auto-private/auto-private.ts @@ -0,0 +1,15 @@ +import { SettingsService } from "@services/settings.service"; +import {Mod} from "../mod"; + +export class AutoPrivate extends Mod { + + startMod(): void { + this.params = this.settings.option.vip.general.autoprivate; + + if (this.params) { + setTimeout(() => { + this.wGame.dofus.connectionManager.sendMessage('PlayerStatusUpdateRequestMessage', { status: { statusId: 30 } }); + }, this.getRandomTime(25, 60)); + } + } +} diff --git a/src/app/mods/index.ts b/src/app/mods/index.ts index 966fd47d..c0546b32 100644 --- a/src/app/mods/index.ts +++ b/src/app/mods/index.ts @@ -2,6 +2,7 @@ export { General } from "../mods/general/general"; export { AutoGroup } from "./auto-group/auto-group"; export { ChallPercent } from "./chall-percent/chall-percent"; +export { AutoPrivate } from "./auto-private/auto-private"; export { DamageEstimator } from "../mods/damage-estimator/damage-estimator"; export { FightChronometer } from "./fight-chronometer/fight-chronometer"; export { GripPositionSave } from "./grip-position-save/grip-position-save"; diff --git a/src/app/modules/option.module.ts b/src/app/modules/option.module.ts index 79d5ea55..699c510a 100644 --- a/src/app/modules/option.module.ts +++ b/src/app/modules/option.module.ts @@ -717,6 +717,7 @@ export namespace Option { private _monster_tooltip: boolean; private _monster_tooltip_shortcut: string; private _verticaltimeline: boolean; + private _autoprivate: boolean; get party_info_pp():boolean{ return this._party_info_pp; @@ -880,6 +881,15 @@ export namespace Option { this._challpercent = challpercent; } + get autoprivate(): boolean { + return this._autoprivate; + } + + set autoprivate(autoprivate: boolean) { + this.settingsProvider.write('option.vip.general.autoprivate', autoprivate); + this._autoprivate = autoprivate; + } + constructor(private settingsProvider: SettingsProvider) { this.disable_inactivity = this.settingsProvider.read('option.vip.general.disable_inactivity'); this.health_bar = this.settingsProvider.read('option.vip.general.health_bar'); @@ -899,6 +909,7 @@ export namespace Option { this.monster_tooltip_shortcut = this.settingsProvider.read('option.vip.general.monster_tooltip_shortcut'); this.verticaltimeline = this.settingsProvider.read('option.vip.general.verticaltimeline'); this.challpercent = this.settingsProvider.read('option.vip.general.challpercent'); + this.autoprivate = this.settingsProvider.read('option.vip.general.autoprivate'); } } diff --git a/src/app/windows/main/menus/option/features/general/general.component.html b/src/app/windows/main/menus/option/features/general/general.component.html index ea696262..31e53372 100644 --- a/src/app/windows/main/menus/option/features/general/general.component.html +++ b/src/app/windows/main/menus/option/features/general/general.component.html @@ -8,6 +8,7 @@ {{ 'app.option.shortcuts.diver.active-open-menu' | translate }} {{ 'app.window.options.features.general.disable-inactivity' | translate }} {{ 'app.window.options.features.general.zaapsearchfilter' | translate }} + {{ 'app.window.options.features.general.autoprivate' | translate }}