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()
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config
CONFIG exports.yml
UNSAFE

View File

@ -18,190 +18,31 @@
<plane texture="tex_settings_bg">
<layout_hint adjust="1, 1" />
<box> <!-- scrollable settings -->
<layout_box adjust="1, 1" layout_type="1" />
<template_ref id="config_page_main" template="config_main"/>
<scroll_view style="_common_style_scroll_view_transparent"
w_sbar_v="vertical_scroll_bar" snap_anim_time="0">
<layout_hint adjust="1, 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> <!-- vertical scroll -->
<layout_box layout_type="1" space="40" adjust="1, 2" left_margin="20"
right_margin="20" />
<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>
<box> <!-- header text -->
<layout_box top_margin="10" />
<button style="style_save_and_launch_button" id="start_game_button"
label="msg_save_launch">
<layout_hint adjust="2, 2" />
</button>
<text style="_common_default_style_text" label="msg_lego_island_config">
<layout_hint adjust="2, 2" />
</text>
</box>
<button style="style_exit_button" id="exit_button" label="msg_exit">
<layout_hint adjust="2, 2" />
</button>
</box>
</plane>
<box> <!-- Island Texture Quality -->
<layout_box layout_type="1" adjust="2, 2" />
<text label="msg_island_texture">
<layout_hint adjust="2, 2" />
</text>
<radio_box style="_common_default_style_radio_box">
<layout_hint adjust="2, 2" />
<box>
<layout_box layout_type="2" space="15" adjust="2, 2" />
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_low">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_medium">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_high">
<layout_hint adjust="2, 2" />
</text>
</box>
</radio_box>
</box>
<box> <!-- Island Model Quality -->
<layout_box layout_type="1" />
<text label="msg_island_quality">
<layout_hint adjust="2, 2" />
</text>
<radio_box style="_common_default_style_radio_box">
<box>
<layout_box layout_type="2" space="15" />
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_texture_fast">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_texture_high">
<layout_hint adjust="2, 2" />
</text>
</box>
</radio_box>
</box>
<box> <!-- sliders -->
<layout_box layout_type="2" space="40" />
<box> <!-- Max LOD -->
<layout_box layout_type="1" space="20" />
<text label="msg_max_lod">
<layout_hint adjust="2, 2" />
</text>
<plane>
<layout_hint adjust="2, 2" />
<slidebar style="_common_default_style_slidebar" slider_label_margin="20"
slider_label_mode="1" slider_size="64, 64, 0" slider_label_pos_mode="3"
touch_mode="1" id="_sample_widget_slidebar">
<layout_hint alpha="1" align="0" size="200, 12, 0" />
</slidebar>
</plane>
</box>
<box> <!-- Max Allowed Extras -->
<layout_box layout_type="1" space="20" />
<text label="msg_max_allowed_extras">
<layout_hint adjust="2, 2" />
</text>
<plane>
<layout_hint adjust="2, 2" />
<slidebar style="_common_default_style_slidebar" slider_size="52, 52, 0"
slider_label_pos_mode="3" touch_mode="1" id="_sample_widget_slidebar">
<layout_hint alpha="1" align="0" size="200, 12, 0" />
</slidebar>
</plane>
</box>
</box>
<box> <!-- checkboxes -->
<layout_box layout_type="1" space="20" align="1, 0" anchor="1, 0" />
<box> <!-- 3d sound -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_3d_sound">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- music -->
<layout_box layout_type="2" space="10" align="1" anchor="2" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_music">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- wide view angle -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_wide_view_angle">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- texture loader -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_texture_loader">
<layout_hint adjust="2, 2" />
</text>
</box>
</box>
<plane style="_common_style_plane_transparent"> <!-- spacing for buttons on bottom -->
<layout_hint size="0, 70" adjust="1, 0" />
</plane>
</box>
<scrollbar style="_common_default_style_scrollbar" id="vertical_scroll_bar"
scroll_type="0">
<layout_hint size="5, 0" />
</scrollbar>
</scroll_view>
</box>
<plane style="_common_style_plane_transparent">
<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">
@ -229,6 +70,180 @@
</pagetable>
<templatetable>
<template id="config_main">
<scroll_view style="_common_style_scroll_view_transparent"
w_sbar_v="vertical_scroll_bar" snap_anim_time="0">
<layout_hint adjust="1, 1" align="0, 1" anchor="0, 1"/>
<box> <!-- vertical scroll -->
<layout_box layout_type="1" space="40" adjust="1, 2" left_margin="20" right_margin="20"/>
<plane style="_common_style_plane_transparent"> <!-- spacing for tabs on top -->
<layout_hint size="0, 60" adjust="1, 0" />
</plane>
<box> <!-- Island Texture Quality -->
<layout_box layout_type="1" space="25"/>
<text label="msg_island_texture">
<layout_hint adjust="2, 2" />
</text>
<radio_box style="_common_default_style_radio_box">
<layout_hint adjust="2, 2" />
<box>
<layout_box layout_type="2" space="15" adjust="2, 2" />
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_low">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_medium">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_quality_high">
<layout_hint adjust="2, 2" />
</text>
</box>
</radio_box>
</box>
<box> <!-- Island Model Quality -->
<layout_box layout_type="1" space="25"/>
<text label="msg_island_quality">
<layout_hint adjust="2, 2" />
</text>
<radio_box style="_common_default_style_radio_box">
<box>
<layout_box layout_type="2" space="15" />
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_texture_fast">
<layout_hint adjust="2, 2" />
</text>
<radio_button style="_common_default_style_radio_button">
<layout_hint size="44, 44" />
</radio_button>
<text label="msg_texture_high">
<layout_hint adjust="2, 2" />
</text>
</box>
</radio_box>
</box>
<box> <!-- sliders -->
<layout_box layout_type="2" space="40" />
<box> <!-- Max LOD -->
<layout_box layout_type="1" space="20" />
<text label="msg_max_lod">
<layout_hint adjust="2, 2" />
</text>
<plane>
<layout_hint adjust="2, 2" />
<slidebar style="_common_default_style_slidebar" slider_label_margin="20"
slider_label_mode="1" slider_size="64, 64, 0" slider_label_pos_mode="3"
touch_mode="1" id="_sample_widget_slidebar">
<layout_hint alpha="1" align="0" size="200, 12, 0" />
</slidebar>
</plane>
</box>
<box> <!-- Max Allowed Extras -->
<layout_box layout_type="1" space="20" />
<text label="msg_max_allowed_extras">
<layout_hint adjust="2, 2" />
</text>
<plane>
<layout_hint adjust="2, 2" />
<slidebar style="_common_default_style_slidebar" slider_size="52, 52, 0"
slider_label_pos_mode="3" touch_mode="1" id="_sample_widget_slidebar">
<layout_hint alpha="1" align="0" size="200, 12, 0" />
</slidebar>
</plane>
</box>
</box>
<box> <!-- checkboxes -->
<layout_box layout_type="1" space="20" align="1, 0" anchor="1, 0" />
<box> <!-- 3d sound -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_3d_sound">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- music -->
<layout_box layout_type="2" space="10" align="1" anchor="2" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_music">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- wide view angle -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_wide_view_angle">
<layout_hint adjust="2, 2" />
</text>
</box>
<box> <!-- texture loader -->
<layout_box layout_type="2" space="10" align="1" anchor="1" />
<check_box style="_common_style_check_box_scalable">
<layout_hint size="40, 40, 0" />
</check_box>
<text label="msg_texture_loader">
<layout_hint adjust="2, 2" />
</text>
</box>
</box>
<plane style="_common_style_plane_transparent"> <!-- spacing for buttons on bottom -->
<layout_hint size="0, 60" adjust="1, 0" />
</plane>
</box>
<scrollbar style="_common_default_style_scrollbar" id="vertical_scroll_bar"
scroll_type="0">
<layout_hint size="5, 0" />
</scrollbar>
</scroll_view>
</template>
</templatetable>
<styletable>
@ -236,9 +251,8 @@
<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_save_and_launch_button">
<planeobj color="0, 0.9, 0.5, 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"
id="text_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" id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button>
@ -247,17 +261,15 @@
label_obj="text_obj1" bg_obj="plane_obj1" adjust_min_size="170, 54"
id="style_save_and_exit_button">
<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"
id="text_obj1" />
<textobj font_size="20" color="1, 1, 1, 1" align_x="1" align_y="1" adjust_x="1" adjust_y="1" id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button>
<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">
<planeobj color="0.9, 0.5, 0.0, 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"
id="text_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" id="text_obj1" />
<planeobj color="1, 1, 1, 1" texture0="_common_texture_button" id="plane_obj2" />
<planeobj texture0="_common_texture_button_glow" blend="2" id="plane_obj3" />
</style_button>

