Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOD] Autoprivate #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions electron/settings/settings-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions electron/settings/settings.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion locale/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion locale/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion locale/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions src/app/mods/auto-private/auto-private.ts
Original file line number Diff line number Diff line change
@@ -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));
}
}
}
1 change: 1 addition & 0 deletions src/app/mods/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
11 changes: 11 additions & 0 deletions src/app/modules/option.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand All @@ -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');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</mat-checkbox><mat-checkbox color="primary" [(ngModel)]="settingsService.option.shortcuts.diver.active_open_menu">{{ 'app.option.shortcuts.diver.active-open-menu' | translate }}</mat-checkbox>
<mat-checkbox color="primary" [(ngModel)]="settingsService.option.vip.general.disable_inactivity">{{ 'app.window.options.features.general.disable-inactivity' | translate }}</mat-checkbox>
<mat-checkbox color="primary" [(ngModel)]="settingsService.option.vip.general.zaapsearchfilter">{{ 'app.window.options.features.general.zaapsearchfilter' | translate }}</mat-checkbox>
<mat-checkbox color="primary" [(ngModel)]="settingsService.option.vip.general.autoprivate">{{ 'app.window.options.features.general.autoprivate' | translate }}</mat-checkbox>
</div>

<div class="col-xs-12 menu">
Expand Down