普特莫斯维基 (Purtmars Wikipedia 📖)

“Chemdah 开发者文档:组件”的版本间的差异

来自Purtmars Wikipedia —— 普特莫斯维基
第144行: 第144行:
  
 
<div style="margin-top: -18px"></div>
 
<div style="margin-top: -18px"></div>
== 任务纵览(addon:ui)==
+
== 纵览(addon:ui)==
 
在 '''ink.ptms.chemdah.core.quest.addon.AddonUI$Companion''' 中提供了以下扩展方法获取任务纵览组件。
 
在 '''ink.ptms.chemdah.core.quest.addon.AddonUI$Companion''' 中提供了以下扩展方法获取任务纵览组件。
 
<syntaxhighlight lang="kotlin" line="line">
 
<syntaxhighlight lang="kotlin" line="line">
第175行: 第175行:
 
  */
 
  */
 
val description: List<String>
 
val description: List<String>
 +
</syntaxhighlight>
 +
 +
<div style="margin-top: -18px"></div>
 +
== 超时(addon:timeout) ==
 +
在 ink.ptms.chemdah.core.quest.addon.AddonTimeout$Companion 中提供了以下扩展方法判断任务超时。
 +
<syntaxhighlight lang="kotlin" line="line">
 +
fun QuestContainer.isTimeout(startTime: Long): Boolean
 +
</syntaxhighlight>
 +
 +
<div style="margin-top: -18px"></div>
 +
== 重启(addon:restart) ==
 +
在 ink.ptms.chemdah.core.quest.addon.AddonRestart$Companion 中提供了以下扩展方法判断任务是否符合重置条件。
 +
<syntaxhighlight lang="kotlin" line="line">
 +
fun QuestContainer.canRestart(profile: PlayerProfile): CompletableFuture<Boolean>
 +
</syntaxhighlight>
 +
 +
<div style="margin-top: -18px"></div>
 +
== 管制(addon:control) ==
 +
在 ink.ptms.chemdah.core.quest.addon.AddonControl$Companion 中提供了以下扩展方法获取任务限制。
 +
<syntaxhighlight lang="kotlin" line="line">
 +
fun Template.control(): ControlOperator
 +
</syntaxhighlight>
 +
 +
在 ink.ptms.chemdah.core.quest.addon.AddonControl$ControlOperator 中提供了以下开放方法用于检测任务限制或创建签名。
 +
<syntaxhighlight lang="kotlin" line="line">
 +
/**
 +
* 任务是否被限制接受
 +
* 并在 Result 中返回结果以及为何被限制
 +
*/
 +
fun check(profile: PlayerProfile): CompletableFuture<Result>
 +
 +
/**
 +
* 创建签名
 +
*/
 +
fun signature(profile: PlayerProfile, type: Trigger = Trigger.COMPLETE)
 
</syntaxhighlight>
 
</syntaxhighlight>

2021年6月12日 (六) 20:15的版本

目录

组件

所有任务组件均通过扩展方法获取。

自动化(addon:automation)

ink.ptms.chemdah.core.quest.addon.AddonAutomation$Companion 中提供了以下扩展方法获取任务自动化组件。

/**
 * 任务是否自动接受
 */
fun Template.isAutoAccept(): Boolean

/**
 * 任务自动化计划
 */
fun Template.plan(): Plan?

/**
 * 任务自动化组
 */
fun Template.planGroup(): String?

组队(addon:party)

ink.ptms.chemdah.core.quest.addon.AddonParty$Companion 中提供了以下扩展方法获取任务组队组件。

/**
 * 获取可能存在的 Party 扩展
 */
fun QuestContainer.party(): AddonParty?

ink.ptms.chemdah.core.quest.addon.AddonParty 中提供了以下开放属性获取任务组队组件配置。

/**
 * 是否分享这个任务
 * 需要在任务下配置
 */
val share: Boolean

/**
 * 是否只有队长可以给队员共享这个任务
 * 需要在任务下配置
 */
val shareOnlyLeader: Boolean

/**
 * 队员是否可以替你进行这个条目
 * 需要在条目下配置
 */
