2016-03-04 23:04:53 +00:00
|
|
|
#include "logvisor/logvisor.hpp"
|
2015-08-17 05:26:58 +00:00
|
|
|
#include "CTweaks.hpp"
|
2015-08-28 00:11:31 +00:00
|
|
|
#include "CResFactory.hpp"
|
|
|
|
#include "CResLoader.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
2016-08-31 20:43:41 +00:00
|
|
|
#include "Editor/ProjectManager.hpp"
|
|
|
|
#include "Editor/ProjectResourceFactoryMP1.hpp"
|
2015-11-02 18:45:39 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp"
|
2015-08-29 01:30:47 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
2015-08-28 00:11:31 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
|
2016-08-31 20:43:41 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGunRes.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerRes.hpp"
|
2016-09-16 20:18:03 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakSlideShow.hpp"
|
2017-01-26 10:06:18 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakTargeting.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGui.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakBall.hpp"
|
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakGuiColors.hpp"
|
2017-01-27 02:58:21 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp"
|
2016-09-15 07:26:35 +00:00
|
|
|
#include "World/CPlayerCameraBob.hpp"
|
2015-08-17 05:26:58 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2015-08-27 00:23:46 +00:00
|
|
|
namespace MP1
|
|
|
|
{
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2016-03-05 00:03:41 +00:00
|
|
|
static logvisor::Module Log("MP1::CTweaks");
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2018-01-15 16:00:20 +00:00
|
|
|
void CTweaks::RegisterTweaks(hecl::CVarManager* cvarMgr)
|
2015-08-17 05:26:58 +00:00
|
|
|
{
|
2016-09-16 20:18:03 +00:00
|
|
|
std::experimental::optional<CMemoryInStream> strm;
|
2017-01-22 01:40:12 +00:00
|
|
|
const SObjectTag* tag;
|
2015-08-29 01:30:47 +00:00
|
|
|
|
2017-01-22 01:40:12 +00:00
|
|
|
/* Particle */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Particle");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakParticle = new DataSpec::DNAMP1::CTweakParticle(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakParticle->initCVars(cvarMgr);
|
2016-09-16 20:21:43 +00:00
|
|
|
|
2017-01-22 01:40:12 +00:00
|
|
|
/* Player */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Player");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2016-09-15 07:26:35 +00:00
|
|
|
g_tweakPlayer = new DataSpec::DNAMP1::CTweakPlayer(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakPlayer->initCVars(cvarMgr);
|
2015-08-29 01:30:47 +00:00
|
|
|
|
2017-01-22 01:40:12 +00:00
|
|
|
/* CameraBob */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("CameraBob");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2016-09-15 07:26:35 +00:00
|
|
|
CPlayerCameraBob::ReadTweaks(*strm);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* Ball */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Ball");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakBall = new DataSpec::DNAMP1::CTweakBall(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakBall->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* PlayerGun */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("PlayerGun");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-27 02:58:21 +00:00
|
|
|
g_tweakPlayerGun = new DataSpec::DNAMP1::CTweakPlayerGun(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakPlayerGun->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* Targeting */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Targeting");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakTargeting = new DataSpec::DNAMP1::CTweakTargeting(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakTargeting->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* Game */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Game");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-22 01:40:12 +00:00
|
|
|
g_tweakGame = new DataSpec::DNAMP1::CTweakGame(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakGame->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* GuiColors */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("GuiColors");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakGuiColors = new DataSpec::DNAMP1::CTweakGuiColors(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakGuiColors->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* AutoMapper */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("AutoMapper");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakAutoMapper = new DataSpec::DNAMP1::CTweakAutoMapper(*strm);
|
2017-04-22 06:42:32 +00:00
|
|
|
CMappableObject::ReadAutoMapperTweaks(*g_tweakAutoMapper);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakPlayerGun->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* Gui */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("Gui");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakGui = new DataSpec::DNAMP1::CTweakGui(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakPlayerGun->initCVars(cvarMgr);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* PlayerControls */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("PlayerControls");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakPlayerControl = new DataSpec::DNAMP1::CTweakPlayerControl(*strm);
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* PlayerControls2 */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("PlayerControls2");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-26 10:06:18 +00:00
|
|
|
g_tweakPlayerControlAlt = new DataSpec::DNAMP1::CTweakPlayerControl(*strm);
|
|
|
|
|
|
|
|
g_currentPlayerControl = g_tweakPlayerControl;
|
2017-01-22 01:40:12 +00:00
|
|
|
|
|
|
|
/* SlideShow */
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("SlideShow");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2017-01-22 01:40:12 +00:00
|
|
|
g_tweakSlideShow = new DataSpec::DNAMP1::CTweakSlideShow(*strm);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakSlideShow->initCVars(cvarMgr);
|
|
|
|
|
2015-08-17 05:26:58 +00:00
|
|
|
}
|
|
|
|
|
2018-01-15 16:00:20 +00:00
|
|
|
void CTweaks::RegisterResourceTweaks(hecl::CVarManager* cvarMgr)
|
2015-08-17 05:26:58 +00:00
|
|
|
{
|
2016-09-02 21:39:46 +00:00
|
|
|
std::experimental::optional<CMemoryInStream> strm;
|
|
|
|
|
2017-10-27 10:10:32 +00:00
|
|
|
const SObjectTag* tag = g_ResFactory->GetResourceIdByName("GunRes");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2016-08-31 20:43:41 +00:00
|
|
|
g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm);
|
2017-10-27 10:10:32 +00:00
|
|
|
g_tweakGunRes->ResolveResources(*g_ResFactory);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakGunRes->initCVars(cvarMgr);
|
2016-09-18 23:47:48 +00:00
|
|
|
|
2017-10-27 10:10:32 +00:00
|
|
|
tag = g_ResFactory->GetResourceIdByName("PlayerRes");
|
|
|
|
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
|
2016-08-31 20:43:41 +00:00
|
|
|
g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm);
|
2017-10-27 10:10:32 +00:00
|
|
|
g_tweakPlayerRes->ResolveResources(*g_ResFactory);
|
2018-01-15 16:00:20 +00:00
|
|
|
g_tweakPlayerRes->initCVars(cvarMgr);
|
2015-08-17 05:26:58 +00:00
|
|
|
}
|
2015-08-17 22:05:00 +00:00
|
|
|
|
|
|
|
}
|
2015-08-27 00:23:46 +00:00
|
|
|
}
|