Skip to content
Merged
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
122 changes: 120 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ option(COPY_PSC "Copies any script sources to the MO2 directory (if specified).
# -------- Project ----------
project(
PerkAdjuster
VERSION 2.0.1
VERSION 2.0.2
LANGUAGES CXX
)

Expand Down Expand Up @@ -36,6 +36,7 @@ add_compile_definitions(SKYRIM_AE)
add_compile_definitions(SKYRIM_SUPPORT_AE)

set(SKSE_COMMONLIBSSE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/External/CommonLibSSE")
set(SKSE_NO_INSTALL ON)

if (GOG)
add_compile_definitions(SKYRIM_GOG)
Expand Down Expand Up @@ -71,6 +72,36 @@ target_include_directories(
${CLIB_UTIL_INCLUDE_DIRS}
)

if (MSVC)
target_compile_options(
${PROJECT_NAME}
PRIVATE
/sdl # Enable Additional Security Checks
/utf-8 # Set Source and Executable character sets to UTF-8
/Zi # Debug Information Format

/permissive- # Standards conformance
/Zc:preprocessor # Enable preprocessor conformance mode
/Zc:__cplusplus

/wd4200 # nonstandard extension used : zero-sized array in struct/union
/W4 # More warnings
/WX # Treat all warnings as errors
/external:anglebrackets # Ignore warnings for external resources.
/external:W0 # Same as above

"$<$<CONFIG:DEBUG>:>"
"$<$<CONFIG:RELEASE>:/Zc:inline;/JMC-;/Ob3>"
)

target_link_options(
${PROJECT_NAME}
PRIVATE
"$<$<CONFIG:DEBUG>:/INCREMENTAL;/OPT:NOREF;/OPT:NOICF>"
"$<$<CONFIG:RELEASE>:/INCREMENTAL:NO;/OPT:REF;/OPT:ICF;/DEBUG:FULL>"
)
endif ()

set(DATA_DIR "${PROJECT_SOURCE_DIR}/data")

include(components.cmake)
Expand All @@ -86,6 +117,40 @@ if(DEFINED ENV{SKYRIM_MODS_FOLDER} AND IS_DIRECTORY "$ENV{SKYRIM_MODS_FOLDER}")
endif()
endif()

# ---- Compile Papyrus Scripts and Pack Into Archive ----
include(Papyrus)
include(BSArchive)

if(
NOT SKIP_ARTIFACTS
AND Skyrim64Path
AND IS_DIRECTORY "${Skyrim64Path}/tools"
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Data/Source/Scripts"
)
file(GLOB ${PROJECT_NAME}_SOURCES
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
"Data/Source/Scripts/*.psc"
)

Papyrus_Add(
"Papyrus"
GAME ${Skyrim64Path}
IMPORTS ${CMAKE_CURRENT_SOURCE_DIR}/Data/Source/Scripts
SOURCES ${${PROJECT_NAME}_SOURCES}
OPTIMIZE ANONYMIZE
)

BSArchive_Add(
"BSA"
OUTPUT "${PROJECT_NAME}.bsa"
FORMAT SSE
FILES ${Papyrus_OUTPUT}
)
else()
message(STATUS "No scripts to compile found, won't compress into BSA.")
endif()

# ---- Automatically copy artifacts to MO2 ----
if(DEFINED OUTPUT_FOLDER AND NOT SKIP_ARTIFACTS)
set(DLL_FOLDER "${OUTPUT_FOLDER}/SKSE/Plugins")
Expand All @@ -102,12 +167,65 @@ if(DEFINED OUTPUT_FOLDER AND NOT SKIP_ARTIFACTS)
-DPROJECT_NAME="${PROJECT_NAME}"
-P "${PROJECT_SOURCE_DIR}/CMake/Scripts/CMake-Copy-Artifacts.cmake"
)

if(COPY_BSA)
add_custom_command(
TARGET "${PROJECT_NAME}"
POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-DSRC_DIR="${PROJECT_SOURCE_DIR}/Data"
-DDST_DIR=${OUTPUT_FOLDER}
-DPROJECT_NAME=${PROJECT_NAME}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
-P "${PROJECT_SOURCE_DIR}/CMake/Scripts/CMake-Copy-Archive.cmake"
VERBATIM
)
endif()

if(COPY_PEX)
add_custom_command(
TARGET "${PROJECT_NAME}"
POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-DCOMPILED_SCRIPTS="${CMAKE_BINARY_DIR}/Scripts"
-DOUTPUT_FOLDER="${OUTPUT_FOLDER}"
-P "${PROJECT_SOURCE_DIR}/CMake/Scripts/CMake-Copy-Scripts.cmake"
VERBATIM
)
endif()

if(COPY_PSC)
add_custom_command(
TARGET "${PROJECT_NAME}"
POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-DSOURCE_SCRIPTS="${PROJECT_SOURCE_DIR}/Data/Source/Scripts"
-DOUTPUT_FOLDER="${OUTPUT_FOLDER}"
-P "${PROJECT_SOURCE_DIR}/CMake/Scripts/CMake-Copy-Sources.cmake"
VERBATIM
)
endif()
endif()

# ---- Github Release Stuff ----
install(
FILES
"${DATA_DIR}/SKSE/Plugins/${PROJECT_NAME}.ini"
"$<TARGET_FILE:${PROJECT_NAME}>"
"$<TARGET_PDB_FILE:${PROJECT_NAME}>"
DESTINATION "SKSE/Plugins"
COMPONENT components
)

install(
FILES
"${DATA_DIR}/Source/Scripts/SEA_PerkFunctions.psc"
DESTINATION "Source/Scripts"
COMPONENT components
)

install(
FILES
"${DATA_DIR}/Scripts/SEA_PerkFunctions.pex"
DESTINATION "Scripts"
COMPONENT components
)
Binary file added Data/Scripts/SEA_PerkFunctions.pex
Binary file not shown.
6 changes: 6 additions & 0 deletions Data/Source/Scripts/SEA_PerkFunctions.psc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Scriptname SEA_PerkFunctions Hidden
{Script for Perk Adjuster's API. To use, <import SEA_PerkFunctions> in your own script.}

Int[] Function GetVersion() Global Native
Bool Function AddPerkToTree(Perk a_kPerk, ActorValueInfo a_kAV, Float a_x, Float a_y, Perk[] a_parents = NONE, Perk[] a_children = NONE) Global Native
Bool Function RemoveFromPerkTree(Perk a_kPerk, ActorValueInfo a_kAV) Global Native
2 changes: 1 addition & 1 deletion External/CommonLibSSE
Submodule CommonLibSSE updated 56 files
+2 −2 cmake/ports/commonlib-shared/portfile.cmake
+26 −0 cmake/sourcelist.cmake
+0 −1 include/RE/A/Actor.h
+35 −0 include/RE/A/AddCellGrassTask.h
+1 −1 include/RE/A/ArmorRatingVisitorBase.h
+30 −0 include/RE/B/BGSAcousticSpaceListener.h
+82 −19 include/RE/B/BGSGrassManager.h
+14 −0 include/RE/B/BSProceduralGeomEvent.h
+52 −0 include/RE/B/BSProceduralLightningController.h
+39 −0 include/RE/B/BSProceduralLightningTasklet.h
+1 −1 include/RE/B/BSShaderProperty.h
+1 −1 include/RE/B/BSSimpleScaleController.h
+1 −1 include/RE/B/BSTArray.h
+39 −0 include/RE/B/BSTask.h
+23 −0 include/RE/B/BSTaskletData.h
+23 −0 include/RE/B/BSWin32TaskletData.h
+2 −3 include/RE/B/BeamProjectile.h
+18 −0 include/RE/B/BeamProjectileImpactEvent.h
+32 −0 include/RE/B/bhkEntityListener.h
+38 −0 include/RE/C/CellLoaderTask.h
+53 −0 include/RE/C/ChainExplosion.h
+34 −0 include/RE/C/CombatBehavior.h
+10 −0 include/RE/C/CombatBehaviorAccessors.h
+12 −0 include/RE/C/CombatBehaviorAction.h
+23 −0 include/RE/C/CombatBehaviorAdvance.h
+7 −0 include/RE/C/CombatBehaviorThread.h
+7 −0 include/RE/C/CombatBehaviorTree.h
+15 −11 include/RE/C/CombatBehaviorTreeNode.h
+174 −0 include/RE/C/CombatBehaviorTreeNodeObject.h
+22 −0 include/RE/C/CombatBehaviorTreeNodeObjectBase.h
+82 −0 include/RE/C/CombatPath.h
+31 −0 include/RE/E/ExteriorCellLoader.h
+1 −1 include/RE/F/FaderData.h
+27 −0 include/RE/G/GFxEvent.h
+20 −0 include/RE/I/IExplosionFactory.h
+22 −0 include/RE/I/IOTask.h
+1 −15 include/RE/N/NiAVObject.h
+1 −1 include/RE/N/NiControllerManager.h
+1 −1 include/RE/N/NiMultiTargetTransformController.h
+2 −1 include/RE/N/NiTimeController.h
+19 −0 include/RE/N/NiUpdateData.h
+36 −0 include/RE/Q/QueuedFile.h
+25 −0 include/RE/Skyrim.h
+2 −1 include/RE/T/TES.h
+12 −0 include/RE/T/TESAudio.h
+2 −0 include/RE/T/TESObjectCELL.h
+7 −0 include/RE/T/TESObjectLAND.h
+1 −0 include/RE/T/TESObjectREFR.h
+1 −0 include/RE/T/TESWorldSpace.h
+0 −7 src/RE/A/Actor.cpp
+12 −0 src/RE/C/CombatBehaviorTreeNode.cpp
+1 −1 src/RE/O/ObjectTypeInfo.cpp
+21 −0 src/RE/T/TESAudio.cpp
+7 −0 src/RE/T/TESObjectCELL.cpp
+7 −0 src/RE/T/TESObjectREFR.cpp
+7 −0 src/RE/T/TESWorldSpace.cpp
2 changes: 1 addition & 1 deletion External/CommonLibSSE_1.6
Submodule CommonLibSSE_1.6 updated 89 files
+2 −2 cmake/ports/commonlib-shared/portfile.cmake
+30 −0 cmake/sourcelist.cmake
+0 −1 include/RE/A/Actor.h
+35 −0 include/RE/A/AddCellGrassTask.h
+21 −0 include/RE/A/AmiiboEvent.h
+1 −1 include/RE/A/ArmorRatingVisitorBase.h
+22 −5 include/RE/A/AttackBlockHandler.h
+30 −0 include/RE/B/BGSAcousticSpaceListener.h
+213 −185 include/RE/B/BGSDefaultObjectManager.h
+82 −19 include/RE/B/BGSGrassManager.h
+4 −0 include/RE/B/BSInputDeviceManager.h
+32 −11 include/RE/B/BSInputEventQueue.h
+14 −0 include/RE/B/BSProceduralGeomEvent.h
+52 −0 include/RE/B/BSProceduralLightningController.h
+39 −0 include/RE/B/BSProceduralLightningTasklet.h
+21 −13 include/RE/B/BSSaveDataSystemUtility.h
+1 −1 include/RE/B/BSShaderProperty.h
+1 −1 include/RE/B/BSSimpleScaleController.h
+10 −7 include/RE/B/BSSystemEvent.h
+3 −0 include/RE/B/BSSystemUtility.h
+1 −1 include/RE/B/BSTArray.h
+39 −0 include/RE/B/BSTask.h
+23 −0 include/RE/B/BSTaskletData.h
+23 −0 include/RE/B/BSWin32TaskletData.h
+2 −3 include/RE/B/BeamProjectile.h
+18 −0 include/RE/B/BeamProjectileImpactEvent.h
+8 −0 include/RE/B/BookMenu.h
+32 −0 include/RE/B/bhkEntityListener.h
+35 −13 include/RE/B/bhkWorld.h
+16 −0 include/RE/B/bhkWorldCinfo.h
+38 −0 include/RE/C/CellLoaderTask.h
+53 −0 include/RE/C/ChainExplosion.h
+34 −0 include/RE/C/CombatBehavior.h
+10 −0 include/RE/C/CombatBehaviorAccessors.h
+12 −0 include/RE/C/CombatBehaviorAction.h
+23 −0 include/RE/C/CombatBehaviorAdvance.h
+7 −0 include/RE/C/CombatBehaviorThread.h
+7 −0 include/RE/C/CombatBehaviorTree.h
+15 −11 include/RE/C/CombatBehaviorTreeNode.h
+174 −0 include/RE/C/CombatBehaviorTreeNodeObject.h
+22 −0 include/RE/C/CombatBehaviorTreeNodeObjectBase.h
+82 −0 include/RE/C/CombatPath.h
+4 −0 include/RE/C/ControlMap.h
+31 −0 include/RE/E/ExteriorCellLoader.h
+1 −1 include/RE/F/FaderData.h
+20 −6 include/RE/F/FirstPersonState.h
+27 −0 include/RE/G/GFxEvent.h
+20 −0 include/RE/I/IExplosionFactory.h
+22 −0 include/RE/I/IOTask.h
+4 −0 include/RE/I/InputDevices.h
+22 −1 include/RE/I/InputEvent.h
+17 −0 include/RE/L/LockpickingMenu.h
+17 −0 include/RE/L/LookHandler.h
+7 −1 include/RE/M/MenuEventHandler.h
+26 −0 include/RE/M/MotionGestureEvent.h
+1 −15 include/RE/N/NiAVObject.h
+1 −1 include/RE/N/NiControllerManager.h
+1 −1 include/RE/N/NiMultiTargetTransformController.h
+2 −1 include/RE/N/NiTimeController.h
+19 −0 include/RE/N/NiUpdateData.h
+3 −0 include/RE/Offsets_RTTI.h
+4 −1 include/RE/Offsets_VTABLE.h
+10 −2 include/RE/P/PlayerCharacter.h
+12 −4 include/RE/P/PlayerInputHandler.h
+36 −0 include/RE/Q/QueuedFile.h
+21 −0 include/RE/S/SixaxisEvent.h
+15 −5 include/RE/S/SkyrimVM.h
+53 −45 include/RE/S/State.h
+29 −0 include/RE/Skyrim.h
+2 −1 include/RE/T/TES.h
+12 −0 include/RE/T/TESAudio.h
+2 −0 include/RE/T/TESObjectCELL.h
+7 −0 include/RE/T/TESObjectLAND.h
+1 −0 include/RE/T/TESObjectREFR.h
+11 −1 include/RE/T/TESTopicInfo.h
+1 −0 include/RE/T/TESWorldSpace.h
+2 −1 include/SKSE/Interfaces.h
+3 −1 include/SKSE/Version.h
+0 −7 src/RE/A/Actor.cpp
+1 −1 src/RE/B/BSScaleformManager.cpp
+12 −0 src/RE/C/CombatBehaviorTreeNode.cpp
+37 −0 src/RE/I/InputEvent.cpp
+12 −0 src/RE/M/MenuEventHandler.cpp
+1 −1 src/RE/O/ObjectTypeInfo.cpp
+21 −0 src/RE/T/TESAudio.cpp
+7 −0 src/RE/T/TESObjectCELL.cpp
+7 −0 src/RE/T/TESObjectREFR.cpp
+7 −0 src/RE/T/TESWorldSpace.cpp
+1 −0 xmake-rules.lua
2 changes: 1 addition & 1 deletion src/perkManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace PerkManipulation {
auto x = a_x + a_targetValue->perkTreeWidth * 0.5;
newNode->perkGridX = (std::max)(static_cast<std::int32_t>(x + 0.58), 0);
newNode->perkGridY = (std::min)((std::max)(static_cast<std::int32_t>(a_y - 0.12 * (xMax + 1)), 0), 4);
newNode->horizontalPosition = x - newNode->perkGridX;
newNode->horizontalPosition = static_cast<float>(x) - static_cast<float>(newNode->perkGridX);
newNode->verticalPosition = a_y - newNode->perkGridY;

newLinks[newNode] = std::make_pair(a_parents, a_children);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "perk-adjuster",
"version-string": "2.0.1",
"version-string": "2.0.2",
"description": "Dynamically replaces perk descriptions.",
"homepage": "https://github.com/SeaSparrowOG/PerkAdjuster",
"license": "GPL-3.0",
Expand Down
Loading