Skip to content

Commit

Permalink
update for 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Sep 8, 2022
1 parent e343594 commit 11d8726
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 3 deletions.
Binary file modified build/red4ext/plugins/input_loader/input_loader.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion deps/red4ext.sdk
Submodule red4ext.sdk updated 9060 files
53 changes: 53 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Cyberpunk 2077 Input Loader

This plugin looks for all `r6/input/*.xml` files and merges them with the appropriate input config file from `r6/config/` and saves results to `r6/cache/`. A configuration file is written to `engine/config/platform/pc/input_loader.ini`, which tells the game to load the merged .xml files.

## Usage

1. Install [RED4ext](https://github.com/WopsS/RED4ext)
2. Install Input Loader using the [latest release](https://github.com/jackhumbert/cyberpunk2077-input-loader/releases/latest), at `red4ext/plugins/`
3. Place a mod's custom .xml file in `r6/input/`
4. Start the game

A log file will be written to `red4ext/logs/input_loader.log` every start-up, if you're having problems.

## Node type

Only children of `<bindings>` are supported currently, but they can all be in the same .xml file (to encourage a mod to have a single .xml file). Depending on the node type, the block will be added to the new `inputContexts.xml` or `inputUserMappings.xml` automatically:

inputUserMappings.xml:
* mapping
* buttonGroup
* pairedAxes
* preset

inputContexts.xml:
* blend
* context
* hold
* multitap
* repeat
* toggle
* acceptedEvents

## Node attributes

You can add `append="true"` to a node to avoid overwriting. This is the recommeneded method for adding functionality, as multiple mods will be able to do this without conflicts. See below for an example.

## Example .xml file

```xml
<?xml version="1.0"?>
<bindings>
<!-- Defines a custom context with a custom Action, mapped to UseConsumable_Button -->
<context name="MyCustomContext" >
<action name="ShakeAroundABit" map="UseConsumable_Button" />
</context>

<!-- Adds the custom context to VehicleDrive without overwriting existing definitions -->
<context name="VehicleDrive" append="true">
<include name="MyCustomContext" />
</context>

</bindings>
```
4 changes: 2 additions & 2 deletions src/input_loader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
13 changes: 13 additions & 0 deletions src/input_loader.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\deps\pugixml\src\pugixml.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="Utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.hpp" />
<ClInclude Include="Utils.hpp" />
</ItemGroup>
</Project>

0 comments on commit 11d8726

Please sign in to comment.