Skip to content

Commit 785f6d4

Browse files
committed
Implimented BusyIndicator, bugfixes & improvements
1 parent 3431885 commit 785f6d4

12 files changed

Lines changed: 69 additions & 16 deletions

File tree

QuickMenuReborn.emd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ Library: QuickMenuReborn function: QuickMenuRebornSetWidgetTextureBase nidvalue:
3939
Library: QuickMenuReborn function: QuickMenuRebornCloseMenu nidvalue: 0xCD66AED8
4040
Library: QuickMenuReborn function: QuickMenuRebornRegisterWidgetFromStyle nidvalue: 0xC236CE22
4141
Library: QuickMenuReborn function: QuickMenuRebornRegisterWidgetFromStyleHash nidvalue: 0x7538EB34
42+
Library: QuickMenuReborn function: QuickMenuRebornAssignOnDeleteHandler nidvalue: 0x3F667364

QuickMenuReborn.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ modules:
3636
QuickMenuRebornCloseMenu: 0xCD66AED8
3737
QuickMenuRebornRegisterWidgetFromStyle: 0xC236CE22
3838
QuickMenuRebornRegisterWidgetFromStyleHash: 0x7538EB34
39+
QuickMenuRebornAssignOnDeleteHandler: 0x3F667364

exporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"QuickMenuRebornSetWidgetTextureBase",
3838
"QuickMenuRebornCloseMenu",
3939
"QuickMenuRebornRegisterWidgetFromStyle",
40-
"QuickMenuRebornRegisterWidgetFromStyleHash"
40+
"QuickMenuRebornRegisterWidgetFromStyleHash",
41+
"QuickMenuRebornAssignOnDeleteHandler",
42+
"QuickMenuRebornStartBusyIndicator",
43+
"QuickMenuRebornStopBusyIndicator"
4144
]
4245

4346
def getHash(string):

resource/src/qmr_plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<progressbar_touch style="slidebar_style" id="qmr_slidebar" />
3131
</template>
3232

33-
<template fast_open="1" id="busyindicator_template">
33+
<template fast_open="1" id="qmr_busyindicator_template">
3434
<busyindicator id="qmr_busyindicator" style="base_style_busyindicator" texture="_common_texture_busy" />
3535
</template>
3636

sample_plugin/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int module_start()
7575

7676
//Get our checkboxes saved state
7777
int ret = QuickMenuRebornGetCheckboxValue(CHECKBOX_REF_ID);
78-
resetOnExit = ret == CONFIG_MGR_ERROR_NOT_EXIST ? false : ret;
78+
resetOnExit = ret == QMR_CONFIG_MGR_ERROR_NOT_EXIST ? false : ret;
7979

8080
QuickMenuRebornRegisterWidget(TEXT_ID, NULL, text);
8181
QuickMenuRebornSetWidgetSize(TEXT_ID, SCE_PLANE_WIDTH, 50, 0, 0);

src/quickmenureborn/c_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef enum
3131
plane,
3232
slidebar,
3333
progressbar_touch,
34+
busyindicator,
3435
} QMRWidgetType;
3536

3637
typedef enum

src/quickmenureborn/qm_reborn.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
//Height of SCE separator planes
3131
#define SCE_SEPARATOR_HEIGHT 20.0f
3232

33-
#define CONFIG_MGR_ERROR_NOT_EXIST -1
34-
#define CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL -2
35-
#define CONFIG_MGR_OK 0
33+
#define QMR_CONFIG_MGR_ERROR_NOT_EXIST -1
34+
#define QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL -2
35+
#define QMR_CONFIG_MGR_OK 0
3636

3737
#define QMR_BUTTON_RELEASE_ID 0x10000008
3838
#define QMR_BUTTON_PRESS_ID 0x10000003
@@ -69,6 +69,7 @@ int QuickMenuRebornGetCheckboxValue(const char *refID);
6969
int QuickMenuRebornAssignRecallHandler(VoidCallback callback, const char *refID);
7070
int QuickMenuRebornAssignSaveHandler(VoidCallback callback, const char *refID);
7171
int QuickMenuRebornAssignOnLoadHandler(VoidCallback callback, const char *refID);
72+
int QuickMenuRebornAssignOnDeleteHandler(VoidCallback callback, const char *refID);
7273

