Skip to content

Commit

Permalink
Merge pull request #251 from KizKizz/system-rework
Browse files Browse the repository at this point in the history
System rework
  • Loading branch information
KizKizz committed Aug 4, 2024
2 parents 26e645a + 5eca755 commit a79e501
Show file tree
Hide file tree
Showing 23 changed files with 3,305 additions and 3,000 deletions.
2 changes: 1 addition & 1 deletion Language/LanguageSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"langFilePath": "E:\\Flutter project\\pso2_mod_manager\\Language\\JP.json",
"selected": false
}
]
]
8 changes: 5 additions & 3 deletions app_version_check/app_version.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "PSO2NGS Mod Manager",
"version": "2.8.8",
"version": "2.8.9",
"description": [
"Added Swap All function which allows swapping all mods in an item to multiple other items at once",
"Added Mod Set Export function",
"Fixed some bugs and improved Item/Mod swapping",
"More bug fixes",
"アイテム内のすべてのMODを他の複数のアイテムに一度にスワップできるスワップ・オール機能を追加",
"MODセットエクスポート機能の追加",
"いくつかのバグを修正し、アイテム/Modの交換を改善しました",
"その他のバグ修正"
],
"windows_file": "",
Expand Down
67 changes: 24 additions & 43 deletions lib/itemsSwapper/items_swapper_acc_homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
borderRadius: BorderRadius.circular(3),
border: Border.all(color: Theme.of(context).hintColor, width: 1),
),
child: swapperSearchTextController.text.isEmpty
child: swapperFromItemsSearchTextController.text.isEmpty
? Image.network(
'$modManMAIconDatabaseLink${fromItemCsvData[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}',
errorBuilder: (context, error, stackTrace) => Image.asset(
Expand All @@ -234,13 +234,9 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
)),
),
//name
modManCurActiveItemNameLanguage == 'JP'
? swapperFromItemsSearchTextController.text.isEmpty
? Text(fromItemCsvData[i].jpName)
: Text(fromItemSearchResults[i].jpName)
: swapperFromItemsSearchTextController.text.isEmpty
? Text(fromItemCsvData[i].enName)
: Text(fromItemSearchResults[i].enName),
swapperFromItemsSearchTextController.text.isEmpty
? Text(modManCurActiveItemNameLanguage == 'JP' ? fromItemCsvData[i].jpName : fromItemCsvData[i].enName)
: Text(modManCurActiveItemNameLanguage == 'JP' ? fromItemSearchResults[i].jpName : fromItemSearchResults[i].enName),
]),
subtitle: swapperFromItemsSearchTextController.text.isEmpty
? selectedFromAccCsvFile == fromItemCsvData[i]
Expand Down Expand Up @@ -284,8 +280,7 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
}
}
//confirm icon set
fromItemIconLink =
'$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';
fromItemIconLink = '$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';

setState(
() {},
Expand Down Expand Up @@ -484,36 +479,23 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
borderRadius: BorderRadius.circular(3),
border: Border.all(color: Theme.of(context).hintColor, width: 1),
),
child: swapperSearchTextController.text.isEmpty
? Image.network(
'$modManMAIconDatabaseLink${availableAccCsvData[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}',
errorBuilder: (context, error, stackTrace) => Image.asset(
'assets/img/placeholdersquare.png',
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
),
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
)
: Image.network(
'$modManMAIconDatabaseLink${toAccSearchResults[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}',
errorBuilder: (context, error, stackTrace) => Image.asset(
'assets/img/placeholdersquare.png',
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
),
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
)),
child: Image.network(
swapperSearchTextController.text.isEmpty
? '$modManMAIconDatabaseLink${availableAccCsvData[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}'
: '$modManMAIconDatabaseLink${toAccSearchResults[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}',
errorBuilder: (context, error, stackTrace) => Image.asset(
'assets/img/placeholdersquare.png',
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
),
filterQuality: FilterQuality.none,
fit: BoxFit.fitWidth,
)),
),
//name
modManCurActiveItemNameLanguage == 'JP'
? swapperSearchTextController.text.isEmpty
? Text(availableAccCsvData[i].jpName)
: Text(toAccSearchResults[i].jpName)
: swapperSearchTextController.text.isEmpty
? Text(availableAccCsvData[i].enName)
: Text(toAccSearchResults[i].enName),
swapperSearchTextController.text.isEmpty
? Text(modManCurActiveItemNameLanguage == 'JP' ? availableAccCsvData[i].jpName : availableAccCsvData[i].enName)
: Text(modManCurActiveItemNameLanguage == 'JP' ? toAccSearchResults[i].jpName : toAccSearchResults[i].enName)
]),
onChanged: (CsvAccessoryIceFile? currentItem) {
//print("Current ${moddedItemsList[i].groupName}");
Expand All @@ -534,8 +516,7 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
}
}
//confirm icon set
toItemIconLink =
'$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';
toItemIconLink = '$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';

