- Els camps numèrics de l'editor ara també es poden modificar escribint
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user