mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-04-26 01:59:55 -05:00
Applet mode warning + disable drive/browser to prevent crash
This commit is contained in:
parent
83228a2911
commit
6f8393483f
Binary file not shown.
|
|
@ -99,4 +99,5 @@ namespace data
|
|||
SDL_Texture *getTitleIconByTID(const uint64_t& tid);
|
||||
int getTitleIndexInUser(const data::user& u, const uint64_t& tid);
|
||||
extern SetLanguage sysLang;
|
||||
|
||||
}
|
||||
|
|
|
|||
4
inc/ui.h
4
inc/ui.h
|
|
@ -48,7 +48,6 @@ namespace ui
|
|||
inline uint64_t padKeysDown() { return padGetButtonsDown(&pad); }
|
||||
inline uint64_t padKeysHeld() { return padGetButtons(&pad); }
|
||||
inline uint64_t padKeysUp() { return padGetButtonsUp(&pad); }
|
||||
inline void touchGetXY(uint32_t *x, uint32_t *y) { *x = touchState.touches[0].x; *y = touchState.touches[0].y; }
|
||||
|
||||
inline void changeState(int newState)
|
||||
{
|
||||
|
|
@ -87,6 +86,9 @@ namespace ui
|
|||
void init();
|
||||
void exit();
|
||||
|
||||
//Inits HID
|
||||
void hidInit();
|
||||
|
||||
//Adds a panel pointer to a vector since they need to be drawn over everything else
|
||||
int registerMenu(ui::menu *m);
|
||||
int registerPanel(ui::slideOutPanel *sop);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ namespace util
|
|||
{
|
||||
return t > 30 && t < 127;
|
||||
}
|
||||
|
||||
std::string safeString(const std::string& s);
|
||||
|
||||
std::string getStringInput(SwkbdType _type, const std::string& def, const std::string& head, size_t maxLength, unsigned dictCnt, const std::string dictWords[]);
|
||||
|
|
@ -147,5 +148,11 @@ namespace util
|
|||
void sysBoost();
|
||||
void sysNormal();
|
||||
|
||||
inline bool isApplet()
|
||||
{
|
||||
AppletType type = appletGetAppletType();
|
||||
return type == AppletType_LibraryApplet;
|
||||
}
|
||||
|
||||
void checkForUpdate(void *a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@ int main(int argc, const char *argv[])
|
|||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
//Drive needs config read
|
||||
fs::driveInit();
|
||||
|
||||
if(!util::isApplet())
|
||||
fs::driveInit();
|
||||
else
|
||||
ui::showMessage(ui::getUICString("appletModeWarning", 0));
|
||||
|
||||
while(ui::runApp()){ }
|
||||
|
||||
fs::driveExit();
|
||||
|
|
|
|||
10
src/ui.cpp
10
src/ui.cpp
|
|
@ -137,13 +137,9 @@ void ui::init()
|
|||
break;
|
||||
}
|
||||
|
||||
//setup pad
|
||||
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
|
||||
padInitializeDefault(&ui::pad);
|
||||
|
||||
//Setup touch
|
||||
hidInitializeTouchScreen();
|
||||
|
||||
ui::usrInit();
|
||||
ui::ttlInit();
|
||||
ui::settInit();
|
||||
|
|
@ -217,7 +213,11 @@ void ui::drawUI()
|
|||
gfx::drawLine(NULL, &divClr, 30, 88, 1250, 88);
|
||||
gfx::drawLine(NULL, &divClr, 30, 648, 1250, 648);
|
||||
gfx::texDraw(NULL, icn, 66, 27);
|
||||
gfx::drawTextf(NULL, 24, 130, 38, &ui::txtCont, "JKSV");
|
||||
|
||||
if(util::isApplet())
|
||||
gfx::drawTextf(NULL, 24, 130, 38, &ui::txtCont, "JKSV *APPLET MODE*");
|
||||
else
|
||||
gfx::drawTextf(NULL, 24, 130, 38, &ui::txtCont, "JKSV");
|
||||
|
||||
//Version / translation author
|
||||
gfx::drawTextf(NULL, 12, 8, 700, &ui::txtCont, "v. %02d.%02d.%04d", BLD_MON, BLD_DAY, BLD_YEAR);
|
||||
|
|
|
|||
|
|
@ -314,6 +314,8 @@ void ui::initStrings()
|
|||
addUIString("debugStatus", 2, "Current Title: ");
|
||||
addUIString("debugStatus", 3, "Safe Title: ");
|
||||
addUIString("debugStatus", 4, "Sort Type: ");
|
||||
|
||||
addUIString("appletModeWarning", 0, "*WARNING*: You are running JKSV in applet mode. Certain functions may not work.");
|
||||
}
|
||||
|
||||
void ui::loadTrans()
|
||||
|
|
@ -335,6 +337,7 @@ void ui::loadTrans()
|
|||
util::replaceButtonsInString(ui::strings[std::make_pair("dialogYes", 0)]);
|
||||
util::replaceButtonsInString(ui::strings[std::make_pair("dialogNo", 0)]);
|
||||
util::replaceButtonsInString(ui::strings[std::make_pair("dialogOK", 0)]);
|
||||
util::replaceButtonsInString(ui::strings[std::make_pair("appletModeWarning", 0)]);
|
||||
}
|
||||
|
||||
void ui::saveTranslationFiles(void *a)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user