Update More Methods!
This commit is contained in:
parent
6ae475785e
commit
f25a2adcef
@ -144,7 +144,7 @@ static Screen *create_chat_screen() {
|
|||||||
void _init_chat_ui() {
|
void _init_chat_ui() {
|
||||||
misc_run_on_game_key_press([](Minecraft *minecraft, int key) {
|
misc_run_on_game_key_press([](Minecraft *minecraft, int key) {
|
||||||
if (key == 0x54) {
|
if (key == 0x54) {
|
||||||
if (Minecraft_isLevelGenerated(minecraft) && minecraft->screen == nullptr) {
|
if (minecraft->isLevelGenerated() && minecraft->screen == nullptr) {
|
||||||
minecraft->setScreen(create_chat_screen());
|
minecraft->setScreen(create_chat_screen());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -213,7 +213,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ
|
|||||||
if (folder.empty()) {
|
if (folder.empty()) {
|
||||||
folder = "World";
|
folder = "World";
|
||||||
}
|
}
|
||||||
folder = getUniqueLevelName(Minecraft_getLevelSource(minecraft), folder);
|
folder = getUniqueLevelName(minecraft->getLevelSource(), folder);
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
LevelSettings settings;
|
LevelSettings settings;
|
||||||
|
@ -45,7 +45,7 @@ static const char *last_message = nullptr;
|
|||||||
static void print_progress(Minecraft *minecraft) {
|
static void print_progress(Minecraft *minecraft) {
|
||||||
const char *message = minecraft->getProgressMessage();
|
const char *message = minecraft->getProgressMessage();
|
||||||
int32_t progress = minecraft->progress;
|
int32_t progress = minecraft->progress;
|
||||||
if (Minecraft_isLevelGenerated(minecraft)) {
|
if (minecraft->isLevelGenerated()) {
|
||||||
message = "Ready";
|
message = "Ready";
|
||||||
progress = -1;
|
progress = -1;
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ static void LoginPacket_read_injection(LoginPacket_read_t original, LoginPacket
|
|||||||
// formatting functionality.
|
// formatting functionality.
|
||||||
static RakNet_RakString *RakNet_RakString_injection(RakNet_RakString *rak_string, const char *format, ...) {
|
static RakNet_RakString *RakNet_RakString_injection(RakNet_RakString *rak_string, const char *format, ...) {
|
||||||
// Call Original Method
|
// Call Original Method
|
||||||
return rak_string->constructor("%s", format);
|
return RakNet_RakString_constructor(rak_string, "%s", format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print Error Message If RakNet Startup Fails
|
// Print Error Message If RakNet Startup Fails
|
||||||
|
@ -293,7 +293,7 @@ __attribute__((destructor)) static void _free_stdin_buffer() {
|
|||||||
// Handle Commands
|
// Handle Commands
|
||||||
static void handle_commands(Minecraft *minecraft) {
|
static void handle_commands(Minecraft *minecraft) {
|
||||||
// Check If Level Is Generated
|
// Check If Level Is Generated
|
||||||
if (Minecraft_isLevelGenerated(minecraft) && stdin_buffer_complete) {
|
if (minecraft->isLevelGenerated() && stdin_buffer_complete) {
|
||||||
// Command Ready; Run It
|
// Command Ready; Run It
|
||||||
if (stdin_buffer != nullptr) {
|
if (stdin_buffer != nullptr) {
|
||||||
ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft);
|
ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft);
|
||||||
|
@ -115,7 +115,7 @@ void TextInputBox::tick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_bFocused) {
|
if (m_bFocused) {
|
||||||
if (Common_getTimeMs() > m_lastFlashed + 500) {
|
if (Common::getTimeMs() > m_lastFlashed + 500) {
|
||||||
m_lastFlashed += 500;
|
m_lastFlashed += 500;
|
||||||
m_bCursorOn ^= 1;
|
m_bCursorOn ^= 1;
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ void TextInputBox::charPressed(int k) {
|
|||||||
static std::string get_rendered_text(Font *font, int width, int scroll_pos, std::string text) {
|
static std::string get_rendered_text(Font *font, int width, int scroll_pos, std::string text) {
|
||||||
std::string rendered_text = text.substr(scroll_pos);
|
std::string rendered_text = text.substr(scroll_pos);
|
||||||
int max_width = width - (PADDING * 2);
|
int max_width = width - (PADDING * 2);
|
||||||
while (Font_width(font, &rendered_text) > max_width) {
|
while (font->width(&rendered_text) > max_width) {
|
||||||
rendered_text.pop_back();
|
rendered_text.pop_back();
|
||||||
}
|
}
|
||||||
return rendered_text;
|
return rendered_text;
|
||||||
|
@ -42,8 +42,8 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
|
|||||||
for (int x = 0; x < 16; x++) {
|
for (int x = 0; x < 16; x++) {
|
||||||
for (int y = 0; y < 16; y++) {
|
for (int y = 0; y < 16; y++) {
|
||||||
float f = 0.0F;
|
float f = 0.0F;
|
||||||
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||||
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||||
for (int bx = x - 1; bx <= x + 1; bx++) {
|
for (int bx = x - 1; bx <= x + 1; bx++) {
|
||||||
for (int by = y - 1; by <= y + 1; by++) {
|
for (int by = y - 1; by <= y + 1; by++) {
|
||||||
int k2 = (bx + ay) & 0xf;
|
int k2 = (bx + ay) & 0xf;
|
||||||
@ -57,7 +57,7 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
|
|||||||
self->m_data3[x + y * 16] = 0.0f;
|
self->m_data3[x + y * 16] = 0.0f;
|
||||||
}
|
}
|
||||||
self->m_data4[x + y * 16] -= 0.06f;
|
self->m_data4[x + y * 16] -= 0.06f;
|
||||||
if (Mth_random() < 0.005f) {
|
if (Mth::random() < 0.005f) {
|
||||||
self->m_data4[x + y * 16] = 1.5f;
|
self->m_data4[x + y * 16] = 1.5f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,8 +106,8 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
|
|||||||
for (int x = 0; x < 16; x++) {
|
for (int x = 0; x < 16; x++) {
|
||||||
for (int y = 0; y < 16; y++) {
|
for (int y = 0; y < 16; y++) {
|
||||||
float f = 0.0F;
|
float f = 0.0F;
|
||||||
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||||
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||||
for (int bx = x - 1; bx <= x + 1; bx++) {
|
for (int bx = x - 1; bx <= x + 1; bx++) {
|
||||||
for (int by = y - 1; by <= y + 1; by++) {
|
for (int by = y - 1; by <= y + 1; by++) {
|
||||||
int k2 = (bx + ay) & 0xf;
|
int k2 = (bx + ay) & 0xf;
|
||||||
@ -121,7 +121,7 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
|
|||||||
self->m_data3[x + y * 16] = 0.0f;
|
self->m_data3[x + y * 16] = 0.0f;
|
||||||
}
|
}
|
||||||
self->m_data4[x + y * 16] -= 0.06f;
|
self->m_data4[x + y * 16] -= 0.06f;
|
||||||
if (Mth_random() < 0.005f) {
|
if (Mth::random() < 0.005f) {
|
||||||
self->m_data4[x + y * 16] = 1.5f;
|
self->m_data4[x + y * 16] = 1.5f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x
|
|||||||
glRotatef(-20.0f, 0.0f, 0.0f, 1.0f);
|
glRotatef(-20.0f, 0.0f, 0.0f, 1.0f);
|
||||||
// Scale
|
// Scale
|
||||||
int textWidth = screen->font->width(¤t_splash);
|
int textWidth = screen->font->width(¤t_splash);
|
||||||
float timeMS = float(Common_getTimeMs() % 1000) / 1000.0f;
|
float timeMS = float(Common::getTimeMs() % 1000) / 1000.0f;
|
||||||
float scale = max_scale - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS));
|
float scale = max_scale - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS));
|
||||||
float real_text_width = textWidth * max_scale;
|
float real_text_width = textWidth * max_scale;
|
||||||
if (real_text_width > max_width) {
|
if (real_text_width > max_width) {
|
||||||
|
Loading…
Reference in New Issue
Block a user