商城按钮改为提示去找百店老板娘

203 没有网页商城,端口也没有网页窗口,系统菜单的商城按钮打开的是空窗口。
新 PORT 模块 mt_mallhint 替换 SystemDialog 的商城按钮和 GameWindow 的 mall 命令处理,
弹出提示框(并在聊天栏提示):商城物品请到各村杂货店旁的百店老板娘处购买。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 00:17:28 +09:00
co-authored by Claude Opus 5.5
parent cc18db5dd1
commit 4bfc4244bd
3 changed files with 48 additions and 1 deletions
+44
View File
@@ -0,0 +1,44 @@
// The system menu's 商城 button (PORT), run by PythonBoot::RunMainScript as module mt_mallhint. In 40250 it
// sends /in_game_mall and the server answers `mall <url>`, which game.GameWindow opens in the web window;
// 203 has no web shop and the port has no web view, so the window stayed empty. The mall items are sold by
// NPC 9010 百店老板娘 next to each village's general store instead (tools/server/item-mall-shop), so the
// button, and a `mall` command from the server, show where to find her. Both are replaced on the classes
// before the system dialog and the game window are created, which bind them.
// Strings are UTF-8 here and go through player.AutoHuntLocalize into the locale's code page.
static const char c_szMallHintScript[] = R"PY(# -*- coding: utf-8 -*-
import chat
import game
import player
import uiCommon
import uiSystem
L = player.AutoHuntLocalize
HINT = "商城物品请到各村杂货店旁的百店老板娘处购买"
POPUP_WIDTH = 330
_popup = []
def _ShowHint():
chat.AppendChat(chat.CHAT_TYPE_INFO, L(HINT))
if not _popup:
popup = uiCommon.PopupDialog()
popup.SetWidth(POPUP_WIDTH)
popup.SetText(L(HINT))
_popup.append(popup)
_popup[0].Open()
def _ClickInGameShopButton(self):
self.Close()
_ShowHint()
def _InGameShop_Show(self, url):
_ShowHint()
uiSystem.SystemDialog._SystemDialog__ClickInGameShopButton = _ClickInGameShopButton
game.GameWindow._GameWindow__InGameShop_Show = _InGameShop_Show
)PY";
+2
View File
@@ -879,6 +879,7 @@ namespace PythonBoot
#include "FrameRateOptionScript.inc"
#include "UIScaleOptionScript.inc"
#include "InventoryPagesScript.inc"
#include "MallHintScript.inc"
static void install_script_module(const char* c_szModule, const char* c_szScript)
{
@@ -937,6 +938,7 @@ bool RunMainScript(const char* lpCmdLine, std::string* error)
install_script_module("mt_framerate", c_szFrameRateOptionScript);
install_script_module("mt_uiscale", c_szUIScaleOptionScript);
install_script_module("mt_inventory", c_szInventoryPagesScript);
install_script_module("mt_mallhint", c_szMallHintScript);
}
return true;
}