Skip to content

Instantly share code, notes, and snippets.

View mrowrpurr's full-sized avatar

Mrowr Purr mrowrpurr

View GitHub Profile
@mrowrpurr
mrowrpurr / Override Keys via Sfall Hook.ssl.pas
Created August 3, 2022 03:35
Override Keys via Sfall Hook
// register_hook_proc in a glz script works :)
#include "sfall/sfall.h"
#include "sfall/dik.h"
// int arg0 - event type: 1 - pressed, 0 - released
// int arg1 - key DX scancode
// int arg2 - key VK code (very similar to ASCII codes)
// int ret0 - overrides the pressed key (a new key DX scancode or 0 for no override)
procedure on_keypress begin
@mrowrpurr
mrowrpurr / skyrimse.ppj
Last active December 17, 2022 21:43
Mrowr Purr's most recent favorite Papyrus project file .ppj
<?xml version='1.0'?>
<PapyrusProject xmlns="PapyrusProject.xsd" Flags="TESV_Papyrus_Flags.flg" Game="sse" Output="Scripts">
<!--
These variables contain hard-coded paths because the VS Code Papyrus extension does not support environment variables: https://github.com/joelday/papyrus-lang/issues/145
Please change the values of these variables to point to folders on your PC.
Notes:
- To create the contents of the "Imports" folder yourself, download the listed mods from Nexus or elsewhere and extract them to a folder.
- In a few cases (notably UIExtensions) the authors put .psc files into .bsa, so be sure to also extract .bsa for these mods.
@mrowrpurr
mrowrpurr / .cpp
Created December 1, 2022 17:45 — forked from kzjeef/cpp
async call example of gmock & gtest
#include <iostream>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
using ::testing::_;
using ::testing::AtLeast; // #1
using ::testing::Ge;
using ::testing::NotNull;
using ::testing::StrictMock;
template <class... Types>
void Log(const std::string text, const Types&... args) {
std::string result = std::format(text, args...);
// logger::info("{}", result);
// RE::ConsoleLog::GetSingleton()->Print(std::format("[SkyrimScripting] {}", result).c_str());
// std::cout << result << std::endl;
};
{
"version": 2,
"cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 },
"configurePresets": [
{
"name": "flags",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/permissive- /Zc:preprocessor /EHsc /MP /W4 -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS"
}
@mrowrpurr
mrowrpurr / .clang-format
Last active December 9, 2022 00:04
Clang for VS Code / C++ on Windows
---
AccessModifierOffset: -4
BasedOnStyle: Google
ColumnLimit: 180
IndentWidth: '4'
NamespaceIndentation: All
TabWidth: '4'
UseTab: Always
IndentPPDirectives: BeforeHash
FixNamespaceComments: false
@mrowrpurr
mrowrpurr / cpp.json
Last active December 11, 2022 00:23
VS Code User Snippets
{
"Singleton Methods": {
"prefix": "singleton",
"body": [
"$1() = default;\n~$1() = default;\n$1(const $1&) = delete;\n$1($1&&) = delete;\n$1& operator=(const $1&) = delete;\n$1& operator=($1&&) = delete;\nstatic $1& GetSingleton() {\n static $1 singleton;\n return singleton;\n}"
],
"description": "Methods for singleton constructor/descructors incl operators"
}
}
@mrowrpurr
mrowrpurr / CheckHeaderIncludes.cmake
Last active December 12, 2022 07:54
CMake function which adds a target to check every that header in your project has all required #include's
# CMake function which adds a target to check every that header in your project has all required #include's
function(check_header_includes)
set(options)
set(oneValueArgs TARGET INCLUDE_DIR TEMP_DIR)
set(multiValueArgs HEADERS PACKAGES LIBRARY_PATHS LIBRARIES)
cmake_parse_arguments(CHECK_HEADER_INCLUDES "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT CMAKE_OBJECT_PATH_MAX OR CMAKE_OBJECT_PATH_MAX LESS 1000)
# Bump up the max object path or CMake can get angry with some generated paths
# https://stackoverflow.com/questions/68351713/maximum-path-lengths-with-cmake