新增插件指引网页
This commit is contained in:
@@ -83,6 +83,42 @@ class WPSStoreSystem(WPSAPI):
|
||||
logger.SaveProperties()
|
||||
self._permanent_mode_ids: set[str] = set()
|
||||
|
||||
def get_guide_subtitle(self) -> str:
|
||||
return "系统商品与玩家寄售的统一商店"
|
||||
|
||||
def get_guide_metadata(self) -> Dict[str, str]:
|
||||
return {
|
||||
"已注册模式": str(len(self._mode_registry)),
|
||||
"永久模式": str(len(self._permanent_mode_ids)),
|
||||
"数据表": f"{self.SYSTEM_TABLE}, {self.PLAYER_TABLE}",
|
||||
}
|
||||
|
||||
def collect_command_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "store",
|
||||
"identifier": "store",
|
||||
"description": "查看系统刷新的商品列表,包含系统和玩家寄售。",
|
||||
"metadata": {"别名": "商店"},
|
||||
},
|
||||
)
|
||||
|
||||
def collect_guide_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "模式注册",
|
||||
"description": "`register_mode/register_permanent_mode` 将背包物品以指定库存与价格投放至系统表。",
|
||||
},
|
||||
{
|
||||
"title": "刷新机制",
|
||||
"description": "每小时根据 `store_hourly_count` 配置刷新系统库存,同时同步永久模式。",
|
||||
},
|
||||
{
|
||||
"title": "玩家寄售",
|
||||
"description": "`sell_item` 将玩家物品挂售至寄售表,`purchase_item` 支持购买系统或玩家商品。",
|
||||
},
|
||||
)
|
||||
|
||||
@override
|
||||
def dependencies(self) -> List[type]:
|
||||
return [WPSAPI, WPSConfigAPI, WPSBackpackSystem]
|
||||
@@ -960,6 +996,31 @@ class WPSStoreSystem(WPSAPI):
|
||||
|
||||
|
||||
class WPSStoreBuyCommand(WPSAPI):
|
||||
def get_guide_subtitle(self) -> str:
|
||||
return "购买商店及玩家寄售物品"
|
||||
|
||||
def collect_command_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "buy",
|
||||
"identifier": "buy",
|
||||
"description": "购买系统或玩家寄售商品,数量需为正整数。",
|
||||
"metadata": {"别名": "购买"},
|
||||
},
|
||||
)
|
||||
|
||||
def collect_guide_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "参数格式",
|
||||
"description": "`购买 <物品名称或ID> <数量>`,内部支持模糊匹配模式名称。",
|
||||
},
|
||||
{
|
||||
"title": "权限校验",
|
||||
"description": "调用 `purchase_item` 时校验库存、积分并自动扣除商品库存。",
|
||||
},
|
||||
)
|
||||
|
||||
@override
|
||||
def dependencies(self) -> list[type]:
|
||||
return [WPSStoreSystem]
|
||||
@@ -1016,6 +1077,31 @@ class WPSStoreBuyCommand(WPSAPI):
|
||||
|
||||
|
||||
class WPSStoreSellCommand(WPSAPI):
|
||||
def get_guide_subtitle(self) -> str:
|
||||
return "挂售物品至商店寄售区"
|
||||
|
||||
def collect_command_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "sell",
|
||||
"identifier": "sell",
|
||||
"description": "将背包物品以指定数量和单价挂售。",
|
||||
"metadata": {"别名": "出售"},
|
||||
},
|
||||
)
|
||||
|
||||
def collect_guide_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "参数格式",
|
||||
"description": "`出售 <物品名称或ID> <数量> <单价>`。",
|
||||
},
|
||||
{
|
||||
"title": "寄售生命周期",
|
||||
"description": "寄售记录写入玩家表,状态变更后定期清理无效记录。",
|
||||
},
|
||||
)
|
||||
|
||||
@override
|
||||
def dependencies(self) -> list[type]:
|
||||
return [WPSStoreSystem]
|
||||
|
||||
Reference in New Issue
Block a user