mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 19:37:50 +00:00
Add two functions to query items from GUI1 menus.
This commit is contained in:
parent
038ac7efbb
commit
c0fcc72ff5
@ -381,6 +381,16 @@ void menu::set_inner_location(SDL_Rect const &rect)
|
||||
bg_register(rect);
|
||||
}
|
||||
|
||||
const menu::item& menu::get_item(int index) const
|
||||
{
|
||||
return items_[index];
|
||||
}
|
||||
|
||||
const menu::item& menu::get_selected_item() const
|
||||
{
|
||||
return items_[selection()];
|
||||
}
|
||||
|
||||
void menu::change_item(int pos1, int pos2,const std::string& str)
|
||||
{
|
||||
if(pos1 < 0 || pos1 >= int(item_pos_.size()) ||
|
||||
|
@ -160,6 +160,9 @@ public:
|
||||
void move_selection_keeping_viewport(size_t id);
|
||||
void reset_selection();
|
||||
|
||||
const item& get_item(int index) const;
|
||||
const item& get_selected_item() const;
|
||||
|
||||
// allows user to change_item while running (dangerous)
|
||||
void change_item(int pos1,int pos2,const std::string& str);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user