Could you please give e a button template? I will try my hardest to answer your question!
Rollback Post to RevisionRollBack
Please give me an Internet. Please. Pretty Please with sprinkles on top
I have a twitter!! Follow me for regular updates on my mods! https://twitter.com/DamienMiller11
I pretty much rewrote the whole thing, with a button class, Touch namespace, and TButton class. I also made a class that's derived from Touch::TButton (class XButton : public Touch::TButton). The problem now is that when I do this:
It crashes BlockLauncher and sometimes causes System UI to stop responding. I tried adding char filler[0x3c]; to the Touch::TButton class, but that didn't help.
I pretty much rewrote the whole thing, with a button class, Touch namespace, and TButton class. I also made a class that's derived from Touch::TButton (class XButton : public Touch::TButton). The problem now is that when I do this:
It crashes BlockLauncher and sometimes causes System UI to stop responding. I tried adding char filler[0x3c]; to the Touch::TButton class, but that didn't help.
Nvm, it was supposed to be char filler[128]. Now it doesn't crash.
May i ask a question ive started working on my addon so what are the functions like useItem() something like that can i have a list of it Thanks(dont have any idea)
I have a twitter!! Follow me for regular updates on my mods!
https://twitter.com/DamienMiller11
Tap the link below to sub to my youtube channel:
https://m.youtube.com/channel/UCDPTTeHo67o7-mZiiGh_XKg?debug_prerolls=false&layout=mobile&tsp=1&utcoffset=480
#include <jni.h> #include <dlfcn.h> #include <android/log.h> #include <stdlib.h> #include <Substrate.h> #include <string> class GuiElement; class Gui; class Touch_TButton; class MinecraftClient; static void(*GuiElement_render_real)(GuiElement*, MinecraftClient*, int, int); static void(*Gui_render_real)(Gui*, float, bool, int, int); static void(*Touch_TButton_TButton)(Touch_TButton*, int, int, int, int, int, std::string const&, MinecraftClient*); static void(*Button_render)(Touch_TButton*, MinecraftClient*, int, int); MinecraftClient* mcClient; Touch_TButton* xbutton=(Touch_TButton*) operator new(0x3c); static void GuiElement_render_hook(GuiElement* guiElement, MinecraftClient* minecraftClient, int idk1, int idk2) { mcClient=minecraftClient; GuiElement_render_real(guiElement, minecraftClient, idk1, idk2); } static void Gui_render_hook(Gui* gui, float f1, bool b1, int i1, int i2) { Touch_TButton_TButton(xbutton, 0, 0, 172, 20, 20, "S", mcClient); Button_render(xbutton, mcClient, 0, 0); Gui_render_real(gui, f1, b1, i1, i2); } //I won't include the hooks because that should be pretty easy to figure out#include <dlfcn.h>
#include <android/log.h>
#include <stdlib.h>
#include <Substrate.h>
#include <string>
class GuiElement;
class Gui;
class Touch_TButton;
class MinecraftClient;
static void(*GuiElement_render_real)(GuiElement*, MinecraftClient*, int, int);
static void(*Gui_render_real)(void*, float, bool, int, int);
static void(*Touch_TButton_TButton)(Touch_TButton*, int, int, int, int, int, std::string const&, MinecraftClient*);
static void(*Button_render)(Touch_TButton*, MinecraftClient*, int, int);
MinecraftClient* mcClient;
Touch_TButton* xbutton=(Touch_TButton*) operator new(0x3c);
static void GuiElement_render_hook(GuiElement* guiElement, MinecraftClient* minecraftClient, int idk1, int idk2) {
mcClient=minecraftClient;
GuiElement_render_real(guiElement, minecraftClient, idk1, idk2);
}
static void Gui_render_hook(void* gui, float f1, bool b1, int i1, int i2) {
Touch_TButton_TButton(xbutton, 0, 0, 172, 20, 20, "S", mcClient);
Button_render(xbutton, mcClient, 0, 0);
Gui_render_real(gui, f1, b1, i1, i2);
}
//not tested yet, it may not working
Tap the link below to sub to my youtube channel:
https://m.youtube.com/channel/UCDPTTeHo67o7-mZiiGh_XKg?debug_prerolls=false&layout=mobile&tsp=1&utcoffset=480
#include <dlfcn.h>
#include <android/log.h>
#include <stdlib.h>
#include <mcpe.h>
#include <Substrate.h>
#include <string>
class GuiElement;
class Gui;
class Touch_TButton;
class MinecraftClient;
MinecraftClient* mcClient;
static void(*Gui_render_real)(void*, float, bool, int, int);
static void(*Touch_TButton_TButton)(Touch_TButton*, int, int, int, int, int, std::string const&, MinecraftClient*);
static void(*GuiElement_render_real)(GuiElement*, MinecraftClient*, int, int);
static void(*Button_render)(Touch_TButton*, MinecraftClient*, int, int);
Touch_TButton* btn=(Touch_TButton*) operator new(0x3c);
static void GuiElement_render_hook(GuiElement* guiElement, MinecraftClient* minecraftClient, int i1, int i2) {
mcClient=minecraftClient;
GuiElement_render_real(guiElement, minecraftClient, i1, i2);
}
static void Gui_render_hook(void* gui, float f, bool b, int i1, int i2) {
Touch_TButton_TButton(btn, 0, 20, 10, 100, 50, "Test Button", mcClient);
Button_render(btn, mcClient, 0, 0);
Gui_render_real(gui, f, b, i1, i2);
}
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
void* Gui_render=dlsym(RTLD_DEFAULT, "_ZN3Gui6renderEfbii");
void* GuiElement_render = dlsym(RTLD_DEFAULT, "_ZN10GuiElement6renderEP15MinecraftClientii");
Touch_TButton_TButton = (void(*)(Touch_TButton*, int, int, int, int, int, std::string const&, MinecraftClient*))dlsym(RTLD_DEFAULT,"_ZN5Touch7TButtonC2EiiiiiRKSsP15MinecraftClient");
Button_render = (void(*)(Touch_TButton*, MinecraftClient*, int, int)) dlsym(RTLD_DEFAULT,"_ZN6Button6renderEP15MinecraftClientii");
MSHookFunction(Gui_render, (void*) &Gui_render_hook, (void**) &Gui_render_real);
MSHookFunction(GuiElement_render, (void*) & GuiElement_render_hook , (void**) & GuiElement_render_real );
return JNI_VERSION_1_2;
}
//This code works
Tap the link below to sub to my youtube channel:
https://m.youtube.com/channel/UCDPTTeHo67o7-mZiiGh_XKg?debug_prerolls=false&layout=mobile&tsp=1&utcoffset=480
Tap the link below to sub to my youtube channel:
https://m.youtube.com/channel/UCDPTTeHo67o7-mZiiGh_XKg?debug_prerolls=false&layout=mobile&tsp=1&utcoffset=480
It crashes BlockLauncher and sometimes causes System UI to stop responding. I tried adding char filler[0x3c]; to the Touch::TButton class, but that didn't help.
By Button ID i believe(im not creating apps but i tried one and asking some info from TomBailey)
Just Having A Break in creating mods
Just Having A Break in creating mods
Nvm, it was supposed to be char filler[128]. Now it doesn't crash.
", sans-serif">Want to get paid for uploading mods?
", sans-serif">Click here
For free Bitcoins, click here!
", sans-serif">Want to get paid for uploading mods?
", sans-serif">Click here
For free Bitcoins, click here!
Just Having A Break in creating mods