Add script hook onNewTurn to the end of AfterSwitchHedgehog. This should signal the very start of a new turn, immediately after CurrentTeam is switched.
#include <QApplication>
#include "mainform.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyWindow *mainWin = new MyWindow;
mainWin->show();
return app.exec();
}