Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Sep 28, 2023
1 parent 98dc7c2 commit 478c132
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 341 deletions.
159 changes: 27 additions & 132 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
Language: Cpp
AccessModifierOffset: -4
BasedOnStyle: WebKit
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignArrayOfStructures: Right
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
Expand All @@ -27,35 +26,23 @@ AlignConsecutiveMacros:
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __declspec
- __cdecl
- __stdcall
- __fastcall
- __try
- __except
- __assume
- __cdecl
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
Expand All @@ -68,135 +55,43 @@ BraceWrapping:
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 160
CommentPragmas: ""
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
ColumnLimit: 180
FixNamespaceComments: true
ForEachMacros:
IfMacros:
IncludeBlocks: Preserve
IncludeCategories:
IncludeIsMainRegex: ""
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
LineEnding: CRLF
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
NamespaceMacros:
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 0
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 0
PenaltyBreakFirstLessLess: 0
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 0
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 0
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
RawStringFormats:
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseInsensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
PenaltyReturnTypeOnItsOwnLine: 60
QualifierAlignment: Custom
QualifierOrder:
- inline
- static
- constexpr
- const
- volatile
- restrict
- friend
- type
SeparateDefinitionBlocks: Always
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
StatementMacros:
TabWidth: 4
TypenameMacros:
UseTab: Never
WhitespaceSensitiveMacros:
---
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Run Prettier
uses: actionsx/prettier@v3
with:
args: --write "${{ github.workspace }}/*.json"
args: --write "**.json" "**.yml"

- name: Add & Commit
uses: EndBug/[email protected]
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
########################################################################################################################
project(
ContainerItemDistributor
VERSION 1.1.2
VERSION 1.1.3
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 23)
Expand Down Expand Up @@ -35,7 +35,6 @@ set(
src/Logging.cpp
src/Main.cpp
src/Settings.cpp
src/Hooks.cpp
src/Parser.cpp
src/Conflicts.cpp
src/Distributor.cpp
Expand Down
16 changes: 0 additions & 16 deletions include/Hooks.h

This file was deleted.

36 changes: 20 additions & 16 deletions include/Maps.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ class Container
std::string container_name{};
};

struct DistrObject
class DistrObject
{
DistrType type{};
RE::TESBoundObject* bound_object{};
std::string filename{};
std::optional<int> count{};
std::optional<RE::TESBoundObject*> replace_with_object{};
std::optional<int> replace_with_count{};
std::optional<Container> container{};
public:
DistrType type{};
RE::TESBoundObject* bound_object{};
RE::TESLevItem* leveled_list{};
std::string filename{};
RE::TESBoundObject* replace_with_object{};
RE::TESLevItem* replace_with_list{};
std::optional<int> count{};
std::optional<int> replace_with_count{};
std::optional<Container> container{};
};

struct FormIDAndPluginName
Expand Down Expand Up @@ -104,18 +107,19 @@ inline auto format_as(const DistrType& type)
inline auto format_as(const DistrToken& token)
{
const auto& [type, filename, to_identifier, identifier, count, rhs, rhs_count]{ token };
return fmt::format("[Type: {} / Filename: {} / To: {} / Identifier: {} / Count: {} / RHS: {} / RHS Count: {}]", type, filename, to_identifier, identifier,
count.value_or(-1), rhs.value_or("null"), rhs_count.value_or(-1));
return fmt::format("[Type: {} / Filename: {} / To: {} / Identifier: {} / Count: {} / RHS: {} / RHS Count: {}]", type, filename, to_identifier, identifier, count.value_or(-1),
rhs.value_or("null"), rhs_count.value_or(-1));
}

inline auto format_as(const DistrObject& obj)
{
const auto& [type, bound_object, filename, count, replace_with_obj, replace_with_count, container]{ obj };
return fmt::format("[Type: {} / Filename: {} / Bound object: {} (0x{:x}) / Count: {} / Replace with: {} (0x{:x}) / Replace count: {} / Container: {} "
"(0x{:x}) ({})]",
type, filename, bound_object ? bound_object->GetName() : "null", bound_object ? bound_object->GetFormID() : 0, count.value_or(-1),
replace_with_obj.has_value() ? (replace_with_obj.value() ? replace_with_obj.value()->GetName() : "null") : "null",
replace_with_obj.has_value() ? (replace_with_obj.value() ? replace_with_obj.value()->GetFormID() : 0) : 0, replace_with_count.value_or(-1),
const auto& [type, bound_object, leveled_list, filename, replace_with_obj, replace_with_list, count, replace_with_count, container]{ obj };
return fmt::format("[Type: {} / Filename: {} / Bound object: {} (0x{:x}) / Leveled list: {} (0x{:x} / Replace with obj: {} (0x{:x}) / Replace with list: {} (0x{:x}) "
"/ Count: {} / Replace count: {} / Container: {} (0x{:x}) ({})]",
type, filename, bound_object ? bound_object->GetName() : "null", bound_object ? bound_object->GetFormID() : 0,
leveled_list ? leveled_list->GetName() : "null", leveled_list ? leveled_list->GetFormID() : 0, replace_with_obj ? replace_with_obj->GetName() : "null",
replace_with_obj ? replace_with_obj->GetFormID() : 0, replace_with_list ? replace_with_list->GetName() : "null",
replace_with_list ? replace_with_list->GetFormID() : 0, count.value_or(-1), replace_with_count.value_or(-1),
container.has_value() ? container.value().container_name : "null", container.has_value() ? container.value().container_form_id : 0,
container.has_value() ? container->container_type : RE::FormType::Container);
}
6 changes: 3 additions & 3 deletions include/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ class EventSingleton : public RE::BSTEventSink<TEvent>
{
using TEventSource = RE::BSTEventSource<TEvent>;

constexpr std::string dirty_name{ typeid(TEvent).name() };
const std::regex p{ "struct |RE::|SKSE::| * __ptr64" };
const auto name{ std::regex_replace(dirty_name, p, "") };
const std::string dirty_name{ typeid(TEvent).name() };
const std::regex p{ "struct |RE::|SKSE::| * __ptr64" };
const auto name{ std::regex_replace(dirty_name, p, "") };

if constexpr (std::is_base_of_v<TEventSource, RE::BSInputDeviceManager>)
{
Expand Down
Loading

0 comments on commit 478c132

Please sign in to comment.