more of the layout for config

This commit is contained in:
olebeck 2025-07-17 16:40:09 +02:00
parent bc96276c45
commit 9a9346c83d
4 changed files with 284 additions and 276 deletions

View File

@ -42,7 +42,6 @@ target_link_libraries(isle-config PRIVATE
) )
block() block()
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config vita_create_self(isle-config.self isle-config
CONFIG exports.yml CONFIG exports.yml
UNSAFE UNSAFE

View File

@ -18,28 +18,72 @@
<plane texture="tex_settings_bg"> <plane texture="tex_settings_bg">
<layout_hint adjust="1, 1" /> <layout_hint adjust="1, 1" />
<box> <!-- scrollable settings --> <template_ref id="config_page_main" template="config_main"/>
<layout_box adjust="1, 1" layout_type="1" />
<plane id="top_buttons" style="_common_style_plane_transparent"> <!-- top buttons -->
<layout_hint adjust="1, 0" size="0, 75" anchor="0, 2" align="0, 2" />
<box style="_common_default_style_box">
<layout_box space="20" layout_type="2" />
<button style="style_save_and_exit_button" id="save_exit_button"
label="msg_save_exit">
<layout_hint adjust="2, 2" />
</button>
<button style="style_save_and_launch_button" id="start_game_button"
label="msg_save_launch">
<layout_hint adjust="2, 2" />
</button>
<button style="style_exit_button" id="exit_button" label="msg_exit">
<layout_hint adjust="2, 2" />
</button>
</box>
</plane>
<plane id="bottom_buttons" style="_common_style_plane_transparent"> <!-- bottom buttons -->
<layout_hint adjust="1, 0" size="0, 75" anchor="0, 1" align="0, 1" />
<box style="_common_default_style_box">
<layout_box space="20" layout_type="2" />
<button style="style_save_and_exit_button" id="save_exit_button"
label="msg_save_exit">
<layout_hint adjust="2, 2" />
</button>
<button style="style_save_and_launch_button" id="start_game_button"
label="msg_save_launch">
<layout_hint adjust="2, 2" />
</button>
<button style="style_exit_button" id="exit_button" label="msg_exit">
<layout_hint adjust="2, 2" />
</button>
</box>
</plane>
</plane>
</box>
</plane>
</page>
</pagetable>
<templatetable>
<template id="config_main">
<scroll_view style="_common_style_scroll_view_transparent" <scroll_view style="_common_style_scroll_view_transparent"
w_sbar_v="vertical_scroll_bar" snap_anim_time="0"> w_sbar_v="vertical_scroll_bar" snap_anim_time="0">
<layout_hint adjust="1, 1" /> <layout_hint adjust="1, 1" align="0, 1" anchor="0, 1"/>
<box> <!-- vertical scroll --> <box> <!-- vertical scroll -->
<layout_box layout_type="1" space="40" adjust="1, 2" left_margin="20" <layout_box layout_type="1" space="40" adjust="1, 2" left_margin="20" right_margin="20"/>
right_margin="20" />
<plane style="_common_style_plane_transparent"> <!-- spacing for tabs on top -->
<box> <!-- header text --> <layout_hint size="0, 60" adjust="1, 0" />
<layout_box top_margin="10" /> </plane>
<text style="_common_default_style_text" label="msg_lego_island_config">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- Island Texture Quality --> <box> <!-- Island Texture Quality -->
<layout_box layout_type="1" adjust="2, 2" /> <layout_box layout_type="1" space="25"/>
<text label="msg_island_texture"> <text label="msg_island_texture">
<layout_hint adjust="2, 2" /> <layout_hint adjust="2, 2" />
@ -74,7 +118,7 @@
</box> </box>
<box> <!-- Island Model Quality --> <box> <!-- Island Model Quality -->
<layout_box layout_type="1" /> <layout_box layout_type="1" space="25"/>
<text label="msg_island_quality"> <text label="msg_island_quality">
<layout_hint adjust="2, 2" /> <layout_hint adjust="2, 2" />
@ -190,7 +234,7 @@
</box> </box>
<plane style="_common_style_plane_transparent"> <!-- spacing for buttons on bottom --> <plane style="_common_style_plane_transparent"> <!-- spacing for buttons on bottom -->
<layout_hint size="0, 70" adjust="1, 0" /> <layout_hint size="0, 60" adjust="1, 0" />
</plane> </plane>
</box> </box>
@ -199,36 +243,7 @@
<layout_hint size="5, 0" /> <layout_hint size="5, 0" />
</scrollbar> </scrollbar>
</scroll_view> </scroll_view>
</box> </template>
<plane style="_common_style_plane_transparent">
<layout_hint adjust="1, 0" size="0, 75" anchor="0, 1" align="0, 1" />
<box style="_common_default_style_box">
<layout_box space="20" layout_type="2" />
<button style="style_save_and_exit_button" id="save_exit_button"
label="msg_save_exit">
<layout_hint adjust="2, 2" />
</button>
<button style="style_save_and_launch_button" id="start_game_button"
label="msg_save_launch">
<layout_hint adjust="2, 2" />
</button>
<button style="style_exit_button" id="exit_button" label="msg_exit">
<layout_hint adjust="2, 2" />
</button>
</box>
</plane>
</plane>
</box>
</plane>
</page>
</pagetable>
<templatetable>
</templatetable> </templatetable>
<styletable> <styletable>
@ -236,9 +251,8 @@
<style_button glow_obj="plane_obj3" color="1, 1, 1, 1" highlight_obj="plane_obj2" <style_button glow_obj="plane_obj3" color="1, 1, 1, 1" highlight_obj="plane_obj2"
label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54" label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54"
id="style_save_and_launch_button"> id="style_save_and_launch_button">
<planeobj color="0, 0.9, 0.5, 1" texture0="_common_texture_button_white" id="plane_obj1" /> <planeobj color="0.09, 0.81, 0.39, 1" texture0="_common_texture_button_white" id="plane_obj1" />
<textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" <textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" id="text_obj1" />
id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" /> <planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" /> <planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button> </style_button>
@ -247,17 +261,15 @@
label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54" label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54"
id="style_save_and_exit_button"> id="style_save_and_exit_button">
<planeobj color="0, 0.5, 0.9, 1" texture0="_common_texture_button_white" id="plane_obj1" /> <planeobj color="0, 0.5, 0.9, 1" texture0="_common_texture_button_white" id="plane_obj1" />
<textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" <textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" id="text_obj1" />
id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" /> <planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" /> <planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button> </style_button>
<style_button glow_obj="plane_obj3" color="1, 1, 1, 1" highlight_obj="plane_obj2" <style_button glow_obj="plane_obj3" color="1, 1, 1, 1" highlight_obj="plane_obj2"
label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54" id="style_exit_button"> label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54" id="style_exit_button">
<planeobj color="0.9, 0.5, 0.0, 1" texture0="_common_texture_button_white" id="plane_obj1" /> <planeobj color="0.96, 0.32, 0.25, 1" texture0="_common_texture_button_white" id="plane_obj1" />
<textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" <textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" id="text_obj1" />
id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" /> <planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" /> <planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button> </style_button>

View File

@ -3,68 +3,50 @@
#include <paf.h> #include <paf.h>
// clang-format on // clang-format on
#include <psp2/kernel/clib.h> #include <psp2/kernel/clib.h>
#include <psp2/kernel/modulemgr.h>
#include <psp2/kernel/processmgr.h>
#include <psp2/sysmodule.h>
char sceUserMainThreadName[] = "paf_sample"; paf::Framework* g_fw;
int sceUserMainThreadPriority = 0x10000100; paf::ui::Scene* g_rootPage;
int sceUserMainThreadCpuAffinityMask = 0x70000;
SceSize sceUserMainThreadStackSize = 0x4000;
void operator delete(void* ptr, unsigned int n) void loadPluginCB(paf::Plugin* plugin)
{ {
return sce_paf_free(ptr); paf::Plugin::PageOpenParam pageOpenParam;
pageOpenParam.option = paf::Plugin::PageOption_None;
plugin->SetLocale(Locale_EN);
paf::ui::Scene* pScene = plugin->PageOpen("page_main", pageOpenParam);
g_rootPage = pScene;
pScene->FindChild("top_buttons")->Hide();
} }
int paf_main(void); int paf_main(void)
typedef struct _ScePafInit { // size is 0x18
SceSize global_heap_size;
int a2;
int a3;
int cdlg_mode;
int heap_opt_param1;
int heap_opt_param2;
} ScePafInit;
extern "C" int module_start(SceSize args, void* argp)
{ {
int load_res; paf::Framework::InitParam fwParam;
ScePafInit init_param; fwParam.mode = paf::Framework::Mode_Normal;
SceSysmoduleOpt sysmodule_opt;
init_param.global_heap_size = 0x1000000; paf::Framework* paf_fw = new paf::Framework(fwParam);
init_param.a2 = 0xEA60; if (paf_fw != NULL) {
init_param.a3 = 0x40000; g_fw = paf_fw;
init_param.cdlg_mode = 0;
init_param.heap_opt_param1 = 0;
init_param.heap_opt_param2 = 0;
load_res = 0xDEADBEEF; paf_fw->LoadCommonResourceSync();
sysmodule_opt.flags = 0;
sysmodule_opt.result = &load_res;
int res = sceSysmoduleLoadModuleInternalWithArg( paf::Plugin::InitParam pluginParam;
SCE_SYSMODULE_INTERNAL_PAF,
sizeof(init_param), pluginParam.name = "config_plugin";
&init_param, pluginParam.caller_name = "__main__";
&sysmodule_opt pluginParam.resource_file = "app0:/config_plugin.rco";
); pluginParam.init_func = NULL;
if ((res | load_res) != 0) { pluginParam.start_func = loadPluginCB;
sceClibPrintf( pluginParam.stop_func = NULL;
"[PAF PRX Loader] Failed to load the PAF prx. (return value 0x%x, result code 0x%x )\n", pluginParam.exit_func = NULL;
res,
load_res paf::Plugin::LoadSync(pluginParam);
); paf_fw->Run();
} }
paf_main(); sceClibPrintf("[SAMPLE] Failed to run PAF instance\n");
return SCE_KERNEL_START_SUCCESS; exit(0);
} return 0;
extern "C" void _start()
{
module_start(0, nullptr);
} }

View File

@ -3,53 +3,68 @@
#include <paf.h> #include <paf.h>
// clang-format on // clang-format on
#include <psp2/kernel/clib.h> #include <psp2/kernel/clib.h>
#include <psp2/kernel/modulemgr.h>
#include <psp2/kernel/processmgr.h>
#include <psp2/sysmodule.h>
paf::Framework* g_fw; char sceUserMainThreadName[] = "isle_config";
paf::ui::Scene* g_rootPage; int sceUserMainThreadPriority = 0x10000100;
int sceUserMainThreadCpuAffinityMask = 0x70000;
SceSize sceUserMainThreadStackSize = 0x4000;
void loadPluginCB(paf::Plugin* plugin) void operator delete(void* ptr, unsigned int n)
{ {
paf::Plugin::PageOpenParam pageOpenParam; return sce_paf_free(ptr);
pageOpenParam.option = paf::Plugin::PageOption_None;
plugin->SetLocale(Locale_EN);
paf::ui::Scene* pScene = plugin->PageOpen("page_main", pageOpenParam);
g_rootPage = pScene;
pScene->SetDebugMode(paf::ui::Scene::DEBUG_AUTH_LAYOUT_RULER);
// paf::ui::Widget* pText = (paf::ui::Text*) pScene->FindChild("title_text");
// pText->SetString(L"Test Text");
} }
int paf_main(void) int paf_main(void);
typedef struct _ScePafInit { // size is 0x18
SceSize global_heap_size;
int a2;
int a3;
int cdlg_mode;
int heap_opt_param1;
int heap_opt_param2;
} ScePafInit;
extern "C" int module_start(SceSize args, void* argp)
{ {
paf::Framework::InitParam fwParam; int load_res;
fwParam.mode = paf::Framework::Mode_Normal; ScePafInit init_param;
SceSysmoduleOpt sysmodule_opt;
paf::Framework* paf_fw = new paf::Framework(fwParam); init_param.global_heap_size = 0x1000000;
if (paf_fw != NULL) { init_param.a2 = 0xEA60;
g_fw = paf_fw; init_param.a3 = 0x40000;
init_param.cdlg_mode = 0;
init_param.heap_opt_param1 = 0;
init_param.heap_opt_param2 = 0;
paf_fw->LoadCommonResourceSync(); load_res = 0xDEADBEEF;
sysmodule_opt.flags = 0;
sysmodule_opt.result = &load_res;
paf::Plugin::InitParam pluginParam; int res = sceSysmoduleLoadModuleInternalWithArg(
SCE_SYSMODULE_INTERNAL_PAF,
pluginParam.name = "config_plugin"; sizeof(init_param),
pluginParam.caller_name = "__main__"; &init_param,
pluginParam.resource_file = "app0:/config_plugin.rco"; &sysmodule_opt
pluginParam.init_func = NULL; );
pluginParam.start_func = loadPluginCB; if ((res | load_res) != 0) {
pluginParam.stop_func = NULL; sceClibPrintf(
pluginParam.exit_func = NULL; "[PAF PRX Loader] Failed to load the PAF prx. (return value 0x%x, result code 0x%x )\n",
res,
paf::Plugin::LoadSync(pluginParam); load_res
paf_fw->Run(); );
} }
sceClibPrintf("[SAMPLE] Failed to run PAF instance\n"); paf_main();
exit(0); return SCE_KERNEL_START_SUCCESS;
return 0; }
extern "C" void _start()
{
module_start(0, nullptr);
} }