Skip to content

Commit

Permalink
Bug-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Nov 12, 2023
1 parent 8013be2 commit 7a161d3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ allprojects {
apply plugin: "java-library"
apply plugin: "org.openjfx.javafxplugin"

version = "2.3.0"
version = "2.3.1"
ext {
// App Metadata
appName = "ArkPets"
Expand Down
2 changes: 2 additions & 0 deletions core/src/cn/harryh/arkpets/ArkChar.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public ArkChar(String assetLocation, AssetCtrl.AssetAccessor assetAccessor, floa
@Override
protected void onApply(AnimData animData) {
Logger.debug("Animation", "Apply " + playing);
// Sync skeleton position data
offsetY.reset((float)playing.offsetY());
position.reset(position.end().x, position.end().y, playing.mobility() != 0 ? playing.mobility() : position.end().z);
}
};
// 6.Canvas setup
Expand Down
16 changes: 9 additions & 7 deletions core/src/cn/harryh/arkpets/ArkPets.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,13 @@ public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (pointer <= 0) {
if (mouse_drag) {
cha.position.reset(cha.position.end().x, cha.position.end().y, mouse_intention_x);
if (tray.keepAnim != null && cha.getPlaying().mobility() != 0) {
AnimData newAnim = cha.getPlaying();
newAnim = new AnimData(newAnim.animClip(), null, newAnim.isLoop(), newAnim.isStrict(), newAnim.offsetY(), Math.abs(newAnim.mobility()) * mouse_intention_x);
tray.keepAnim = newAnim;
if (cha.getPlaying() != null && cha.getPlaying().mobility() != 0) {
AnimData anim = cha.getPlaying();
cha.setAnimation(anim.derive(anim.offsetY(), Math.abs(anim.mobility()) * mouse_intention_x));
}
if (tray.keepAnim != null && tray.keepAnim.mobility() != 0) {
AnimData anim = tray.keepAnim;
tray.keepAnim = anim.derive(anim.offsetY(), Math.abs(anim.mobility()) * mouse_intention_x);
}
} else if (button == Input.Buttons.LEFT) {
changeAnimation(behavior.clickEnd());
Expand Down Expand Up @@ -391,9 +394,8 @@ public static int getArkPetsWindowNum(String title) {
private void walkWindow(float len) {
float expectedLen = len * WD_SCALE * (30f / APP_FPS);
int realLen = randomRound(expectedLen);
float newPlaneX = windowPosition.end().x + realLen;
float newPlaneY = -(windowPosition.end().y - WD_H);
plane.changePosition(Gdx.graphics.getDeltaTime(), newPlaneX, newPlaneY);
float newPlaneX = plane.getX() + realLen;
plane.changePosition(Gdx.graphics.getDeltaTime(), newPlaneX, plane.getY());
}

private int randomRound(float val) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/cn/harryh/arkpets/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public final class Const {
// App version
public static final Version appVersion = new Version(2, 3, 0);
public static final Version appVersion = new Version(2, 3, 1);

// App name
public static final String appName = "ArkPets";
Expand Down
3 changes: 3 additions & 0 deletions core/src/cn/harryh/arkpets/animations/AnimClip.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import java.util.regex.Pattern;


/** One Animation Clip is corresponding to one certain Spine {@link Animation}.
* @since ArkPets 2.3
*/
public class AnimClip {
public final String fullName;
public final String baseName;
Expand Down
3 changes: 3 additions & 0 deletions core/src/cn/harryh/arkpets/animations/AnimClipGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import java.util.*;


/** The class implements the Collection of {@link AnimClip}.
* @since ArkPets 2.3
*/
public class AnimClipGroup implements Collection<AnimClip> {
protected final ArrayList<AnimClip> animClipList;

Expand Down
1 change: 1 addition & 0 deletions core/src/cn/harryh/arkpets/transitions/Transition.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/** The class represents a transition,
* which controls a value transit from its starting value to its ending value.
* @param <E> The type of the value.
* @since ArkPets 2.3
*/
abstract public class Transition<E> {
protected E start;
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/ExePacking.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; Download Inno Setup: https://jrsoftware.org/isdl.php

#define MyAppName "ArkPets"
#define MyAppVersion "2.3.0"
#define MyAppVersion "2.3.1"
#define MyAppPublisher "Harry Huang"
#define MyAppURL "https://arkpets.harryh.cn/"

Expand Down

0 comments on commit 7a161d3

Please sign in to comment.