feat: achievements, minecraft store, languages, auto lb sendStats, more Language Strings

This commit is contained in:
Byte
2026-06-23 20:40:27 +02:00
parent 658849b427
commit 028dcdce41
58 changed files with 1649 additions and 375 deletions
@@ -4,6 +4,7 @@
#include <algorithm>
#include <vector>
#include <thread>
#include "../Network/json.hpp"
using json = nlohmann::json;
@@ -168,6 +169,31 @@ bool WindowsLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views)
return false; // Since WriteStats is useless we just do this, exact same thing is done in DurangoLeaderboardManager
}
// ByteBukkit: Tick function
void WindowsLeaderboardManager::Tick()
{
if (++m_tickCount < 1000)
return;
m_tickCount = 0;
std::thread([this]()
{
static const EStatsType types[] = {
eStatsType_Travelling,
eStatsType_Mining,
eStatsType_Farming,
eStatsType_Kills,
};
for (EStatsType t : types)
{
for (int diff = 0; diff <= 3; ++diff)
SendStats(t, diff);
}
}).detach();
}
bool WindowsLeaderboardManager::SendStats(EStatsType type, int diff)
{
if (!Windows64Launcher::IsInOfflineMode || Windows64Minecraft::IsOfflineMode)
@@ -4,7 +4,7 @@
class WindowsLeaderboardManager : public LeaderboardManager
{
public:
virtual void Tick() override {}
virtual void Tick() override;
virtual bool OpenSession() override { return true; }
virtual void CloseSession() override {}
virtual void DeleteSession() override {}
@@ -39,6 +39,7 @@ public:
virtual bool isIdle() override { return true; }
private:
int m_tickCount = 0;
bool ReadNetworkStats(
LeaderboardReadListener* callback,
int difficulty,
@@ -1574,7 +1574,7 @@ void StartGame(Win64LaunchOptions launchOptions, int nCmdShow) {
if (!g_KBMInput.IsMouseGrabbed())
{
if (!g_KBMInput.IsKBMActive())
if (!g_KBMInput.IsKBMActive() && ui.FindScene(eUIScene_AchievementsMenu) == nullptr)
g_KBMInput.SetCursorHiddenForUI(true);
else if (!g_KBMInput.IsScreenCursorHidden())
g_KBMInput.SetCursorHiddenForUI(false);