7374
int QuickMenuRebornAssignDefaultCheckBoxSave(const char *refID);
7475
int QuickMenuRebornAssignDefaultCheckBoxRecall(const char *refID);
@@ -90,6 +91,9 @@ int QuickMenuRebornSetWidgetTextureBase(const char *refID, const char *textureID
9091

9192
int QuickMenuRebornCloseMenu();
9293

94+
int QuickMenuRebornStartBusyIndicator(const char *refID);
95+
int QuickMenuRebornStopBusyIndicator(const char *refID);
96+
9397
#ifdef __cplusplus
9498
}
9599
#endif

src/user/common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ extern bool displayed;
2424
#define PLANE_TEMPLATE_ID "qmr_plane_template"
2525
#define SLIDEBAR_TEMPLATE_ID "qmr_slidebar_template"
2626
#define PROGRESSBAR_TOUCH_TEMPLATE_ID "qmr_progressbar_touch_template"
27+
#define BUSYINDICATOR_TEMPLATE_ID "qmr_busyindicator_template"
2728

2829
#endif

src/user/config_mgr.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ int writeIntToFile(const char *path, int val)
2424
SceUID file = sceIoOpen(path, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
2525
int ret = sceIoWrite(file, &val, sizeof(val));
2626
sceIoClose(file);
27-
return ret == sizeof(int) ? CONFIG_MGR_OK : CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
27+
return ret == sizeof(int) ? QMR_CONFIG_MGR_OK : QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
2828
}
2929

3030
int writeFloatToFile(const char *path, float val)
3131
{
3232
SceUID file = sceIoOpen(path, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
3333
int ret = sceIoWrite(file, &val, sizeof(val));
3434
sceIoClose(file);
35-
return ret == sizeof(float) ? CONFIG_MGR_OK : CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
35+
return ret == sizeof(float) ? QMR_CONFIG_MGR_OK : QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
3636
}
3737

3838
int preSetup()
@@ -61,7 +61,7 @@ int readCheckBoxState(const char *refID)
6161

6262
sce_paf_snprintf(key, 0x400, CHECKBOX_SAVE_DIR "%s", refID);
6363

64-
if(!checkFileExist(key)) return CONFIG_MGR_ERROR_NOT_EXIST;
64+
if(!checkFileExist(key)) return QMR_CONFIG_MGR_ERROR_NOT_EXIST;
6565

6666
ret = readIntFromFile(key);
6767

@@ -70,7 +70,7 @@ int readCheckBoxState(const char *refID)
7070

7171
int saveCheckBoxState(const char *refID, int val)
7272
{
73-
int ret = CONFIG_MGR_OK;
73+
int ret = QMR_CONFIG_MGR_OK;
7474
if(ret = preSetup(), ret < 0) return ret;
7575

7676
char key[0x400] = {0};
@@ -83,7 +83,7 @@ int saveCheckBoxState(const char *refID, int val)
8383

8484
int saveSlidebarState(const char *refId, SceFloat32 val)
8585
{
86-
int ret = CONFIG_MGR_OK;
86+
int ret = QMR_CONFIG_MGR_OK;
8787
if(ret = preSetup(), ret < 0)
8888
{
8989
print("preSetup() Failed!\n");
@@ -106,7 +106,7 @@ SceFloat32 getSlidebarValue(const char *refID)
106106

107107
sce_paf_snprintf(key, 0x400, SLIDEBAR_SAVE_DIR "%s", refID);
108108

109-
if(!checkFileExist(key)) return CONFIG_MGR_ERROR_NOT_EXIST;
109+
if(!checkFileExist(key)) return QMR_CONFIG_MGR_ERROR_NOT_EXIST;
110110

111111
return readFloatFromFile(key);
112112
}

src/user/default_handlers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void defaultCheckBoxRecall(const char *refID)
2727
if(data == NULL) return;
2828

2929
int state = readCheckBoxState(refID);
30-
if(state == CONFIG_MGR_ERROR_NOT_EXIST) return;
30+
if(state == QMR_CONFIG_MGR_ERROR_NOT_EXIST) return;
3131

3232
((CheckBox *)data->widget)->SetChecked(0, state, 0);
3333
}
@@ -38,7 +38,7 @@ void defaultSliderRecall(const char *refID)
3838
if(data == NULL) return;
3939

4040
SceFloat32 state = getSlidebarValue(refID);
41-
if(state == CONFIG_MGR_ERROR_NOT_EXIST) return;
41+
if(state == QMR_CONFIG_MGR_ERROR_NOT_EXIST) return;
4242

4343
((ProgressBarTouch *)data->widget)->SetProgress(state, 0, 0);
4444
}

0 commit comments

Comments
 (0)