setState(
() {},
Expand All @@ -549,7 +530,7 @@ class _ItemsSwapperAccHomePageState extends State<ItemsSwapperAccHomePage> {
),
),
],
))
)),
],
),
),
Expand Down Expand Up @@ -718,7 +699,7 @@ Future<void> swapperConfirmDialog(context, SubMod fromSubmod, String fromAccItem
),
),
),
)
),
],
),
],
Expand All @@ -732,7 +713,7 @@ Future<void> swapperConfirmDialog(context, SubMod fromSubmod, String fromAccItem
ElevatedButton(
onPressed: () {
Navigator.pop(context);
msas.swapperAccSwappingDialog(context, true, fromSubmod, fromAccItemAvailableIces, toAccItemAvailableIces, toItemName);
msas.swapperAccSwappingDialog(context, true, fromItemModGet(), fromSubmod, fromAccItemAvailableIces, toAccItemAvailableIces, toItemName);
},
child: Text(curLangText!.uiSwap))
]);
Expand Down
12 changes: 8 additions & 4 deletions lib/itemsSwapper/items_swapper_data_loader.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import 'package:flutter/material.dart';
import 'package:pso2_mod_manager/classes/csv_ice_file_class.dart';
import 'package:pso2_mod_manager/classes/item_class.dart';
import 'package:pso2_mod_manager/classes/mod_class.dart';
import 'package:pso2_mod_manager/classes/mod_file_class.dart';
import 'package:pso2_mod_manager/classes/sub_mod_class.dart';
import 'package:pso2_mod_manager/global_variables.dart';
Expand Down Expand Up @@ -34,7 +34,8 @@ SubMod fromItemSubmodGet(List<String> iceFileNames) {
orElse: () => '',
);
if (p.basename(icePathFromOgData) == iceName) {
modFileList.add(ModFile(iceName, fromItemNameSwap, fromItemNameSwap, fromItemNameSwap, selectedCategoryF!, '', [], icePathFromOgData, false, DateTime(0), 0, false, false, false, [], [], [], [], [], []));
modFileList.add(
ModFile(iceName, fromItemNameSwap, fromItemNameSwap, fromItemNameSwap, selectedCategoryF!, '', [], icePathFromOgData, false, DateTime(0), 0, false, false, false, [], [], [], [], [], []));
}
}
//}
Expand All @@ -43,6 +44,10 @@ SubMod fromItemSubmodGet(List<String> iceFileNames) {
return SubMod(fromItemNameSwap, fromItemNameSwap, fromItemName, selectedCategoryF!, '', false, DateTime(0), 0, false, false, false, false, false, -1, -1, '', [], [], [], [], [], modFileList);
}

Mod fromItemModGet() {
return Mod('', '', '', '', false, DateTime(0), 0, false, false, false, [], [], [], [], []);
}

