Skip to content
Open
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
16 changes: 16 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<ElinDir>C:\Games\Steam\steamapps\common\Elin</ElinDir>
<ElinManaged>$(ElinDir)\Elin_Data\Managed</ElinManaged>
<bepinexppath>$(ElinDir)\BepInEx\core</bepinexppath>
</PropertyGroup>

<Target Name="CopyToGameDir" AfterTargets="PostBuildEvent">
<Copy
SourceFiles="$(TargetDir)\$(ProjectName).dll"
DestinationFolder="$(ElinDir)\Package\$(ProjectName)" />
<Copy
SourceFiles="$(ProjectDir)\assets\package.xml"
DestinationFolder="$(ElinDir)\Package\$(ProjectName)" />
</Target>
</Project>
7 changes: 3 additions & 4 deletions FloorLibraryMod/BankAbility.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using UnityEngine;
using System;
using HarmonyLib;
using static TextureReplace;

public class ActBankAccess : Act
{
Expand All @@ -14,7 +13,7 @@ public override bool Perform()
BankUtilityPatch.AccessBankInventory();
BankUtility.Log("Bank Access action performed successfully.");
}
catch (System.Exception ex)
catch (Exception ex)
{
BankUtility.Log($"Error during Bank Access action: {ex.Message}");
}
Expand Down Expand Up @@ -53,7 +52,7 @@ static void Postfix()

}
}
catch (System.Exception ex)
catch (Exception ex)
{
BankUtility.Log($"Error granting Bank Access ability: {ex.Message}");
}
Expand Down
57 changes: 32 additions & 25 deletions FloorLibraryMod/BankUtility.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System;
using System.IO;
using UnityEngine;

[BepInPlugin("floor.elin.bankutility", "Bank Utility", "1.0.0")]
public class BankUtility : BaseUnityPlugin


{
internal static new ManualLogSource Logger;

public void OnStartCore()
public void OnStartCore()
{
var dir = Path.GetDirectoryName(Info.Location);
var excel = dir + "/Data/SourceCard.xlsx";
var sources = Core.Instance.sources;
ModUtil.ImportExcel(excel, "Element", sources.elements);
}

private KeyCode openBankHotkey;
//private KeyCode openBankHotkey;

private void Awake()
{
// Configuring the hotkey
//openBankHotkey = Config.Bind(
// "Keybinds",
// "OpenBankHotkey",
// KeyCode.B, // Default hotkey
// "Key to open the bank from anywhere."
//).Value;
try
{
Logger = base.Logger;
// Configuring the hotkey
//openBankHotkey = Config.Bind(
// "Keybinds",
// "OpenBankHotkey",
// KeyCode.B, // Default hotkey
// "Key to open the bank from anywhere."
//).Value;


// Initialize Harmony
var harmony = new Harmony("floor.elin.bankutility");
LoadData();
harmony.PatchAll();
} catch (Exception ex) {
BankUtility.Log($"[BankUtility] Error during LoadData: {ex.Message}");
}
}

// Initialize Harmony
var harmony = new Harmony("floor.elin.bankutility");
LoadData();
harmony.PatchAll();
}
private void LoadData()
{
try
Expand All @@ -62,16 +67,18 @@ private void LoadData()
// Texture2D tex = IO.LoadPNG(Path.Combine(dir, "Texture/BankAccess.png"));
// ...
}
catch (System.Exception ex)
catch (Exception ex)
{
BankUtility.Log($"[BankUtility] Error during LoadData: {ex.Message}");
}
}
private void OpenBankFromAnywhere()
{
Log("Attempting to open the bank UI from anywhere...");
BankUtilityPatch.AccessBankInventory(); // Call the patch logic
}

//private void OpenBankFromAnywhere()
//{
// Log("Attempting to open the bank UI from anywhere...");
// BankUtilityPatch.AccessBankInventory(); // Call the patch logic
//}

//private void Update()
//{
// // Check for the hotkey press
Expand All @@ -83,6 +90,6 @@ private void OpenBankFromAnywhere()

public static void Log(string message)
{
Console.WriteLine($"[BankUtility]: {message}");
Logger.LogInfo(message);
}
}
13 changes: 2 additions & 11 deletions FloorLibraryMod/BankUtilityPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@ public static void AccessBankInventory()
{
try
{
var container = LayerInventory.CreateContainer(EClass.game.cards.container_deposit);

if (container != null)
{
BankUtility.Log("Bank container opened successfully.");
}
else
{
BankUtility.Log("Failed to open bank container.");
}
LayerInventory.CreateContainer(EClass.game.cards.container_deposit);
}
catch (Exception ex)
{
BankUtility.Log($"Error opening bank container: {ex.Message}");
BankUtility.Log($"Error opening bank container: {ex.Message}\n{ex.StackTrace}");
}
}
}
134 changes: 46 additions & 88 deletions FloorLibraryMod/FloorLibraryMod.csproj
Original file line number Diff line number Diff line change
@@ -1,88 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B3385291-2122-4D4A-AB10-A213D3A4DC2A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FloorLibraryMod</RootNamespace>
<AssemblyName>FloorLibraryMod</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\SteamLibrary\steamapps\common\Elin\Package\BankUtility\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\BepInEx\core\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Core">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\BepInEx\core\BepInEx.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Unity">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\BepInEx\core\BepInEx.Unity.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Elin">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\Elin.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Plugins.BaseCore">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\Plugins.BaseCore.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Plugins.UI">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\Plugins.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Elin\Elin_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BankAbility.cs" />
<Compile Include="BankUtility.cs" />
<Compile Include="BankUtilityPatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>FloorLibraryMod</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="UnityEngine.Modules" Version="2021.3.34" IncludeAssets="compile" />
</ItemGroup>

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>$(bepinexppath)\0Harmony.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Core">
<HintPath>$(bepinexppath)\BepInEx.Core.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Unity">
<HintPath>$(bepinexppath)\BepInEx.Unity.dll</HintPath>
</Reference>
<Reference Include="Elin">
<HintPath>$(ElinManaged)\Elin.dll</HintPath>
</Reference>
<Reference Include="Plugins.BaseCore">
<HintPath>$(ElinManaged)\Plugins.BaseCore.dll</HintPath>
</Reference>
<Reference Include="Plugins.UI">
<HintPath>$(ElinManaged)\Plugins.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>$(ElinManaged)\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="ModConfigGUI">
<HintPath>..\packages\ModConfigGUI.dll</HintPath>
</Reference>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy
SourceFiles="$(TargetDir)\$(ProjectName).dll"
DestinationFolder="$(ProjectDir)\assets\" />
</Target>

</Project>
Binary file added FloorLibraryMod/assets/Data/SourceCard.xlsx
Binary file not shown.
Binary file added FloorLibraryMod/assets/FloorLibraryMod.dll
Binary file not shown.
14 changes: 14 additions & 0 deletions FloorLibraryMod/assets/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Meta>
<title>Bank Utility</title>
<id>floor.elin.bankutility</id>
<author>flooristired</author>
<builtin>false</builtin>
<loadPriority>100</loadPriority>
<version>0.23.55</version>
<description>Currently grants you an ability to access the bank from anywhere.
Can be removed or added at will.
https://github.com/ZombGuy/BankUtility/
</description>
<tags>QoL,Skill,Cheat</tags>
</Meta>
Binary file added FloorLibraryMod/assets/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.