Skip to content

Commit

Permalink
--no-launchpad commandline option
Browse files Browse the repository at this point in the history
  • Loading branch information
counter185 committed Sep 10, 2024
1 parent 29f15df commit c6c8721
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
4 changes: 3 additions & 1 deletion freesprite/StartScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include "Notification.h"

void StartScreen::tick() {

if (closeNextTick) {
g_closeScreen(this);
}
}

void StartScreen::render()
Expand Down
25 changes: 18 additions & 7 deletions freesprite/StartScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class StartScreen : public BaseScreen, public EventCallbackListener

ScreenWideNavBar<StartScreen*>* navbar;

bool closeNextTick = false;

BaseTemplate* tab2templates[2] = {
new TemplateRPG2KCharset(),
new TemplateMC64x32Skin()
Expand Down Expand Up @@ -169,16 +171,25 @@ class StartScreen : public BaseScreen, public EventCallbackListener

for (std::string& arg : g_cmdlineArgs) {

//g_addNotification(Notification("", arg));
if (arg.substr(0,2) == "--") {
std::string option = arg.substr(2);
if (option == "no-launchpad") {
this->closeNextTick = true;
}
}
else {

//g_addNotification(Notification("", arg));
#if _WIDEPATHS
if (std::filesystem::exists(utf8StringToWstring(arg))) {
if (std::filesystem::exists(utf8StringToWstring(arg))) {
#else
if (std::filesystem::exists(arg)) {
if (std::filesystem::exists(arg)) {
#endif
tryLoadFile(arg);
}
else {
g_addPopup(new PopupMessageBox("", std::format("Error finding file: {}", arg)));
tryLoadFile(arg);
}
else {
g_addPopup(new PopupMessageBox("", std::format("Error finding file: {}", arg)));
}
}
}
}
Expand Down

0 comments on commit c6c8721

Please sign in to comment.