本文整理汇总了C++中Quest::is_data_path方法的典型用法代码示例。如果您正苦于以下问题:C++ Quest::is_data_path方法的具体用法?C++ Quest::is_data_path怎么用?C++ Quest::is_data_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quest
的用法示例。
在下文中一共展示了Quest::is_data_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open_file_requested
/**
* @brief Slot called when the user attempts to open a file.
* @param quest The quest that holds this file.
* @param path Path of the file to open.
*/
void EditorTabs::open_file_requested(Quest& quest, const QString& path) {
if (path.isEmpty()) {
return;
}
QFileInfo file_info(path);
QString canonical_path = file_info.canonicalFilePath();
if (!quest.is_in_root_path(canonical_path)) {
// Not a file of this quest.
return;
}
ResourceType resource_type;
QString element_id;
if (quest.is_resource_element(canonical_path, resource_type, element_id)) {
// A resource element declared in the quest.
// Possibly a map data file, an enemy Lua script,
// a language directory, etc.
open_resource(quest, resource_type, element_id);
}
else if (quest.is_dialogs_file(canonical_path, element_id)) {
open_dialogs_editor(quest, element_id);
}
else if (quest.is_strings_file(canonical_path, element_id)) {
open_strings_editor(quest, element_id);
}
else if (quest.is_script(canonical_path)) {
// A Lua script that is not a resource element.
open_text_editor(quest, canonical_path);
}
else if (quest.is_data_path(canonical_path)) {
open_quest_properties_editor(quest);
}
}