Compare commits

..

4 Commits

5 changed files with 24 additions and 30 deletions

View File

@@ -12,7 +12,7 @@
<PropertyGroup Condition="'$(AssemblyVersion)' == '' OR '$(MajorVersion)' != '' OR '$(MinorVersion)' != ''">
<MajorVersion Condition="'$(MajorVersion)' == ''">0</MajorVersion>
<MinorVersion Condition="'$(MinorVersion)' == ''">1</MinorVersion>
<PatchVersion Condition="'$(PatchVersion)' == ''">0</PatchVersion>
<PatchVersion Condition="'$(PatchVersion)' == ''">1</PatchVersion>
<AssemblyVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<ProductVersion>$(AssemblyVersion)</ProductVersion>

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) [year] [fullname]
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.

View File

@@ -1,5 +1,5 @@
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) [![Buymeacoffee](https://badgen.net/badge/icon/buymeacoffee?icon=buymeacoffee&label)](https://ko-fi.com/rmroc451)
# RMROC451's Tweaks and Thinks
# RMROC451's Tweaks and Things
Please Read this **ENTIRE** README before continuing.
This is a mod for Railroader which is available on Steam.
@@ -17,7 +17,7 @@ This mod requires Railloader by Zamu.
2. Drag the zip file onto Railloader.exe and have Railloader install the mod.
* as with option 1, this will put a `RMROC451.TweaksAndThings` folder into the Mods folder created in step 1
* If you DO NOT have the `RMROC451.TweaksAndThings` folder in the Mods folder after completing ONE of the above steps, you didn't complete the step successfully.
3. Run the game and enjoy all of you interchange tracks being used.
3. Run the game and enjoy all of the tweaks and things!
## Notes
1. This mod currently supports Railroader verison 2024.4.4. This mod may break in future updates. I will do my best to continue to update this mod.

View File

@@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Paths.user = Paths.user
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMROC451.TweaksAndThings", "TweaksAndThings\RMROC451.TweaksAndThings.csproj", "{59BB5A3F-C26B-4E2D-A657-94C562449365}"

View File

@@ -46,17 +46,24 @@ public class CarInspector_PopulateCarPanel_Patch
builder.HStack(delegate (UIPanelBuilder hstack)
{
hstack.AddButtonCompact("Handbrakes", delegate
var consist = __instance._car.EnumerateCoupled(LogicalEnd.A);
var buttonName = $"{(consist.Any(c => c.HandbrakeApplied()) ? "Release " : "Set ")} {TextSprites.HandbrakeWheel}";
hstack.AddButtonCompact(buttonName, delegate
{
MrocConsistHelper(__instance._car, MrocHelperType.Handbrake);
}).Tooltip("Release Consist Handbrakes", "Iterates over each car in this consist and releases handbrakes.");
if (StateManager.IsHost || true)
hstack.Rebuild();
}).Tooltip(buttonName, $"Iterates over cars in this consist and {(consist.Any(c => c.HandbrakeApplied()) ? "releases" : "sets")} {TextSprites.HandbrakeWheel}.");
if (consist.Any(c => c.EndAirSystemIssue()))
{
hstack.AddButtonCompact("Air Lines", delegate
hstack.AddButtonCompact("Connect Air Lines", delegate
{
MrocConsistHelper(__instance._car, MrocHelperType.GladhandAndAnglecock);
hstack.Rebuild();
}).Tooltip("Connect Consist Air Lines", "Iterates over each car in this consist and connects gladhands and opens anglecocks.");
}
hstack.RebuildOnInterval(1f);
});
return true;
@@ -70,7 +77,14 @@ public class CarInspector_PopulateCarPanel_Patch
switch (mrocHelperType)
{
case MrocHelperType.Handbrake:
consist.Do(c => c.SetHandbrake(false));
if (consist.Any(c => c.HandbrakeApplied()))
{
consist.Do(c => c.SetHandbrake(false));
} else
{
TrainController tc = UnityEngine.Object.FindObjectOfType<TrainController>();
tc.ApplyHandbrakesAsNeeded(consist.ToList(), PlaceTrainHandbrakes.Automatic);
}
break;
case MrocHelperType.GladhandAndAnglecock: