mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[app/code] Wipe scripts when adding one with opt
This commit is contained in:
@@ -25,6 +25,7 @@ const Image * App::Descriptor::icon() {
|
||||
App::Snapshot::Snapshot() :
|
||||
#if EPSILON_GETOPT
|
||||
m_lockOnConsole(false),
|
||||
m_hasBeenWiped(false),
|
||||
#endif
|
||||
m_scriptStore()
|
||||
{
|
||||
@@ -49,10 +50,12 @@ bool App::Snapshot::lockOnConsole() const {
|
||||
}
|
||||
|
||||
void App::Snapshot::setOpt(const char * name, const char * value) {
|
||||
if (strcmp(name, "wipe") == 0) {
|
||||
m_scriptStore.deleteAllScripts();
|
||||
}
|
||||
if (strcmp(name, "script") == 0) {
|
||||
if (!m_hasBeenWiped) {
|
||||
m_hasBeenWiped = true;
|
||||
m_scriptStore.deleteAllScripts();
|
||||
}
|
||||
|
||||
char * separator = const_cast<char *>(UTF8Helper::CodePointSearch(value, ':'));
|
||||
if (*separator == 0) {
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
private:
|
||||
#if EPSILON_GETOPT
|
||||
bool m_lockOnConsole;
|
||||
bool m_hasBeenWiped;
|
||||
#endif
|
||||
ScriptStore m_scriptStore;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user