From f694a331b60fd0817ccabb185754f8bd40b6dc59 Mon Sep 17 00:00:00 2001 From: Jordan Johnson <52584279+MightyBurger@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:13:51 -0600 Subject: [PATCH 1/2] Make Addons menu transparent --- ball/main.c | 3 +++ share/st_package.c | 16 +++++++--------- share/st_package.h | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ball/main.c b/ball/main.c index 0e4acc359..fb65958ba 100644 --- a/ball/main.c +++ b/ball/main.c @@ -57,6 +57,7 @@ #include "st_common.h" #include "st_start.h" #include "st_package.h" +#include "st_shared.h" const char TITLE[] = "Neverball"; const char ICON[] = "icon/neverball.png"; @@ -938,6 +939,8 @@ static int main_init(int argc, char *argv[]) package_set_installed_action(handle_installed_action); + package_set_paint_action(shared_paint); + /* Enable joystick events. */ joy_init(); diff --git a/share/st_package.c b/share/st_package.c index 880ac84c8..baa00958e 100644 --- a/share/st_package.c +++ b/share/st_package.c @@ -63,6 +63,7 @@ struct download_info }; static int (*installed_action)(int pi); +static void (*paint_action)(int id, float st); /*---------------------------------------------------------------------------*/ @@ -521,8 +522,6 @@ static int package_enter(struct state *st, struct state *prev) { common_init(package_action); - back_init("back/gui.png"); - if (do_init) { package_back = prev; @@ -576,13 +575,8 @@ static void package_leave(struct state *st, struct state *next, int id) void package_paint(int id, float st) { - video_push_persp((float) config_get_d(CONFIG_VIEW_FOV), 0.1f, FAR_DIST); - { - back_draw_easy(); - } - video_pop_matrix(); - - gui_paint(id); + if (paint_action) + paint_action(id, st); } static void package_point(int id, int x, int y, int dx, int dy) @@ -627,6 +621,10 @@ void package_set_installed_action(int (*installed_action_fn)(int pi)) installed_action = installed_action_fn; } +void package_set_paint_action(void (*paint_action_fn)(int id, float st)) { + paint_action = paint_action_fn; +} + /*---------------------------------------------------------------------------*/ struct state st_package = { diff --git a/share/st_package.h b/share/st_package.h index d768938df..34cec95a5 100644 --- a/share/st_package.h +++ b/share/st_package.h @@ -7,5 +7,6 @@ extern struct state st_package; void goto_package(int package_id, struct state *back_state); void package_set_installed_action(int (*installed_action_fn)(int pi)); +void package_set_paint_action(void (*paint_action_fn)(int id, float st)); #endif \ No newline at end of file From 03b4961f24cd02b40e8498dd89c1c75c8073b0eb Mon Sep 17 00:00:00 2001 From: Jordan Johnson <52584279+MightyBurger@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:39:20 -0600 Subject: [PATCH 2/2] Load background in the case the user launches with --link and has not yet installed the package --- ball/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ball/main.c b/ball/main.c index fb65958ba..1a485b34a 100644 --- a/ball/main.c +++ b/ball/main.c @@ -494,6 +494,8 @@ static int process_link(const char *link) else if ((index = package_search(set_file)) >= 0) { log_printf("Found package with the given reference.\n"); + load_title_background(); + game_kill_fade(); goto_package(index, &st_title); processed = 1; }