Skip to content

Commit

Permalink
Update files for 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MoArtis committed Sep 21, 2019
1 parent 257376c commit 8042d9a
Show file tree
Hide file tree
Showing 10 changed files with 1,400 additions and 727 deletions.
45 changes: 45 additions & 0 deletions Code/Mod/HighResolutionDateTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Runtime.InteropServices;

namespace Mod
{
public static class HighResolutionTime
{
public static bool IsAvailable { get; private set; }

[DllImport("Kernel32.dll", CallingConvention = CallingConvention.Winapi)]
private static extern void GetSystemTimePreciseAsFileTime(out long filetime);

public static long Time
{
get
{
if (!IsAvailable)
{
throw new InvalidOperationException(
"High resolution clock isn't available.");
}

long filetime;
GetSystemTimePreciseAsFileTime(out filetime);

return filetime;
}
}

static HighResolutionTime()
{
try
{
long filetime;
GetSystemTimePreciseAsFileTime(out filetime);
IsAvailable = true;
}
catch (EntryPointNotFoundException)
{
// Not running Windows 8 or higher.
IsAvailable = false;
}
}
}
}
58 changes: 58 additions & 0 deletions Code/Mod/InputConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Rewired;
using System;
using System.IO;

namespace Mod
{

[System.Serializable]
public struct InputConfig
{
public string up;
public string down;
public string left;
public string right;
public string jump;
public string quickAttack;
public string heavyAttack;
public string specialAttack;
public string block;
public string recruit;
public string start;

public int[] ToKeycodeArray()
{
return new int[] {
ParseKeycode(up),
ParseKeycode(down),
ParseKeycode(left),
ParseKeycode(right),
ParseKeycode(start),
ParseKeycode(quickAttack),
ParseKeycode(heavyAttack),
ParseKeycode(jump),
ParseKeycode(specialAttack),
ParseKeycode(block),
ParseKeycode(recruit),
ParseKeycode(jump),
ParseKeycode(specialAttack)
};
}

private int ParseKeycode(string keycodeStr)
{
KeyboardKeyCode keyboardKeyCode;
try
{
keyboardKeyCode = (KeyboardKeyCode)Enum.Parse(typeof(KeyboardKeyCode), keycodeStr);
}
catch (Exception e)
{
File.WriteAllText(string.Format(".\\{0}.txt", keycodeStr), e.Message);
keyboardKeyCode = KeyboardKeyCode.None;
}
return (int)keyboardKeyCode;
}
}

}
67 changes: 67 additions & 0 deletions Code/Mod/ModData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using UnityEngine;

namespace Mod
{
public enum DefaultCharacters
{
Misako,
Kyoko,
Kunio,
Riki,
None
}

[System.Serializable]
public struct ModData
{
public bool allowQuickSkip;
public bool startFromStartMenu;
public bool skipStartMenu;

public string interactActionId;
public InputConfig[] playerOneInputConfigs;
public InputConfig[] playerTwoInputConfigs;
public bool forceXInput;
public bool usePS4buttonPrompts;
public bool displayProgressionInfo;

public int vSyncCount;
public int targetFramerate;
public bool useCustomFramelimiter;

public bool displayDamageOnHit;
public Color xpGetTextColor;
public int xpGetTextFontSize;
public Color hitDmgTextColor;
public int hitDmgTextFontSizeMin;
public int hitDmgTextFontSizeMax;

public bool moreInfosInUseableShops;
public bool loiterSelectedByDefault;
public bool startSelectedByDefault;
public bool noTutorialInNewGamePlus;
public string characterByDefault;
public bool displayMoveInputsInDojo;

public bool unlockSecretCharactersOnceForAllSave;

public bool fixBooksBug;
public bool fixMaxStaminaBug;

public bool activateTrainingMode;
public float enemiesScalingRatio;

public InputConfig GetInputConfig(int playerId)
{
if (playerId == 0)
{
return playerOneInputConfigs[0];
}
else
{
return playerTwoInputConfigs[0];
}
}
}

}
Loading

0 comments on commit 8042d9a

Please sign in to comment.