mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Add writeable configuration.
This commit is contained in:
@@ -209,6 +209,18 @@ std::vector<std::string> AppPlatform_windows::getOptionStrings()
|
||||
return o;
|
||||
}
|
||||
|
||||
void AppPlatform_windows::setOptionStrings(const std::vector<std::string>& str)
|
||||
{
|
||||
assert(str.size() % 2 == 0);
|
||||
|
||||
std::ofstream os("options.txt");
|
||||
|
||||
os << "#Config file for Minecraft PE. The # at the start denotes a comment, removing it makes it a command.\n\n";
|
||||
|
||||
for (int i = 0; i < int(str.size()); i += 2)
|
||||
os << str[i] << '|' << str[i + 1] << '\n';
|
||||
}
|
||||
|
||||
void AppPlatform_windows::setScreenSize(int width, int height)
|
||||
{
|
||||
m_ScreenWidth = width;
|
||||
|
||||
@@ -47,6 +47,9 @@ public:
|
||||
// Also add these to allow proper text input within the game.
|
||||
bool shiftPressed() override;
|
||||
void setShiftPressed(bool b);
|
||||
|
||||
// Also add these to allow saving options.
|
||||
void setOptionStrings(const std::vector <std::string>& str) override;
|
||||
|
||||
void setScreenSize(int width, int height);
|
||||
|
||||
|
||||
@@ -276,6 +276,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
|
||||
}
|
||||
|
||||
_cleanup:
|
||||
g_pApp->saveOptions();
|
||||
|
||||
// disable OpenGL for the window
|
||||
DisableOpenGL(hWnd, hDC, hRC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user