Skip to content

Commit

Permalink
Update 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon007 committed Apr 27, 2020
1 parent 6a950db commit a699904
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 26 deletions.
3 changes: 2 additions & 1 deletion ActualMop/ActualMop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
<PropertyGroup>
<PostBuildEvent>if "$(ConfigurationName)" == "Debug" (
copy $(TargetPath) "C:\Users\aathl\Documents\MySummerCar\Mods" /y
copy "$(TargetDir)$(TargetName).pdb" "C:\Users\aathl\Documents\MySummerCar\Mods\mods"
copy "$(TargetDir)$(TargetName).pdb" "C:\Users\aathl\Documents\MySummerCar\Mods" /y
cd "C:\Users\aathl\Documents\MySummerCar\Mods"
call "C:\Users\aathl\Documents\MySummerCar\Mods\debug.bat"
) ELSE (
copy $(TargetPath) "C:\Users\aathl\Documents\MySummerCar\Mods" /y
Expand Down
4 changes: 2 additions & 2 deletions ActualMop/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
17 changes: 13 additions & 4 deletions ActualMop/Resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Added:
- "Use" icon will now appear when mop is in hand
WARNING: With this update mop will respawn at the default position!

Bug Fixes:
- Player can't 'clean yourself' with mop
### Changes

- Updated for MSC Mod Loader version 1.1.7
- Improved chnagelog readibility
- The message for incorrect urinating key will now pop up the console
- Actual Mop save is now located in MSC save folder
- Changed the default spawn position
- Slightly changed the save format (warning: old Actual Mop saves won't work in the current version!)

### Bug Fixes

- Fixed mod not loading for some users, and for others leaving an error in output log
63 changes: 57 additions & 6 deletions ActualMop/src/ActualMop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ActualMop : Mod
public override string ID => "ActualMop"; //Your mod ID (unique)
public override string Name => "Actual Mop"; //You mod name
public override string Author => "Athlon"; //Your Username
public override string Version => "1.0.2"; //Version
public override string Version => "1.0.3"; //Version

// Set this to true if you will be load custom assets from Assets folder.
// This will create subfolder in Assets folder for your mod.
Expand All @@ -48,7 +48,7 @@ public override void OnLoad()
MopBehaviour behaviour = mop.AddComponent<MopBehaviour>();

// Load save data
MopSaveData mopSaveData = SaveLoad.DeserializeSaveFile<MopSaveData>(this, "mop.cfg");
MopSaveData mopSaveData = SaveLoad.DeserializeSaveFile<MopSaveData>(this, GetSavePath());
if (mopSaveData != null)
{
behaviour.Initialize(mopSaveData);
Expand All @@ -57,13 +57,14 @@ public override void OnLoad()

public override void OnSave()
{
SaveLoad.SerializeSaveFile(this, mop.GetComponent<MopBehaviour>().GetSaveInfo(), "mop.cfg");
SaveLoad.SerializeSaveFile(this, mop.GetComponent<MopBehaviour>().GetSaveInfo(), GetSavePath());
}

public override void OnNewGame()
{
// Delete save data on new game
System.IO.File.Delete(ModLoader.GetModConfigFolder(this) + "\\mop.cfg");
ModConsole.Print("[Actual Mop] Resetting save data.");
System.IO.File.Delete(GetSavePath());
}

// ayy, lmao
Expand All @@ -75,9 +76,10 @@ public override void OnNewGame()
public override void ModSettings()
{
Settings.AddButton(this, resetPosition);

// Changelog
Settings.AddHeader(this, "Changelog", headerColor);
Settings.AddText(this, Properties.Resources.changelog);
Settings.AddText(this, GetChangelog());
}

/// <summary>
Expand All @@ -90,8 +92,57 @@ static void ResetMopPosition()
GameObject mop = GameObject.Find("mop(Clone)");
mop.GetComponent<Rigidbody>().velocity = Vector3.zero;
mop.transform.position = MopBehaviour.DefaultPosition;
mop.transform.rotation = new Quaternion();
mop.transform.eulerAngles = MopBehaviour.DefaultEuler;
}
}

/// <summary>
/// Gets changelog from changelog.txt and adds rich text elements.
/// </summary>
/// <returns></returns>
string GetChangelog()
{
string[] changelog = Properties.Resources.changelog.Split('\n');
string output = "";
for (int i = 0; i < changelog.Length; i++)
{
string line = changelog[i];

// If line starts with ###, make it look like a header of section.
if (line.StartsWith("###"))
{
line = line.Replace("###", "");
line = $"<color=yellow><size=24>{line}</size></color>";
}

// Replace - with bullet.
if (line.StartsWith("-"))
{
line = line.Substring(1);
line = $"• {line}";
}

// Similar to the bullet, but also increase the tab.
if (line.StartsWith(" -"))
{
line = line.Substring(3);
line = $" • {line}";
}

if (line.Contains("(Development)"))
{
line = line.Replace("(Development)", "<color=orange>Development: </color>");
}

output += line + "\n";
}

return output;
}

string GetSavePath()
{
return Application.persistentDataPath + "/Mop.cfg";
}
}
}
10 changes: 5 additions & 5 deletions ActualMop/src/MopBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ namespace ActualMop
{
class MopBehaviour : MonoBehaviour
{
public static Vector3 DefaultPosition = new Vector3(-13.5f, -0.6f, 2.8f);
public static Vector3 DefaultPosition = new Vector3(-13.5f, -0.5f, 3f);
public static Vector3 DefaultEuler = new Vector3(341, 91.5f, 359);

PlayMakerFSM pissAreas;
ParticleRenderer pissRenderer;
Expand Down Expand Up @@ -63,7 +64,7 @@ class MopBehaviour : MonoBehaviour

bool isPaused;

public MopBehaviour()
void Start()
{
// Clone this game object to be used later for in hand object
mopInHand = GameObject.Instantiate(this.gameObject);
Expand All @@ -88,7 +89,6 @@ public MopBehaviour()
// Get item pivot
itemPivot = player.transform.Find("Pivot/AnimPivot/Camera/FPSCamera/1Hand_Assemble/ItemPivot");
GetComponent<Rigidbody>().isKinematic = false;
transform.position = DefaultPosition;

// Get hand
hand = player.transform.Find("Pivot/AnimPivot/Camera/FPSCamera/1Hand_Assemble/Hand");
Expand Down Expand Up @@ -117,7 +117,7 @@ public void Initialize(MopSaveData mopSaveData)
{
GetComponent<Rigidbody>().isKinematic = true;
transform.position = mopSaveData.Position;
transform.rotation = mopSaveData.Rotation;
transform.eulerAngles = mopSaveData.Euler;
GetComponent<Rigidbody>().isKinematic = false;
}

Expand Down Expand Up @@ -237,7 +237,7 @@ IEnumerator DisableRoutine()
/// <returns></returns>
public MopSaveData GetSaveInfo()
{
return new MopSaveData(transform.position, transform.rotation);
return new MopSaveData(transform.position, transform.eulerAngles);
}

void OnApplicationFocus(bool hasFocus)
Expand Down
8 changes: 4 additions & 4 deletions ActualMop/src/MopSaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ namespace ActualMop
public class MopSaveData
{
public Vector3 Position;
public Quaternion Rotation;
public Vector3 Euler;

public MopSaveData()
{
this.Position = MopBehaviour.DefaultPosition;
this.Rotation = new Quaternion();
this.Euler = MopBehaviour.DefaultEuler;
}

public MopSaveData(Vector3 position, Quaternion rotation)
public MopSaveData(Vector3 position, Vector3 euler)
{
this.Position = position;
this.Rotation = rotation;
this.Euler = euler;
}
}
}
2 changes: 1 addition & 1 deletion ActualMop/src/Utilities/HexManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public byte GetHex()
// Return default value (P) if invalid
if (!IsValidKey(bind))
{
MSCLoader.ModConsole.Print("[Actual Mop] Urinate key has to be binded to letter or a number on the keyboard!");
MSCLoader.ModConsole.Error("[Actual Mop] Urinate key has to be binded to letter or a number on the keyboard!");
return VK_DEFAULT;
}

Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 1.0.3 (27.04.2020)

WARNING: With this update mop will respawn at the default position!

### Changes

- Updated for MSC Mod Loader version 1.1.7
- Improved chnagelog readibility
- The message for incorrect urinating key will now pop up the console
- Actual Mop save is now located in MSC save folder
- Changed the default spawn position
- Slightly changed the save format (warning: old Actual Mop saves won't work in the current version!)

### Bug Fixes

- Fixed mod not loading for some users, and for others leaving an error in output log

## 1.0.2 (01.03.2020)

### Added
Expand All @@ -8,7 +25,7 @@

### Bug Fixes

- Player can't 'clean yourself' with mop
- Player can't 'clean himself' with mop

## 1.0.1 (16.02.2020)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Actual Mop adds a... Mop to My Summer Car, which lets you clean the urine stains
## Requirements

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

## Installation

Expand Down

0 comments on commit a699904

Please sign in to comment.