移动端界面大小设置:默认 600 逻辑高,系统选项可选 600/700/800

Android 上 40250 界面原先固定按 800 逻辑像素高排版,弹窗文字在手机上只有约 1 mm 高。
- UIScaleMode.h + host ui_scale.cpp:逻辑高度来自保存的设置(默认 600),ui_height.cfg 保存,下次启动生效;
  桌面可用 MT_UI_HEIGHT 测试
- app.GetUIHeight/GetAppliedUIHeight/SetUIHeight
- mt_uiscale PORT 模块:系统选项对话框加高一行,"界面大小 大/中/小",修改后聊天提示重启生效

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-29 23:10:51 +09:00
co-authored by Claude Opus 5.5
parent e33e41c12b
commit 71d8f8c6e7
10 changed files with 248 additions and 9 deletions
@@ -4,6 +4,7 @@
#include "PythonApplication.h"
#include "../EterLib/Camera.h"
#include "../../platform/EterBase/FrameRateMode.h" // PORT: frame-rate setting
#include "../../platform/EterBase/UIScaleMode.h" // PORT: UI size setting
extern bool PERF_CHECKER_RENDER_GAME;
extern D3DXCOLOR g_fSpecularColor;
@@ -1207,6 +1208,27 @@ PyObject* appSetFrameRateMode(PyObject* poSelf, PyObject* poArgs)
return Py_BuildNone();
}
// PORT: the UI size setting of the system option dialog (platform/EterBase/UIScaleMode.h). GetUIHeight is
// the player's choice (0 = unavailable), GetAppliedUIHeight the height this run lays out at.
PyObject* appGetUIHeight(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", MtUIScale::Chosen().load());
}
PyObject* appGetAppliedUIHeight(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", MtUIScale::Applied().load());
}
PyObject* appSetUIHeight(PyObject* poSelf, PyObject* poArgs)
{
int iHeight;
if (!PyTuple_GetInteger(poArgs, 0, &iHeight))
return Py_BuildException();
MtUIScale::Set(iHeight);
return Py_BuildNone();
}
void initapp()
{
static PyMethodDef s_methods[] =
@@ -1275,6 +1297,9 @@ void initapp()
{ "GetRandom", appGetRandom, METH_VARARGS },
{ "GetFrameRateMode", appGetFrameRateMode, METH_VARARGS }, // PORT
{ "SetFrameRateMode", appSetFrameRateMode, METH_VARARGS }, // PORT
{ "GetUIHeight", appGetUIHeight, METH_VARARGS }, // PORT
{ "GetAppliedUIHeight", appGetAppliedUIHeight, METH_VARARGS }, // PORT
{ "SetUIHeight", appSetUIHeight, METH_VARARGS }, // PORT
{ "RunPythonFile", appRunPythonFile, METH_VARARGS },
{ "IsWebPageMode", appIsWebPageMode, METH_VARARGS },
{ "ShowWebPage", appShowWebPage, METH_VARARGS },