MCPcopy Create free account
hub / github.com/DFHack/dfhack / gui_makeAnnouncement

Function gui_makeAnnouncement

library/LuaApi.cpp:1496–1534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1494}
1495
1496static int gui_makeAnnouncement(lua_State *state)
1497{
1498 int rv; // return the index into reports vector or -1
1499 df::coord pos;
1500 int color = 0; // initialize these to prevent warning
1501 bool bright = false;
1502
1503 auto type = (df::announcement_type)lua_tointeger(state, 1);
1504 df::announcement_flags *mode = Lua::CheckDFObject<df::announcement_flags>(state, 2);
1505 Lua::CheckDFAssign(state, &pos, 3);
1506 string message = luaL_checkstring(state, 4);
1507
1508 switch (lua_gettop(state))
1509 {
1510 default:
1511 case 6:
1512 bright = lua_toboolean(state, 6);
1513 case 5:
1514 color = lua_tointeger(state, 5);
1515 case 4:
1516 break;
1517 }
1518
1519 switch (lua_gettop(state))
1520 { // Use the defaults in Gui.h
1521 default:
1522 case 6:
1523 rv = Gui::makeAnnouncement(type, *mode, pos, message, color, bright);
1524 break;
1525 case 5:
1526 rv = Gui::makeAnnouncement(type, *mode, pos, message, color);
1527 break;
1528 case 4:
1529 rv = Gui::makeAnnouncement(type, *mode, pos, message);
1530 }
1531
1532 lua_pushinteger(state, rv);
1533 return 1;
1534}
1535
1536static int gui_showAnnouncement(lua_State *state)
1537{

Callers

nothing calls this directly

Calls 4

CheckDFAssignFunction · 0.85
lua_gettopFunction · 0.85
lua_tobooleanFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected