Skip to content

Commit

Permalink
update (#39)
Browse files Browse the repository at this point in the history
- [x] test for 1130 and 1170
- [x] fix xp
- [x] fall damage perk
- [x] translation replacement
  • Loading branch information
mlthelama authored Jan 25, 2024
2 parents bd4a0c2 + 843db47 commit 693137c
Show file tree
Hide file tree
Showing 32 changed files with 470 additions and 138 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,5 @@ FodyWeavers.xsd
out/
build/
swf/gfx/
venv/

4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
path = extern/hint_button_menu
url = https://github.com/mlthelama/hint_button_menu.git
branch = main
[submodule "extern/CommonLibSSE-NG"]
path = extern/CommonLibSSE-NG
url = https://github.com/mlthelama/CommonLibSSE.git
branch = ng
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25)

set(NAME "SkyrimCharacterSheet")
set(VERSION 1.1.1.0)
set(VERSION 1.1.2.0)

# ---- Options ----

Expand Down Expand Up @@ -85,10 +85,17 @@ set(Boost_USE_STATIC_LIBS ON)

# ---- Dependencies ----

find_package(CommonLibSSE CONFIG REQUIRED)
#find_package(CommonLibSSE CONFIG REQUIRED)
find_package(spdlog REQUIRED CONFIG)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(unordered_dense CONFIG REQUIRED)

find_path(CLIB_UTIL_INCLUDE_DIRS "ClibUtil/utils.hpp")

set(CommonLibPath "extern/CommonLibSSE-NG")
set(CommonLibName "CommonLibSSE")
set(GameVersion "Skyrim")

# ---- Add source files ----