Future<List<CsvAccessoryIceFile>> getAccSwapToCsvList(List<CsvAccessoryIceFile> cvsAccDataInput, String category) async {
return cvsAccDataInput.where((element) => element.category == category && element.enName.isNotEmpty && element.jpName.isNotEmpty).toList();
}
Expand Down Expand Up @@ -248,8 +253,7 @@ class _ItemsSwapperDataLoaderState extends State<ItemsSwapperDataLoader> {
// (a, b) => a.enName.compareTo(b.enName),
// );
// }
return const ItemsSwapperWeaponHomePage(
);
return const ItemsSwapperWeaponHomePage();
} else {
availableItemsCsvData = snapshot.data;
if (modManCurActiveItemNameLanguage == 'JP') {
Expand Down
21 changes: 11 additions & 10 deletions lib/itemsSwapper/items_swapper_homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pso2_mod_manager/classes/csv_ice_file_class.dart';
import 'package:pso2_mod_manager/classes/mod_class.dart';
import 'package:pso2_mod_manager/classes/sub_mod_class.dart';
import 'package:pso2_mod_manager/global_variables.dart';
import 'package:pso2_mod_manager/itemsSwapper/items_swapper_data_loader.dart';
Expand Down Expand Up @@ -252,7 +253,7 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
borderRadius: BorderRadius.circular(3),
border: Border.all(color: Theme.of(context).hintColor, width: 1),
),
child: swapperSearchTextController.text.isEmpty
child: swapperFromItemsSearchTextController.text.isEmpty
? Image.network(
'$modManMAIconDatabaseLink${fromItemCsvData[i].iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}',
errorBuilder: (context, error, stackTrace) => Image.asset(
Expand Down Expand Up @@ -336,8 +337,7 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
}

//confirm icon set
fromItemIconLink =
'$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';
fromItemIconLink = '$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';

setState(
() {},
Expand Down Expand Up @@ -587,8 +587,7 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
}

//confirm icon set
toItemIconLink =
'$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';
toItemIconLink = '$modManMAIconDatabaseLink${currentItem.iconImageWebPath.replaceAll('\\', '/').replaceAll(' ', '%20')}';

setState(
() {},
Expand All @@ -602,7 +601,7 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
),
),
],
))
)),
],
),
),
Expand Down Expand Up @@ -640,7 +639,8 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
? null
: () {
if (selectedFromCsvFile != null && selectedToCsvFile != null) {
swapperConfirmDialog(context, fromItemSubmodGet(fromItemAvailableIces), fromItemIds, fromItemAvailableIces, toItemIds, toItemAvailableIces);
swapperConfirmDialog(
context, fromItemModGet(), fromItemSubmodGet(fromItemAvailableIces), fromItemIds, fromItemAvailableIces, toItemIds, toItemAvailableIces);
}
},
child: Text(curLangText!.uiNext))
Expand All @@ -658,7 +658,8 @@ class _ItemsSwapperHomePageState extends State<ItemsSwapperHomePage> {
}
}

Future<void> swapperConfirmDialog(context, SubMod fromSubmod, List<String> fromItemIds, List<String> fromItemAvailableIces, List<String> toItemIds, List<String> toItemAvailableIces) async {
Future<void> swapperConfirmDialog(
context, Mod fromMod, SubMod fromSubmod, List<String> fromItemIds, List<String> fromItemAvailableIces, List<String> toItemIds, List<String> toItemAvailableIces) async {
await showDialog(
barrierDismissible: false,
context: context,
Expand Down Expand Up @@ -779,7 +780,7 @@ Future<void> swapperConfirmDialog(context, SubMod fromSubmod, List<String> fromI
),
),
),
)
),
],
),
],
Expand All @@ -793,7 +794,7 @@ Future<void> swapperConfirmDialog(context, SubMod fromSubmod, List<String> fromI
ElevatedButton(
onPressed: () {
Navigator.pop(context);
mss.swapperSwappingDialog(context, true, fromSubmod, fromItemAvailableIces, toItemAvailableIces, toItemName, fromItemIds[0], toItemIds[0]);
mss.swapperSwappingDialog(context, true, fromMod, fromSubmod, fromItemAvailableIces, toItemAvailableIces, toItemName, fromItemIds[0], toItemIds[0]);
},
child: Text(curLangText!.uiSwap))
]);
Expand Down
Loading

0 comments on commit a79e501

Please sign in to comment.