This software is open source software licensed under GPL3, as found in the COPYING file.
You can follow Noggit's development and get the latest build here: https://discord.gg/UbdFHyM
Noggit can be scripted using the Lua (5.1) programming language. See the scripting documentation.
This project requires CMake to be built. It also requires the following libraries:
Further following libraries are required for MySQL GUID Storage builds:
The following libraries are automatically installed:
Text in <brackets>
below are up to your choice but shall be replaced
with the same choice every time the same text is contained.
Any recent version of Microsoft Visual C++ should work. Be sure to remember which version you chose as later on you will have to pick corresponding versions for other dependencies.
Any recent CMake version >= 3.18 should work. Just take the latest.
Install boost to <boost-install>
. The easiest is to download a pre-built
package from https://sourceforge.net/projects/boost/files/boost-binaries/.
Install Qt5 to <Qt-install>
The recommended Qt version for noggit is 5.9, which can be downloaded from https://download.qt.io/archive/qt/5.9/5.9.9/qt-opensource-windows-x86-5.9.9.exe.
If you want to try a newer version, you can download the online installer from https://www.qt.io/download-open-source/#section-2.
Note that during installation you only need one version of Qt and also only one compiler version. If download size is noticably large (more than a few hundred MB), you're probably downloading way too much.
_(Not necessary if disabling NOGGIT_WITH_SCRIPTING
)_
<Lua-install>
using git: git clone https://luajit.org/git/luajit.git
<Lua-install>/src
(with the visual studio command prompt)=== Successfully built LuaJIT for Windows/x64 ===
CMAKE_PREFIX_PATH
(path) to "<Qt-install>"
,
e.g. "C:/Qt/5.6/msvc2015"
BOOST_ROOT
(path) to <boost-install>
, e.g. "C:/local/boost_1_71_0"
BOOST_ROOT/lib
so that CMake finds them automatically or
set BOOST_LIBRARYDIR
to where your lib are (.dll and .lib). Again, this
is highly unlikely to be required.CMAKE_INSTALL_PREFIX
(path) to an empty destination, e.g.
"C:/Users/blurb/Documents/noggitinstall
LUA_INCLUDE_DIR
to <Lua-install>/src
LUA_LIBRARY
to <Lua-install>/src/lua51.lib
To launch noggit you will need the following DLLs from Qt loadable. Install
them in the system, or copy them from C:/Qt/X.X/msvcXXXX/bin
into the
directory containing noggit.exe, i.e. CMAKE_INSTALL_PREFIX
configured.
release: Qt5Core, Qt5OpenGL, Qt5Widgets, Qt5Gui
debug: Qt5Cored, Qt5OpenGLd, Qt5Widgetsd, Qt5Guid
If using scripting, you will also need to copy <Lua-install>/src/lua51.dll
to CMAKE_INSTALL_PREFIX
These instructions assume a working directory <Linux-Build>
, for example /home/myuser/
On Ubuntu you can install the building requirements using:
sudo apt install freeglut3-dev libboost-all-dev qt5-default libsdl2-dev libbz2-dev
From <Linux-Build>
, build luajit using:
git clone https://luajit.org/git/luajit.git
cd luajit
make
sudo make install
cd ..
<Linux-Build>/luajit
should now exist.
From <Linux-Build>
, clone Noggit3 (change repo as needed):
git clone https://github.com/wowdev/noggit3
<Linux-Build>/noggit3
should now exist.
From <Linux-Build>
, compile and build using the following commands.
Note that <Linux-Build>
should be written as the full path in the commands below.
For example: cmake -DLUA_LIBRARIES=/home/myuser/luajit/src/libluajit.so -DLUA_INCLUDE_DIR=/home/myuser/luajit/src ../noggit3
mkdir build
cd build
cmake -DLUA_LIBRARIES=<Linux-Build>/luajit/src/libluajit.so -DLUA_INCLUDE_DIR=<Linux-Build>/luajit/src ../noggit3
make -j $(nproc)
Instead of make -j $(nproc)
you may want to pick a bigger number than
$(nproc)
, e.g. the number of CPU cores * 1.5
.
From <Linux-Build>/build
, if the build pass correctly without errors, you can install the default lua scripts using:
cp -r ../noggit3/scripts ./bin/scripts
You can now go into <Linux-Build>/build/bin
and run noggit.
Note that make install
will probably not work.
To generate the scripting API documentation, install any new version of Node.js and run:
npm i -g typedoc@0.20.28 typedoc-plugin-markdown@3.5.0 typescript@4.0
Then, enter the "scripting" directory in this repository and run the following commands:
typedoc --disableSources --plugin typedoc-plugin-markdown --hideBreadcrumbs --out docs/api global.d.ts
rm docs/api/README.md
Feel free to ask the owner of the official repository (https://github.com/wowdev/noggit3) for write access or fork and post a pull request.
There is a bug tracker at https://github.com/wowdev/noggit3/issues which should be used.
Discord, as linked above, may be used for communication.
Following is an example for file src/noggit/ui/foo_ban.hpp
. .cpp
files
are similar.
// This file is part of Noggit3, licensed under GNU General Public License (version 3).
//! \note Include guard shall be using #pragma once
#pragma once
//! \note Use fully qualified paths rather than "../relative". Order
//! includes with own first, then external dependencies, then c++ STL.
#include <noggit/bar.hpp>
//! \note Namespaces equal directories. (java style packages.)
namespace noggit
{
namespace ui
{
//! \note Lower case, underscore separated.
class foo_ban : public QWidget
{
Q_OBJECT;
public:
//! \note Long parameter list. Would be more than 80 chars.
//! chars. Break with comma in front. Use spaces to be
//! aligned below the braces.
foo_ban ( type name
, type_2 const& name_2
, type const& name3
)
: QWidget (nullptr)
//! \note Prefer initialization lists over assignment.
, _var (std::move (name))
{}
//! \note Use const where possible. No space between name and
//! braces when no arguments are given.
void render() const;
//! \note If you really need getters and setters, your design
//! might be broken. Please avoid them or consider just a
//! public data member, or use proper methods with semantics.
type const& var() const
{
return _var;
}
void var (type var_)
{
_var = std::move (var_);
}
//! \note Prefer const where possible. If you need to copy,
//! just take a `T`. Otherwise prefer taking a `T const&`.
//! Don't bother when it comes to tiny types.
baz_type count_some_numbers ( std::size_t begin
, std::size_t end
) const
{
bazs_type bazs;
//! \note Prefer construction over assignment. Prefer
//! preincrement.
for (size_t it (begin); it != end; ++it)
{
bazs.emplace_back (it);
}
//! \note Prefer STL algorithms over hand written code.
assert (!bazs.empty());
auto const smallest
(std::min_element (bazs.begin(), bazs.end()));
return *smallest;
}
private:
//! \note Member variables are prefixed with an underscore.
type _var;
//! \note Typedef when using complex types. Fully qualify
//! types.
using baz_type = type_2;
using bazs_type = std::vector<baz_type>;
bazs_type _bazs;
}
}
}