the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2using namespace std;
3class Minecraft;
4class KeyMapping;
5#include "..\Minecraft.World\File.h"
6
7class Options
8{
9public:
10 static const int AO_OFF = 0;
11 static const int AO_MIN = 1;
12 static const int AO_MAX = 2;
13
14 // 4J - this used to be an enum
15 class Option
16 {
17 public:
18 static const Option options[17];
19 static const Option *MUSIC;
20 static const Option *SOUND;
21 static const Option *INVERT_MOUSE;
22 static const Option *SENSITIVITY;
23 static const Option *RENDER_DISTANCE;
24 static const Option *VIEW_BOBBING;
25 static const Option *ANAGLYPH;
26 static const Option *ADVANCED_OPENGL;
27 static const Option *FRAMERATE_LIMIT;
28 static const Option *DIFFICULTY;
29 static const Option *GRAPHICS;
30 static const Option *AMBIENT_OCCLUSION;
31 static const Option *GUI_SCALE;
32 static const Option *FOV;
33 static const Option *GAMMA;
34 static const Option *RENDER_CLOUDS;
35 static const Option *PARTICLES;
36
37 private:
38 const bool _isProgress;
39 const bool _isBoolean;
40 const wstring captionId;
41
42 public:
43 static const Option *getItem(int id);
44
45 Option(const wstring& captionId, bool hasProgress, bool isBoolean);
46 bool isProgress() const;
47 bool isBoolean() const;
48 int getId() const;
49 wstring getCaptionId() const;
50 };
51
52private:
53 static const wstring RENDER_DISTANCE_NAMES[];
54 static const wstring DIFFICULTY_NAMES[];
55 static const wstring GUI_SCALE[];
56 static const wstring FRAMERATE_LIMITS[];
57 static const wstring PARTICLES[];
58
59public:
60 float music;
61 float sound;
62 float sensitivity;
63 bool invertYMouse;
64 int viewDistance;
65 bool bobView;
66 bool anaglyph3d;
67 bool advancedOpengl;
68 int framerateLimit;
69 bool fancyGraphics;
70 bool ambientOcclusion;
71 bool renderClouds;
72 wstring skin;
73
74 KeyMapping *keyUp;
75 KeyMapping *keyLeft;
76 KeyMapping *keyDown;
77 KeyMapping *keyRight;
78 KeyMapping *keyJump;
79 KeyMapping *keyBuild;
80 KeyMapping *keyDrop;
81 KeyMapping *keyChat;
82 KeyMapping *keySneak;
83 KeyMapping *keyAttack;
84 KeyMapping *keyUse;
85 KeyMapping *keyPlayerList;
86 KeyMapping *keyPickItem;
87 KeyMapping *keyToggleFog;
88
89 static const int keyMappings_length = 14;
90 KeyMapping *keyMappings[keyMappings_length];
91
92protected:
93 Minecraft *minecraft;
94private:
95 File optionsFile;
96
97public:
98 int difficulty;
99 bool hideGui;
100 bool thirdPersonView;
101 bool renderDebug;
102 wstring lastMpIp;
103
104 bool isFlying;
105 bool smoothCamera;
106 bool fixedCamera;
107 float flySpeed;
108 float cameraSpeed;
109 int guiScale;
110 int particles; // 0 is all, 1 is decreased and 2 is minimal
111 float fov;
112 float gamma;
113
114 void init(); // 4J added
115 Options(Minecraft *minecraft, File workingDirectory);
116 Options();
117 wstring getKeyDescription(int i);
118 wstring getKeyMessage(int i);
119 void setKey(int i, int key);
120 void set(const Options::Option *item, float value);
121 void toggle(const Options::Option *option, int dir);
122 float getProgressValue(const Options::Option *item);
123 bool getBooleanValue(const Options::Option *item);
124 wstring getMessage(const Options::Option *item);
125 void load();
126private:
127 float readFloat(wstring string);
128public:
129 void save();
130
131 bool isCloudsOn();
132};