|
|
@ -1,6 +1,6 @@ |
|
|
|
use quests::{Quest, QuestList};
|
|
|
|
use libpso::packet::ship::*;
|
|
|
|
use libpso::{utf8_to_array, utf8_to_utf16_array};
|
|
|
|
use libpso::util::{utf8_to_array, utf8_to_utf16_array};
|
|
|
|
|
|
|
|
pub const QUEST_CATEGORY_MENU_ID: u32 = 0xA2;
|
|
|
|
pub const QUEST_SELECT_MENU_ID: u32 = 0xA3;
|
|
|
@ -12,8 +12,8 @@ pub fn quest_category_list(quests: &QuestList) -> QuestCategoryList { |
|
|
|
QuestCategory {
|
|
|
|
menu_id: QUEST_CATEGORY_MENU_ID,
|
|
|
|
option_id: i as u32,
|
|
|
|
name: utf8_to_utf16_array!(category.name, 32),
|
|
|
|
description: utf8_to_utf16_array!(category.description, 122),
|
|
|
|
name: utf8_to_utf16_array(&category.name),
|
|
|
|
description: utf8_to_utf16_array(&category.description),
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.collect();
|
|
|
@ -30,8 +30,8 @@ pub fn quest_list(category_id: u32, quests: &[Quest]) -> QuestOptionList { |
|
|
|
menu_id: QUEST_SELECT_MENU_ID,
|
|
|
|
category_id: category_id as u16,
|
|
|
|
quest_id: quest.id,
|
|
|
|
name: utf8_to_utf16_array!(quest.name, 32),
|
|
|
|
description: utf8_to_utf16_array!(quest.description, 122),
|
|
|
|
name: utf8_to_utf16_array(&quest.name),
|
|
|
|
description: utf8_to_utf16_array(&quest.description),
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.collect();
|
|
|
@ -43,7 +43,7 @@ pub fn quest_list(category_id: u32, quests: &[Quest]) -> QuestOptionList { |
|
|
|
|
|
|
|
pub fn quest_detail(quest: &Quest) -> QuestDetail {
|
|
|
|
QuestDetail {
|
|
|
|
description: utf8_to_utf16_array!(quest.full_description, 288),
|
|
|
|
description: utf8_to_utf16_array(&quest.full_description),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
@ -51,9 +51,9 @@ pub fn quest_header(quest_menu_select: &QuestMenuSelect, data_blob: &[u8], suffi |
|
|
|
let path = format!("{}-{}.{}", quest_menu_select.category, quest_menu_select.quest, suffix);
|
|
|
|
QuestHeader {
|
|
|
|
unknown1: [0; 0x24],
|
|
|
|
filename: utf8_to_array!(path, 16),
|
|
|
|
filename: utf8_to_array(&path),
|
|
|
|
length: data_blob.len() as u32,
|
|
|
|
name: utf8_to_array!(path, 16),
|
|
|
|
name: utf8_to_array(&path),
|
|
|
|
unknown2: [0; 8],
|
|
|
|
}
|
|
|
|
}
|
|
|
|