val canContinue: Boolean

/**
 * 只有处于队伍中,且队员人数达到需求才能进行该任务或条目
 * 任务和条目均支持该配置
 */
val requireMembers: Boolean

进度(addon:stats)

ink.ptms.chemdah.core.quest.addon.AddonStats$Companion 中提供了以下扩展方法获取任务进度组件。

/**
 * 获取可能存在的 Stats 扩展
 */
fun QuestContainer.stats()

/**
 * 通过可能存在的 Stats 扩展展示条目进度
 */
fun QuestContainer.statsDisplay(profile: PlayerProfile): CompletableFuture

/**
 * 获取条目进度
 * 并通过可能存在的 Stats 扩展
 */
fun QuestContainer.getProgress(profile: PlayerProfile): CompletableFuture

/**
 * 隐藏任务进度
 */
fun Quest.hiddenStats(profile: PlayerProfile)

/**
 * 隐藏条目进度
 */
fun Task.hiddenStats(profile: PlayerProfile)

/**
 * 刷新任务进度(仅持续显示的)
 */
fun Quest.refreshStatusAlwaysType(profile: PlayerProfile)

/**
 * 刷新条目进度
 */
fun QuestContainer.refreshStats(profile: PlayerProfile)

追踪(addon:track)

ink.ptms.chemdah.core.quest.addon.AddonTrack$Companion 中提供了以下扩展方法获取任务进度组件。

/**
 * 任务允许被追踪
 */
fun QuestContainer.allowTracked(): Boolean

/**
 * 获取可能存在的 Track 扩展
 */
fun QuestContainer.track(): AddonTrack?

/**
 * 当前任务追踪
 */
var PlayerProfile.trackQuest: Template?

/**
 * 删除任务追踪(Navigation)
 */
fun Player.cancelTrackingNavigation()

/**
 * 创建或更新任务追踪(Navigation)
 */
fun Player.refreshTrackingNavigation()

/**
 * 删除任务追踪(Scoreboard)
 */
fun Player.cancelTrackingScoreboard(quest: Template?)

/**
 * 创建或刷新任务追踪(Scoreboard)
 */
fun Player.refreshTrackingScoreboard()

纵览(addon:ui)

ink.ptms.chemdah.core.quest.addon.AddonUI$Companion 中提供了以下扩展方法获取任务纵览组件。

/**
 * 获取可能存在的 UI 扩展
 */
fun Template.ui(): AddonUI?

ink.ptms.chemdah.core.quest.addon.AddonUI 中提供了以下开放属性获取任务组队纵览配置。

/**
 * 持续在 UI 中显示
 * 启用后则可能显示为 can-start 或 cannot-start
 */
val visibleStart: Boolean

/**
 * 任务完成后显示为 complete 已完成状态
 */
val visibleComplete: Boolean

/**
 * 显示图标
 */
val icon: String

/**
 * 显示介绍
 */
val description: List

超时(addon:timeout)

在 ink.ptms.chemdah.core.quest.addon.AddonTimeout$Companion 中提供了以下扩展方法判断任务超时。

fun QuestContainer.isTimeout(startTime: Long): Boolean

重启(addon:restart)

在 ink.ptms.chemdah.core.quest.addon.AddonRestart$Companion 中提供了以下扩展方法判断任务是否符合重置条件。

fun QuestContainer.canRestart(profile: PlayerProfile): CompletableFuture

管制(addon:control)

在 ink.ptms.chemdah.core.quest.addon.AddonControl$Companion 中提供了以下扩展方法获取任务限制。

fun Template.control(): ControlOperator

在 ink.ptms.chemdah.core.quest.addon.AddonControl$ControlOperator 中提供了以下开放方法用于检测任务限制或创建签名。

/**
 * 任务是否被限制接受
 * 并在 Result 中返回结果以及为何被限制
 */
fun check(profile: PlayerProfile): CompletableFuture

/**
 * 创建签名
 */
fun signature(profile: PlayerProfile, type: Trigger = Trigger.COMPLETE)