Updated build procedure
This commit is contained in:
parent
4992dda543
commit
aa9d2d3170
File diff suppressed because one or more lines are too long
BIN
_build/build.cmd
(Stored with Git LFS)
BIN
_build/build.cmd
(Stored with Git LFS)
Binary file not shown.
@ -5,7 +5,6 @@ Enderal - Forgotten Stories.ini
|
|||||||
E - Update.bsa
|
E - Update.bsa
|
||||||
Interface\controls\pc\controlmap.txt
|
Interface\controls\pc\controlmap.txt
|
||||||
Interface\dialoguemenu.swf
|
Interface\dialoguemenu.swf
|
||||||
Interface\exported\hudmenu.gfx
|
|
||||||
Interface\exported\widgets\skyui\followerpanel.swf
|
Interface\exported\widgets\skyui\followerpanel.swf
|
||||||
Interface\fontconfig.txt
|
Interface\fontconfig.txt
|
||||||
Interface\fonts_en2.swf
|
Interface\fonts_en2.swf
|
||||||
@ -22,9 +21,7 @@ Interface\translate_japanese.txt
|
|||||||
Interface\translate_korean.txt
|
Interface\translate_korean.txt
|
||||||
Interface\translate_russian.txt
|
Interface\translate_russian.txt
|
||||||
Interface\translate_spanish.txt
|
Interface\translate_spanish.txt
|
||||||
Interface\translations\skyui_se_chinese.txt
|
|
||||||
Interface\translations\skyui_se_japanese.txt
|
Interface\translations\skyui_se_japanese.txt
|
||||||
Interface\translations\skyui_se_korean.txt
|
|
||||||
meshes\terrain\Vyn\vyn.32.-5.9.btr
|
meshes\terrain\Vyn\vyn.32.-5.9.btr
|
||||||
Scripts\Game.pex
|
Scripts\Game.pex
|
||||||
Scripts\SKI_FavoritesManager.pex
|
Scripts\SKI_FavoritesManager.pex
|
||||||
@ -32,61 +29,8 @@ Scripts\SKI_ConfigMenu.pex
|
|||||||
SKSE\Plugins\FlatMapMarkersSSE.json
|
SKSE\Plugins\FlatMapMarkersSSE.json
|
||||||
SKSE\Plugins\fs.dll
|
SKSE\Plugins\fs.dll
|
||||||
SKSE\Plugins\version-1-5-97-0.bin
|
SKSE\Plugins\version-1-5-97-0.bin
|
||||||
|
SKSE\Plugins\versionlib-1-6-323-0.bin
|
||||||
SKSE\SKSE.ini
|
SKSE\SKSE.ini
|
||||||
Strings\enderal - forgotten stories_chinese.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_chinese.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_chinese.strings
|
|
||||||
Strings\enderal - forgotten stories_english.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_english.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_english.strings
|
|
||||||
Strings\enderal - forgotten stories_french.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_french.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_french.strings
|
|
||||||
Strings\enderal - forgotten stories_german.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_german.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_german.strings
|
|
||||||
Strings\enderal - forgotten stories_italian.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_italian.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_italian.strings
|
|
||||||
Strings\enderal - forgotten stories_japanese.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_japanese.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_japanese.strings
|
|
||||||
Strings\enderal - forgotten stories_korean.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_korean.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_korean.strings
|
|
||||||
Strings\enderal - forgotten stories_russian.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_russian.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_russian.strings
|
|
||||||
Strings\enderal - forgotten stories_spanish.dlstrings
|
|
||||||
Strings\enderal - forgotten stories_spanish.ilstrings
|
|
||||||
Strings\enderal - forgotten stories_spanish.strings
|
|
||||||
Strings\skyrim_chinese.dlstrings
|
|
||||||
Strings\skyrim_chinese.ilstrings
|
|
||||||
Strings\skyrim_chinese.strings
|
|
||||||
Strings\skyrim_english.dlstrings
|
|
||||||
Strings\skyrim_english.ilstrings
|
|
||||||
Strings\skyrim_english.strings
|
|
||||||
Strings\skyrim_french.dlstrings
|
|
||||||
Strings\skyrim_french.ilstrings
|
|
||||||
Strings\skyrim_french.strings
|
|
||||||
Strings\skyrim_german.dlstrings
|
|
||||||
Strings\skyrim_german.ilstrings
|
|
||||||
Strings\skyrim_german.strings
|
|
||||||
Strings\skyrim_italian.dlstrings
|
|
||||||
Strings\skyrim_italian.ilstrings
|
|
||||||
Strings\skyrim_italian.strings
|
|
||||||
Strings\skyrim_japanese.dlstrings
|
|
||||||
Strings\skyrim_japanese.ilstrings
|
|
||||||
Strings\skyrim_japanese.strings
|
|
||||||
Strings\skyrim_korean.dlstrings
|
|
||||||
Strings\skyrim_korean.ilstrings
|
|
||||||
Strings\skyrim_korean.strings
|
|
||||||
Strings\skyrim_russian.dlstrings
|
|
||||||
Strings\skyrim_russian.ilstrings
|
|
||||||
Strings\skyrim_russian.strings
|
|
||||||
Strings\skyrim_spanish.dlstrings
|
|
||||||
Strings\skyrim_spanish.ilstrings
|
|
||||||
Strings\skyrim_spanish.strings
|
|
||||||
Skyrim.esm
|
Skyrim.esm
|
||||||
Update.esm
|
Update.esm
|
||||||
Dawnguard.esm
|
Dawnguard.esm
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
#include "Achievements.h"
|
|
||||||
#include "skse64/GameMenus.h"
|
|
||||||
#include "skse64/GameEvents.h"
|
|
||||||
#include "steam\steam_api.h"
|
|
||||||
#include <string>
|
|
||||||
#include <processenv.h>
|
|
||||||
|
|
||||||
class InitSteamOnEvent : public BSTEventSink<MenuOpenCloseEvent> {
|
|
||||||
public:
|
|
||||||
virtual ~InitSteamOnEvent() {}
|
|
||||||
virtual EventResult ReceiveEvent(MenuOpenCloseEvent * evn, EventDispatcher<MenuOpenCloseEvent> * dispatcher) {
|
|
||||||
if (std::strcmp(evn->menuName.data, "Main Menu")) {
|
|
||||||
_MESSAGE("Main menu opened, trying to init steam API.");
|
|
||||||
Achievements::startSteam();
|
|
||||||
}
|
|
||||||
return EventResult::kEvent_Continue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Achievements {
|
|
||||||
|
|
||||||
bool setAchievementUnlocked(StaticFunctionTag* tag, BSFixedString achievement)
|
|
||||||
{
|
|
||||||
return singleton->setAchievementUnlocked(achievement.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void registerMainMenuEvent() {
|
|
||||||
MenuManager * mm = MenuManager::GetSingleton();
|
|
||||||
if (mm) {
|
|
||||||
mm->MenuOpenCloseEventDispatcher()->AddEventSink(new InitSteamOnEvent());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_MESSAGE("Failed to register SKSE menuEventHandler!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void steamInit(StaticFunctionTag* tag) {
|
|
||||||
startSteam();
|
|
||||||
}
|
|
||||||
|
|
||||||
void startSteam()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (singleton.get() == nullptr) {
|
|
||||||
SteamAPI_Shutdown();
|
|
||||||
SetEnvironmentVariable("SteamAppID", "933480");
|
|
||||||
SetEnvironmentVariable("SteamGameId", "933480");
|
|
||||||
bool success = SteamAPI_Init();
|
|
||||||
if (success)
|
|
||||||
_MESSAGE("Steam api init was successfull");
|
|
||||||
else
|
|
||||||
_MESSAGE("Error while initializing the steam api");
|
|
||||||
|
|
||||||
singleton.swap(std::make_unique<AchievementHolder>());
|
|
||||||
singleton->start();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_MESSAGE("Already initialized steam api, skipping it");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const std::exception& ex) {
|
|
||||||
std::string msg = "Exception while initializing the Steam API, steam achievements will not be available: " + std::string(ex.what());
|
|
||||||
_MESSAGE(msg.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterFuncs(VMClassRegistry * registry)
|
|
||||||
{
|
|
||||||
registry->RegisterFunction(new NativeFunction1<StaticFunctionTag, bool, BSFixedString>("UnlockAchievement", "Game", Achievements::setAchievementUnlocked, registry));
|
|
||||||
registry->RegisterFunction( new NativeFunction0<StaticFunctionTag, void>("SteamInit", "Game", Achievements::steamInit, registry));
|
|
||||||
Achievements::registerMainMenuEvent();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
AchievementHolder::AchievementHolder() : stats(SteamUserStats()), callback(this, &AchievementHolder::onUserStatsReceived)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AchievementHolder::onUserStatsReceived(UserStatsReceived_t * event) {
|
|
||||||
try {
|
|
||||||
std::string msg = "User id: " + std::to_string(event->m_steamIDUser.ConvertToUint64()) + ", game id: " + std::to_string(event->m_nGameID) + ", success state: " + std::to_string(event->m_eResult);
|
|
||||||
_MESSAGE(msg.c_str());
|
|
||||||
|
|
||||||
uint32 achievementCount = this->stats->GetNumAchievements();
|
|
||||||
msg = "There are " + std::to_string(achievementCount) + " achievements";
|
|
||||||
_MESSAGE(msg.c_str());
|
|
||||||
}
|
|
||||||
catch (const std::exception& ex) {
|
|
||||||
std::string msg = "Exception during steam callback: onUserStatsReceived. Failed to print data: " + std::string(ex.what());
|
|
||||||
_MESSAGE(msg.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AchievementHolder::setAchievementUnlocked(const char * achievementName)
|
|
||||||
{
|
|
||||||
std::string msg = "Unlocking achievement: " + std::string(achievementName);
|
|
||||||
_MESSAGE(msg.c_str());
|
|
||||||
bool success = this->stats->SetAchievement(achievementName);
|
|
||||||
if (!success) {
|
|
||||||
_MESSAGE("Error while unlocking achievement");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
success = this->stats->StoreStats();
|
|
||||||
if (!success) {
|
|
||||||
_MESSAGE("Error while storing unlocked achievement");
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AchievementHolder::start()
|
|
||||||
{
|
|
||||||
this->stats->RequestCurrentStats();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "skse64/PapyrusNativeFunctions.h"
|
|
||||||
#include "skse64/GameReferences.h"
|
|
||||||
//Steam API Version 1.31 matches the Skyrim Steam API version
|
|
||||||
#include "steam\steam_api.h"
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace Achievements {
|
|
||||||
|
|
||||||
class AchievementHolder {
|
|
||||||
private:
|
|
||||||
ISteamUserStats * stats;
|
|
||||||
CCallback<AchievementHolder, UserStatsReceived_t, false> callback;
|
|
||||||
|
|
||||||
public:
|
|
||||||
AchievementHolder();
|
|
||||||
|
|
||||||
void start();
|
|
||||||
void onUserStatsReceived(UserStatsReceived_t * event);
|
|
||||||
bool setAchievementUnlocked(const char * achievementName);
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::unique_ptr<AchievementHolder> singleton(nullptr);
|
|
||||||
|
|
||||||
void startSteam();
|
|
||||||
void registerMainMenuEvent();
|
|
||||||
|
|
||||||
bool setAchievementUnlocked(StaticFunctionTag* tag, BSFixedString achievement);
|
|
||||||
void steamInit(StaticFunctionTag* tag);
|
|
||||||
bool RegisterFuncs(VMClassRegistry* registry);
|
|
||||||
}
|
|
BIN
source/fs_steam_src.zip
(Stored with Git LFS)
Normal file
BIN
source/fs_steam_src.zip
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user