From 613eb79d478a5e50326bc94d4ef8baeb043eda2e Mon Sep 17 00:00:00 2001 From: KizKizz Date: Sun, 26 May 2024 00:29:46 -0700 Subject: [PATCH] prep --- .../Eyes/Luther the Fallen Replica Eyes.png | Bin 0 -> 2961 bytes json/itemData.json | 23892 ++++++++-------- json/playerItemData.json | 23856 +++++++-------- lib/data_loaders/ref_sheets.dart | 56 +- lib/global_vars.dart | 2 +- lib/pages/home_page.dart | 51 +- pubspec.lock | 8 + pubspec.yaml | 1 + 8 files changed, 22393 insertions(+), 25473 deletions(-) create mode 100644 icons/Player/Classic/Eyes/Luther the Fallen Replica Eyes.png diff --git a/icons/Player/Classic/Eyes/Luther the Fallen Replica Eyes.png b/icons/Player/Classic/Eyes/Luther the Fallen Replica Eyes.png new file mode 100644 index 0000000000000000000000000000000000000000..1d772ed176a485c21f528b0ae11edec32326fa40 GIT binary patch literal 2961 zcmV;C3vTp@P)sH>9e~p|M-aZMQO(Z-z4*0Rv!DXhl^cOo~IBR&n`{^ z=kc+HFcS%H%>-r$nzq=w9wOv6;bhVA7WXS8V)d5D7)*ez;u$->RG>*>5C7rzD3|vF zPd${IJzj%_&t z$e1zn;Y1uN4<>-XU+psE+N1}_F42T>ZJ2=6xGP4&;(;U_Ou!j}rfp(f?*bom)R+wj zB1FVw_xeFTqLYAHSi{qEk->$Kz0Ls@y;j=1y5Uvt`yJH@{EK|Q*jHuxs0HjC-Kf?I z+RxCb&UPt0&m*|;$Kd;Bd%JwXU=85lt48u;v&c5kqarBQ3DSE_gf3GP!RymxTnK3v zM8XgmM8J7=j}^T(uGO3zv)Ry-07o4p*rG`xB6xq=+F(mT0`|>K(4U0f1Qg&itiTUj zp9?Jw7#-kd_&Xy-Z0Z0WI6`L8M(9sMt#!>d|GEHAuBK-9P*-&yuZz4owy)cJ*L%X! zrb0ZkeX+_Uwe!sUw9*7#1en06Ej)ts z^$D#6P?)nF9fNKL>mdV zP-;Gi01f$acaKR@wCM1xXCJf{+&nQyF9ix7`zHuK#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w}Cm^We`ALP@alz zEuc!e<_j)!3H18YMRo0GbLcCd|6u`t#?1h)M1$9RmwKmaP-M&6nuV?rKxRNIyf*o; zwLY$}NF@9TRt5=+ug#D+4$U4(*P;NfWe9kEY)_GIpgtL@rPHNq7WF_#_rBh9;4Tul z5D_cO1x&`K3B>ns6mj+b7QKX11Nb*{nlPLwXSmI2PE8f2<^{rHW~~~77jHT$D}4f+ z!y|&uUkONZW@c>OBk}?)-FK2`_q+rNrBBeIF9RxH6)os`H9p*6a?-gz;6}}uUMLcD zNaUf>UicuOUrI^9&?Oc?`%2TS4p;p?aesl}5B@f2=LNE1>cFe!1&oOjBQGDGal3%K z?4E4lO_S>CaEy!A` zp6sggO}?+)r#R1lFmcdthUn*GLw`D_E2Tw<{JUb&NT8v#9Oh;nUfwUYM(+2yIdmQ2 z-zIktXWKHozEaY42nn(gRRdf^gw}eanpgxqX2->X28YQk)Rgl>!IK#JatsnCNJ4zT z;73c+;uyE6{+lE8I+t2YyGUrWFyOSlW}dZr%j4tqbdxmFc?=S?a3KE;P<_Ps@pRWi|I6|pA!u>=> populateItemList() async { if (line.isNotEmpty) csvContent.add(line); }); + //headers and padding switch (filePathParts[1]) { case 'Enemies': if (filePathParts.last == 'EnemiesClassic.csv' || filePathParts.last == 'EnemyBaseStats.csv') { @@ -249,12 +251,15 @@ Future> populateItemList() async { break; } + String emoteChatCommand = ''; + String emoteENName = ''; + String emoteJPName = ''; for (var line in csvContent) { if (line.split(',').isNotEmpty) { int categoryIndex = csvFileList.indexWhere((element) => element.where((e) => e == p.basename(file.path)).isNotEmpty); String enItemName = ''; String jpItemName = ''; - List fields = line.split(','); + List fields = const CsvToListConverter().convert(line).first.map((e) => e.toString()).toList(); for (var element in fields) { fields[fields.indexOf(element)] = element.trim(); } @@ -279,6 +284,22 @@ Future> populateItemList() async { } else if (enItemName.contains('[Fu]') || jpItemName.contains('[Fu]')) { subCategory = 'Full Setwear'; } + } else if (categoryIndex == 7) { + //Emotes + int commandHeaderIndex = headers.indexWhere((element) => element == 'Chat Command'); + if (commandHeaderIndex != -1) { + if (emoteENName.isEmpty) emoteENName = enItemName; + if (emoteJPName.isEmpty) emoteJPName = jpItemName; + if (infos[commandHeaderIndex].isEmpty && emoteChatCommand.isNotEmpty && (emoteENName == enItemName || emoteJPName == jpItemName)) { + infos[commandHeaderIndex] = emoteChatCommand; + emoteENName = enItemName; + emoteJPName = jpItemName; + } else if (infos[commandHeaderIndex] != emoteChatCommand && infos[commandHeaderIndex].isNotEmpty) { + emoteChatCommand = infos[commandHeaderIndex]; + emoteENName = enItemName; + emoteJPName = jpItemName; + } + } } else if (categoryIndex == 14) { //Motions if (p.basename(file.path) == 'SubstituteMotionGlide.csv') { @@ -298,7 +319,7 @@ Future> populateItemList() async { } } - itemList.add(await itemFromCsv( + Item newItem = await itemFromCsv( p.basename(file.path), p.dirname(filePathInCsvDir), filePathInCsvDir.contains('NGS') @@ -312,7 +333,9 @@ Future> populateItemList() async { categoryIndex, '', headers, - infos)); + infos); + + itemList.add(newItem); infos.clear(); } } @@ -365,15 +388,19 @@ Future> populateItemList() async { csvContent.removeAt(0); break; case 'Player': - List threeFieldsFiles = ['CasealVoices.csv', 'CastVoices.csv', 'DarkBlasts_DrivableVehicles.csv', 'FemaleVoices.csv', 'MaleVoices.csv', 'PhotonBlastCreatures.csv', + List threeFieldsFiles = [ + 'CasealVoices.csv', + 'CastVoices.csv', + 'DarkBlasts_DrivableVehicles.csv', + 'FemaleVoices.csv', + 'MaleVoices.csv', + 'PhotonBlastCreatures.csv', 'General Character Animations.csv', 'General Character Effects.csv', 'General Character Animations NGS.csv', - 'General Reboot Character Effects.csv']; - List fourFieldsFiles = [ - 'Mags.csv', - 'MagsNGS.csv' + 'General Reboot Character Effects.csv' ]; + List fourFieldsFiles = ['Mags.csv', 'MagsNGS.csv']; if (threeFieldsFiles.contains(filePathParts.last)) { headers.addAll(['Japanese Name', 'English Name', 'Ice Hash']); @@ -503,12 +530,13 @@ Future> populateItemList() async { break; } + String emoteChatCommand = ''; for (var line in csvContent) { if (line.split(',').isNotEmpty) { int categoryIndex = csvFileList.indexWhere((element) => element.where((e) => e == p.basename(file.path)).isNotEmpty); String enItemName = ''; String jpItemName = ''; - List fields = line.split(','); + List fields = const CsvToListConverter().convert(line).first.map((e) => e.toString()).toList(); for (var element in fields) { fields[fields.indexOf(element)] = element.trim(); } @@ -533,6 +561,16 @@ Future> populateItemList() async { } else if (enItemName.contains('[Fu]') || jpItemName.contains('[Fu]')) { subCategory = 'Full Setwear'; } + } else if (categoryIndex == 7) { + //Emotes + int commandHeaderIndex = headers.indexWhere((element) => element == 'Chat Command'); + if (commandHeaderIndex != -1) { + if (infos[commandHeaderIndex].isEmpty && emoteChatCommand.isNotEmpty) { + infos[commandHeaderIndex] = emoteChatCommand; + } else if (infos[commandHeaderIndex] != emoteChatCommand && infos[commandHeaderIndex].isNotEmpty) { + emoteChatCommand = infos[commandHeaderIndex]; + } + } } else if (categoryIndex == 14) { //Motions if (p.basename(file.path) == 'SubstituteMotionGlide.csv') { diff --git a/lib/global_vars.dart b/lib/global_vars.dart index 7e9f9bb7..a37f0f17 100644 --- a/lib/global_vars.dart +++ b/lib/global_vars.dart @@ -34,7 +34,7 @@ Directory downloadDir = Directory(Uri.file('${Directory.current.path}/Downloaded String zamboniExePath = Uri.file('${Directory.current.path}/Zamboni/Zamboni.exe').toFilePath(); String githubIconPath = 'https://raw.githubusercontent.com/KizKizz/pso2ngs_file_downloader/main'; String charToReplace = '[\\/:*?"<>|]'; -bool overrideDebugMode = false; +bool overrideDebugMode = true; bool filterBoxShow = true; List itemFilters = []; List selectedItemFilters = []; diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index bd66b4ac..369fce6f 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -49,31 +49,32 @@ class _HomePageState extends State with WindowListener { } else { filteredItems = items.where((element) => selectedItemFilters.contains(element.itemType) && element.containsCategory(selectedItemFilters)).toList(); } - - final dledItems = downloadDir.listSync().whereType().map((e) => p.basenameWithoutExtension(e.path)).toList(); - downloadedItemList.add( - Padding( - padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), - child: Center( - child: ElevatedButton( - child: const Text('Open Download Folder'), - onPressed: () async { - launchUrl(Uri.directory(downloadDir.path)); - }), - ), - ), - ); - if (dledItems.isNotEmpty) { + if (downloadDir.existsSync()) { + final dledItems = downloadDir.listSync().whereType().map((e) => p.basenameWithoutExtension(e.path)).toList(); downloadedItemList.add( - Divider( - thickness: 1, - indent: 5, - endIndent: 5, - height: 0, + Padding( + padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), + child: Center( + child: ElevatedButton( + child: const Text('Open Download Folder'), + onPressed: () async { + launchUrl(Uri.directory(downloadDir.path)); + }), + ), ), ); - for (var name in dledItems) { - downloadedItemList.add(ListTile(title: Text(name), dense: true)); + if (dledItems.isNotEmpty) { + downloadedItemList.add( + Divider( + thickness: 1, + indent: 5, + endIndent: 5, + height: 0, + ), + ); + for (var name in dledItems) { + downloadedItemList.add(ListTile(title: Text(name), dense: true)); + } } } for (var filter in itemFilters) { @@ -282,7 +283,11 @@ class _HomePageState extends State with WindowListener { minWidth: 10, onPressed: () { searchBarController.clear(); - filteredItems = items; + if (selectedItemFilters.contains('PSO2') && selectedItemFilters.contains('NGS') && selectedItemFilters.length == 2) { + filteredItems = items; + } else { + filteredItems = items.where((element) => selectedItemFilters.contains(element.itemType) && element.containsCategory(selectedItemFilters)).toList(); + } setState(() {}); }, child: Icon(Icons.close), diff --git a/pubspec.lock b/pubspec.lock index 73172eda..d905ce95 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -177,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + csv: + dependency: "direct main" + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" cupertino_icons: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e49960aa..abca10e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,6 +43,7 @@ dependencies: window_manager: ^0.3.8 package_info_plus: ^5.0.1 archive: ^3.4.10 + csv: ^6.0.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.