eDonnes124 / Town-Of-Us-R

An Among Us mod containing a bunch of roles
GNU General Public License v3.0
345 stars 140 forks source link

[WIP] change from killbutton to abilitybutton #133

Closed whichtwix closed 1 year ago

whichtwix commented 1 year ago

currently wip as there is a bug with no buttons appearing after hauntminigame.begin

right now imp/nk abilities are killbuttons, but the abilitybutton is unused apart from haunt so it may be good to change to using that, the patch to change their button becomes alike to how crew,nk, and arso/pb roles get theirs. this way all the sprite changing could be in 1 file

AlchlcDvl commented 1 year ago

alternatively you could also make a custom button class and override the button's OnClick function so there's no need to patch AbilityButton.DoClick, plus if you add an effect parameter you can maybe make it work like the shapeshift button from the vanilla shapeshifter

whichtwix commented 1 year ago

the thing with that is it leads to the same thing, we will have to instanatiate that class and itll be mostly like before, and I dont think the do click will run on its own without a patch unless we go the rainbow route and do the registerinil2cpp stuff, will have to look into how that way is

whichtwix commented 1 year ago

clicking haunt a 2nd time made the buttons appear but the minigame would technically close, found a quite sketchy way to fix it by inverting the close states, though you still have to click it multiple times

AlchlcDvl commented 1 year ago

the thing with that is it leads to the same thing, we will have to instanatiate that class and itll be mostly like before, and I dont think the do click will run on its own without a patch unless we go the rainbow route and do the registerinil2cpp stuff, will have to look into how that way is

nah i made a quick class and checked it out, there's no need for patches

whichtwix commented 1 year ago

hmm ok, though in that case overriding useability from rolebehavior may be better, since the doclick runs that within its method, and there are other methods in rolebehavior that may be helpful