-
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 - Afficher les items craftable #164
base: develop
Are you sure you want to change the base?
Conversation
Un mod qui rajoute un checkbox dans les recettes pour filtrer les items craftables.
dcf986b
to
546ce2a
Compare
En attente de Broseidon pour opti le css |
Pas avant ce week-end, sorry ! |
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 ! Petite review du code, y'a plusieurs choses à améliorer au niveau du CSS : tu vas gagner des lignes et en lisibilité !
Je t'ai mis pas mal de code d'exemple, mais pas tout : faut quand même que tu travailles !
background-image: url("./assets/ui/checkbox.png") | ||
` | ||
} | ||
} |
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.
Il te faut une fonction reset()
pour enlever (this.styleTag?.remove?.();
) la feuille de style définie dans le startMod()
et la checkbox ajoutée
this.styleTag = this.wGame.document.createElement("style"); | ||
this.wGame.document.getElementsByTagName("head")[0].appendChild(this.styleTag); |
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
this.styleTag.innerHTML += ` | ||
.checkboxitemcraftable { | ||
text-align: left; | ||
padding: 3px 3px 3px 30px; | ||
background-position: -24px calc(50% - 2px); | ||
background-size: 18px 18px; | ||
background-repeat: no-repeat; | ||
background-origin: content-box; | ||
background-image: url("./assets/ui/checkbox.png") | ||
} | ||
` |
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
this.styleTag.innerHTML = ` | ||
.checkboxitemcraftable { | ||
text-align: left; | ||
padding: 3px 3px 3px 30px; | ||
background-position: -24px calc(50% - 2px); | ||
background-size: 18px 18px; | ||
background-repeat: no-repeat; | ||
background-origin: content-box; | ||
background-image: url("./assets/ui/checkbox_checked.png"); | ||
` |
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, à remplacer par element.classList.add('on')
pour ajouter la classe "on" et ainsi avoir la box checked visuellement.
this.styleTag.innerHTML = ` | ||
.checkboxitemcraftable { | ||
text-align: left; | ||
padding: 3px 3px 3px 30px; | ||
background-position: -24px calc(50% - 2px); | ||
background-size: 18px 18px; | ||
background-repeat: no-repeat; | ||
background-origin: content-box; | ||
background-image: url("./assets/ui/checkbox.png") | ||
` |
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, à remplacer par element.classList.remove('on')
pour retirerla classe "on" et ainsi avoir la box non check.
let checkboxic = document.createElement("div"); | ||
checkboxic.setAttribute("type", "checkbox"); | ||
checkboxic.className = "checkboxitemcraftable"; | ||
checkboxic.innerText = "Afficher les items craftable"; |
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.
Remplacer checkboxic
par le champs privé déclaré plus haut
} | ||
|
||
private verifRecette(statuscheckbox){ | ||
let aa = this.wGame.gui.windowsContainer.getChildren().find(e=>e.id=="itemRecipes") |
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.
aa
...
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.
hahaha
Le checkbox ne ce remove pas lors du reload . . . |
Je pense que l'on peut mettre cette pr (et surtout le checkbox) de cote, tant que #136 ne sera pas merge |
Yep ca me va |
Bonjour, Désolé je regarde seulement mais c'est compliqué sans avoir la main sur le code des autres car c'est des soucis de typage HTMLElement dans le code. Error: src/app/mods/general/auto-focus.ts:38:95 - error TS2339: Property 'focus' does not exist on type 'Element'.
(Ça, c'est déjà corrigé dans la PR normalement) Pour les problèmes des lignes 51, 54 et 63 il faut juste caster l'élément HTML |
Un script qui rajoute un checkbox dans les recettes pour afficher filtrer les items qui sont craftable