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] Zaap Double Clic #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

TheKetur55
Copy link

Idée : 🏋🫖☠#1

Script fonctionelle mais si vous avez des idées d'optimisation ( Keda 😶) ca sera pas plus mal

Idée : 🏋🫖☠prixe#1
@JulienCoutault JulienCoutault added the enhancement New feature or request label Jan 30, 2022
Copy link

@Kedaostram Kedaostram left a 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 !

Comment on lines +4 to +5
private Zaap;
private DivList = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inutile

Copy link
Author

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

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

Copy link
Author

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

Comment on lines +21 to +59
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(); })
})
}


}

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(); })

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants