mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-28 13:12:21 +00:00
Move UserReporter C++/JS functions from JSInterface_Debug.cpp to JSInterface_UserReport.cpp, refs #4772.
This way it stands out more as a separate feature that can be more easily exchanged, extended, maintained or conditionally removed from the build and leaves more transparent includes, refs #5257. Add missing string includes following7c2e9027c2andd6cb9c845b. Remove unused Profile include following38d6f81d71andd6cb9c845b. Remove unused CLogger include, add missing debug include followingd6cb9c845b. Remove unused CConsole include following9f0484e5ce/ D1073. Remove unused ProfilerViewer include following2af94c5898. This was SVN commit r21866.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 2018 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 0 A.D. is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "JSInterface_UserReport.h"
|
||||
|
||||
#include "ps/UserReport.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
bool JSI_UserReport::IsUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
{
|
||||
return g_UserReporter.IsReportingEnabled();
|
||||
}
|
||||
|
||||
void JSI_UserReport::SetUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool enabled)
|
||||
{
|
||||
g_UserReporter.SetReportingEnabled(enabled);
|
||||
}
|
||||
|
||||
std::string JSI_UserReport::GetUserReportStatus(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
{
|
||||
return g_UserReporter.GetStatus();
|
||||
}
|
||||
|
||||
void JSI_UserReport::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
|
||||
{
|
||||
scriptInterface.RegisterFunction<bool, &IsUserReportEnabled>("IsUserReportEnabled");
|
||||
scriptInterface.RegisterFunction<void, bool, &SetUserReportEnabled>("SetUserReportEnabled");
|
||||
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
|
||||
}
|
||||
Reference in New Issue
Block a user