商城按钮改为提示去找百店老板娘
203 没有网页商城,端口也没有网页窗口,系统菜单的商城按钮打开的是空窗口。 新 PORT 模块 mt_mallhint 替换 SystemDialog 的商城按钮和 GameWindow 的 mall 命令处理, 弹出提示框(并在聊天栏提示):商城物品请到各村杂货店旁的百店老板娘处购买。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cc18db5dd1
commit
4bfc4244bd
+2
-1
@@ -117,7 +117,8 @@ PORT 扩展(40250 没有对应物,只为移动端/平台而加;不能改 4
|
||||
|
||||
- 由 `PythonBoot::RunMainScript` 注入的 Python 模块:`mt_autohunt`(自动狩猎,`AutoHuntScript.inc`)、`mt_register`
|
||||
(客户端内账号注册)、`mt_framerate`(系统选项里的"画面帧率"行)、`mt_uiscale`(系统选项里的"界面大小"行)、`mt_inventory`(5 页背包:改写 `InventoryWindow.py` 的装备格起点和页签,
|
||||
泛化翻页、自动药水高亮和选宝石窗口的格子扫描)。它们包装 40250 窗口类的方法,不修改脚本文件。
|
||||
泛化翻页、自动药水高亮和选宝石窗口的格子扫描)、`mt_mallhint`(系统菜单"商城"按钮和服务端 `mall` 命令改为
|
||||
提示去各村杂货店旁的 NPC 9010 百店老板娘购买,见 `tools/server/item-mall-shop/`;203 没有网页商城)。它们包装 40250 窗口类的方法,不修改脚本文件。
|
||||
- 界面大小(`platform/EterBase/UIScaleMode.h` + `src/host/ui_scale.cpp`):Android 上 40250 界面按 600 / 700 / 800
|
||||
逻辑像素高排版(默认 600,最低就是 600:背包窗口 565 高),宽度随屏幕比例;选择存在 `ui_height.cfg`,下次启动生效。
|
||||
桌面按窗口大小排版,`MT_UI_HEIGHT=600` 可在桌面上测试这一设置。
|
||||
|
||||
@@ -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";
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user