Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModdingStatsHelper #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
18 changes: 16 additions & 2 deletions MasterList.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
{
"Name": "Container Quick Loot",
"Author": "CactusPie",
"SupportedVersion": "1.9.8767.26420",
"SupportedVersion": "1.9.8766.40295",
"ModVersion": "1.3.1",
"PortVersion": "1.0.0",
"Description": "Looting an item will now place it in a matching container with a @loot tag, such as a dogtag case or a document case",
Expand All @@ -280,5 +280,19 @@
"CactusPie.ContainerQuickLoot.dll"
],
"ConfigFiles": []
},
{
"Name": "Modding Stats Helper"
"Author": "wara",
"SupportedVersion": "1.9.8767.26420",
"ModVersion": "1.0.2",
"PortVersion": "1.0.0",
"Description": "Adds a tooltip when hovering parts in the weapon building screen that shows a quick overview of relevant stats and comparisons.",
"ModUrl": "https://hub.sp-tarkov.com/files/file/1442-modding-stats-helper/",
"RequiresFiles": false,
"PluginFiles": [
"Wara-ModdingStatsHelper.dll"
],
"ConfigFiles": []
}
]
]
62 changes: 62 additions & 0 deletions ModdingStatsHelper-SIT/Globals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using EFT.InventoryLogic;
using EFT.UI;
using System.Collections.Generic;

namespace ShowMeTheStats
{
public static class Globals
{
public static bool isWeaponModding = false;

public static Item mod = null;

public static List<Slot> allSlots = new List<Slot>();

public static SimpleTooltip simpleTooltip = null;

//public static Slot slotType = null;

public static Item dropDownCurrentItem = null;

public static bool isKeyPressed = false;

//some stats are not very interesting to see and will clog up the ui more than anything, so we blacklist them
public static string[] statBlacklist = {
EItemAttributeId.CompatibleWith.ToString(),
EItemAttributeId.Weight.ToString(),
EItemAttributeId.Size.ToString(),
//EItemAttributeId.Caliber.ToString(),
//EItemAttributeId.BulletSpeed.ToString(),
EItemAttributeId.RaidModdable.ToString(),
EItemAttributeId.OpticCrate.ToString(),
//EItemAttributeId.EffectiveDist.ToString(),
//EItemAttributeId.EffectiveDistance.ToString(),
//EItemAttributeId.Velocity.ToString(),
EItemAttributeId.SightingRange.ToString(),
//EItemAttributeId.AmmoCaliber.ToString(),
EItemAttributeId.SingleFireRate.ToString(),
EItemAttributeId.FireRate.ToString(),
EItemAttributeId.DurabilityBurn.ToString(),
EItemAttributeId.HeatFactor.ToString(),
EItemAttributeId.CoolFactor.ToString(),

EItemAttributeId.MalfFeedChance.ToString(),
EItemAttributeId.MalfMisfireChance.ToString(),
EItemAttributeId.LoadUnloadSpeed.ToString(),
EItemAttributeId.CheckTimeSpeed.ToString(),
"AutoROF",
"SemiROF",
};

public static void ClearAllGlobals()
{
isWeaponModding = false;
mod = null;
allSlots.Clear();
simpleTooltip = null;
//slotType = null;
dropDownCurrentItem = null;
isKeyPressed = false;
}
}
}
21 changes: 21 additions & 0 deletions ModdingStatsHelper-SIT/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 warawanaidene

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
44 changes: 44 additions & 0 deletions ModdingStatsHelper-SIT/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using BepInEx;
using ShowMeTheStats;
using UnityEngine;

namespace Plugin
{
[BepInPlugin("com.moddingstatshelper.aki", "Modding Stats Helper", "1.0")]
public class Plugin : BaseUnityPlugin
{
void Awake()
{
new ItemShowTooltipPatch().Enable();
new ShowTooltipPatch().Enable();
new WeaponUpdatePatch().Enable();
new DropDownSlotContextPatch().Enable();
new SlotViewPatch().Enable();
new ScreenTypePatch().Enable();

new DropDownSlotContextClosePatch().Enable();

}



void Update()
{
if (Globals.isWeaponModding)
{
bool isKeyDown = Input.GetKey(KeyCode.LeftControl);

if (isKeyDown && !Globals.isKeyPressed)
{
Globals.isKeyPressed = true;
Globals.simpleTooltip.Show("", null, 0.1f, null);
}
else if (!isKeyDown && Globals.isKeyPressed)
{
Globals.isKeyPressed = false;
Globals.simpleTooltip.Show("", null, 0.1f, null);
}
}
}
}
}
61 changes: 61 additions & 0 deletions ModdingStatsHelper-SIT/ShowMeTheStats.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>Wara-ModdingStatsHelper</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>False</Optimize>
</PropertyGroup>

<ItemGroup>
<Reference Include="Aki.Common">
<HintPath>dependencies\Aki.Common.dll</HintPath>
</Reference>
<Reference Include="Aki.Reflection">
<HintPath>dependencies\Aki.Reflection.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>dependencies\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>dependencies\BepInEx.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Harmony">
<HintPath>dependencies\BepInEx.Harmony.dll</HintPath>
</Reference>
<Reference Include="Comfort">
<HintPath>dependencies\Comfort.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>dependencies\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Sirenix.Serialization">
<HintPath>dependencies\Sirenix.Serialization.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="UnityEngine">
<HintPath>dependencies\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>dependencies\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>dependencies\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>dependencies\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>dependencies\UnityEngine.InputModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>dependencies\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="System.IO">
<HintPath>dependencies\System.Runtime.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
30 changes: 30 additions & 0 deletions ModdingStatsHelper-SIT/ShowMeTheStats.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33723.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShowMeTheStats", "ShowMeTheStats.csproj", "{06EE05FF-852D-47D1-882B-E8D3044A382E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4CC091D9-5745-4098-AC8B-1CB99EE9A1DA}"
ProjectSection(SolutionItems) = preProject
Complete Gameplay Overhaul.sln = Complete Gameplay Overhaul.sln
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{06EE05FF-852D-47D1-882B-E8D3044A382E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06EE05FF-852D-47D1-882B-E8D3044A382E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06EE05FF-852D-47D1-882B-E8D3044A382E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06EE05FF-852D-47D1-882B-E8D3044A382E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DF3EE3DB-0374-47BD-BC99-2ED85C439AC8}
EndGlobalSection
EndGlobal
Loading