Skip to content

Commit aa5da92

Browse files
committed
Beta 0.2
1 parent 2be2f3c commit aa5da92

25 files changed

+54
-28
lines changed

ActualMop/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.1.0.0")]
36-
[assembly: AssemblyFileVersion("0.1.0.0")]
35+
[assembly: AssemblyVersion("0.2.0.0")]
36+
[assembly: AssemblyFileVersion("0.2.0.0")]

ActualMop/Resources/changelog.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
Added:
2+
- New mop model thanks to BrennFuchS!
3+
- Added settings
4+
- Added changelog
5+
- Added "Reset Mop Position" button
6+
- Urinating button can now be binded under any key (as long as it's one of the letters, or digit)
7+
18
Changes:
2-
- New mop model thanks to BrennFuchS!
9+
- Stain removal rate is now a constant value

ActualMop/src/ActualMop.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ActualMop : Mod
2424
public override string ID => "ActualMop"; //Your mod ID (unique)
2525
public override string Name => "Actual Mop (Beta)"; //You mod name
2626
public override string Author => "Athlon"; //Your Username
27-
public override string Version => "0.1"; //Version
27+
public override string Version => "0.2"; //Version
2828

2929
// Set this to true if you will be load custom assets from Assets folder.
3030
// This will create subfolder in Assets folder for your mod.
@@ -61,7 +61,6 @@ public override void OnSave()
6161
}
6262

6363
// ayy, lmao
64-
6564
Settings resetPosition = new Settings("resetMopPosition", "Reset Mop Positon", ResetMopPosition);
6665

6766
// Default header color
@@ -83,9 +82,9 @@ static void ResetMopPosition()
8382
if (Application.loadedLevelName == "GAME")
8483
{
8584
GameObject mop = GameObject.Find("mop(Clone)");
85+
mop.GetComponent<Rigidbody>().velocity = Vector3.zero;
8686
mop.transform.position = MopBehaviour.DefaultPosition;
8787
mop.transform.rotation = new Quaternion();
88-
mop.GetComponent<Rigidbody>().velocity = Vector3.zero;
8988
}
9089
}
9190
}

