dynamic mod menu snippets [not leechable, experienced users only]
probably wont compile in older visual studio versions, this makes use of C++14 (I believe) standards to define inline vectors
how to use this?
its quite a simple concept really
when a player presses up/down, change currentsetting
when they press left/right, change thisstatus to the previous/next index in statuses
to find that index, you can make a function similar to findsetting - but return the index of thisstatus instead, then add or subtract accordingly
to check if a setting is on/off? call findsetting, check psetting_td->thisstatus using strcmp() or similar
to render the menu, iterate over them, draw the current category if its changed since the last feature, if not, draw the feature +20 pixels or so below the last one
draw a rectangle behind all of this text as a size 200 x (features*20) or so pixels
"why is this useful you fat prick i can just use hans base"????
well, for one, thats an old laggy outdated piece of crap (no offense), its just not with todays standards.. its incredibly limited
if you add/remove/rearrange features, you have to go back and rearrange all of your indexes for checking statuses - with this you dont
this menus a lot more lightweight, a lot less laggy [less drawn items, less code back-end], more modern, etc
"gimme all teh code!!"
no fuck off this takes like 30 mins to write you lazy bitch
credits: no clue, sorta just started writing this and it worked lol
+thanks if i helped
if you have any suggestions for improving this method or i left out/forgot anything, please comment below
Code:
typedef struct {
std::string name;
std::vector<std::string> statuses;
std::string thisstatus;
std::string category;
} setting_td, *psetting_td;
std::vector<setting_td> settings = {
setting_td(),
};
int currentsetting = 0;
psetting_td findsetting(std::string name) {
for (int k = 0; (k < settings.size()); k++) {
psetting_td thissetting = &settings.at(k);
if (!strcmp((thissetting->name).c_str(), name.c_str())) {
return thissetting;
};
};
};
how to use this?
its quite a simple concept really
when a player presses up/down, change currentsetting
when they press left/right, change thisstatus to the previous/next index in statuses
to find that index, you can make a function similar to findsetting - but return the index of thisstatus instead, then add or subtract accordingly
to check if a setting is on/off? call findsetting, check psetting_td->thisstatus using strcmp() or similar
to render the menu, iterate over them, draw the current category if its changed since the last feature, if not, draw the feature +20 pixels or so below the last one
draw a rectangle behind all of this text as a size 200 x (features*20) or so pixels
"why is this useful you fat prick i can just use hans base"????
well, for one, thats an old laggy outdated piece of crap (no offense), its just not with todays standards.. its incredibly limited
if you add/remove/rearrange features, you have to go back and rearrange all of your indexes for checking statuses - with this you dont
this menus a lot more lightweight, a lot less laggy [less drawn items, less code back-end], more modern, etc
"gimme all teh code!!"
no fuck off this takes like 30 mins to write you lazy bitch
credits: no clue, sorta just started writing this and it worked lol
+thanks if i helped
if you have any suggestions for improving this method or i left out/forgot anything, please comment below