-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增强日志,重命名ui活动栏类,更新部分语言,优化平台检测逻辑,去除不需要的类
- Loading branch information
Showing
40 changed files
with
823 additions
and
789 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
module/ExtensionLoader/src/team/zxorg/extensionloader/core/PlatformType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package team.zxorg.extensionloader.core; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public enum PlatformType { | ||
MAC_ARM("mac", "aarch64"), | ||
MAC("mac"), | ||
LINUX_ARM("linux", "aarch64"), | ||
LINUX("linux"), | ||
WINDOWS("win"), | ||
ALL(""); | ||
public static final PlatformType CURRENT_PLATFORM = detectCurrentPlatform(); | ||
private final Set<String> keywords; | ||
|
||
public Set<String> getKeywords() { | ||
return keywords; | ||
} | ||
|
||
PlatformType(String... keywords) { | ||
this.keywords = new HashSet<>(List.of(keywords)); | ||
} | ||
|
||
public boolean isMac() { | ||
return keywords.contains("mac"); | ||
} | ||
|
||
public boolean isLinux() { | ||
return keywords.contains("linux"); | ||
} | ||
|
||
public boolean isWindows() { | ||
return keywords.contains("win"); | ||
} | ||
|
||
public boolean isArm() { | ||
return keywords.contains("aarch64"); | ||
} | ||
|
||
public boolean isAll() { | ||
return this == ALL; | ||
} | ||
|
||
private static PlatformType detectCurrentPlatform() { | ||
String osName = System.getProperty("os.name").toLowerCase(); | ||
String arch = System.getProperty("os.arch").toLowerCase(); | ||
|
||
if (osName.contains("mac")) { | ||
return arch.contains("aarch64") ? MAC_ARM : MAC; | ||
} else if (osName.contains("linux")) { | ||
return arch.contains("aarch64") ? LINUX_ARM : LINUX; | ||
} else if (osName.contains("windows")) { | ||
return WINDOWS; | ||
} else { | ||
return ALL; | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name().toLowerCase(); | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
module/ExtensionLoader/src/team/zxorg/extensionloader/core/Resource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
module/ExtensionLoader/src/team/zxorg/extensionloader/core/StopWatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package team.zxorg.extensionloader.core; | ||
|
||
public class StopWatch { | ||
private long startTime; | ||
private long stopTime; | ||
private boolean isRunning; | ||
|
||
public void start() { | ||
if (!isRunning) { | ||
startTime = System.currentTimeMillis(); | ||
isRunning = true; | ||
} | ||
} | ||
|
||
public void stop() { | ||
if (isRunning) { | ||
stopTime = System.currentTimeMillis(); | ||
isRunning = false; | ||
} | ||
} | ||
|
||
public long getTime() { | ||
if (isRunning) { | ||
return System.currentTimeMillis() - startTime; | ||
} else { | ||
return stopTime - startTime; | ||
} | ||
} | ||
|
||
public void reset() { | ||
startTime = 0; | ||
stopTime = 0; | ||
isRunning = false; | ||
} | ||
|
||
public boolean isRunning() { | ||
return isRunning; | ||
} | ||
} |
Oops, something went wrong.