Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fireundubh committed May 13, 2021
1 parent a9dc7e5 commit 39c165a
Show file tree
Hide file tree
Showing 27 changed files with 312 additions and 797 deletions.
126 changes: 62 additions & 64 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,95 +1,93 @@
---
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignConsecutiveMacros: 'false'
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Left
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'false'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: 'true'
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'true'
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'true'
BinPackParameters: 'true'
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: 'true'
AfterClass: 'true'
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: 'false'
AfterEnum: 'true'
AfterExternBlock: 'true'
AfterFunction: 'true'
AfterNamespace: 'true'
AfterStruct: 'true'
AfterUnion: 'true'
BeforeCatch: 'false'
BeforeElse: 'false'
IndentBraces: 'false'
SplitEmptyFunction: 'false'
SplitEmptyNamespace: 'false'
SplitEmptyRecord: 'false'
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: 'false'
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'true'
BreakStringLiterals: true
ColumnLimit: 0
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: 'false'
DeriveLineEnding: 'true'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
FixNamespaceComments: 'false'
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
FixNamespaceComments: false
IncludeBlocks: Preserve
IndentCaseBlocks: 'true'
IndentCaseLabels: 'false'
IndentGotoLabels: 'false'
IndentCaseBlocks: true
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments : 'false'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'false'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
ReflowComments : false
SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceBeforeSquareBrackets: 'false'
SpaceInEmptyBlock: 'false'
SpaceInEmptyParentheses: 'false'
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInConditionalStatement: 'false'
SpacesInContainerLiterals: 'true'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseCRLF: 'true'
UseCRLF: true
UseTab: Always

...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
/cmake-build-debug*
/cmake-build-release*
workspace.xml
Expand Down
54 changes: 29 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "")
# ---- Project ----

project(
TurtleClub
LibTurtleClub
VERSION 1.0.0
LANGUAGES CXX
)
Expand Down Expand Up @@ -45,12 +45,12 @@ if (MSVC)
set(COMPILE_OPTIONS_DEBUG
/Zc:inline- # Keep unreferenced COMDAT
/JMC # Just My Code debugging
)
)

set(COMPILE_OPTIONS_RELEASE
/Zc:inline # Remove unreferenced COMDAT
/JMC- # Disable Just My Code debugging
)
)

add_compile_options(
/Gy # Enable Function-Level Linking
Expand Down Expand Up @@ -88,7 +88,7 @@ if (MSVC)
/external:W0

/W4 # Warning level (all warnings)
/WX # Warning level (warnings are errors)
# /WX # Warning level (warnings are errors)

"$<$<CONFIG:Debug>:${COMPILE_OPTIONS_DEBUG}>"
"$<$<CONFIG:Release>:${COMPILE_OPTIONS_RELEASE}>"
Expand All @@ -98,13 +98,13 @@ if (MSVC)
/INCREMENTAL # Link Incrementally
/OPT:NOREF # Optimizations (keep functions/data never referenced)
/OPT:NOICF # Optimizations (prevent identical COMDAT folding)
)
)

set(LINK_OPTIONS_RELEASE
/INCREMENTAL:NO # Link Incrementally
/OPT:REF # Optimizations (eliminate functions/data never referenced)
/OPT:ICF # Optimizations (perform identical COMDAT folding)
)
)

add_link_options(
"$<$<CONFIG:Debug>:${LINK_OPTIONS_DEBUG}>"
Expand All @@ -122,22 +122,19 @@ find_package(spdlog REQUIRED)

set(headers
src/PCH.h
src/Registration.h
src/PapyrusActor.h
src/PapyrusFaction.h
src/PapyrusMisc.h
src/PapyrusString.h
)
src/Constants.h
src/Papyrus/Registration.h
src/Papyrus/PapyrusActor.h
src/Papyrus/PapyrusMisc.h
)

set(sources
src/main.cpp
src/PCH.cpp
src/Registration.cpp
src/PapyrusActor.cpp
src/PapyrusFaction.cpp
src/PapyrusMisc.cpp
src/PapyrusString.cpp
)
src/Papyrus/Registration.cpp
src/Papyrus/PapyrusActor.cpp
src/Papyrus/PapyrusMisc.cpp
)

source_group(
TREE
Expand All @@ -156,42 +153,49 @@ add_library(
${sources}
${CMAKE_CURRENT_BINARY_DIR}/version.rc
.clang-format
)
)

target_compile_features(
${PROJECT_NAME}
PUBLIC
cxx_std_20
)
)

target_compile_options(
${PROJECT_NAME}
PRIVATE
"$<$<BOOL:${MSVC}>:/TP>"
)
)

target_include_directories(
${PROJECT_NAME}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:src>
)
)

