- [ONGOING] Treballant en que els camps d'edició funcionen millor
This commit is contained in:
@@ -16,6 +16,8 @@ namespace modules
|
||||
std::vector<std::string> gifs;
|
||||
int treeview_scroll = 0;
|
||||
|
||||
int *current_field = nullptr;
|
||||
|
||||
void init()
|
||||
{
|
||||
actor::clear(true);
|
||||
@@ -61,11 +63,18 @@ namespace modules
|
||||
const bool btn_small(const int x, const int y, int &var, int min, int max)
|
||||
{
|
||||
char buffer[100];
|
||||
if (current_field == &var) {
|
||||
ui::selected(false);
|
||||
} else {
|
||||
ui::selected(true);
|
||||
}
|
||||
const char *result=ui::spin(SDL_itoa(var, buffer, 10), x, y, 17, 11);
|
||||
ui::selected(false);
|
||||
if (result)
|
||||
{
|
||||
const int value = SDL_atoi(result);
|
||||
var=SDL_max(min, SDL_min(max, value));
|
||||
current_field = &var;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user