Skip to content

Commit

Permalink
Merge pull request #260 from KizKizz/system-rework
Browse files Browse the repository at this point in the history
System rework
  • Loading branch information
KizKizz authored Aug 17, 2024
2 parents ddfd6ed + 51e2824 commit 7eb2666
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 97 deletions.
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.8.15",
"version": "2.8.16",
"description": [
"v2.8.15 hotfixes",
"Added expand and collapse all categories to Item List",
"Added an option to add newly added mods to Mod Sets",
"Fixed a bug where Applied List would not refresh correctly in Mod Sets",
"Improved Mod Sets Apply-Unapply function",
"More code and performance optimization",
"Ajusted some filters in Add Mods function",
"Fixed Mod Export popup not scrolling on long list",
"More bug fixes",
"v2.8.15 ホットフィックス",
"アイテムリストに全カテゴリーの展開と折りたたみを追加",
"新しく追加されたMODをMODセットに追加するオプションを追加",
"MODセットで適用済みリストが正しく更新されないバグを修正",
"MODセットの適用・未適用機能の改善",
"より多くのコードとパフォーマンスの最適化",
"MOD追加機能のフィルターを調整した",
"長いリストでMOD Exportポップアップがスクロールしなかった問題を修正",
"その他のバグ修正"
],
"windows_file": "",
Expand Down
4 changes: 3 additions & 1 deletion lib/functions/apply_mods_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Future<bool> applyModsToTheGame(context, Item curItem, Mod curMod, SubMod curSub
curSubmod.setApplyState(true);
curSubmod.isNew = false;
curMod.setApplyState(true);
curMod.isNew = false;
if (curMod.submods.where((e) => e.isNew).isEmpty) {
curMod.isNew = false;
}
curItem.setApplyState(true);
if (curItem.mods.where((element) => element.isNew).isEmpty) {
curItem.isNew = false;
Expand Down
4 changes: 3 additions & 1 deletion lib/homepage/applied_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,9 @@ class _AppliedListState extends State<AppliedList> {
curItem.mods[curModIndex].submods[curSubModIndex].isNew = false;
curItem.mods[curModIndex].submods[curSubModIndex].applyDate = DateTime.now();
curItem.mods[curModIndex].setApplyState(true);
curItem.mods[curModIndex].isNew = false;
if (curItem.mods[curModIndex].submods.where((e) => e.isNew).isEmpty) {
curItem.mods[curModIndex].isNew = false;
}
curItem.mods[curModIndex].applyDate = DateTime.now();
curItem.setApplyState(true);
if (curItem.mods.where((element) => element.isNew).isEmpty) {
Expand Down
5 changes: 4 additions & 1 deletion lib/modsAdder/mods_adder_homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,10 @@ Future<List<ModsAdderItem>> modsAdderFilesProcess(context, List<XFile> xFilePath
if (!ignore) iceFileList.addAll(subDir.listSync(recursive: false).whereType<File>().where((element) => p.extension(element.path).isEmpty && element.lengthSync() > 0));
}
} else {
iceFileList.addAll(dir.listSync(recursive: true).whereType<File>().where((element) => p.extension(element.path).isEmpty && element.lengthSync() > 0));
iceFileList.addAll(dir.listSync(recursive: true).whereType<File>().where((element) =>
p.extension(element.path).isEmpty &&
RegExp(r'^[a-f0-9]').hasMatch(p.basename(element.path)) &&
(p.basenameWithoutExtension(element.path).length == 30 || p.basenameWithoutExtension(element.path).length == 32)));
}
//listing mods with no ices in root
// if (dir.listSync().whereType<File>().where((element) => p.extension(element.path).isEmpty && element.lengthSync() > 0).isEmpty) {
Expand Down
155 changes: 77 additions & 78 deletions lib/sharing/mods_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,42 @@ Future<void> modExportHomePage(context, List<CategoryType> baseList, List<SubMod
File exportedZip = File('');
List<String> exportNames = exportSubmods.map((e) => '${e.itemName} > ${e.modName} > ${e.submodName}').toList();
Provider.of<StateProvider>(context, listen: false).createModExportProgressStatus(List.generate(exportNames.length, (index) => false));
bool exportStart = false;
return await showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return StatefulBuilder(builder: (dialogContext, setState) {
return AlertDialog(
shape: RoundedRectangleBorder(side: BorderSide(color: Theme.of(context).primaryColorLight), borderRadius: const BorderRadius.all(Radius.circular(5))),
backgroundColor: Color(context.watch<StateProvider>().uiBackgroundColorValue).withOpacity(0.8),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
content: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 200, minWidth: 200, maxHeight: double.infinity, maxWidth: double.infinity),
shape: RoundedRectangleBorder(side: BorderSide(color: Theme.of(context).primaryColorLight), borderRadius: const BorderRadius.all(Radius.circular(5))),
backgroundColor: Color(context.watch<StateProvider>().uiBackgroundColorValue).withOpacity(0.8),
titlePadding: const EdgeInsets.symmetric(vertical: 5),
title: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
Text(
curLangText!.uiModExport,
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
Visibility(
visible: context.watch<StateProvider>().modExportProgessZipping && !exportedZip.existsSync(),
child: Center(
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Text(
curLangText!.uiPackingFiles,
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
),
)),
),
]),
contentPadding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
content: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 20, minWidth: 200, maxHeight: double.infinity, maxWidth: double.infinity),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 5),
child: Text(
curLangText!.uiModExport,
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
Visibility(
visible: exportedZip.path.isEmpty,
child: Padding(
Expand All @@ -48,27 +61,6 @@ Future<void> modExportHomePage(context, List<CategoryType> baseList, List<SubMod
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10),
child: CircularProgressIndicator(),
)),
Visibility(
visible: !context.watch<StateProvider>().modExportProgessZipping,
child: const Center(
child: Padding(
padding: EdgeInsets.only(bottom: 10),
child: Text('', style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),),
)),
),
Visibility(
visible: context.watch<StateProvider>().modExportProgessZipping,
child: Center(
child: Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(curLangText!.uiPackingFiles, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold),),
)),
),
for (int i = 0; i < exportNames.length; i++)
Text(
exportNames[i],
Expand All @@ -79,59 +71,66 @@ Future<void> modExportHomePage(context, List<CategoryType> baseList, List<SubMod
),
Visibility(
visible: exportedZip.path.isNotEmpty,
child: Padding(
padding: const EdgeInsets.only(bottom: 5),
child: Center(
child: Text(
exportedZip.existsSync() ? curLangText!.uiAllDone : curLangText!.uiFailed,
style: const TextStyle(fontSize: 15),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Provider.of<StateProvider>(context, listen: false).modExportProgessZippingStateSet(false);
Navigator.pop(context, true);
},
child: Text(curLangText!.uiClose)),
Visibility(
visible: exportedZip.path.isEmpty,
child: Padding(
padding: const EdgeInsets.only(left: 5),
child: ElevatedButton(
onPressed: () async {
String exportedZipPath = await modExport(context, baseList, exportSubmods, appliedModsExport);
exportedZip = File(exportedZipPath);
setState(
() {},
);
},
child: Text(curLangText!.uiExport)),
),
),
Visibility(
visible: exportedZip.existsSync(),
child: Padding(
padding: const EdgeInsets.only(left: 5),
child: ElevatedButton(
onPressed: () async {
Provider.of<StateProvider>(context, listen: false).modExportProgessZippingStateSet(false);
await launchUrl(Uri.file(exportedZip.parent.path));
// ignore: use_build_context_synchronously
Navigator.pop(context, true);
},
child: Text(curLangText!.uiOpenInFileExplorer)),
),
),
],
)),
],
),
));
),
),
actionsPadding: const EdgeInsets.all(5),
actionsAlignment: MainAxisAlignment.end,
actions: [
ElevatedButton(
onPressed: () {
Provider.of<StateProvider>(context, listen: false).modExportProgessZippingStateSet(false);
exportStart = false;
Navigator.pop(context, true);
},
child: Text(curLangText!.uiClose)),
Visibility(
visible: exportedZip.path.isEmpty,
child: Padding(
padding: const EdgeInsets.only(left: 0),
child: ElevatedButton(
onPressed: !exportStart
? () async {
exportStart = true;
setState(
() {},
);
String exportedZipPath = await modExport(context, baseList, exportSubmods, appliedModsExport);
exportedZip = File(exportedZipPath);
exportStart = false;
setState(
() {},
);
}
: null,
child: Text(curLangText!.uiExport)),
),
),
Visibility(
visible: exportedZip.existsSync(),
child: Padding(
padding: const EdgeInsets.only(left: 0),
child: ElevatedButton(
onPressed: () async {
Provider.of<StateProvider>(context, listen: false).modExportProgessZippingStateSet(false);
exportStart = false;
await launchUrl(Uri.file(exportedZip.parent.path));
// ignore: use_build_context_synchronously
Navigator.pop(context, true);
},
child: Text(curLangText!.uiOpenInFileExplorer)),
),
),
],
);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.8.15
version: 2.8.16

environment:
sdk: ">=3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
#ifdef FLUTTER_BUILD_NUMBER
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
#else
#define VERSION_AS_NUMBER 2,8,15
#define VERSION_AS_NUMBER 2,8,16
#endif

#ifdef FLUTTER_BUILD_NAME
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
#else
#define VERSION_AS_STRING "2.8.15"
#define VERSION_AS_STRING "2.8.16"
#endif

VS_VERSION_INFO VERSIONINFO
Expand Down

0 comments on commit 7eb2666

Please sign in to comment.