- Manifest multiarch i386 (Compat.i386 + GL32 + gamescope) - Wrapper launcher con EULA dialog GTK3 (persistente), audio PipeWire, saves - sdl12-compat build i386, risoluzione 1024x768@16, 60fps - Icona composita (mech + kanji + banner SHOGO, trasparente) 512/256 - icon-build.py (post-processing rembg) - Cartella flathub-submission pronta per la PR - install-shogo-demo.sh per PC nuovi
234 lines
8.3 KiB
C
234 lines
8.3 KiB
C
/* eula-dialog.c — Dialog EULA per Shogo Demo Flatpak
|
|
* Compila: gcc eula-dialog.c -o eula-dialog $(pkg-config --cflags --libs gtk+-3.0)
|
|
* Exit: 0 = accettato, 1 = rifiutato/chiuso
|
|
*/
|
|
#include <gtk/gtk.h>
|
|
|
|
static int accepted = 0;
|
|
|
|
static void on_accept(GtkWidget *w, gpointer d) { (void)w; (void)d; accepted = 1; gtk_main_quit(); }
|
|
static void on_decline(GtkWidget *w, gpointer d) { (void)w; (void)d; accepted = 0; gtk_main_quit(); }
|
|
static void on_close(GtkWidget *w, gpointer d) { (void)w; (void)d; accepted = 0; gtk_main_quit(); }
|
|
static gboolean on_delete(GtkWidget *w, GdkEvent *e, gpointer d) { (void)w; (void)e; (void)d; accepted = 0; gtk_main_quit(); return TRUE; }
|
|
|
|
static const char *EULA_TEXT =
|
|
"END USER LICENSE AGREEMENT\n"
|
|
"==========================\n"
|
|
"\n"
|
|
"Shogo: Mobile Armor Division - Linux Demo (version 2.1)\n"
|
|
"\n"
|
|
"Copyright (c) 1998 Monolith Productions, Inc.\n"
|
|
"Linux port by Hyperion Entertainment.\n"
|
|
"\n"
|
|
"This is the official SHAREWARE DEMO version of Shogo:\n"
|
|
"Mobile Armor Division. It contains limited demo content\n"
|
|
"and is provided free of charge for personal, non-commercial\n"
|
|
"evaluation use.\n"
|
|
"\n"
|
|
"The full version of the game is sold separately. All game\n"
|
|
"code, data, artwork, music and other content remain the\n"
|
|
"property of Monolith Productions, Inc. and the respective\n"
|
|
"rights holders.\n"
|
|
"\n"
|
|
"This package is provided as-is, without warranty of any\n"
|
|
"kind, express or implied, including but not limited to the\n"
|
|
"warranties of merchantability or fitness for a particular\n"
|
|
"purpose.\n"
|
|
"\n"
|
|
"By clicking \"I Accept\" you agree to use this demo only for\n"
|
|
"personal, non-commercial purposes and to respect the rights\n"
|
|
"of the copyright holders.\n";
|
|
|
|
static const char *SHOGO_CSS =
|
|
"window {"
|
|
" background-color: #050b13;"
|
|
" color: #9fc9c5;"
|
|
"}"
|
|
".shell {"
|
|
" background-color: #07121d;"
|
|
" border: 2px solid #c46b22;"
|
|
" padding: 14px;"
|
|
"}"
|
|
".hud-header {"
|
|
" background-color: #08263a;"
|
|
" border: 2px solid #20c7d5;"
|
|
" border-left: 7px solid #ef8b2c;"
|
|
" padding: 10px 14px;"
|
|
"}"
|
|
".hud-title {"
|
|
" color: #eafcff;"
|
|
" font-family: Sans;"
|
|
" font-size: 24px;"
|
|
" font-weight: 900;"
|
|
" letter-spacing: 2px;"
|
|
"}"
|
|
".hud-subtitle {"
|
|
" color: #39d5df;"
|
|
" font-family: Monospace;"
|
|
" font-size: 10px;"
|
|
" letter-spacing: 1px;"
|
|
"}"
|
|
".hud-mark {"
|
|
" color: #e9812b;"
|
|
" font-family: Monospace;"
|
|
" font-size: 16px;"
|
|
" font-weight: bold;"
|
|
"}"
|
|
".license-frame {"
|
|
" background-color: #061019;"
|
|
" border: 1px solid #197a89;"
|
|
" border-top: 3px solid #25bdca;"
|
|
" padding: 3px;"
|
|
"}"
|
|
".license-text {"
|
|
" background-color: #061019;"
|
|
" color: #aac8bd;"
|
|
" font-family: Monospace;"
|
|
" font-size: 11px;"
|
|
" padding: 14px;"
|
|
"}"
|
|
".status-line {"
|
|
" color: #278b97;"
|
|
" font-family: Monospace;"
|
|
" font-size: 10px;"
|
|
"}"
|
|
"button {"
|
|
" min-width: 112px;"
|
|
" min-height: 30px;"
|
|
" border-radius: 0;"
|
|
" font-family: Sans;"
|
|
" font-weight: bold;"
|
|
" letter-spacing: 1px;"
|
|
" text-shadow: none;"
|
|
" box-shadow: none;"
|
|
"}"
|
|
".decline-button {"
|
|
" background: #0b2634;"
|
|
" color: #79aab0;"
|
|
" border: 1px solid #287381;"
|
|
"}"
|
|
".decline-button:hover {"
|
|
" background: #103747;"
|
|
" color: #b6edf0;"
|
|
" border-color: #36b6c1;"
|
|
"}"
|
|
".accept-button {"
|
|
" background: #c86620;"
|
|
" color: #fff3dc;"
|
|
" border: 2px solid #ffad49;"
|
|
"}"
|
|
".accept-button:hover, .accept-button:focus {"
|
|
" background: #ed862a;"
|
|
" color: #ffffff;"
|
|
" border-color: #ffd073;"
|
|
"}"
|
|
".accept-button:active { background: #8f4217; }"
|
|
"scrollbar { background-color: #071722; }"
|
|
"scrollbar slider {"
|
|
" background-color: #176878;"
|
|
" border-radius: 0;"
|
|
" min-width: 8px;"
|
|
" min-height: 8px;"
|
|
"}";
|
|
|
|
static void add_class(GtkWidget *widget, const char *class_name) {
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(widget), class_name);
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
GtkWidget *win, *vbox, *header, *header_text, *title, *subtitle, *mark;
|
|
GtkWidget *frame, *sw, *label, *status, *hbox, *b_accept, *b_decline;
|
|
GtkCssProvider *css;
|
|
|
|
gtk_init(&argc, &argv);
|
|
|
|
/* evita la selezione automatica di tutto il testo quando un label
|
|
selezionabile riceve il focus (default GTK: gtk-label-select-on-focus=TRUE) */
|
|
g_object_set(gtk_settings_get_default(), "gtk-label-select-on-focus", FALSE, NULL);
|
|
|
|
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
|
gtk_window_set_title(GTK_WINDOW(win), "Shogo: Mobile Armor Division - License Agreement");
|
|
gtk_window_set_default_size(GTK_WINDOW(win), 560, 480);
|
|
gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
|
|
g_signal_connect(win, "destroy", G_CALLBACK(on_close), NULL);
|
|
g_signal_connect(win, "delete-event", G_CALLBACK(on_delete), NULL);
|
|
|
|
css = gtk_css_provider_new();
|
|
gtk_css_provider_load_from_data(css, SHOGO_CSS, -1, NULL);
|
|
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
|
|
GTK_STYLE_PROVIDER(css),
|
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
g_object_unref(css);
|
|
|
|
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
|
|
add_class(vbox, "shell");
|
|
gtk_container_add(GTK_CONTAINER(win), vbox);
|
|
|
|
header = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
|
|
add_class(header, "hud-header");
|
|
gtk_box_pack_start(GTK_BOX(vbox), header, FALSE, FALSE, 0);
|
|
|
|
header_text = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
|
|
gtk_box_pack_start(GTK_BOX(header), header_text, TRUE, TRUE, 0);
|
|
|
|
title = gtk_label_new("SHOGO — MOBILE ARMOR DIVISION");
|
|
gtk_label_set_xalign(GTK_LABEL(title), 0.0);
|
|
add_class(title, "hud-title");
|
|
gtk_box_pack_start(GTK_BOX(header_text), title, FALSE, FALSE, 0);
|
|
|
|
subtitle = gtk_label_new("LICENSE AGREEMENT // LITH-SYS 98");
|
|
gtk_label_set_xalign(GTK_LABEL(subtitle), 0.0);
|
|
add_class(subtitle, "hud-subtitle");
|
|
gtk_box_pack_start(GTK_BOX(header_text), subtitle, FALSE, FALSE, 0);
|
|
|
|
mark = gtk_label_new("昇剛 ▸▸▸");
|
|
add_class(mark, "hud-mark");
|
|
gtk_box_pack_end(GTK_BOX(header), mark, FALSE, FALSE, 0);
|
|
|
|
frame = gtk_frame_new(NULL);
|
|
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
|
|
add_class(frame, "license-frame");
|
|
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
|
|
|
|
sw = gtk_scrolled_window_new(NULL, NULL);
|
|
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
|
gtk_container_add(GTK_CONTAINER(frame), sw);
|
|
|
|
label = gtk_label_new(EULA_TEXT);
|
|
gtk_label_set_xalign(GTK_LABEL(label), 0.0);
|
|
gtk_label_set_yalign(GTK_LABEL(label), 0.0);
|
|
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
|
|
gtk_label_set_line_wrap(GTK_LABEL(label), FALSE);
|
|
add_class(label, "license-text");
|
|
gtk_container_add(GTK_CONTAINER(sw), label);
|
|
|
|
status = gtk_label_new("▸ SECURE TERMINAL // REVIEW LICENSE AND SELECT AUTHORIZATION STATUS");
|
|
gtk_label_set_xalign(GTK_LABEL(status), 0.0);
|
|
add_class(status, "status-line");
|
|
gtk_box_pack_start(GTK_BOX(vbox), status, FALSE, FALSE, 0);
|
|
|
|
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
|
|
gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
b_decline = gtk_button_new_with_label("I Decline");
|
|
add_class(b_decline, "decline-button");
|
|
g_signal_connect(b_decline, "clicked", G_CALLBACK(on_decline), NULL);
|
|
gtk_box_pack_end(GTK_BOX(hbox), b_decline, FALSE, FALSE, 0);
|
|
|
|
b_accept = gtk_button_new_with_label("I Accept");
|
|
add_class(b_accept, "accept-button");
|
|
gtk_widget_set_can_default(b_accept, TRUE);
|
|
g_signal_connect(b_accept, "clicked", G_CALLBACK(on_accept), NULL);
|
|
gtk_box_pack_end(GTK_BOX(hbox), b_accept, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_grab_default(b_accept);
|
|
gtk_widget_show_all(win);
|
|
/* focus sul bottone Accept: evita la selezione automatica del testo all'apertura */
|
|
gtk_window_set_focus(GTK_WINDOW(win), b_accept);
|
|
gtk_main();
|
|
|
|
return accepted ? 0 : 1;
|
|
}
|