| 1639 | } |
| 1640 | |
| 1641 | static int gui_showAutoAnnouncement(lua_State *state) |
| 1642 | { |
| 1643 | df::coord pos; |
| 1644 | int color = 0; |
| 1645 | bool bright = false; |
| 1646 | df::unit *unit_a = NULL, *unit_d = NULL; |
| 1647 | |
| 1648 | auto type = (df::announcement_type)lua_tointeger(state, 1); |
| 1649 | Lua::CheckDFAssign(state, &pos, 2); |
| 1650 | string message = luaL_checkstring(state, 3); |
| 1651 | |
| 1652 | switch (lua_gettop(state)) |
| 1653 | { |
| 1654 | default: |
| 1655 | case 7: |
| 1656 | unit_d = Lua::CheckDFObject<df::unit>(state, 7); |
| 1657 | case 6: |
| 1658 | unit_a = Lua::CheckDFObject<df::unit>(state, 6); |
| 1659 | case 5: |
| 1660 | bright = lua_toboolean(state, 5); |
| 1661 | case 4: |
| 1662 | color = lua_tointeger(state, 4); |
| 1663 | case 3: |
| 1664 | break; |
| 1665 | } |
| 1666 | |
| 1667 | switch (lua_gettop(state)) |
| 1668 | { // Use the defaults in Gui.h |
| 1669 | default: |
| 1670 | case 7: |
| 1671 | Gui::showAutoAnnouncement(type, pos, message, color, bright, unit_a, unit_d); |
| 1672 | break; |
| 1673 | case 6: |
| 1674 | Gui::showAutoAnnouncement(type, pos, message, color, bright, unit_a); |
| 1675 | break; |
| 1676 | case 5: |
| 1677 | Gui::showAutoAnnouncement(type, pos, message, color, bright); |
| 1678 | break; |
| 1679 | case 4: |
| 1680 | Gui::showAutoAnnouncement(type, pos, message, color); |
| 1681 | break; |
| 1682 | case 3: |
| 1683 | Gui::showAutoAnnouncement(type, pos, message); |
| 1684 | } |
| 1685 | |
| 1686 | return 1; |
| 1687 | } |
| 1688 | |
| 1689 | static int gui_autoDFAnnouncement(lua_State *state) |
| 1690 | { |
nothing calls this directly
no test coverage detected