Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ikt32 committed Jul 3, 2021
2 parents 7919ff1 + 0734e59 commit 56d7fb1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ Good luck modding!
* DireDan for the [original implementation for sudomod](https://www.unknowncheats.me/forum/grand-theft-auto-v/200692-originbase-sudomod-1-37-a.html)
* Sudomod authors
* NativeUI authors
* Unknown Modder
* alloc8or
9 changes: 9 additions & 0 deletions menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ void Menu::OptionPlusPlus(const std::vector<std::string>& extra, const std::stri
drawOptionPlusExtras(extra, title);
}

bool Menu::UInt8Option(const std::string& option, uint8_t& var, uint8_t min, uint8_t max, uint8_t step, const std::vector<std::string>& details) {
Option(option, details);
std::string printVar = std::to_string(var);
bool highlighted = currentoption == optioncount;

drawOptionValue(printVar, highlighted, max - min);
return processOptionItemControls(var, min, max, step);
}

bool Menu::IntOption(const std::string& option, int &var, int min, int max, int step, const std::vector<std::string>& details) {
Option(option, details);
std::string printVar = std::to_string(var);
Expand Down
4 changes: 4 additions & 0 deletions menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class Menu {
*/
void OptionPlusPlus(const std::vector<std::string>& extra, const std::string& title = "Info");

bool UInt8Option(const std::string& option, uint8_t& var, uint8_t min, uint8_t max, uint8_t step,
const std::vector<std::string>& details = {});

/*
* Option that changes an int value with optional custom-sized steps.
* Shows option with the value inside < > brackets.
Expand Down Expand Up @@ -248,6 +251,7 @@ class Menu {
float smoothFactor = 0.00001f;
uint16_t mRecordGlobal = 0;

float MenuWidth() const { return menuWidth; }
private:
static const unsigned maxMenus = 255;
enum class FooterType {
Expand Down

0 comments on commit 56d7fb1

Please sign in to comment.