예제 #1
0
파일: LuaApi.cpp 프로젝트: Elvang/dfhack
int Lua::PushPosXYZ(lua_State *state, df::coord pos)
{
    if (!pos.isValid())
    {
        lua_pushnil(state);
        return 1;
    }
    else
    {
        lua_pushinteger(state, pos.x);
        lua_pushinteger(state, pos.y);
        lua_pushinteger(state, pos.z);
        return 3;
    }
}
예제 #2
0
파일: Gui.cpp 프로젝트: Reag/dfhack
void Gui::showAutoAnnouncement(
    df::announcement_type type, df::coord pos, std::string message, int color, bool bright
) {
    using df::global::announcements;

    df::announcement_flags flags;
    if (is_valid_enum_item(type) && announcements)
        flags = announcements->flags[type];

    doShowAnnouncement(type, pos, message, color, bright);

    if (flags.bits.DO_MEGA || flags.bits.PAUSE || flags.bits.RECENTER)
    {
        resetDwarfmodeView(flags.bits.DO_MEGA || flags.bits.PAUSE);

        if (flags.bits.RECENTER && pos.isValid())
            revealInDwarfmodeMap(pos, true);
    }

    if (flags.bits.DO_MEGA)
        showPopupAnnouncement(message, color, bright);
}