mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 02:23:16 +00:00
Lua GUI2 API: Add setters and getters for a slider's min and max values
This commit is contained in:
parent
40c6090c2e
commit
de08d53adc
@ -252,6 +252,26 @@ WIDGET_SETTER("value_compat,value", int, gui2::slider)
|
||||
w.set_value(value);
|
||||
}
|
||||
|
||||
WIDGET_GETTER("max_value", int, gui2::slider)
|
||||
{
|
||||
return w.get_maximum_value();
|
||||
}
|
||||
|
||||
WIDGET_SETTER("max_value", int, gui2::slider)
|
||||
{
|
||||
w.set_value_range(w.get_minimum_value(), value);
|
||||
}
|
||||
|
||||
WIDGET_GETTER("min_value", int, gui2::slider)
|
||||
{
|
||||
return w.get_minimum_value();
|
||||
}
|
||||
|
||||
WIDGET_SETTER("min_value", int, gui2::slider)
|
||||
{
|
||||
w.set_value_range(value, w.get_maximum_value());
|
||||
}
|
||||
|
||||
WIDGET_GETTER("value_compat,percentage", int, gui2::progress_bar)
|
||||
{
|
||||
return w.get_percentage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user