Skip to content

Commit 57613bf

Browse files
authored
add intermediate dev mode (#1367)
* add intermediate dev mode * remove logging * Move internal tools under INTERNAL_DEVELOPER_MODE * split dev tokens. remove checkbox. * internal tokens also unlock regular dev mode. * only one dev token field
1 parent f1c7243 commit 57613bf

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,12 @@ void GlobalSettings::load_json(const JsonValue& json){
281281
}
282282

283283
STATIC_GLOBALS.load_json(json);
284-
const bool developer_mode = STATIC_GLOBALS.DEVELOPER_MODE;
285284
BatchOption::load_json(json);
286285

286+
// cout << "DEVELOPER_MODE: " << STATIC_GLOBALS.DEVELOPER_MODE << endl;
287+
// cout << "INTERNAL_DEVELOPER_MODE: " << STATIC_GLOBALS.INTERNAL_DEVELOPER_MODE << endl;
288+
const bool developer_mode = STATIC_GLOBALS.DEVELOPER_MODE;
289+
287290
ConfigOptionState devmode_visibility = developer_mode
288291
? ConfigOptionState::ENABLED
289292
: ConfigOptionState::HIDDEN;

SerialPrograms/Source/CommonFramework/StaticGlobals.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ const std::set<std::string> TOKENS{
2121
"6643d9fe87b3e54dc75dfac8ac22f0cc8bd17f6a8a786debf5fc4c517ee65469",
2222
"8e48e38e49bffc8462ada9d2d9d850d5b3b5c9529d20978c09bc548bc9a614a4",
2323
"7694adee4419d62c6a923c4efc9e7b41def7b96bb84ea882701b0bf2e8c13bee",
24-
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", // jw's token.
2524
"e8d168bc482e96553ea9f9ecaea5a817474dbccc2a6a228a6bde67f2b2aa2889", // James' token.
25+
};
26+
27+
const std::set<std::string> INTERNAL_TOKENS{
28+
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", // jw's token.
2629
"7555b7c63481cad42306718c67e7f9def5bfd1da8f6cd299ccd3d7dc95f307ae", // Kuro's token.
2730
"3d475b46d121fc24559d100de2426feaa53cd6578aac2817c4857a610ccde2dd", // kichi's token.
2831
"9b41db8175b5f248a78e738c7bd63a36e33b57953cb4e80ccdd13c2a7e892eec", // Dalton's token.
@@ -47,7 +50,11 @@ void StaticGlobals::load_json(const JsonValue& json){
4750
hash.push(dev_token->c_str(), dev_token->size());
4851
hash.finish();
4952
hash.get_hash_hex();
50-
DEVELOPER_MODE = TOKENS.find(hash.get_hash_hex()) != TOKENS.end();
53+
54+
bool internal_dev = INTERNAL_TOKENS.find(hash.get_hash_hex()) != INTERNAL_TOKENS.end();
55+
bool regular_dev = TOKENS.find(hash.get_hash_hex()) != TOKENS.end();
56+
DEVELOPER_MODE = regular_dev || internal_dev;
57+
INTERNAL_DEVELOPER_MODE = internal_dev;
5158
}
5259

5360
const JsonObject* debug_obj = obj->get_object("DEBUG");

SerialPrograms/Source/CommonFramework/StaticGlobals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class StaticGlobals{
2727
public:
2828
bool NAUGHTY_MODE = false;
2929
bool DEVELOPER_MODE = false;
30+
bool INTERNAL_DEVELOPER_MODE = false;
3031

3132

3233
// Debug color stats like those in:

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Panels.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
8888
ret.emplace_back(make_single_switch_program<TestDudunsparceFormDetector_Descriptor, TestDudunsparceFormDetector>());
8989
ret.emplace_back(make_computer_program<ComputerPrograms::UnitTestRunner_Descriptor, ComputerPrograms::UnitTestRunner>());
9090
#ifdef PA_OFFICIAL
91-
add_panels(ret);
91+
if (STATIC_GLOBALS.INTERNAL_DEVELOPER_MODE){
92+
add_panels(ret);
93+
}
9294
#endif
9395
}
9496

SerialPrograms/Source/PokemonSV/PokemonSV_Panels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
171171
}
172172

173173
#ifdef PA_OFFICIAL
174-
if (STATIC_GLOBALS.DEVELOPER_MODE){
174+
if (STATIC_GLOBALS.INTERNAL_DEVELOPER_MODE){
175175
ret.emplace_back("---- Research ----");
176176
add_panels(ret);
177177
}

0 commit comments

Comments
 (0)