Skip to content

Commit

Permalink
Fix LINE support
Browse files Browse the repository at this point in the history
  • Loading branch information
atampy25 committed Jul 26, 2024
1 parent 21ac15e commit 60a6419
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
8 changes: 6 additions & 2 deletions src-tauri/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use hashbrown::HashMap;
use hitman_commons::game::GameVersion;
use hitman_commons::hash_list::HashList;
use hitman_commons::metadata::{ResourceID, ResourceType};
use hitman_commons::rpkg_tool::RpkgResourceMeta;
use indexmap::IndexMap;
use itertools::Itertools;
use quickentity_rs::qn_structs::{Entity, FullRef, Ref, RefMaybeConstantValue, RefWithConstantValue, SubEntity};
Expand Down Expand Up @@ -640,8 +641,11 @@ pub fn get_line_decoration(
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?;

locr.convert(&locr_data, to_string(&locr_meta)?)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
locr.convert(
&locr_data,
to_string(&RpkgResourceMeta::from_resource_metadata(locr_meta.to_owned(), false))?
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
} {
break x;
} else {
Expand Down
10 changes: 8 additions & 2 deletions src-tauri/src/event_handling/content_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,14 @@ pub fn start_content_search(
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?;

locr.convert(&locr_data, to_string(&locr_meta)?)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
locr.convert(
&locr_data,
to_string(&RpkgResourceMeta::from_resource_metadata(
locr_meta.to_owned(),
false
))?
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
} {
break x;
} else {
Expand Down
22 changes: 12 additions & 10 deletions src-tauri/src/event_handling/resource_overview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,14 @@ pub fn initialise_resource_overview(
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?;

locr.convert(&locr_data, to_string(&locr_meta)?)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
locr.convert(
&locr_data,
to_string(&RpkgResourceMeta::from_resource_metadata(
locr_meta.to_owned(),
false
))?
)
.map_err(|x| anyhow!("TonyTools error: {x:?}"))?
} {
break x;
} else {
Expand Down Expand Up @@ -1145,8 +1151,7 @@ pub async fn handle_resource_overview_event(app: &AppHandle, event: ResourceOver
}
};

if let Some(game_files) = app_state.game_files.load().as_ref()
{
if let Some(game_files) = app_state.game_files.load().as_ref() {
if hash == "0057C2C3941115CA".parse()? {
let (_, res_data) = extract_latest_resource(game_files, hash)?;

Expand Down Expand Up @@ -1337,8 +1342,7 @@ pub async fn handle_resource_overview_event(app: &AppHandle, event: ResourceOver
}
};

if let Some(game_files) = app_state.game_files.load().as_ref()
{
if let Some(game_files) = app_state.game_files.load().as_ref() {
let mut dialog = AsyncFileDialog::new().set_title("Extract file");

if let Some(project) = app_state.project.load().as_ref() {
Expand Down Expand Up @@ -1385,8 +1389,7 @@ pub async fn handle_resource_overview_event(app: &AppHandle, event: ResourceOver
}
};

if let Some(game_files) = app_state.game_files.load().as_ref()
{
if let Some(game_files) = app_state.game_files.load().as_ref() {
let mut dialog = AsyncFileDialog::new().set_title("Extract all WAVs to folder");

if let Some(project) = app_state.project.load().as_ref() {
Expand Down Expand Up @@ -1478,8 +1481,7 @@ pub async fn handle_resource_overview_event(app: &AppHandle, event: ResourceOver
}
};

if let Some(game_files) = app_state.game_files.load().as_ref()
{
if let Some(game_files) = app_state.game_files.load().as_ref() {
let mut dialog = AsyncFileDialog::new().set_title("Extract file");

if let Some(project) = app_state.project.load().as_ref() {
Expand Down

0 comments on commit 60a6419

Please sign in to comment.