| 9487 | } |
| 9488 | |
| 9489 | void 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 | |
| 9521 | void cFodder::String_Input_Print(int16 pPosY) { |
| 9522 | GUI_Input_CheckKey(); |
nothing calls this directly
no test coverage detected