Skip to content

Commit

Permalink
v0.0.7 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianscar committed Jun 28, 2022
1 parent ab293e7 commit e40d16d
Show file tree
Hide file tree
Showing 351 changed files with 13,058 additions and 5,763 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
applicationVariants.all { variant ->
if (variant.buildType.name == 'release') {
variant.outputs.all {
outputFileName = "cbpd-v${defaultConfig.versionName}.apk"
outputFileName = "CarbonizedPD-v${defaultConfig.versionName}-Android.apk"
}
}
}
Expand Down
Binary file modified android/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public boolean connectedToUnmeteredNetwork() {
private static FreeTypeFontGenerator KRFontGenerator;
//droid sans / noto sans, for use with Simplified Chinese
private static FreeTypeFontGenerator SCFontGenerator;
//droid sans / noto sans, for use with Traditional Chinese
private static FreeTypeFontGenerator TCFontGenerator;
//droid sans / noto sans, for use with Japanese
private static FreeTypeFontGenerator JPFontGenerator;

Expand All @@ -191,14 +193,21 @@ public void setupFontGenerators(int pageSize, boolean systemfont) {

resetGenerators(false);
fonts = new HashMap<>();
basicFontGenerator = KRFontGenerator = SCFontGenerator = JPFontGenerator = null;
if (systemfont && Gdx.files.absolute("/system/fonts/Roboto-Regular.ttf").exists()) {
basicFontGenerator = KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = fallbackFontGenerator = null;

if (Gdx.files.absolute("/system/fonts/Roboto-Regular.ttf").exists()) {
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/Roboto-Regular.ttf"));
} else if (systemfont && Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){
} else if (Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/DroidSans.ttf"));
} else {
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
}
if (!systemfont) {
if (basicFontGenerator == null) {
basicFontGenerator = fallbackFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
}
else {
fallbackFontGenerator = basicFontGenerator;
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
}
}

//android 7.0+. all asian fonts are nicely contained in one spot
Expand All @@ -217,7 +226,7 @@ public void setupFontGenerators(int pageSize, boolean systemfont) {
default:
typeFace = 2;
}
KRFontGenerator = SCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansCJK-Regular.ttc"), typeFace);
KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansCJK-Regular.ttc"), typeFace);

//otherwise we have to go over a few possibilities.
} else {
Expand All @@ -230,12 +239,19 @@ public void setupFontGenerators(int pageSize, boolean systemfont) {
koreanAndroid6OTF = true;
}

//Chinese font generators
//Simplified Chinese font generators
if (Gdx.files.absolute("/system/fonts/NotoSansSC-Regular.otf").exists()){
SCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansSC-Regular.otf"));
} else if (Gdx.files.absolute("/system/fonts/NotoSansHans-Regular.otf").exists()){
SCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansHans-Regular.otf"));
}

//Traditional Chinese font generators
if (Gdx.files.absolute("/system/fonts/NotoSansTC-Regular.otf").exists()){
TCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansTC-Regular.otf"));
} else if (Gdx.files.absolute("/system/fonts/NotoSansHant-Regular.otf").exists()){
TCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansHant-Regular.otf"));
}

//Japaneses font generators
if (Gdx.files.absolute("/system/fonts/NotoSansJP-Regular.otf").exists()){
Expand All @@ -253,57 +269,65 @@ public void setupFontGenerators(int pageSize, boolean systemfont) {

if (KRFontGenerator == null) KRFontGenerator = fallbackGenerator;
if (SCFontGenerator == null) SCFontGenerator = fallbackGenerator;
if (TCFontGenerator == null) TCFontGenerator = fallbackGenerator;
if (JPFontGenerator == null) JPFontGenerator = fallbackGenerator;

}
if (!systemfont) {
switch (PDSettings.language()) {
case CHINESE:
fallbackFontGenerator = SCFontGenerator;
break;
case TR_CHINESE:
fallbackFontGenerator = TCFontGenerator;
break;
case KOREAN:
fallbackFontGenerator = KRFontGenerator;
break;
case JAPANESE:
fallbackFontGenerator = JPFontGenerator;
break;
}
KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/fusion_pixel.ttf"));
}

if (basicFontGenerator != null) fonts.put(basicFontGenerator, new HashMap<>());
if (KRFontGenerator != null) fonts.put(KRFontGenerator, new HashMap<>());
if (SCFontGenerator != null) fonts.put(SCFontGenerator, new HashMap<>());
if (TCFontGenerator != null) fonts.put(TCFontGenerator, new HashMap<>());
if (JPFontGenerator != null) fonts.put(JPFontGenerator, new HashMap<>());
if (fallbackFontGenerator != null) fonts.put(fallbackFontGenerator, new HashMap<>());

//would be nice to use RGBA4444 to save memory, but this causes problems on some gpus =S
packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 1, false);
}

private static Matcher KRMatcher = Pattern.compile("\\p{InHangul_Syllables}").matcher("");
private static Matcher SCMatcher = Pattern.compile("\\p{InCJK_Unified_Ideographs}|\\p{InCJK_Symbols_and_Punctuation}|\\p{InHalfwidth_and_Fullwidth_Forms}").matcher("");
private static Matcher CNMatcher = Pattern.compile("\\p{InCJK_Unified_Ideographs}|\\p{InCJK_Symbols_and_Punctuation}|\\p{InHalfwidth_and_Fullwidth_Forms}").matcher("");
private static Matcher JPMatcher = Pattern.compile("\\p{InHiragana}|\\p{InKatakana}").matcher("");

@Override
protected FreeTypeFontGenerator getGeneratorForString( String input ){
if (KRMatcher.reset(input).find()){
return KRFontGenerator;
} else if (SCMatcher.reset(input).find()){
return SCFontGenerator;
} else if (CNMatcher.reset(input).find()){
switch (PDSettings.language()) {
case CHINESE:
default:
return SCFontGenerator;
case TR_CHINESE:
return TCFontGenerator;
}
} else if (JPMatcher.reset(input).find()){
return JPFontGenerator;
} else {
return basicFontGenerator;
}
}

//splits on newlines, underscores, and chinese/japaneses characters
private Pattern regularsplitter = Pattern.compile(
"(?<=\n)|(?=\n)|(?<=_)|(?=_)|" +
"(?<=\\p{InHiragana})|(?=\\p{InHiragana})|" +
"(?<=\\p{InKatakana})|(?=\\p{InKatakana})|" +
"(?<=\\p{InCJK_Unified_Ideographs})|(?=\\p{InCJK_Unified_Ideographs})|" +
"(?<=\\p{InCJK_Symbols_and_Punctuation})|(?=\\p{InCJK_Symbols_and_Punctuation})|" +
"(?<=\\p{InHalfwidth_and_Fullwidth_Forms})|(?=\\p{InHalfwidth_and_Fullwidth_Forms})");

//additionally splits on words, so that each word can be arranged individually
private Pattern regularsplitterMultiline = Pattern.compile(
"(?<= )|(?= )|(?<=\n)|(?=\n)|(?<=_)|(?=_)|" +
"(?<=\\p{InHiragana})|(?=\\p{InHiragana})|" +
"(?<=\\p{InKatakana})|(?=\\p{InKatakana})|" +
"(?<=\\p{InCJK_Unified_Ideographs})|(?=\\p{InCJK_Unified_Ideographs})|" +
"(?<=\\p{InCJK_Symbols_and_Punctuation})|(?=\\p{InCJK_Symbols_and_Punctuation})|" +
"(?<=\\p{InHalfwidth_and_Fullwidth_Forms})|(?=\\p{InHalfwidth_and_Fullwidth_Forms})");

//splits on each non-hangul character. Needed for weird android 6.0 font files
private Pattern android6KRSplitter = Pattern.compile(
"(?<= )|(?= )|(?<=\n)|(?=\n)|(?<=_)|(?=_)|" +
private static Pattern android6KRSplitter = Pattern.compile(
"(?<= )|(?= )|(?<=\n)|(?=\n)|(?<=_)|(?=_)|(?<=\\\\)|(?=\\\\)|" +
"(?!\\p{InHangul_Syllables})|(?<!\\p{InHangul_Syllables})");

@Override
Expand Down
Binary file modified android/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-hdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-mdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ allprojects {

ext {
appName = 'Carbonized Pixel Dungeon'
appVendor = 'AnsdoShip'
appPackageName = 'com.ansdoship.carbonizedpixeldungeon'

appVersionCode = 18
appVersionName = '0.0.6p2-ALPHA'
appVersionCode = 19
appVersionName = '0.0.6p3-ALPHA'

appJavaCompatibility = JavaVersion.VERSION_1_8

Expand All @@ -24,7 +25,7 @@ allprojects {
appAndroidTargetSDK = 31

gdxVersion = '1.11.0'
gdxControllersVersion = '2.2.1'
gdxControllersVersion = '2.2.2'
robovmVersion = '2.3.14'
}
version = appVersionName
Expand Down
Binary file added core/src/main/assets/fonts/fusion_pixel.ttf
Binary file not shown.
Binary file added core/src/main/assets/gdx/cursor_controller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/src/main/assets/gdx/cursor_mouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified core/src/main/assets/interfaces/badges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified core/src/main/assets/interfaces/banners.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified core/src/main/assets/interfaces/icons.png
Binary file modified core/src/main/assets/interfaces/status_pane.png
Loading

0 comments on commit e40d16d

Please sign in to comment.