Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
spd789562 committed Oct 15, 2024
2 parents 7383ab6 + 815662a commit 2a0ce45
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.4.3]
### 修改
- 修正皮膚無法被搜尋到的問題

## [0.4.2]
修正更多 bug,並新增一點點小東西

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maplecharactercreator",
"version": "0.4.2",
"version": "0.4.3",
"description": "",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "maplesalon2"
version = "0.4.2"
version = "0.4.3"
description = "MapleSalon2 - A tool for preview hair, face and item dye using MapleStory wz files."
authors = ["Leo"]
edition = "2021"
Expand Down
45 changes: 45 additions & 0 deletions src-tauri/src/handlers/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,51 @@ pub fn resolve_equip_string(

let mut result = Vec::new();

if let Some(skin_string_node) = string_node.at("Skin") {
let category_node_read = skin_string_node.read().unwrap();
let category_name = "Skin";
let category = get_equip_category_from_str(category_name);

let mut category_result = category_node_read
.children
.values()
.par_bridge()
.fold_with(
Vec::with_capacity(category_node_read.children.len()),
|mut result, child| {
let child_read = child.read().unwrap();
let name = child_read.name.to_string();

let text_node = child_read.at("name");

if text_node.is_none() {
return result;
}

let text_node = text_node.unwrap();

let text_node_read = text_node.read().unwrap();
let name_text = text_node_read.try_as_string().map(WzString::get_string);
if let Some(Ok(text)) = name_text {
result.push((category.clone(), name, text, false, false, false, false));
}

result
},
)
.reduce(
|| Vec::<StringDictItem>::new(),
|mut r, next| {
r.extend(next);
r
},
);

category_result.sort_by(|a, b| a.1.cmp(&b.1));

result.extend(category_result);
}

for (category_string_node, category_equip_node) in EQUIP_CATEGORY_NEEDS
.iter()
.filter_map(|x| string_node.at(x).zip(equip_node.at(x)))
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"productName": "MapleSalon2",
"version": "0.4.2",
"version": "0.4.3",
"identifier": "com.maplesalon.io",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down

0 comments on commit 2a0ce45

Please sign in to comment.