MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Game_Save

Method Game_Save

Source/Fodder.cpp:9489–9519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9487}
9488
9489void cFodder::Game_Save() {
9490 mInput.clear();
9491 mGUI_Select_File_String_Input_Callback = 0;
9492 mSurface->clearBuffer();
9493
9494 GUI_Element_Reset();
9495
9496 GUI_Render_Text_Centred("TYPE A SAVE NAME IN", 0x32);
9497
9498 GUI_Button_Draw("EXIT", 0xA0);
9499 GUI_Button_Setup(&cFodder::GUI_Button_Load_Exit);
9500
9501 mGUI_Select_File_String_Input_Callback = &cFodder::String_Input_Print;
9502 GUI_Select_File_Loop(true);
9503 mGUI_Select_File_String_Input_Callback = 0;
9504
9505 if (mGUI_SaveLoadAction != 2) {
9506 mGUI_SaveLoadAction = 1;
9507 return;
9508 }
9509
9510 {
9511 std::string Filename = g_ResourceMan->GetSaveNewName();
9512 std::ofstream outfile(Filename, std::ofstream::binary);
9513 outfile << mGame_Data.ToJson(mInput);
9514 outfile.close();
9515 }
9516
9517 g_ResourceMan->refresh();
9518 mMouse_Exit_Loop = false;
9519}
9520
9521void cFodder::String_Input_Print(int16 pPosY) {
9522 GUI_Input_CheckKey();

Callers

nothing calls this directly

Calls 6

clearBufferMethod · 0.80
GetSaveNewNameMethod · 0.80
closeMethod · 0.80
refreshMethod · 0.80
clearMethod · 0.45
ToJsonMethod · 0.45

Tested by

no test coverage detected