Greater Rift: two Guardians from level 75, overtime status spelled out (#33); item descriptions stay open on touch (#32); Mac: click monsters to attack, items take the mouse, Share Log

The overtime status (#33) was reported with a clear direction by Joe Hu, who also sent a patch along the same lines (#34).

Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
jhaizhou
2026-10-14 10:34:48 +08:00
co-authored by Joe Hu
parent dc3cc22b9b
commit 2e7177c080
25 changed files with 364 additions and 57 deletions
+18 -7
View File
@@ -195,6 +195,8 @@ def pad_bliss(s): # 手柄版建角模式页(原版布局原样)+ 「极
s, n = re.subn(r'\{\s*"action"\s*:\s*"option2"\s*,\s*"description"\s*:\s*"@LegacyGameVersionSwitch"\s*\}\s*,?', '', s); assert n == 1, n
at, add = INSERT['controller/console/characteroptionspanelhd.json']; ms = list(re.finditer(at, s)); assert len(ms) == 1
key = ' { "type": "ImageWidget", "name": "TouchBlissKey", "fields": { "rect": { "x": -1665, "y": 1330, "scale": 1.5 }, "filename": "Controller/ControllerButtons/Switch/ButtonLeft" } },\n'
if os.environ.get('DM_OVERLAY_MAC'): # Mac App:同位再带一个键盘键帽(缺省在屏外,玩家用键盘时宿主把两个对调,dm_padmode.c) | Mac App: one more keyboard key cap at the same position (off screen by default; when the player uses the keyboard the host swaps the two, dm_padmode.c)
key += ' { "type": "ImageWidget", "name": "TouchBlissKeyK", "fields": { "rect": { "x": 99999, "y": 1330, "scale": 1.5 }, "filename": "Ztouch_controller_buttons_ui/switchKButtonLeft" } },\n'
return s[:ms[0].start()] + add.lstrip() + key + ' ' + s[ms[0].start():]
def set_rect(s, name, x, y, w, h):
m = re.search(r'"name"\s*:\s*"%s"' % re.escape(name), s); assert m, name
@@ -808,6 +810,8 @@ def _rf_div(name, x, y, w=500): # 分隔金线按所在栏宽缩放 | The gold
return {'type': 'ImageWidget', 'name': name, 'fields': {'rect': {'x': x, 'y': y, 'scale': round(w / RF_DIV_W, 4)}, 'filename': 'PauseMenu\\Divider'}}
def _rf_key(name, cap, by): # 手柄模式下贴在按钮左端的原版键帽(Switch 手柄:右 = A、上 = X;48×45 原图放大 1.5)。缺省在屏外,宿主在手柄模式挪进来(dm_rift_ui.c);这一页原版底部提示条不在屏上 | The original button glyph placed at the left end of the button in controller mode (Switch controller: right = A, top = X; the 48x45 source image scaled by 1.5). Off screen by default, moved in by the host in controller mode (dm_rift_ui.c); on this page the original bottom button legend is not on screen
return {'type': 'ImageWidget', 'name': name, 'fields': {'rect': {'x': 99999, 'y': by + 26, 'scale': 1.5}, 'filename': 'Controller/ControllerButtons/Switch/' + cap}}
def _rf_keys(name, cap, by): # Mac App 的覆盖层(DM_OVERLAY_MAC)再带一个同位的键盘键帽(名字加 K,图在 kbd_glyphs.py 那一套里):玩家用键盘时宿主显示它、藏手柄那个。iOS 的覆盖层不带 | the Mac App's overlay (DM_OVERLAY_MAC) additionally carries a keyboard key cap at the same position (name with K appended, images from the kbd_glyphs.py set): when the player uses the keyboard the host shows it and hides the gamepad one. The iOS overlay does not carry it
k = _rf_key(name, cap, by); return [k] + ([dict(k, name=name + 'K', fields=dict(k['fields'], filename='Ztouch_controller_buttons_ui/switchK' + cap))] if os.environ.get('DM_OVERLAY_MAC') else [])
def _rift_board():
# 左栏:标题 0–65 → 箭头组 80–188(大厅大箭头 94×108 原尺寸,层数大字在两箭头正中)→ ±10 两个等宽钮 212–267(前端小按钮 366×92 × 0.596 = 218×55,间隔 24,左右与箭头组对齐)
# → 本层信息 5 行(行距 64)307–627 → 组间 40 → 安亚赌博 667–851 → 「开始」贴底:底边 = 右列列表底边 1280,宽 460(前端中按钮 470×118 × 0.979)
@@ -827,7 +831,7 @@ def _rift_board():
# Four rows (row pitch 64, same as 「本层」(This Level)): gray label on the left (unique / set / unique after clear / set after clear) + right-aligned value (one widget each in unique gold and set green; the host fills one of them).
# Two rows of full sentences and two side-by-side columns both exceed the column width (Mac screenshot: truncated / overlapping each other); five rows with a subtitle are too cramped on the real device (row pitch 56, last row touching 「开始」(Enter Rift))
for n in range(4): sel += [_kb_text('TouchRF_Gam%dL' % n, 0, 842 + 64 * n, 300, 56, '$FontColorMoreLightGray', '$MediumFontSize', 'left'), _kb_text('TouchRF_Gam%dLE' % n, 99999, 842 + 64 * n, 330, 56, '$FontColorMoreLightGray', RF_EN_PT, 'left'), _kb_text('TouchRF_Gam%dU' % n, 230, 842 + 64 * n, 250, 56, '$FontColorGoldYellow', '$MediumFontSize', 'right'), _kb_text('TouchRF_Gam%dS' % n, 230, 842 + 64 * n, 250, 56, '$FontColorGreen', '$MediumFontSize', 'right')]
sel += [_rf_btn('TouchRF_Start', 0, 1155, 'FrontEnd/HD/Final/FrontEnd_ButtonMed', _RF_BTN, 1.064, '@dmRiftBtnStart'), _rf_key('TouchRF_KeyA', 'ButtonRight', 1155)]
sel += [_rf_btn('TouchRF_Start', 0, 1155, 'FrontEnd/HD/Final/FrontEnd_ButtonMed', _RF_BTN, 1.064, '@dmRiftBtnStart')] + _rf_keys('TouchRF_KeyA', 'ButtonRight', 1155)
# 进行中页:层数大字 96–204 → 「本层」小节(标题 332、金线 394、三行 414 / 478 / 542,与选层页同位)→ 放弃一组(说明 746、按钮 818–943)→ 继续一组贴底(说明 1083、按钮 1155,同「开始」)。
# 信息—放弃—继续三段间距相等(各 140);按钮上方的说明都是四到八个字的短句、居中(放弃那句与「本层」三行宿主按「守护者打倒没有」换说法)
# In-progress page: large level number text 96–204 → 「本层」(This Level) section (title 332, gold line 394, three rows 414 / 478 / 542, same positions as the level selection page) → abandon group (caption 746, button 818–943) → continue group flush against the bottom (caption 1083, button 1155, same as 「开始」(Enter Rift)).
@@ -848,7 +852,7 @@ def _rift_board():
# When this level is completed the secondary button becomes "Reselect level" (progress is already recorded, so "Abandon" reads wrong). The host cannot
# change button text, so a button is placed at the same position and the host moves it in and out according to "has the Guardian been defeated"
_rf_btn('TouchRF_Resel', 99999, 818, 'FrontEnd/HD/Final/FrontEnd_ButtonMed', _RF_BTN, 1.064, '@dmRiftBtnResel'),
_rf_key('TouchRF_KeyA2', 'ButtonRight', 1155), _rf_key('TouchRF_KeyX', 'ButtonTop', 818)]
] + _rf_keys('TouchRF_KeyA2', 'ButtonRight', 1155) + _rf_keys('TouchRF_KeyX', 'ButtonTop', 818)
right = [_kb_text('TouchRF_MsT', 530, RF_T0, 500, 60, '$FontColorGoldYellow', '$MediumFontSize', 'left', '@dmRiftMsT'), _rf_div('TouchRF_DivR', 530, 62, 1157),
_kb_text('TouchRF_MsN', 1030, RF_T0, 657, 60, '$FontColorMoreLightGray', '$SmallFontSize', 'right', '@dmRiftMsN'),
# 英文版的这一句写物品原名(Token of Absolution),比中文长一倍:另放一个更宽、字号更小的控件,缺省在屏外,英文时宿主换用
@@ -893,12 +897,19 @@ def _rift_panel(s):
{'type': 'ImageWidget', 'name': 'TouchRF_FrameBg', 'fields': {'filename': '\\PANEL\\Options\\FrontEndOptionsBG'}},
{'type': 'TextBoxWidget', 'name': 'TouchRF_Title', 'fields': {'rect': {'x': 0, 'y': 45, 'width': 1950, 'height': 103}, 'text': '@dmRiftPanelTitle', 'style': '$StyleTitleBlock'}},
{'type': 'ButtonWidget', 'name': 'TouchRF_CloseBtn', 'fields': {'rect': {'x': 1868, 'y': 8}, 'filename': 'PANEL\\closebtn_4x', 'hoveredFrame': 3, 'onClickMessage': close,
'tooltipString': '@strClose', 'sound': 'cursor_close_window_hd', 'acceptsEscKeyEverywhere': True}}]}]},
'tooltipString': '@strClose', 'sound': 'cursor_close_window_hd', 'acceptsEscKeyEverywhere': True}},
# 触摸关闭钮:外框右上角同一处只留一个——手柄 / 键鼠显示上面那个原版红框,触屏显示这个金色 X(与别的面板同图),宿主按模式把另一个挪出屏(dm_rift_ui.c)。
# 位置:标题条(y 45 起、高 103,深色底)那一行的右端、面板内侧——金 X(24×33 像素 = 48×66 单位,单位是外框贴图像素的 2 倍)垂直居中于标题条:
# y = 45 + 103 / 2 − 33 = 64;x = 1766:整个 X 落在标题条右端角花(约 1832 起)以左的深色底上,不伸出外框、不压角花。原先对准红框中心,一半伸出外框、压着石角花纹,几乎看不见
# 点按热区:金 X 本体只有约 10×13 点,另放一个透明的按钮罩在它上面当热区(借触屏那套透明键帽图 48×45 像素,放大 2.4 倍 = 约 46×43 点),中心对准 X 的中心(x 1705 是按「按名字取到的控件中心」实测校的:1675 时偏左 6 点)
# Touch close button: only one stays at the same place at the top right of the frame - gamepad / keyboard-and-mouse show the original red frame above, touch shows this gold X (same image as other panels), and the host moves the other one off screen by mode (dm_rift_ui.c).
# Position: at the right end of the title bar row (starting at y 45, 103 high, dark background), inside the panel - the gold X (24x33 pixels = 48x66 units, a unit being twice a pixel of the frame texture) is centred vertically on the title bar:
# y = 45 + 103 / 2 - 33 = 64; x = 1766: the whole X sits on the dark background to the left of the corner ornament at the right end of the title bar (starting at about 1832), neither sticking out of the frame nor covering the ornament. It used to be aligned with the centre of the red frame, half outside the frame and on top of the stone corner pattern, nearly invisible
# Tap hot zone: the gold X itself is only about 10x13 points, so a transparent button is placed over it as the hot zone (borrowing the touch layout's transparent key-cap image of 48x45 pixels, enlarged 2.4 times = about 46x43 points), centred on the centre of the X (x 1705 was calibrated by measuring "the widget centre fetched by name": at 1675 it was 6 points to the left)
{'type': 'ImageWidget', 'name': 'TouchRF_CloseX', 'fields': {'rect': {'x': 1766, 'y': 64}, 'filename': 'PANEL\\HUD_02\\front_panel'}},
{'type': 'ButtonWidget', 'name': 'TouchClose', 'fields': {'rect': {'x': 1705, 'y': -11, 'scale': 2.4}, 'filename': 'Ztouch_controller_buttons_ui/switch_ButtonRight', 'sound': 'cursor_close_window_hd', 'onClickMessage': close}}]}]},
{'type': 'ImageWidget', 'name': 'TouchRF_ContentBg', 'fields': {'rect': '$SettingsPanelBackgroundRect', 'anchor': {'x': 0.5}, 'filename': 'Controller/Panel/Options/Panel_Options_BG'}},
# 触摸关闭钮:同编年史 _chronicle_touch(右上角)
# Touch close button: same as the chronicle's _chronicle_touch (top-right corner)
{'type': 'Widget', 'name': 'TouchCloseBox', 'fields': {'rect': {'x': -998, 'y': 256, 'width': 2600, 'height': 121, 'scale': '$ConsoleUIScale'}, 'anchor': {'x': 0.5}}, 'children': [
{'type': 'ButtonWidget', 'name': 'TouchClose', 'fields': {'rect': {'x': 2236, 'y': -171}, 'filename': 'PANEL\\HUD_02\\front_panel', 'sound': 'cursor_close_window_hd', 'onClickMessage': close}}]}]
]
board = _rift_board(); board['children'][0]['fields']['rect']['x'] = 0; board['children'][0]['fields']['rect']['y'] = -54 # 没有页签条:内容上移 54,吃掉标题下的空带,底边留出与左边距相当的空(原先上空下贴底) # 内容缺省就在屏上(编年史版要切页签才挪进来) | No tab strip: content moves up 54, taking up the empty band under the title, leaving a gap at the bottom edge comparable to the left margin (previously empty at the top and flush against the bottom) # the content is on screen by default (the chronicle version only moves it in when the tab is switched)
lay = {'basedOn': 'MessageLogPanel_800x600HD.json', 'type': 'MessageLogPanel', 'name': 'MessageLogPanel',
'fields': {'priority': 9002, 'fitToParent': True, 'defaultWidget': 'TouchRF_Start'}, 'children': native + frame + [board]}