Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Code/client/Games/Skyrim/Misc/CrosshairPickData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <TiltedOnlinePCH.h>

#include <Misc/CrosshairPickData.h>

CrosshairPickData* CrosshairPickData::Get()
{
POINTER_SKYRIMSE(CrosshairPickData*, s_instance, 401585);

return *s_instance.Get();
}
16 changes: 16 additions & 0 deletions Code/client/Games/Skyrim/Misc/CrosshairPickData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

// What the crosshair points at; Target is the ref the HUD's activate prompt ("E Talk") is for.
struct CrosshairPickData
{
static CrosshairPickData* Get();

uint32_t pad0;
uint32_t Target; // ObjectRefHandle
uint32_t TargetActor; // ObjectRefHandle
uint8_t padC[0x38 - 0xC];
};

static_assert(offsetof(CrosshairPickData, Target) == 0x4);
static_assert(offsetof(CrosshairPickData, TargetActor) == 0x8);
static_assert(sizeof(CrosshairPickData) == 0x38);
7 changes: 6 additions & 1 deletion Code/client/Games/Skyrim/NetImmerse/NiAVObject.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <NetImmerse/NiObjectNET.h>
#include <Games/Primitives.h>

struct BSFixedString;

Expand All @@ -14,7 +15,11 @@ struct NiAVObject : NiObjectNET
virtual void sub_29();
virtual NiAVObject* GetByName(BSFixedString& aName);

uint8_t pad30[0x110 - 0x30];
uint8_t pad30[0xA0 - 0x30];
// Translation of the world transform (which starts at 0x7C).
NiPoint3 worldTranslate;
uint8_t padAC[0x110 - 0xAC];
};

static_assert(offsetof(NiAVObject, worldTranslate) == 0xA0);
static_assert(sizeof(NiAVObject) == 0x110);
17 changes: 17 additions & 0 deletions Code/client/Services/Generic/ImguiService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ImguiService::~ImguiService() noexcept
void ImguiService::Create(RenderSystemD3D11* apRenderSystem, HWND aHwnd)
{
m_imDriver.Initialize(static_cast<void*>(aHwnd));
LoadNameTagFont();

// init platform
if (!ImGui_ImplWin32_Init(aHwnd))
Expand All @@ -30,6 +31,22 @@ void ImguiService::Create(RenderSystemD3D11* apRenderSystem, HWND aHwnd)
ImGui_ImplDX11_Init(apRenderSystem->GetDevice(), apRenderSystem->GetDeviceContext());
}

void ImguiService::LoadNameTagFont()
{
// Same font file the overlay UI ships with. Loaded large so tags stay sharp when scaled down.
const auto fontPath = TiltedPhoques::GetPath() / "UI" / "assets" / "futura-condensed-medium.otf";
if (!std::filesystem::exists(fontPath))
{
spdlog::warn("Name tag font not found at {}, using the default ImGui font", fontPath.string());
return;
}

auto& io = ImGui::GetIO();
m_pNameTagFont = io.Fonts->AddFontFromFileTTF(fontPath.string().c_str(), 40.f, nullptr, io.Fonts->GetGlyphRangesCyrillic());
if (!m_pNameTagFont)
spdlog::warn("Failed to load name tag font {}", fontPath.string());
}

void ImguiService::Render() const
{
ImGui_ImplDX11_NewFrame();
Expand Down
Loading