Skip to content

Commit

Permalink
Merge pull request #229 from KizKizz/system-rework
Browse files Browse the repository at this point in the history
System rework
  • Loading branch information
KizKizz committed Jun 22, 2024
2 parents d1e2e78 + 079af71 commit 36e9729
Show file tree
Hide file tree
Showing 21 changed files with 1,730 additions and 1,423 deletions.
10 changes: 8 additions & 2 deletions Language/CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
"uiBackupModSettings": "备份MOD设置",
"uiOpenModSettingsBackupFolder": "打开设置备份文件夹",
"uiBackups": "已有MOD备份数",
"uiQuickRemoveAllMods": "Save and Remove All Mods",
"uiRemoveAllModsFromTheGameAndSaveThemToReApplyLater": "Remove all mods from the game while saving them to re-apply later",
"uiQuickReapplyAllModsToTheGame": "Re-apply All Saved Mods",
"uiReapplyAllRemovedModsBackToTheGame": "Re-apply all saved mods back to the game",
"uiItemList": "物品列表",
"uiLoadingUILanguage": "加载UI语言",
"uiReloadingMods": "重新加载MOD",
Expand Down Expand Up @@ -515,5 +519,7 @@
"uiDashMotion": "行动方式-冲刺",
"uiRunMotion": "行动方式-移动",
"uiStandbyMotion": "行动方式-待机",
"uiSwimMotion": "行动方式-游泳"
}
"uiSwimMotion": "行动方式-游泳",
"uiRemovingAllModsFromTheGame": "Removing all mods from the game",
"uiReApplyingAllModsBackToTheGame": "Re-applying all saved mods back to the game"
}
8 changes: 7 additions & 1 deletion Language/EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
"uiBackupModSettings": "Backup Mod Settings",
"uiOpenModSettingsBackupFolder": "Open Mod Settings Backup Folder",
"uiBackups": "Backups",
"uiQuickRemoveAllMods": "Save and Remove All Mods",
"uiRemoveAllModsFromTheGameAndSaveThemToReApplyLater": "Remove all mods from the game while saving them to re-apply later",
"uiQuickReapplyAllModsToTheGame": "Re-apply All Saved Mods",
"uiReapplyAllRemovedModsBackToTheGame": "Re-apply all saved mods back to the game",
"uiItemList": "Item List",
"uiLoadingUILanguage": "Loading UI Language",
"uiReloadingMods": "Reloading Mods",
Expand Down Expand Up @@ -514,5 +518,7 @@
"uiDashMotion": "Dash Motion",
"uiRunMotion": "Run Motion",
"uiStandbyMotion": "Standby Motion",
"uiSwimMotion": "Swim Motion"
"uiSwimMotion": "Swim Motion",
"uiRemovingAllModsFromTheGame": "Removing all mods from the game",
"uiReApplyingAllModsBackToTheGame": "Re-applying all saved mods back to the game"
}
8 changes: 7 additions & 1 deletion Language/JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
"uiBackupModSettings": "MOD設定のバックアップ",
"uiOpenModSettingsBackupFolder": "MOD設定のバックアップフォルダを開く",
"uiBackups": "バックアップ",
"uiQuickRemoveAllMods": "すべてのMODを保存して削除する",
"uiRemoveAllModsFromTheGameAndSaveThemToReApplyLater": "すべてのMODをゲームから削除し、後で再適用するために保存する",
"uiQuickReapplyAllModsToTheGame": "保存したすべてのMODを再適用する",
"uiReapplyAllRemovedModsBackToTheGame": "保存したすべてのMODをゲームに再適用する",
"uiItemList": "アイテムリスト",
"uiLoadingUILanguage": "UI言語の読み込み",
"uiReloadingMods": "リローディングモッズ",
Expand Down Expand Up @@ -515,5 +519,7 @@
"uiDashMotion": "ダッシュ",
"uiRunMotion": "ラン",
"uiStandbyMotion": "スタンバイ",
"uiSwimMotion": "スイム"
"uiSwimMotion": "スイム",
"uiRemovingAllModsFromTheGame": "ゲームからすべてのMODを削除する",
"uiReApplyingAllModsBackToTheGame": "保存したすべてのMODをゲームに再適用する。"
}
2 changes: 1 addition & 1 deletion Language/LanguageSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"langInitial": "CN",
"revision": 16,
"revision": 17,
"langFilePath": "E:\\Flutter project\\pso2_mod_manager\\Language\\CN.json",
"selected": false
},
Expand Down
18 changes: 5 additions & 13 deletions app_version_check/app_version.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"name": "PSO2NGS Mod Manager",
"version": "2.7.10",
"version": "2.7.11",
"description": [
"Added a custom filter to Add Mods that automatically ignores unwanted folders/mods when adding mods to the Manager",
"Added an option to add preview images and videos to mods and to ice files",
"Added an option to select which mod files to replace if duplicate are found in applied mods",
"Added highlight on selected item in Item List",
"Added mod preview when hovering on items in Set List",
"Fixed a bug where return button on bounding radius popup being greyed out",
"Added a button bar for function buttons",
"Added a quick mod removal and reapply button to either turn all applied mods on or off",
"More bug fixes",
"MODをManagerに追加する際、不要なフォルダやMODを自動的に無視するカスタムフィルタをAdd Modsに追加",
"MODとアイスファイルにプレビュー画像とビデオを追加するオプションを追加",
"適用されたMODで重複が見つかった場合、どのMODファイルを置き換えるかを選択できるオプションを追加",
"アイテムリストの選択アイテムにハイライトを追加",
"セットリストのアイテムにカーソルを置いたときのMODプレビューを追加",
"境界半径ポップアップの戻るボタンがグレーアウトしていたバグを修正",
"ファンクションボタン用のボタンバーを追加",
"すべての適用されたMODをオンまたはオフにするクイックMOD削除および再適用ボタンを追加",
"その他のバグ修正"
],
"windows_file": "",
Expand Down
91 changes: 47 additions & 44 deletions lib/boundary/mods_boundary_edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,52 +121,55 @@ void boundaryEdit(context, SubMod submod) async {
for (var aqpFile in aqpFiles) {
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus('${curLangText!.uiReadingspace}${p.basename(aqpFile.path)}');
await Future.delayed(const Duration(milliseconds: 100));
Uint8List aqpBytes = await File(aqpFile.path).readAsBytes();
if (aqpBytes[233] == 0 && aqpBytes[234] == 0 && aqpBytes[235] == 0) {
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiEditingBoundaryRadiusValue);
await Future.delayed(const Duration(milliseconds: 100));
//-10
aqpBytes[236] = 0;
aqpBytes[237] = 0;
aqpBytes[238] = 32;
aqpBytes[239] = 193;
aqpFile.writeAsBytesSync(Uint8List.fromList(aqpBytes));
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiPackingFiles);
await Future.delayed(const Duration(milliseconds: 100));
//pack
while (!File(Uri.file('${p.dirname(aqpFile.parent.path)}.ice').toFilePath()).existsSync()) {
await Process.run('$modManZamboniExePath -c -pack -outdir "${p.dirname(aqpFile.parent.path)}"', [Uri.file(p.dirname(aqpFile.parent.path)).toFilePath()]);
packRetries++;
debugPrint(packRetries.toString());
if (packRetries == 10) {
break;
if (File(aqpFile.path).existsSync()) {
Uint8List aqpBytes = await File(aqpFile.path).readAsBytes();

if (aqpBytes[233] == 0 && aqpBytes[234] == 0 && aqpBytes[235] == 0) {
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiEditingBoundaryRadiusValue);
await Future.delayed(const Duration(milliseconds: 100));
//-10
aqpBytes[236] = 0;
aqpBytes[237] = 0;
aqpBytes[238] = 32;
aqpBytes[239] = 193;
aqpFile.writeAsBytesSync(Uint8List.fromList(aqpBytes));
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiPackingFiles);
await Future.delayed(const Duration(milliseconds: 100));
//pack
while (!File(Uri.file('${p.dirname(aqpFile.parent.path)}.ice').toFilePath()).existsSync()) {
await Process.run('$modManZamboniExePath -c -pack -outdir "${p.dirname(aqpFile.parent.path)}"', [Uri.file(p.dirname(aqpFile.parent.path)).toFilePath()]);
packRetries++;
debugPrint(packRetries.toString());
if (packRetries == 10) {
break;
}
}
packRetries = 0;
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiReplacingModFiles);
await Future.delayed(const Duration(milliseconds: 100));
try {
File renamedFile = await File(Uri.file('${p.dirname(aqpFile.parent.path)}.ice').toFilePath()).rename(Uri.file(p.dirname(aqpFile.parent.path).replaceAll('_ext', '')).toFilePath());
await renamedFile.copy(modFile.location);
} catch (e) {
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus('${curLangText!.uiError}\n${e.toString()}');
}
boundaryRemovedFiles.add(modFile.modFileName);
// if (modFile.modFileName == matchingFiles.last.modFileName) {
// Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(
// modFile.applyStatus ? '${curLangText!.uiSuccess}\n${curLangText!.uiAllDone}\n${curLangText!.uiMakeSureToReapplyThisMod}' : '${curLangText!.uiSuccess}\n${curLangText!.uiAllDone} ');
// await Future.delayed(const Duration(milliseconds: 100));
// if (isBoundaryEditDuringApply) {
// Navigator.pop(context, true);
// }
// }
} else {
boundaryNotFoundFiles.add(modFile.modFileName);
// Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus('${curLangText!.uiError}\n${curLangText!.uiBoundaryRadiusValueNotFound}');
// await Future.delayed(const Duration(milliseconds: 100));
// if (isBoundaryEditDuringApply) {
// Navigator.pop(context, true);
// }
}
packRetries = 0;
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(curLangText!.uiReplacingModFiles);
await Future.delayed(const Duration(milliseconds: 100));
try {
File renamedFile = await File(Uri.file('${p.dirname(aqpFile.parent.path)}.ice').toFilePath()).rename(Uri.file(p.dirname(aqpFile.parent.path).replaceAll('_ext', '')).toFilePath());
await renamedFile.copy(modFile.location);
} catch (e) {
Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus('${curLangText!.uiError}\n${e.toString()}');
}
boundaryRemovedFiles.add(modFile.modFileName);
// if (modFile.modFileName == matchingFiles.last.modFileName) {
// Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus(
// modFile.applyStatus ? '${curLangText!.uiSuccess}\n${curLangText!.uiAllDone}\n${curLangText!.uiMakeSureToReapplyThisMod}' : '${curLangText!.uiSuccess}\n${curLangText!.uiAllDone} ');
// await Future.delayed(const Duration(milliseconds: 100));
// if (isBoundaryEditDuringApply) {
// Navigator.pop(context, true);
// }
// }
} else {
boundaryNotFoundFiles.add(modFile.modFileName);
// Provider.of<StateProvider>(context, listen: false).setBoundaryEditProgressStatus('${curLangText!.uiError}\n${curLangText!.uiBoundaryRadiusValueNotFound}');
// await Future.delayed(const Duration(milliseconds: 100));
// if (isBoundaryEditDuringApply) {
// Navigator.pop(context, true);
// }
}
}
} else {
Expand Down
27 changes: 18 additions & 9 deletions lib/functions/preview_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';
import 'package:provider/provider.dart';
import 'package:pso2_mod_manager/global_variables.dart';
import 'package:pso2_mod_manager/loaders/language_loader.dart';
Expand Down Expand Up @@ -32,22 +32,31 @@ void previewDialog(context) async {
],
),
contentPadding: const EdgeInsets.symmetric(vertical: 10),
content: CarouselSlider(
carouselController: previewDialogCarouselController,
content: FlutterCarousel(
options: CarouselOptions(
enableInfiniteScroll: isAutoPlay,
aspectRatio: 2.0,
enlargeCenterPage: true,
enlargeStrategy: CenterPageEnlargeStrategy.scale,
controller: previewDialogCarouselController,
autoPlay: isAutoPlay,
autoPlayInterval: const Duration(seconds: 1),
autoPlayInterval: previewDialogImages.length > 1 && previewDialogImages.where((element) => element.toString() == ('PreviewVideoStack')).length == previewDialogImages.length
? const Duration(seconds: 5)
: previewDialogImages.length > 1 && previewDialogImages.where((element) => element.toString() == ('previewDialogImagestack')).length == previewDialogImages.length
? const Duration(seconds: 1)
: const Duration(seconds: 2),
disableCenter: true,
viewportFraction: 1.0,
aspectRatio: 2.0,
floatingIndicator: false,
enableInfiniteScroll: true,
onPageChanged: (index, reason) {
setState(() {
currentImageIndex = index;
});
}),
},
indicatorMargin: 4,
slideIndicator: CircularWaveSlideIndicator(
itemSpacing: 10, indicatorRadius: 4, currentIndicatorColor: Theme.of(context).colorScheme.primary, indicatorBackgroundColor: Theme.of(context).hintColor.withOpacity(0.3))),
items: previewDialogImages,
),

actionsOverflowButtonSpacing: 5,
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: <Widget>[
Expand Down
Loading

0 comments on commit 36e9729

Please sign in to comment.