target_link_libraries(
${PROJECT_NAME}
PUBLIC
CommonLibSSE::CommonLibSSE
spdlog::spdlog
)
)

target_link_options(
${PROJECT_NAME}
PUBLIC
${LINK_OPTIONS_${CONFIG}}
)
)

target_precompile_headers(
${PROJECT_NAME}
PRIVATE
src/PCH.h
)
)

add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> "F:/ModOrganizer/Games/SkyrimSE/mods/LibTurtleClub/SKSE/Plugins/"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Scripts/Source/LibTurtleClub.psc "F:/ModOrganizer/Games/SkyrimSE/mods/LibTurtleClub/Scripts/Source/LibTurtleClub.psc"
)
63 changes: 10 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,17 @@
# TurtleClub (CommonLibSSE Plugin)
# LibTurtleClub (CommonLibSSE Plugin)

```
{ Actor }
; Returns true if akActor has any keyword in akKeywords
Bool Function ActorHasAnyKeyword(Actor akActor, FormList akKeywords) Global Native
; Returns true if akActor is a member of any faction in akFactions (faction rank must be > -1)
Bool Function ActorIsInAnyFaction(Actor akActor, FormList akFactions) Global Native
Papyrus extensions by fireundubh specifically for Master of Disguise SSE

; Returns true if akActor is a member of akFaction (faction rank must be > -1)
Bool Function ActorIsInFaction(Actor akActor, Faction akFaction) Global Native
## Actor Functions

; Iterates through akFactions, returning IsInFaction array for akActor (does not evaluate faction rank)
```papyrus
; Returns whether `akActor` is a member of each faction in `akFactions` (does not evaluate faction rank)
Bool[] Function GetFactionStates(Actor akActor, FormList akFactions) Global Native
```

; Returns array of forms equipped by akActor in slots 31, 32, 33, 35, 36, 37, 39, and 42
Form[] Function GetWornEquipment(Actor akActor) Global Native
{ Faction }
; Sets akFaction as ally or friend to each faction in akFactions
Function SetAllies(Faction akFaction, FormList akFactions, Bool abSelfIsFriendToOther = False, Bool abOtherIsFriendToSelf = False) Global Native
; Sets akFaction as enemy or neutral to each faction in akFactions
Function SetEnemies(Faction akFaction, FormList akFactions, Bool abSelfIsNeutralToOther = False, Bool abOtherIsNeutralToSelf = False) Global Native
{ Misc }
; Search akFormlist for akBaseObjects
Bool[] Function SearchListForForms(FormList akFormList, Form[] akNeedles) Global Native
; Search formlists in akFormlist for akBaseObject
Bool[] Function SearchListsForForm(FormList akFormList, Form akNeedle) Global Native
; Returns true if current game time (converted to 24-hour clock) is between afMin and less than afMax
Bool Function InRangeGameTime(Float afMin, Float afMax) Global Native
; Returns index to akPlayerRace in akRaces after checking if akPlayerRace is mapped to aiFactionIndex
Int Function LookupRaceWeightIndex(Int aiFactionIndex, Race akPlayerRace, Race[] akRaces) Global Native
{ String }
; Returns asSource as array of String split by asDelimiter
String[] Function SplitString(String asSource, String asDelimiter) Global Native
; Returns asSource as array of Float split by asDelimiter
Float[] Function StrToFloatArray(String asSource, String asDelimiter) Global Native
; Returns asSource as array of Int split by asDelimiter
Int[] Function StrToIntArray(String asSource, String asDelimiter) Global Native
; Returns asSource wrapped to column aiMaxLength with lines delimited by newline character
String Function WrapString(String asSource, Int aiMaxLength) Global Native
## Misc. Functions

```papyrus
; Returns index to `akPlayerRace` in `argRaces` after checking if `akPlayerRace` is mapped to `aiFactionIndex`
Int Function LookupRaceWeightIndex(Int aiFactionIndex, Race akPlayerRace, Race[] argRaces) Global Native
```
11 changes: 11 additions & 0 deletions Scripts/Source/LibTurtleClub.psc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ScriptName LibTurtleClub Hidden

{ Actor }

; Returns whether `akActor` is a member of each faction in `akFactions` (does not evaluate faction rank)
Bool[] Function GetFactionStates(Actor akActor, FormList akFactions) Global Native

{ Misc }

; Returns index to `akPlayerRace` in `argRaces` after checking if `akPlayerRace` is mapped to `aiFactionIndex`
Int Function LookupRaceWeightIndex(Int aiFactionIndex, Race akPlayerRace, Race[] argRaces) Global Native
Loading

0 comments on commit 39c165a

Please sign in to comment.