Skip to content

Commit

Permalink
Updated readme. Improved Windows 7 compatibility. Updated addon loade…
Browse files Browse the repository at this point in the history
…r version. More debug logging for path finding. Runtime library changes.
  • Loading branch information
Friendly0Fire committed Feb 27, 2022
1 parent acd6be0 commit 445b30e
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 44 deletions.
29 changes: 28 additions & 1 deletion GW2Radial.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,66 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzma", "GW2Radial\ziplib\So
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "GW2Radial\ziplib\Source\ZipLib\extlibs\zlib\zlib.vcxproj", "{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ZipLib Dependencies", "ZipLib Dependencies", "{C74AC87C-FD77-4C5E-BAB9-4B6713418B58}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{C74AC87C-FD77-4C5E-BAB9-4B6713418B58}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml2", "GW2Radial\tinyxml2\tinyxml2\tinyxml2.vcxproj", "{D1C528B6-AA02-4D29-9D61-DC08E317A70D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Debug|x64.ActiveCfg = Debug|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Debug|x64.Build.0 = Debug|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Debug|x86.ActiveCfg = Debug|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Debug|x86.Build.0 = Debug|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Release|x64.ActiveCfg = Release|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Release|x64.Build.0 = Release|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Release|x86.ActiveCfg = Release|x64
{7EFE6DCC-544A-4116-9EF2-13C0431356E6}.Release|x86.Build.0 = Release|x64
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Debug|x64.ActiveCfg = Debug|x64
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Debug|x64.Build.0 = Debug|x64
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Debug|x86.ActiveCfg = Debug|Win32
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Debug|x86.Build.0 = Debug|Win32
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Release|x64.ActiveCfg = Release|x64
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Release|x64.Build.0 = Release|x64
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Release|x86.ActiveCfg = Release|Win32
{5C9FD859-DDF9-4510-8397-B329B0AE8C48}.Release|x86.Build.0 = Release|Win32
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Debug|x64.ActiveCfg = Debug|x64
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Debug|x64.Build.0 = Debug|x64
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Debug|x86.ActiveCfg = Debug|Win32
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Debug|x86.Build.0 = Debug|Win32
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Release|x64.ActiveCfg = Release|x64
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Release|x64.Build.0 = Release|x64
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Release|x86.ActiveCfg = Release|Win32
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71}.Release|x86.Build.0 = Release|Win32
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Debug|x64.ActiveCfg = Debug|x64
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Debug|x64.Build.0 = Debug|x64
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Debug|x86.ActiveCfg = Debug|Win32
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Debug|x86.Build.0 = Debug|Win32
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Release|x64.ActiveCfg = Release|x64
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Release|x64.Build.0 = Release|x64
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Release|x86.ActiveCfg = Release|Win32
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9}.Release|x86.Build.0 = Release|Win32
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Debug|x64.ActiveCfg = Debug|x64
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Debug|x64.Build.0 = Debug|x64
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Debug|x86.ActiveCfg = Debug|Win32
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Debug|x86.Build.0 = Debug|Win32
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Release|x64.ActiveCfg = Release|x64
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Release|x64.Build.0 = Release|x64
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Release|x86.ActiveCfg = Release|Win32
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D}.Release|x86.Build.0 = Release|Win32
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug|x64.ActiveCfg = Debug-Lib|x64
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug|x64.Build.0 = Debug-Lib|x64
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug|x86.ActiveCfg = Debug-Dll|Win32
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug|x86.Build.0 = Debug-Dll|Win32
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release|x64.ActiveCfg = Release-Lib|x64
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release|x64.Build.0 = Release-Lib|x64
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release|x86.ActiveCfg = Release-Dll|Win32
{D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release|x86.Build.0 = Release-Dll|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -65,6 +91,7 @@ Global
{DBBF348D-C221-4F2E-8A0D-24EFA0D98E71} = {C74AC87C-FD77-4C5E-BAB9-4B6713418B58}
{7EAD1358-3E72-4FB6-A212-25D462B5C1E9} = {C74AC87C-FD77-4C5E-BAB9-4B6713418B58}
{BAEB16B3-DB4C-432F-9E6A-2ACADEA0691D} = {C74AC87C-FD77-4C5E-BAB9-4B6713418B58}
{D1C528B6-AA02-4D29-9D61-DC08E317A70D} = {C74AC87C-FD77-4C5E-BAB9-4B6713418B58}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {10A8C694-9C19-4823-8500-325C3B6AEF44}
Expand Down
8 changes: 4 additions & 4 deletions GW2Radial/GW2Radial.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>D3D_DEBUG_INFO;_DEBUG;GW2Radial_EXPORTS;_WINDOWS;_USRDLL;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SHADERS_DIR=LR"sd($(ProjectDir)shaders\)sd";$(GitHubDefs);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>D3D_DEBUG_INFO;_DEBUG;GW2Radial_EXPORTS;_WINDOWS;_USRDLL;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SHADERS_DIR=LR"sd($(ProjectDir)shaders\)sd";_WIN32_WINNT=0x0600;$(GitHubDefs);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
Expand Down Expand Up @@ -106,9 +106,9 @@ git describe --always --dirty --match "NOT A TAG" &gt;&gt; "$(ProjectDir)include
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;GW2Radial_EXPORTS;_WINDOWS;_USRDLL;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SHADERS_DIR=LR"sd($(ProjectDir)shaders\)sd";$(GitHubDefs);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;GW2Radial_EXPORTS;_WINDOWS;_USRDLL;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SHADERS_DIR=LR"sd($(ProjectDir)shaders\)sd";_WIN32_WINNT=0x0600;$(GitHubDefs);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion GW2Radial/d3d9_wrapper
2 changes: 1 addition & 1 deletion GW2Radial/include/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Core : public Singleton<Core>

ImGuiContext* imguiContext_ = nullptr;

using GetDpiForWindow_t = decltype(::GetDpiForWindow)*;
using GetDpiForWindow_t = UINT (WINAPI *)(HWND hwnd);
HMODULE user32_ = 0;
GetDpiForWindow_t getDpiForWindow_ = nullptr;

Expand Down
5 changes: 2 additions & 3 deletions GW2Radial/src/CustomWheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,8 @@ std::unique_ptr<Wheel> CustomWheelsManager::BuildWheel(const std::filesystem::pa
void CustomWheelsManager::Reload(ID3D11Device* dev)
{
{
APTTYPE a;
APTTYPEQUALIFIER b;
if(CoGetApartmentType(&a, &b) == CO_E_NOTINITIALIZED) {
ULONG_PTR contextToken;
if(CoGetContextToken(&contextToken) == CO_E_NOTINITIALIZED) {
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (hr != S_FALSE && hr != RPC_E_CHANGED_MODE && FAILED(hr))
CriticalMessageBox(L"Could not initialize COM library: error code 0x%X.", hr);
Expand Down
4 changes: 2 additions & 2 deletions GW2Radial/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ gw2al_addon_dsc gAddonDsc = {
L"gw2radial",
L"Radial menu overlay to select mount, novelty and more on fly",
2,
1,
1,
2,
0,
gAddonDeps
};

Expand Down
17 changes: 17 additions & 0 deletions GW2Radial/src/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ std::filesystem::path GetGameFolder()
std::wstring exeFolder;
SplitFilename(exeFullPath, &exeFolder, nullptr);

#if _DEBUG
Log::i().Print(Severity::Debug, L"Game folder path: {}", exeFolder.c_str());
#endif

return exeFolder;
}

Expand All @@ -123,16 +127,29 @@ std::optional<std::filesystem::path> GetDocumentsFolder()
std::filesystem::path documentsGW2 = myDocuments;
documentsGW2 /= L"GUILD WARS 2";

#if _DEBUG
Log::i().Print(Severity::Debug, L"Documents folder path: {}", documentsGW2.c_str());
#endif

if (std::filesystem::is_directory(documentsGW2))
return documentsGW2;

if (SUCCEEDED(SHCreateDirectoryExW(nullptr, documentsGW2.c_str(), nullptr)))
return documentsGW2;

Log::i().Print(Severity::Warn, L"Could not open or create documents folder '{}'.", documentsGW2.wstring());

return std::nullopt;
}

std::optional<std::filesystem::path> GetAddonFolder()
{
auto folder = (GetGameFolder() / "addons/gw2radial").make_preferred();

#if _DEBUG
Log::i().Print(Severity::Debug, L"Addons folder path: {}", folder.c_str());
#endif

if (std::filesystem::is_directory(folder))
return folder;

Expand Down
2 changes: 1 addition & 1 deletion GW2Radial/tinyxml2
42 changes: 12 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ An [*ArenaNET-approved<sup>TM</sup>*](https://www.reddit.com/r/Guildwars2/commen
- Run the game!

### Manual Installation
- Install the [addon loader](https://github.com/gw2-addon-loader/loader-core) and [d3d wrapper](https://github.com/gw2-addon-loader/d3d9_wrapper).
- Download and extract the archive ``gw2radial.zip`` found in the [latest release](https://github.com/Friendly0Fire/GW2Radial/releases/latest).
- Rename ``gw2addon_gw2radial.dll`` to ``d3d9.dll`` and place it in your bin64 directory (default path: ``C:\Program Files\Guild Wars 2\bin64``).
- Place ``gw2addon_gw2radial.dll`` in your addons folder inside a new folder named `gw2radial` (with the default game install path, this would be ``C:\Program Files\Guild Wars 2\addons\gw2radial``).
- Run the game! If everything was setup properly, you should be greeted by a prompt on your first launch.

## Usage
Expand All @@ -53,38 +54,19 @@ Please refer to the readme in the `custom_examples` folder for more information

### Q: I want to thank you in some way, how do I do that?

A: I do this for fun/because I wanted this to exist, but if you really want to, feel free to send me mail in game to my account ``FriendlyFire.6275`` and toss a few gold my way or just say hi!
A: I do this for fun/because I wanted this to exist, but if you really want to, feel free to send me mail in game to my account ``FriendlyFire.6275`` and toss a few gold or mats my way or just say hi!

### Q: I'm having a crash on launch (maybe mentioning "Coherent DLL"), what do?
### Q: The addon won't load or crashes.

A: There seems to be a lot of potential reasons for this particular crash. [BGDM's website](https://web.archive.org/web/20200409062402/http://gw2bgdm.blogspot.com/p/faq.html#2.5) lists quite a few. I'd especially recommend making sure you have the very latest [VC++ Redist](https://go.microsoft.com/fwlink/?LinkId=746572). Please also ensure that your graphics card drivers are up-to-date.
A: There can be a lot of reasons for this. Try the following debugging steps:

The crash may also be related to the Windows 10 Ransomware Protection system; you can add `Gw2-64.exe` and `CoherentUI_Host.exe` to the exception list following [these instructions](https://www.windowscentral.com/how-allow-blocked-apps-ransomware-protection-windows-10-october-2018-update) (thanks @Myster-Marz for the tip).
1. Look in your Guild Wars 2 installation folder for a file named ``gw2radial.log``.
2. If it exists, look inside the log file for details on what might be going wrong. If you cannot find anything, also look if there are files of the format ``gw2radial_*.dmp``. If those exist, the addon is loading but crashing at some point. Zip up the files and provide upload them somewhere safe, then open an issue.
3. If it does not exist, look for a file named ``gw2al_log.txt``.
4. If it does not exist, your addon loader is not installed correctly. Head over to the [addon loader](https://github.com/gw2-addon-loader/loader-core) project for support.
5. Inside the log file, look for the line "Loaded gw2radial". If it is not present, the addon loader cannot load the addon correctly. Make sure you have installed the [d3d wrapper](https://github.com/gw2-addon-loader/d3d9_wrapper) addon and look at the other log messages for information on what might be going wrong.

### Q: The addon doesn't seem to be loading at all, what's wrong?

A: There can be a few reasons for this, but the most common one is that you're using a special shortcut which skips the login prompt and boots the game directly. In this specific circumstance, you must put the addon's ``d3d9.dll`` directly next to the game's ``Gw2-64.exe`` (default path: ``C:\Program Files\Guild Wars 2``).

### Q: The game crashes with an error message mentioning "RivaTuner Statistics Server/RTSS", what's that?

A: RivaTuner Statistics Server is a component of some GPU management software such as MSI Afterburner which displays some information overlaid on top of games, such as FPS, temperatures, clocks, etc. Unfortunately, RTSS works in such a way that it breaks this addon, and as a result you must disable RTSS before launching the game. Fortunately, you do not have to uninstall RTSS or MSI Afterburner, simply shutting down the server (which can be done from the notification area located on the right side of the taskbar) before launching the game is sufficient. ![Shutting down RTSS](https://i.imgur.com/O9t9qZq.png)

### Q: I want to load up ArcDPS/GW2Hook/something else which also needs to be called ``d3d9.dll``, how do I load both?

A: You have three options: the first option is to use the GW2 Addon Loader through the [GW2 Addon Manager](https://github.com/gw2-addon-loader/GW2-Addon-Manager), **which is the recommended approach**.

Otherwise, either the other thing you want to run supports *chainloading* this, in which case you should look up the documentation for that plugin (e.g. ArcDPS supports chainloading by renaming this plugin to ``d3d9_chainload.dll``), or you can make this plugin chainload something else by renaming that other plugin to ``d3d9_mchain.dll``.

The most common use case would be combining ArcDPS, GW2Hook and this. For this instance, I heavily recommend setting things up as follows:
- ArcDPS is named ``d3d9.dll``.
- GW2Radial is named ``d3d9_chainload.dll``.
- GW2Hook is named ``ReShade64.dll``.

*N.B. If your Windows options hide file extensions (which is the default, you can confirm by looking at whether the game's file name is "Gw2-64.exe" or just "Gw2-64") leave out the ".dll" part of the file names (i.e. use "d3d9", "d3d9_chainload" and "ReShade64" respectively).

This should allow all addons to load properly. Note that there is special code present within GW2Radial to load GW2Hook properly, but this could break unexpectedly if GW2Hook/Reshade changes.

Finally, note that combining addons is largely unsupported. I will attempt to keep ArcDPS and d912pxy compatible with this, but that is the most I am able to do in a reasonable amount of time.
If all else fails, please open an issue.

### Q: What is the "show in center" keybind used for?

Expand All @@ -94,7 +76,7 @@ Unfortunately, I can't make this automatic (i.e. switching to that mode when Act

### Q: Can you make it so selecting a mount while already mounted will directly swap to the new mount?

No. I talked with GW2 staff about this and they've decided that the can of worms it could potentially open is not worth it. Unfortunately, you'll need to select the new mount you want to use twice, once to unmount and then again to remount. This will not change unless ArenaNet's policy on addons changes.
No. I talked with ArenaNet devs about this and they've decided that the can of worms it could potentially open is not worth it. Unfortunately, you'll need to separately unmount then select the new mount you want to use. This will not change unless ArenaNet's policy on addons changes.

### Q: Can I use this code for my project?

Expand Down

0 comments on commit 445b30e

Please sign in to comment.