-
Notifications
You must be signed in to change notification settings - Fork 95
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] Zaap Double Clic #178
base: master
Are you sure you want to change the base?
Conversation
Idée : 🏋🫖☠prixe#1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, quelques remarques pour essayer de rendre le code moins répétitif, et enlever les choses inutiles !
private Zaap; | ||
private DivList = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inutile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci pour t'est commentaire,
tu as recrée un compte Discord ? si oui mp KeyTur#4671
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop pas de DS, pas pour le moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok tu me dira si tu revien dessus,
On a crée un discord privé pour l'instant
private getZaap(e){ | ||
const Zaap = this.wGame.gui.windowsContainer.getChildren().find(e=>e.id=="teleporterList") | ||
const ZaapList = Zaap.zaapBody.panelCollection.Zaap.table.content._childrenList | ||
const PrismList = Zaap.zaapBody.panelCollection.Prism.table.content._childrenList | ||
for (var i = 0; i < ZaapList.length - 1; i++) { | ||
this.DivList.push(ZaapList[i].rootElement) | ||
} | ||
for (var i = 0; i < PrismList.length - 1; i++) { | ||
this.DivList.push(PrismList[i].rootElement) | ||
} | ||
this.DivList.forEach(element => { | ||
element.addEventListener('dblclick', () => { Zaap.windowBody._childrenList.find(e => e.rootElement?.classList?.contains('footer'))._childrenList[0].tap(); }) | ||
}) | ||
} | ||
|
||
|
||
|
||
private getZaapiPrism(e){ | ||
const Zaapi = this.wGame.gui.windowsContainer.getChildren().find(e=>e.id=="teleporterList") | ||
const ZaapiListC = Zaapi.subwayBody.panelCollection.CraftHouse.table.content._childrenList | ||
const ZaapiListB = Zaapi.subwayBody.panelCollection.BidHouse.table.content._childrenList | ||
const ZaapiListM = Zaapi.subwayBody.panelCollection.Misc.table.content._childrenList | ||
if(e.teleporterType === 1){ | ||
for (var i = 0; i < ZaapiListC.length - 1; i++) { | ||
this.DivList.push(ZaapiListC[i].rootElement) | ||
} | ||
for (var i = 0; i < ZaapiListB.length - 1; i++) { | ||
this.DivList.push(ZaapiListB[i].rootElement) | ||
} | ||
for (var i = 0; i < ZaapiListM.length - 1; i++) { | ||
this.DivList.push(ZaapiListM[i].rootElement) | ||
} | ||
this.DivList.forEach(element => { | ||
element.addEventListener('dblclick', () => { Zaapi.windowBody._childrenList.find(e => e.rootElement?.classList?.contains('footer'))._childrenList[0].tap(); }) | ||
}) | ||
} | ||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux fusionner tes fonctions getZaapiPrism()
et getZaap()
en 1 seule avec une simple condition if/else
if (e.teleporterType == 1) {
// Craft/Bid/Misc
} else {
// Zaap/Zaapi
}
Cette fonction ainsi créée peut retourner directement la liste des zaap, et t'as plus qu'à boucler dessus.
this.DivList.push(PrismList[i].rootElement) | ||
} | ||
this.DivList.forEach(element => { | ||
element.addEventListener('dblclick', () => { Zaap.windowBody._childrenList.find(e => e.rootElement?.classList?.contains('footer'))._childrenList[0].tap(); }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu devrais ajouter un délai entre le double clic et le OK, histoire de pas le faire instantanément.
Idée : 🏋🫖☠#1
Script fonctionelle mais si vous avez des idées d'optimisation ( Keda 😶) ca sera pas plus mal