Files
mcpe/source/client/common/Options.hpp
iProgramInCpp 9a24abc603 Improve Survival Mode + others (#56)
* * Undo some of the changes done in the "* Work on survival mode." commit.
* TEST_SURVIVAL_MODE is now on by default.

* * Dying no longer crashes the game.

* * Death seems to work ok.

* * Improve some of the damage code.

* x

* work

* Fixed the Makefile (#54)

* * Finally fix the crack texture appearing to flicker/restart

* * Add VS2010 as an optional target.

Fix build with VS2010 (both windows_vs and xenon_vs).

* * Disable survival mode. Getting ready to merge now!

---------

Co-authored-by: Alexander Argentakis <38327951+MFDGaming@users.noreply.github.com>
2023-08-16 22:32:09 +03:00

119 lines
2.3 KiB
C++

/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
#include <stdint.h>
#include <string>
#include <vector>
class Options
{
public:
struct Option;
struct KeyBind;
public:
Options();
void initDefaultValues();
void load();
void save();
std::string getMessage(const Options::Option&);
void update(const std::vector<std::string>& string);
std::vector<std::string> getOptionStrings();
public:
static bool readBool(const std::string& str);
static int readInt(const std::string& str);
static std::string saveBool(bool b);
static std::string saveInt(int i);
public:
enum KeyBindIndex
{
FORWARD,
LEFT,
BACK,
RIGHT,
JUMP,
INVENTORY,
DROP,
CHAT,
FOG,
SNEAK,
DESTROY,
PLACE,
MENU_NEXT,
MENU_PREVIOUS,
MENU_OK,
MENU_CANCEL,
};
struct KeyBind {
std::string key;
int value;
KeyBind() {}
KeyBind(const char* keyName, int keyCode) : key(keyName), value(keyCode) {}
};
struct Option
{
bool field_0;
bool field_1;
std::string str;
int field_1C;
Option(int i, const std::string& str, bool b1, bool b2) : field_0(b1), field_1(b2), str(str), field_1C(i) {}
static Option MUSIC;
static Option SOUND;
static Option INVERT_MOUSE;
static Option SENSITIVITY;
static Option RENDER_DISTANCE;
static Option VIEW_BOBBING;
static Option ANAGLYPH;
static Option LIMIT_FRAMERATE;
static Option DIFFICULTY;
static Option GRAPHICS;
static Option AMBIENT_OCCLUSION;
static Option GUI_SCALE;
};
public:
float field_0;
float m_fMasterVolume;
float field_8;
bool m_bInvertMouse;
int m_iViewDistance;
bool m_bViewBobbing;
bool m_bAnaglyphs;
uint8_t field_16;
bool m_bFancyGraphics;
bool m_bAmbientOcclusion;
uint8_t field_19;
std::string field_1C;
KeyBind m_keyBinds[16];
int field_238;
uint8_t field_23C;
bool m_bThirdPerson;
uint8_t field_23E;
bool m_bFlyCheat;
uint8_t field_240;
uint8_t field_241;
float field_244;
float field_248;
int field_24C;
std::string m_playerName;
bool m_bServerVisibleDefault;
bool m_bAutoJump;
bool m_bDebugText;
};