chore(update.yml): remove update.yml workflow file
chore(.gitmodules): remove .gitmodules file chore(about_contributors_zh_cn.json): remove about_contributors_zh_cn.json file fix(Hook.cpp): change parameter name from TMP_Text_this to TMP_Textself in UpdateFont function fix(MainActivity.kt): remove unused import statement for FilesChecker chore(ProgramConfig.kt): update default values for transRemoteZipUrl, useRemoteAssets, and delRemoteAfterUpdate in ProgramConfig class chore(HomePage.kt): remove unused GakuSwitch for replace_font feat(Color.kt): add Color.kt file feat(Type.kt): add Type.kt file feat(colors.xml): add colors.xml file fix(strings.xml): fix typo in basic_settings string
This commit is contained in:
parent
e663f5ca80
commit
1f73aee3c1
40
.github/workflows/update.yml
vendored
40
.github/workflows/update.yml
vendored
@ -1,40 +0,0 @@
|
||||
name: Update Submodule
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- update-submodule
|
||||
|
||||
jobs:
|
||||
update-submodule:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Authorize Git
|
||||
run: |
|
||||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
git config --global user.name "$GITHUB_ACTOR"
|
||||
|
||||
- name: Update Submodule
|
||||
run: |
|
||||
git submodule update --init --recursive --remote -f
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
|
||||
- name: Commit Changes
|
||||
run: |
|
||||
git commit -am "chore(submodule): Update Translation Data"
|
||||
git push origin main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "app/src/main/assets/gakumas-local"]
|
||||
path = app/src/main/assets/gakumas-local
|
||||
url = https://github.com/NatsumeLS/Gakumas-Translation-Data-EN.git
|
@ -1,29 +0,0 @@
|
||||
{
|
||||
"plugin_repo": "https://github.com/chinosk6/gakuen-imas-localify",
|
||||
"main_contributors": [
|
||||
{
|
||||
"name": "chinosk(插件本体)",
|
||||
"links": [
|
||||
{"name": "Github", "link": "https://github.com/chinosk6"},
|
||||
{"name": "Bilibili", "link": "https://space.bilibili.com/287061163"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DarwinTree(译文工作流)",
|
||||
"links": [
|
||||
{"name": "Github", "link": "https://github.com/darwintree"},
|
||||
{"name": "Bilibili", "link": "https://space.bilibili.com/6069705"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "以及其他所有翻译贡献者",
|
||||
"links": [
|
||||
{"name": "Github", "link": "https://github.com/chinosk6/GakumasTranslationData/graphs/contributors"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"contrib_img": {
|
||||
"plugin": "https://contrib.rocks/image?repo=chinosk6/gakuen-imas-localify",
|
||||
"translation": "https://contrib.rocks/image?repo=chinosk6/GakumasTranslationData"
|
||||
}
|
||||
}
|
@ -298,7 +298,7 @@ namespace GakumasLocal::HookMain {
|
||||
}
|
||||
|
||||
std::unordered_set<void*> updatedFontPtrs{};
|
||||
void UpdateFont(void* TMP_Text_this) {
|
||||
void UpdateFont(void* TMP_Textself) {
|
||||
static auto get_font = Il2cppUtils::GetMethod("Unity.TextMeshPro.dll",
|
||||
"TMPro", "TMP_Text", "get_font");
|
||||
static auto set_font = Il2cppUtils::GetMethod("Unity.TextMeshPro.dll",
|
||||
@ -309,7 +309,7 @@ namespace GakumasLocal::HookMain {
|
||||
static auto UpdateFontAssetData = Il2cppUtils::GetMethod("Unity.TextMeshPro.dll", "TMPro",
|
||||
"TMP_FontAsset", "UpdateFontAssetData");
|
||||
|
||||
auto fontAsset = get_font->Invoke<void*>(TMP_Text_this);
|
||||
auto fontAsset = get_font->Invoke<void*>(TMP_Textself);
|
||||
|
||||
if (!updatedFontPtrs.contains(fontAsset)) {
|
||||
updatedFontPtrs.emplace(fontAsset);
|
||||
|
@ -14,7 +14,6 @@ import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import io.github.chinosk.gakumas.localify.hookUtils.FileHotUpdater
|
||||
import io.github.chinosk.gakumas.localify.hookUtils.FilesChecker
|
||||
import io.github.chinosk.gakumas.localify.hookUtils.MainKeyEventDispatcher
|
||||
import io.github.chinosk.gakumas.localify.mainUtils.json
|
||||
import io.github.chinosk.gakumas.localify.models.GakumasConfig
|
||||
@ -73,8 +72,7 @@ class MainActivity : ComponentActivity(), ConfigUpdateListener, IConfigurableAct
|
||||
var resVersionText = "unknown"
|
||||
|
||||
try {
|
||||
val stream = assets.open("${FilesChecker.localizationFilesDir}/version.txt")
|
||||
resVersionText = FilesChecker.convertToString(stream)
|
||||
resVersionText = programConfigViewModel.localResourceVersion.value
|
||||
|
||||
val packInfo = packageManager.getPackageInfo(packageName, 0)
|
||||
val version = packInfo.versionName
|
||||
|
@ -141,15 +141,11 @@ object FilesChecker {
|
||||
val pluginBasePath = File(filesDir, localizationFilesDir)
|
||||
val localFilesDir = File(pluginBasePath, "local-files")
|
||||
|
||||
val fontFile = File(localFilesDir, "gkamsZHFontMIX.otf")
|
||||
val resourceDir = File(localFilesDir, "resource")
|
||||
val genericTransDir = File(localFilesDir, "genericTrans")
|
||||
val genericTransFile = File(localFilesDir, "generic.json")
|
||||
val i18nFile = File(localFilesDir, "localization.json")
|
||||
|
||||
if (fontFile.exists()) {
|
||||
fontFile.delete()
|
||||
}
|
||||
if (deleteRecursively(resourceDir)) {
|
||||
resourceDir.mkdirs()
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ import kotlinx.serialization.json.jsonObject
|
||||
@Serializable
|
||||
data class ProgramConfig(
|
||||
var checkBuiltInAssets: Boolean = true,
|
||||
var transRemoteZipUrl: String = "",
|
||||
var useRemoteAssets: Boolean = false,
|
||||
var delRemoteAfterUpdate: Boolean = true,
|
||||
var transRemoteZipUrl: String = "https://github.com/NatsumeLS/Gakumas-Translation-Data-EN.git",
|
||||
var useRemoteAssets: Boolean = true,
|
||||
var delRemoteAfterUpdate: Boolean = false,
|
||||
var cleanLocalAssets: Boolean = false,
|
||||
var p: Boolean = false
|
||||
)
|
||||
|
@ -140,10 +140,6 @@ fun HomePage(modifier: Modifier = Modifier,
|
||||
GakuSwitch(modifier, stringResource(R.string.enable_plugin), checked = config.value.enabled) {
|
||||
v -> context?.onEnabledChanged(v)
|
||||
}
|
||||
|
||||
GakuSwitch(modifier, stringResource(R.string.replace_font), checked = config.value.replaceFont) {
|
||||
v -> context?.onReplaceFontChanged(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.height(6.dp))
|
||||
|
@ -0,0 +1,11 @@
|
||||
package io.github.chinosk.gakumas.localify.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val Purple80 = Color(0xFFD0BCFF)
|
||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
||||
val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650a4)
|
||||
val PurpleGrey40 = Color(0xFF625b71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
@ -0,0 +1,34 @@
|
||||
package io.github.chinosk.gakumas.localify.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp,
|
||||
letterSpacing = 0.sp
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 11.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
*/
|
||||
)
|
10
app/src/main/res/values/colors.xml
Normal file
10
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
@ -11,7 +11,7 @@
|
||||
<string name="live_custome_dress_id">Live Custom Dress ID (eg. hski-cstm-0002)</string>
|
||||
<string name="useCustomeGraphicSettings">Use Custom Graphic Settings</string>
|
||||
<string name="renderscale">Render Scale (0.5-1.0)</string>
|
||||
<string name="text_hook_test_mode">Text Hook Test Mode (For Testing Only)</string>
|
||||
<string name="text_hook_test_mode">Text Hook Test Mode</string>
|
||||
<string name="export_text">Export Text (For Collecting Strings)</string>
|
||||
<string name="force_export_resource">Force Update Resource</string>
|
||||
<string name="max_high">Max</string>
|
||||
@ -43,7 +43,7 @@
|
||||
<string name="axisx_y">axisX.y</string>
|
||||
<string name="axisy_y">axisY.y</string>
|
||||
<string name="axisz_y">axisZ.y</string>
|
||||
<string name="basic_settings">Basic Ssettings</string>
|
||||
<string name="basic_settings">Basic Settings</string>
|
||||
<string name="graphic_settings">Graphic Settings</string>
|
||||
<string name="camera_settings">Camera Settings</string>
|
||||
<string name="test_mode_live">Test Mode - LIVE</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user