ActualMop/src/MopBehaviour.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,25 @@ namespace ActualMop
2222
{
2323
class MopBehaviour : MonoBehaviour
2424
{
25-
public static Vector3 DefaultPosition =new Vector3(-13.5f, -0.6f, 2.8f);
25+
public static Vector3 DefaultPosition = new Vector3(-13.5f, -0.6f, 2.8f);
2626

2727
PlayMakerFSM pissAreas;
2828
ParticleRenderer pissRenderer;
2929
Transform itemPivot;
3030

3131
float lastUrineValue;
32+
float lastPissRate;
3233

3334
// Import the user32.dll
35+
// We're using keybd_event function in Win32 API to simulate the keyboard click
36+
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event
3437
[DllImport("user32.dll", SetLastError = true)]
3538
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
3639

3740
// Declare some keyboard keys as constants with its respective code
3841
// See Virtual Code Keys: https://msdn.microsoft.com/en-us/library/dd375731(v=vs.85).aspx
3942
const int KEYEVENTF_EXTENDEDKEY = 0x0001; //Key down flag
4043
const int KEYEVENTF_KEYUP = 0x0002; //Key up flag
41-
const int VK_P = 0x50; // P key
4244
byte virtualKey = 0x50;
4345

4446
public MopBehaviour()
@@ -83,6 +85,7 @@ void Update()
8385

8486
// Hold the urine level
8587
PlayMakerGlobals.Instance.Variables.FindFsmFloat("PlayerUrine").Value = lastUrineValue <= 0 ? 1 : lastUrineValue;
88+
pissAreas.FsmVariables.FindFsmFloat("PissRate").Value = -400;
8689
}
8790
else
8891
{
@@ -100,11 +103,12 @@ void ToggleCleaningMode(bool enabled)
100103
if (!enabled && pissAreas.FsmVariables.FindFsmFloat("PissRate").Value > 0)
101104
return;
102105

103-
// Multiple the PissRate by -1, so it will decrease/increase the piss stain.
104-
pissAreas.FsmVariables.FindFsmFloat("PissRate").Value *= -1;
105-
106106
if (enabled)
107107
{
108+
// Get current key binded to urinating
109+
virtualKey = HexManager.instance.GetHex();
110+
111+
lastPissRate = pissAreas.FsmVariables.FindFsmFloat("PissRate").Value;
108112
lastUrineValue = PlayMakerGlobals.Instance.Variables.FindFsmFloat("PlayerUrine").Value;
109113
pissRenderer.enabled = !enabled;
110114
}
@@ -129,6 +133,8 @@ IEnumerator DisableRoutine()
129133

130134
// Remove the dirtiness given by the game for finishing pissing
131135
PlayMakerGlobals.Instance.Variables.FindFsmFloat("PlayerDirtiness").Value -= 5;
136+
// Restore last PissRate value
137+
pissAreas.FsmVariables.FindFsmFloat("PissRate").Value = lastPissRate;
132138
}
133139

134140
/// <summary>

ActualMop/src/Utilities/HexManager.cs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ namespace ActualMop
2121
{
2222
class HexManager
2323
{
24+
// This class manages the hexadecimal values corresponding to appropriate keyboard keys.
25+
// See Virtual Code Keys: https://msdn.microsoft.com/en-us/library/dd375731(v=vs.85).aspx
26+
2427
public static HexManager instance;
2528

2629
Dictionary<string, byte> keys;
30+
const byte VK_DEFAULT = 0x50; // P key
2731

2832
public HexManager()
2933
{
3034
instance = this;
3135

32-
// Initialize the list
36+
// Initialize and populate the dictionary
3337
keys = new Dictionary<string, byte>();
3438
keys.Add("0", 0x30);
3539
keys.Add("1", 0x31);
@@ -70,9 +74,8 @@ public HexManager()
7074
}
7175

7276
/// <summary>
73-
/// Finds and returns currently binded key to urinating
77+
/// Returns currently binded key to urinating
7478
/// </summary>
75-
/// <returns></returns>
7679
string GetCurrentlyBindedButton()
7780
{
7881
return cInput.GetText("Urinate");
@@ -81,28 +84,33 @@ string GetCurrentlyBindedButton()
8184
/// <summary>
8285
/// Returns the hexadecimal value corresponding to currently binded button for urinating
8386
/// </summary>
84-
/// <returns></returns>
8587
public byte GetHex()
8688
{
87-
string letter = GetCurrentlyBindedButton();
88-
if (!IsValidKey(letter))
89+
string bind = GetCurrentlyBindedButton();
90+
91+
// Test if binded is valid
92+
// Return default value (P) if invalid
93+
if (!IsValidKey(bind))
8994
{
9095
MSCLoader.ModConsole.Print("[Actual Mop] Urinate key has to be binded to letter or a number on the keyboard!");
91-
// Return default value (P) if invalid
92-
return 0x50;
96+
return VK_DEFAULT;
9397
}
9498

95-
return keys.First(t => t.Key == letter).Value;
99+
return keys.First(t => t.Key == bind).Value;
96100
}
97101

98-
bool IsValidKey(string text)
102+
/// <summary>
103+
/// Checks if the bind is a valid key.
104+
/// Bind has to be not longer than 1 character, and has to be digit or letter.
105+
/// </summary>
106+
bool IsValidKey(string bind)
99107
{
100108
// Binded key is too long for a number or character
101-
if (text.Length > 1)
109+
if (bind.Length > 1)
102110
return false;
103111

104112
// Char has to be a digit or letter
105-
char c = text.ToCharArray()[0];
113+
char c = bind.ToCharArray()[0];
106114
return char.IsLetter(c) || char.IsDigit(c);
107115
}
108116
}

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Beta 0.2 (tba)
3+
## Beta 0.2 (08.02.2020)
44

55
### Added
66

@@ -10,6 +10,14 @@
1010
- Added "Reset Mop Position" button
1111
- Urinating button can now be binded under any key (as long as it's one of the letters, or digit)
1212

13+
### Changes
14+
15+
- Stain removal rate is now a constant value
16+
17+
### Bug Fixes
18+
19+
- Improved in hand rotation and holding
20+
1321
## Beta 0.1 (07.02.2020)
1422

1523
- Initial release

Media/images/1080p.png

80 Bytes
Loading

Media/images/1080p.xcf

1.07 MB
Binary file not shown.

Media/images/400p.png

52.2 KB
Loading

Media/images/400pbanner.png

29.4 KB
Loading

Media/images/400pbanner.xcf

249 KB
Binary file not shown.

Media/images/640pgit.png

0 Bytes
Loading

Media/images/640pgitbanner.png

41.3 KB
Loading

Media/images/640pgitbanner.xcf

384 KB
Binary file not shown.

Media/images/banner.png

0 Bytes
Loading

Media/images/icon.png

143 KB
Loading

Media/images/icon.xcf

2.3 MB
Binary file not shown.

Media/images/icon_small.png

16.8 KB
Loading

Media/images/icon_transparent.png

7.41 KB
Loading

Media/images/icon_transparent.xcf

14.5 KB
Binary file not shown.

Media/images/nexuslogo.png

84.8 KB
Loading

Media/images/ss.png

-545 KB
Loading

Media/images/transparent.png

58.3 KB
Loading

PleaseReadMe.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ You can find your mop in the washing machine room (between kitchen and bathroom)
1919

2020

2121
# KNOWN ISSUES #
22-
- Player haas to have the pissing button binded to P, otherwise the mod will not work
2322
- Player may need to drop and grab the mop again, in order to it work when moving between rooms
2423

2524

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
[![](https://img.shields.io/github/v/release/Athlon007/ActualMop?include_prereleases&label=Development&style=for-the-badge)](https://github.com/Athlon007/MOP/releases)
55
[![](https://img.shields.io/github/license/Athlon007/ActualMop?style=for-the-badge)](LICENSE.md)
66

7-
<img align="right" src="Media/images/icon_small.png" alt="icon" width=128 />
7+
<img align="right" src="Media/images/icon_transparent.png" alt="icon" width=128 />
88

99
Actual Mop adds a... Mop to My Summer Car, which lets you clean the urine stains in your home!
1010

1111
## Requirements
1212

1313
- My Summer Car (newest release)
1414
- [MSC Mod Loader 1.1.5](https://www.racedepartment.com/downloads/msc-mod-loader.15339/)
15-
- Windows operating system (this mod will not work on macOS or Linux, due to required Windows API)
15+
- Windows operating system (this mod will not work on macOS or Linux, due to required Win32 API)
1616

1717
## Installation
1818

@@ -22,7 +22,6 @@ You can find your mop in the washing machine room (between kitchen and bathroom)
2222

2323
## Known issues
2424

25-
* Player has to have the pissing button binded to P, otherwise the mod will not work
2625
* Player may need to drop and grab the mop again, in order to it work when moving between rooms
2726

2827
## License

0 commit comments

Comments
 (0)