From e221cd716d74e63d1f27ddedd598f23b0fce611d Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 26 May 2011 22:04:59 +0200 Subject: unitmenu: add method to add a unit (bzr r10232) --- src/ui/widget/unit-menu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/widget/unit-menu.cpp') diff --git a/src/ui/widget/unit-menu.cpp b/src/ui/widget/unit-menu.cpp index 5c68f7196..362f5d90f 100644 --- a/src/ui/widget/unit-menu.cpp +++ b/src/ui/widget/unit-menu.cpp @@ -67,6 +67,14 @@ UnitMenu::resetUnitType(UnitType unit_type) return setUnitType(unit_type); } +/** Adds a unit, possibly user-defined, to the menu. */ +void +UnitMenu::addUnit(Unit const& u) +{ + _unit_table.addUnit(u, false); + append_text(u.abbr); +} + /** Returns the Unit object corresponding to the current selection in the dropdown widget */ Unit -- cgit v1.2.3