View File

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

View File

@ -3,53 +3,68 @@
#include <paf.h>
// clang-format on
#include <psp2/kernel/clib.h>
#include <psp2/kernel/modulemgr.h>
#include <psp2/kernel/processmgr.h>
#include <psp2/sysmodule.h>
paf::Framework* g_fw;
paf::ui::Scene* g_rootPage;
char sceUserMainThreadName[] = "isle_config";
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;
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");
return sce_paf_free(ptr);
}
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;
fwParam.mode = paf::Framework::Mode_Normal;
int load_res;
ScePafInit init_param;
SceSysmoduleOpt sysmodule_opt;
paf::Framework* paf_fw = new paf::Framework(fwParam);
if (paf_fw != NULL) {
g_fw = paf_fw;
init_param.global_heap_size = 0x1000000;
init_param.a2 = 0xEA60;
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;
pluginParam.name = "config_plugin";
pluginParam.caller_name = "__main__";
pluginParam.resource_file = "app0:/config_plugin.rco";
pluginParam.init_func = NULL;
pluginParam.start_func = loadPluginCB;
pluginParam.stop_func = NULL;
pluginParam.exit_func = NULL;
paf::Plugin::LoadSync(pluginParam);
paf_fw->Run();
int res = sceSysmoduleLoadModuleInternalWithArg(
SCE_SYSMODULE_INTERNAL_PAF,
sizeof(init_param),
&init_param,
&sysmodule_opt
);
if ((res | load_res) != 0) {
sceClibPrintf(
"[PAF PRX Loader] Failed to load the PAF prx. (return value 0x%x, result code 0x%x )\n",
res,
load_res
);
}
sceClibPrintf("[SAMPLE] Failed to run PAF instance\n");
paf_main();
exit(0);
return 0;
return SCE_KERNEL_START_SUCCESS;
}
extern "C" void _start()
{
module_start(0, nullptr);
}