Expand Down Expand Up @@ -131,14 +138,18 @@ add_library(
target_compile_features(
${PROJECT_NAME}
PRIVATE
cxx_std_20
cxx_std_23
)

add_subdirectory(${CommonLibPath} ${CommonLibName} EXCLUDE_FROM_ALL)


target_include_directories(
${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CLIB_UTIL_INCLUDE_DIRS}
)

target_link_libraries(
Expand All @@ -148,6 +159,7 @@ target_link_libraries(
CommonLibSSE::CommonLibSSE
nlohmann_json::nlohmann_json
magic_enum::magic_enum
unordered_dense::unordered_dense
)

if (MSVC)
Expand Down
133 changes: 70 additions & 63 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,75 @@
{
"configurePresets": [{
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
}
},
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "STRING",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
"hidden": true,
"name": "vcpkg"
"configurePresets": [
{
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
}
},
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "STRING",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": {
"type": "STRING",
"value": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
},
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
},
"hidden": true,
"name": "windows"
"VCPKG_OVERLAY_PORTS": {
"type": "STRING",
"value": "${sourceDir}/cmake/ports/"
}
},
"hidden": true,
"name": "vcpkg"
},
{
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": {
"type": "STRING",
"value": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
},
{
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4 /WX"
},
"generator": "Visual Studio 17 2022",
"inherits": [
"cmake-dev",
"vcpkg",
"windows"
],
"name": "vs2022-windows",
"toolset": "v143"
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
],
"buildPresets": [{
"name": "vs2022-windows",
"configurePreset": "vs2022-windows",
"configuration": "Release"
}],
"version": 3
},
"hidden": true,
"name": "windows"
},
{
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4 /WX"
},
"generator": "Visual Studio 17 2022",
"inherits": [
"cmake-dev",
"vcpkg",
"windows"
],
"name": "vs2022-windows",
"toolset": "v143"
}
],
"buildPresets": [
{
"name": "vs2022-windows",
"configurePreset": "vs2022-windows",
"configuration": "Release"
}
],
"version": 3
}
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skyrim Character Sheet
![Platform](https://img.shields.io/static/v1?label=platform&message=windows&color=dimgray&style=for-the-badge&logo=windows)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/mlthelama/SkyrimCharacterSheet?style=for-the-badge)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/mlthelama/SkyrimCharacterSheet?style=for-the-badge&include_prereleases)
![GitHub](https://img.shields.io/github/license/mlthelama/SkyrimCharacterSheet?style=for-the-badge)
![GitHub top language](https://img.shields.io/github/languages/top/mlthelama/SkyrimCharacterSheet?style=for-the-badge)
![GitHub language count](https://img.shields.io/github/languages/count/mlthelama/SkyrimCharacterSheet?style=for-the-badge)
Expand All @@ -13,11 +13,11 @@
## End User Dependencies
* [SKSE64](https://skse.silverlock.org/)
* [Address Library for SKSE Plugins](https://www.nexusmods.com/skyrimspecialedition/mods/32444)
* [Scaleform Translation Plus Plus](https://www.nexusmods.com/skyrimspecialedition/mods/22603)
* [Icons for Skyrim Character Sheet](https://www.nexusmods.com/skyrimspecialedition/mods/71282)

## Build Dependencies
* [CommonLibSSE NG](https://github.com/CharmedBaryon/CommonLibSSE-NG)
* [CommonLibSSE NG](https://github.com/mlthelama/CommonLibSSE/tree/ng)
- currently a [fork from](https://github.com/alandtse/CommonLibVR/tree/ng) with minor changes
- added as [submodule](extern/CommonLibSSE-NG)
* [spdlog](https://github.com/gabime/spdlog)
* [nlohmann-json](https://github.com/nlohmann/json)
* [tomlplusplus](https://github.com/marzer/tomlplusplus)
Expand All @@ -28,6 +28,16 @@
* [cmake](https://cmake.org)
- installed dir needs to be added to the `PATH` environment variable
- Version `3.25`
* [clib-util](https://github.com/powerof3/CLibUtil)
- added as vcpkg [port](cmake/ports/clib-util)
* [unordered-dense](https://github.com/martinus/unordered_dense)
- added as vcpkg [port](cmake/ports/unordered-dense)

## Release Dependencies
* [hint_button_menu](https://github.com/mlthelama/hint_button_menu)
- needed [file](extern/hint_button_menu/bin/hint_button_menu.swf)
* [skyui](https://github.com/mlthelama/skyui)
- needed [file](extern/skyui/swf/icons_item_psychosteve_merged.swf)

## Building
```
Expand All @@ -37,3 +47,12 @@ cd SkyrimCharacterSheet
cmake --preset vs2022-windows
cmake --build --preset vs2022-windows --config Release
```

## Manual Release
```
cd SkyrimCharacterSheet
./scripts/run.sh
or
.\scripts\run.sh
```
1 change: 1 addition & 0 deletions cmake/Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Version
inline constexpr auto NAME = "@PROJECT_VERSION@";
inline constexpr auto PROJECT = "@PROJECT_NAME@";
inline constexpr auto AUTHOR = "mlthelama";
inline constexpr auto EMAIL = "mlthelama [at] gmail [dot] com";

inline constexpr std::uint32_t ASINT =
(static_cast<std::uint32_t>((MAJOR * 1000000) + (MINOR * 10000) + (PATCH * 100) + (BETA)));
Expand Down
14 changes: 14 additions & 0 deletions cmake/ports/clib-util/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# header-only library
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO powerof3/CLibUtil
REF a801992250ee8c6178159cc73ce3354a742be6b4
SHA512 3eb37eb0958bf5cf01c8cd80f673b5ab60c562757d76024937fde529b82938481ad8d6fa30d6ca21d5ef93ab8a2d92e7ad093ddc242fb2462aa234689efd31eb
HEAD_REF master
)

# Install codes
set(CLIBUTIL_SOURCE ${SOURCE_PATH}/include/ClibUtil)
file(INSTALL ${CLIBUTIL_SOURCE} DESTINATION ${CURRENT_PACKAGES_DIR}/include)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
7 changes: 7 additions & 0 deletions cmake/ports/clib-util/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "clib-util",
"version-string": "1.3.5",
"port-version": 1,
"description": "",
"homepage": "https://github.com/powerof3/CLibUtil"
}
24 changes: 24 additions & 0 deletions cmake/ports/unordered-dense/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO martinus/unordered_dense
REF a570a0e87f95027e8544c72295236df5d84c3dcc
SHA512 3f06daf92b68ef7e1ec0c7bbd7070aac8d0bf7ce57bfc6408770ab001f4c3c5efe084b01405a65d6b9e3d99eb0f16c95dd6c5dfc88387d246552f850a9ec6cad
HEAD_REF main
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(
PACKAGE_NAME unordered_dense
CONFIG_PATH lib/cmake/unordered_dense
)

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/lib"
)

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
17 changes: 17 additions & 0 deletions cmake/ports/unordered-dense/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "unordered-dense",
"version-string": "4.1.0",
"port-version": 1,
"description": "",
"homepage": "https://github.com/martinus/unordered_dense",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 2 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ set(sources ${sources}
src/util/player/player.h
src/util/quest/quest.cpp
src/util/quest/quest.h
src/util/translation.cpp
src/util/translation.h
src/util/type_util.cpp
src/util/type_util.h
)
4 changes: 4 additions & 0 deletions config/SkyrimCharacterSheet_Keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{
"key": "alternative",
"name": "$ShowAlternative"
},
{
"key": "close",
"name": "$ShowClose"
}
]
}
1 change: 1 addition & 0 deletions extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG added at 69317b
16 changes: 16 additions & 0 deletions src/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING

#include <RE/Skyrim.h>
#include <SKSE/SKSE.h>
Expand All @@ -10,9 +11,24 @@

#include "magic_enum.hpp"
#include "nlohmann/json.hpp"
#include <ClibUtil/string.hpp>
#include <ankerl/unordered_dense.h>
#include <codecvt>

using namespace std::literals;

struct string_hash {
using is_transparent = void; // enable heterogeneous overloads
using is_avalanching = void; // mark class as high quality avalanching hash

[[nodiscard]] std::uint64_t operator()(std::string_view str) const noexcept {
return ankerl::unordered_dense::hash<std::string_view>{}(str);
}
};

template <class D>
using string_map = ankerl::unordered_dense::segmented_map<std::string, D, string_hash, std::equal_to<>>;

namespace stl {
using namespace SKSE::stl;
}
Expand Down
Loading

0 comments on commit 693137c

Please sign in to comment.