Compare commits

...

2 Commits

Author SHA1 Message Date
TheBrokenRail f25e760831 Some CMake Cleanup
CI / Build (ARM64, Client) (push) Waiting to run Details
CI / Build (ARM64, Server) (push) Waiting to run Details
CI / Build (ARMHF, Client) (push) Waiting to run Details
CI / Build (ARMHF, Server) (push) Waiting to run Details
CI / Test (Client) (push) Waiting to run Details
CI / Test (Server) (push) Waiting to run Details
CI / Build Example Mods (push) Waiting to run Details
CI / Release (push) Blocked by required conditions Details
CI / Build (AMD64, Server) (push) Has been cancelled Details
CI / Build (AMD64, Client) (push) Has been cancelled Details
2024-02-07 22:11:18 -05:00
TheBrokenRail d86018717e Split Splash Loading Into Own Function 2024-02-07 21:40:26 -05:00
4 changed files with 21 additions and 18 deletions

View File

@ -28,9 +28,6 @@ set(MESSAGE_QUIET TRUE)
add_subdirectory(src EXCLUDE_FROM_ALL)
unset(MESSAGE_QUIET)
# Ensure Build
add_custom_target(LIEF-build ALL DEPENDS LIB_LIEF)
# Install
install(TARGETS LIB_LIEF DESTINATION "${MCPI_LIB_DIR}")
if(BUILD_ARM_COMPONENTS)

View File

@ -20,9 +20,6 @@ set(MESSAGE_QUIET TRUE)
add_subdirectory(src EXCLUDE_FROM_ALL)
unset(MESSAGE_QUIET)
# Ensure Build
add_custom_target(glfw-build ALL DEPENDS glfw)
# Install
install(TARGETS glfw DESTINATION "${MCPI_LIB_DIR}")

View File

@ -0,0 +1,5 @@
#pragma once
#include <vector>
void title_screen_load_splashes(std::vector<std::string> &splashes);

View File

@ -9,6 +9,7 @@
#include <mods/init/init.h>
#include <mods/compat/compat.h>
#include <mods/touch/touch.h>
#include <mods/title-screen/title-screen.h>
// Improved Title Screen Background
static void StartMenuScreen_render_Screen_renderBackground_injection(Screen *screen) {
@ -49,6 +50,20 @@ static void StartMenuScreen_buttonClicked_injection(StartMenuScreen *screen, But
}
// Add Splashes
void title_screen_load_splashes(std::vector<std::string> &splashes) {
std::ifstream stream("data/splashes.txt");
if (stream.good()) {
std::string line;
while (std::getline(stream, line)) {
if (line.length() > 0) {
splashes.push_back(line);
}
}
stream.close();
} else {
WARN("Unable To Load Splashes");
}
}
static Screen *last_screen = nullptr;
static std::string current_splash;
static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x, int y, float param_1) {
@ -62,18 +77,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x
// Mark As Loaded
splashes_loaded = true;
// Load
std::ifstream stream("data/splashes.txt");
if (stream.good()) {
std::string line;
while (std::getline(stream, line)) {
if (line.length() > 0) {
splashes.push_back(line);
}
}
stream.close();
} else {
WARN("Unable To Load Splashes");
}
title_screen_load_splashes(splashes);
}
// Display Splash