diff --git a/QuickMenuReborn.emd b/QuickMenuReborn.emd
index 0740927..07f20c2 100644
--- a/QuickMenuReborn.emd
+++ b/QuickMenuReborn.emd
@@ -39,3 +39,4 @@ Library: QuickMenuReborn function: QuickMenuRebornSetWidgetTextureBase nidvalue:
Library: QuickMenuReborn function: QuickMenuRebornCloseMenu nidvalue: 0xCD66AED8
Library: QuickMenuReborn function: QuickMenuRebornRegisterWidgetFromStyle nidvalue: 0xC236CE22
Library: QuickMenuReborn function: QuickMenuRebornRegisterWidgetFromStyleHash nidvalue: 0x7538EB34
+Library: QuickMenuReborn function: QuickMenuRebornAssignOnDeleteHandler nidvalue: 0x3F667364
diff --git a/QuickMenuReborn.yml b/QuickMenuReborn.yml
index 30b352e..76164e3 100644
--- a/QuickMenuReborn.yml
+++ b/QuickMenuReborn.yml
@@ -36,3 +36,4 @@ modules:
QuickMenuRebornCloseMenu: 0xCD66AED8
QuickMenuRebornRegisterWidgetFromStyle: 0xC236CE22
QuickMenuRebornRegisterWidgetFromStyleHash: 0x7538EB34
+ QuickMenuRebornAssignOnDeleteHandler: 0x3F667364
diff --git a/exporter.py b/exporter.py
index e73a756..7f11245 100644
--- a/exporter.py
+++ b/exporter.py
@@ -37,7 +37,10 @@
"QuickMenuRebornSetWidgetTextureBase",
"QuickMenuRebornCloseMenu",
"QuickMenuRebornRegisterWidgetFromStyle",
- "QuickMenuRebornRegisterWidgetFromStyleHash"
+ "QuickMenuRebornRegisterWidgetFromStyleHash",
+ "QuickMenuRebornAssignOnDeleteHandler",
+ "QuickMenuRebornStartBusyIndicator",
+ "QuickMenuRebornStopBusyIndicator"
]
def getHash(string):
diff --git a/resource/src/qmr_plugin.xml b/resource/src/qmr_plugin.xml
index cab5252..d3955a5 100644
--- a/resource/src/qmr_plugin.xml
+++ b/resource/src/qmr_plugin.xml
@@ -30,7 +30,7 @@
-
+
diff --git a/sample_plugin/src/main.c b/sample_plugin/src/main.c
index 749d83b..5eb4582 100644
--- a/sample_plugin/src/main.c
+++ b/sample_plugin/src/main.c
@@ -75,7 +75,7 @@ int module_start()
//Get our checkboxes saved state
int ret = QuickMenuRebornGetCheckboxValue(CHECKBOX_REF_ID);
- resetOnExit = ret == CONFIG_MGR_ERROR_NOT_EXIST ? false : ret;
+ resetOnExit = ret == QMR_CONFIG_MGR_ERROR_NOT_EXIST ? false : ret;
QuickMenuRebornRegisterWidget(TEXT_ID, NULL, text);
QuickMenuRebornSetWidgetSize(TEXT_ID, SCE_PLANE_WIDTH, 50, 0, 0);
diff --git a/src/quickmenureborn/c_types.h b/src/quickmenureborn/c_types.h
index 0559b07..79ea6b9 100644
--- a/src/quickmenureborn/c_types.h
+++ b/src/quickmenureborn/c_types.h
@@ -31,6 +31,7 @@ typedef enum
plane,
slidebar,
progressbar_touch,
+ busyindicator,
} QMRWidgetType;
typedef enum
diff --git a/src/quickmenureborn/qm_reborn.h b/src/quickmenureborn/qm_reborn.h
index 25d1577..b122c39 100644
--- a/src/quickmenureborn/qm_reborn.h
+++ b/src/quickmenureborn/qm_reborn.h
@@ -30,9 +30,9 @@
//Height of SCE separator planes
#define SCE_SEPARATOR_HEIGHT 20.0f
-#define CONFIG_MGR_ERROR_NOT_EXIST -1
-#define CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL -2
-#define CONFIG_MGR_OK 0
+#define QMR_CONFIG_MGR_ERROR_NOT_EXIST -1
+#define QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL -2
+#define QMR_CONFIG_MGR_OK 0
#define QMR_BUTTON_RELEASE_ID 0x10000008
#define QMR_BUTTON_PRESS_ID 0x10000003
@@ -69,6 +69,7 @@ int QuickMenuRebornGetCheckboxValue(const char *refID);
int QuickMenuRebornAssignRecallHandler(VoidCallback callback, const char *refID);
int QuickMenuRebornAssignSaveHandler(VoidCallback callback, const char *refID);
int QuickMenuRebornAssignOnLoadHandler(VoidCallback callback, const char *refID);
+int QuickMenuRebornAssignOnDeleteHandler(VoidCallback callback, const char *refID);
int QuickMenuRebornAssignDefaultCheckBoxSave(const char *refID);
int QuickMenuRebornAssignDefaultCheckBoxRecall(const char *refID);
@@ -90,6 +91,9 @@ int QuickMenuRebornSetWidgetTextureBase(const char *refID, const char *textureID
int QuickMenuRebornCloseMenu();
+int QuickMenuRebornStartBusyIndicator(const char *refID);
+int QuickMenuRebornStopBusyIndicator(const char *refID);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/user/common.hpp b/src/user/common.hpp
index 724f766..2de2c38 100644
--- a/src/user/common.hpp
+++ b/src/user/common.hpp
@@ -24,5 +24,6 @@ extern bool displayed;
#define PLANE_TEMPLATE_ID "qmr_plane_template"
#define SLIDEBAR_TEMPLATE_ID "qmr_slidebar_template"
#define PROGRESSBAR_TOUCH_TEMPLATE_ID "qmr_progressbar_touch_template"
+#define BUSYINDICATOR_TEMPLATE_ID "qmr_busyindicator_template"
#endif
\ No newline at end of file
diff --git a/src/user/config_mgr.cpp b/src/user/config_mgr.cpp
index 8742eca..061f41e 100644
--- a/src/user/config_mgr.cpp
+++ b/src/user/config_mgr.cpp
@@ -24,7 +24,7 @@ int writeIntToFile(const char *path, int val)
SceUID file = sceIoOpen(path, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
int ret = sceIoWrite(file, &val, sizeof(val));
sceIoClose(file);
- return ret == sizeof(int) ? CONFIG_MGR_OK : CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
+ return ret == sizeof(int) ? QMR_CONFIG_MGR_OK : QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
}
int writeFloatToFile(const char *path, float val)
@@ -32,7 +32,7 @@ int writeFloatToFile(const char *path, float val)
SceUID file = sceIoOpen(path, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
int ret = sceIoWrite(file, &val, sizeof(val));
sceIoClose(file);
- return ret == sizeof(float) ? CONFIG_MGR_OK : CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
+ return ret == sizeof(float) ? QMR_CONFIG_MGR_OK : QMR_CONFIG_MGR_ERROR_COULD_NOT_WRITE_FULL;
}
int preSetup()
@@ -61,7 +61,7 @@ int readCheckBoxState(const char *refID)
sce_paf_snprintf(key, 0x400, CHECKBOX_SAVE_DIR "%s", refID);
- if(!checkFileExist(key)) return CONFIG_MGR_ERROR_NOT_EXIST;
+ if(!checkFileExist(key)) return QMR_CONFIG_MGR_ERROR_NOT_EXIST;
ret = readIntFromFile(key);
@@ -70,7 +70,7 @@ int readCheckBoxState(const char *refID)
int saveCheckBoxState(const char *refID, int val)
{
- int ret = CONFIG_MGR_OK;
+ int ret = QMR_CONFIG_MGR_OK;
if(ret = preSetup(), ret < 0) return ret;
char key[0x400] = {0};
@@ -83,7 +83,7 @@ int saveCheckBoxState(const char *refID, int val)
int saveSlidebarState(const char *refId, SceFloat32 val)
{
- int ret = CONFIG_MGR_OK;
+ int ret = QMR_CONFIG_MGR_OK;
if(ret = preSetup(), ret < 0)
{
print("preSetup() Failed!\n");
@@ -106,7 +106,7 @@ SceFloat32 getSlidebarValue(const char *refID)
sce_paf_snprintf(key, 0x400, SLIDEBAR_SAVE_DIR "%s", refID);
- if(!checkFileExist(key)) return CONFIG_MGR_ERROR_NOT_EXIST;
+ if(!checkFileExist(key)) return QMR_CONFIG_MGR_ERROR_NOT_EXIST;
return readFloatFromFile(key);
}
\ No newline at end of file
diff --git a/src/user/default_handlers.cpp b/src/user/default_handlers.cpp
index c95d4ff..43cc986 100644
--- a/src/user/default_handlers.cpp
+++ b/src/user/default_handlers.cpp
@@ -27,7 +27,7 @@ void defaultCheckBoxRecall(const char *refID)
if(data == NULL) return;
int state = readCheckBoxState(refID);
- if(state == CONFIG_MGR_ERROR_NOT_EXIST) return;
+ if(state == QMR_CONFIG_MGR_ERROR_NOT_EXIST) return;
((CheckBox *)data->widget)->SetChecked(0, state, 0);
}
@@ -38,7 +38,7 @@ void defaultSliderRecall(const char *refID)
if(data == NULL) return;
SceFloat32 state = getSlidebarValue(refID);
- if(state == CONFIG_MGR_ERROR_NOT_EXIST) return;
+ if(state == QMR_CONFIG_MGR_ERROR_NOT_EXIST) return;
((ProgressBarTouch *)data->widget)->SetProgress(state, 0, 0);
}
\ No newline at end of file
diff --git a/src/user/export_handler.cpp b/src/user/export_handler.cpp
index 6442512..bb7b30d 100644
--- a/src/user/export_handler.cpp
+++ b/src/user/export_handler.cpp
@@ -202,7 +202,7 @@ int QuickMenuRebornRemoveSeparator(const char *id)
sce_paf_snprintf(rID, sizeof(rID), "qmr_sep_%s_internal", id);
- QMR::UnregisterWidget(rID);
+ return QMR::UnregisterWidget(rID);
}
@@ -274,7 +274,7 @@ int QuickMenuRebornSetSlidebarValue(const char *refID, float val)
int QuickMenuRebornSaveSlidebarValue(const char *refID, float val)
{
- saveSlidebarState(refID, val);
+ return saveSlidebarState(refID, val);
}
int QuickMenuRebornSetCheckBoxState(const char *refID, int state)
@@ -356,4 +356,36 @@ widgetData *QuickMenuRebornRegisterWidgetFromStyleHash(const char *id, const cha
dat.advancedData.useHash = true;
return QMR::RegisterWidget(&dat);
+}
+
+int QuickMenuRebornAssignOnDeleteHandler(VoidCallback callback, const char *refID)
+{
+ widgetData *data = currentWidgets.GetNode(refID);
+
+ if(data == NULL)
+ return -1;
+
+ data->OnDelete = callback;
+}
+
+int QuickMenuRebornStartBusyIndicator(const char *refID)
+{
+ widgetData *data = currentWidgets.GetNode(refID);
+
+ if(data == NULL)
+ return -1;
+
+ ((BusyIndicator *)data->widget)->Start();
+ return 0;
+}
+
+int QuickMenuRebornStopBusyIndicator(const char *refID)
+{
+ widgetData *data = currentWidgets.GetNode(refID);
+
+ if(data == NULL)
+ return -1;
+
+ ((BusyIndicator *)data->widget)->Stop();
+ return 0;
}
\ No newline at end of file
diff --git a/src/user/widgets.cpp b/src/user/widgets.cpp
index 3c3f7a8..a8cc23b 100644
--- a/src/user/widgets.cpp
+++ b/src/user/widgets.cpp
@@ -29,6 +29,7 @@ const char *widgetTemplateID[] = //THESE ARE IN ORDER TO MATCH WITH THE ENUM
PLANE_TEMPLATE_ID,
SLIDEBAR_TEMPLATE_ID,
PROGRESSBAR_TOUCH_TEMPLATE_ID,
+ BUSYINDICATOR_TEMPLATE_ID
};
static bool addedTask = false;
@@ -56,6 +57,15 @@ SceVoid OnQuickMenuClose()
n->texture = SCE_NULL;
n = n->next;
}
+
+
+ node *widget = currentWidgets.head;
+ while(widget != NULL)
+ {
+ if(widget->widget.OnDelete != NULL)
+ widget->widget.OnDelete(widget->widget.refId);
+ widget = widget->next;
+ }
}
SceVoid onPluginReady(Plugin *plugin)