- Els camps numèrics de l'editor ara també es poden modificar escribint

This commit is contained in:
2024-07-08 06:46:06 +02:00
parent 84618348e2
commit d4ce5ef973
3 changed files with 31 additions and 14 deletions

View File

@@ -60,11 +60,11 @@ namespace modules
const bool btn_small(const int x, const int y, int &var, int min, int max)
{
char buffer[100];
int result=0;
result=ui::spin(SDL_itoa(var, buffer, 10), x, y, 17, 11);
const char *result=ui::spin(SDL_itoa(var, buffer, 10), x, y, 17, 11);
if (result)
{
var=SDL_max(min, SDL_min(max, var+result));
const int value = SDL_atoi(result);
var=SDL_max(min, SDL_min(max, value));
return true;
}
return false;
@@ -73,12 +73,11 @@ namespace modules
const bool btn_small(const int x, const int y, int &var, int min, int max, int width)
{
char buffer[100];
int result=0;
result=ui::spin(SDL_itoa(var, buffer, 10), x, y, width, 11);
const char *result=ui::spin(SDL_itoa(var, buffer, 10), x, y, width, 11);
if (result)
{
var=SDL_max(min, SDL_min(max, var+result));
return true;
const int value = SDL_atoi(result);
var=SDL_max(min, SDL_min(max, value));
}
return false;
}