Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
froquede committed Jun 29, 2023
1 parent d8b1e3e commit fbb3975
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 93 deletions.
17 changes: 9 additions & 8 deletions AnimationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AnimController
public Quaternion rotation_offset = Quaternion.Euler(0, 0, 0), original_rotation = Quaternion.identity;
CallBack callback;
bool loop = true;
public bool anchorRoot = false, doCrossfade = true;
public bool anchorRoot = false, doCrossfade = true, offsetPelvis = false;
public float speed = 1f;
public float timeLimit = 0f, timeLimitStart = 0f;

Expand Down Expand Up @@ -54,6 +54,7 @@ public AnimController(AnimController origin)
first_frame_pelvis = origin.first_frame_pelvis;
anchorRootFade = origin.anchorRootFade;
anchorRootSpeed = origin.anchorRootSpeed;
offsetPelvis = origin.offsetPelvis;
}

public AnimController()
Expand Down Expand Up @@ -133,7 +134,7 @@ async void LoadJSON()
}
else
{
MessageSystem.QueueMessage(MessageDisplayData.Type.Error, "Error loading animation '" + name + "', file doesn't exists", 3f);
MessageSystem.QueueMessage(MessageDisplayData.Type.Error, "Error loading animation '" + path + "', file doesn't exist", 3f);
return;
}

Expand All @@ -155,10 +156,10 @@ async void LoadJSON()
}
}

try
{
anchorRoot = json_parsed["anchorRoot"] == null ? anchorRoot : (bool)json_parsed["anchorRoot"];
}
try { anchorRoot = json_parsed["anchorRoot"] == null ? anchorRoot : (bool)json_parsed["anchorRoot"]; }
catch { }

try { offsetPelvis = json_parsed["offset_pelvis"] == null ? offsetPelvis : (bool)json_parsed["offset_pelvis"]; }
catch { }

animation = new AnimationJSON((float)json_parsed["duration"], Newtonsoft.Json.JsonConvert.DeserializeObject<float[]>(json_parsed["times"].ToString()), parts);
Expand Down Expand Up @@ -190,7 +191,7 @@ public void Update()

if (Main.walking_go.last_animation == null) Main.walking_go.last_animation = new AnimController(this);

int d_crossfade = (Main.walking_go.last_animation.name != name && doCrossfade || interpolateActual) ? 10 : doCrossfade ? crossfade : 0;
int d_crossfade = (Main.walking_go.last_animation.name != name && doCrossfade || interpolateActual) ? 16 : doCrossfade ? crossfade : 0;
float step = 0;

if (count < d_crossfade) index = 0;
Expand Down Expand Up @@ -263,7 +264,7 @@ public void Update()
{
i_target_pos = tpart.position;
i_rotation = tpart.rotation;
step = Time.deltaTime * 24f;
step = Time.deltaTime * 12f;
}

if (animation.times.Length > 1)
Expand Down
2 changes: 1 addition & 1 deletion Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "walking-mod",
"DisplayName": "Walking Mod",
"Author": "froquede",
"Version": "1.1.0",
"Version": "1.2.0",
"ManagerVersion": "0.22.5.0",
"Requirements": [],
"LoadAfter": ["XXLMod3"],
Expand Down
7 changes: 4 additions & 3 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private static void OnGUI(UnityModManager.ModEntry modEntry)
GUILayout.Space(12);
settings.throwdown_force = Slider("Throwdown force (" + settings.throwdown_force.ToString("N0") + ")", settings.throwdown_force, 0f, 50f, .1f, 25f);
settings.max_magnitude_bail = Slider("Max bail force to stumble (" + settings.max_magnitude_bail.ToString("N2") + ")", settings.max_magnitude_bail, 0f, 20f, .1f, 8f, "0 is always bail");
settings.step_off_limit = Slider("Step off velocity limit (" + settings.step_off_limit.ToString("N2") + ")", settings.step_off_limit, 0f, 20f, .1f, 7f, "0 will make the board to never be magnetized");
settings.minVelocityRoll = Slider("Roll limiter (" + settings.minVelocityRoll.ToString("N2") + ")", settings.minVelocityRoll, 0f, 1f, .05f, .3f, "0 is always roll after impact");
settings.bailLimit = Slider("Respawn on skate after bail limit (" + settings.bailLimit.ToString("N2") + ")", settings.bailLimit, 0f, 20f, .05f, 2f, "This limits the time you want to use to respawn walking or skating in \nseconds");
settings.frame_wait = (int)Slider("Button press wait (" + settings.frame_wait.ToString("N0") + ")", settings.frame_wait, 0f, 64f, 1f, 12f, "The amount of frames to wait to enter walk mode");
Expand Down Expand Up @@ -155,8 +156,8 @@ private static void OnGUI(UnityModManager.ModEntry modEntry)

GUILayout.Label("<b>Velocity</b>", subtitle);
GUILayout.Space(10);
settings.camera_pos_vel = Slider("Position (" + settings.camera_pos_vel.ToString("N2") + ")", settings.camera_pos_vel, 0f, 20f, .1f, 10f);
settings.camera_rot_vel = Slider("Rotation (" + settings.camera_rot_vel.ToString("N2") + ")", settings.camera_rot_vel, 0f, 20f, .1f, 4f);
settings.camera_pos_vel = Slider("Position (" + settings.camera_pos_vel.ToString("N2") + ")", settings.camera_pos_vel, 0f, 40f, .1f, 20f);
settings.camera_rot_vel = Slider("Rotation (" + settings.camera_rot_vel.ToString("N2") + ")", settings.camera_rot_vel, 0f, 40f, .1f, 8f);
GUILayout.Space(6);
}
GUILayout.EndVertical();
Expand Down Expand Up @@ -262,4 +263,4 @@ private static void OnSaveGUI(UnityModManager.ModEntry modEntry)
settings.Save(modEntry);
}
}
}
}
3 changes: 2 additions & 1 deletion Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Settings : UnityModManager.ModSettings, IDrawable
public float max_magnitude_bail = 8f;
public float minVelocityRoll = 0.3f;
public float smooth_factor_transition = .25f;
public float camera_pos_vel = 10f, camera_rot_vel = 4f;
public float camera_pos_vel = 20f, camera_rot_vel = 8f;
public float bailLimit = 2f;
public bool left_arm = false;
public bool hippie_jump = false;
Expand All @@ -30,6 +30,7 @@ public class Settings : UnityModManager.ModSettings, IDrawable
public string magnetize_button = "X";
public string pin_button = "Y";
public bool mallgrab = false;
public float step_off_limit = 7f;

public float idle_jump_force = 1f, running_jump_force = 2.5f, flip_jump_force = 3f, hippie_jump_force = 2.5f;
public void OnChange()
Expand Down
Loading

0 comments on commit fbb3975

Please sign in to comment.