Greater Rift: invading act bosses from level 80 (second segment of #26), Guardian count on the top bar, boss-summoned units keep original strength; touch: floating stick measured from the touch-down point, item descriptions move beside the inventory; rewriter output r43
This commit is contained in:
@@ -75,7 +75,8 @@ void dm_rift_hud_draw(UIView *host, CGRect wr, BOOL hide) {
|
||||
NSString *st = h.done ? (h.inc ? [NSString stringWithFormat:@(dm_ui("dmRiftHudDone")), h.tier] : [NSString stringWithFormat:@(dm_ui("dmRiftHudLate")), h.tier]) : g ? @(dm_ui("dmRiftHudGuard")) : [NSString stringWithFormat:@(dm_ui("dmRiftTierN")), h.tier];
|
||||
set_text(sub, st, d2font(14 * u), white, CGRectMake(48 * u, 9 * u, 130 * u, 19 * u), kCAAlignmentLeft);
|
||||
set_text(timer, [NSString stringWithFormat:@"%d:%02d", s / 60, s % 60], d2font(17 * u), (s <= 60 && !h.done) ? red : gold, CGRectMake(W - 90 * u, 6 * u, 80 * u, 22 * u), kCAAlignmentRight);
|
||||
NSString *gl = h.done ? (!h.inc ? @(dm_ui("dmRiftHudSame")) : h.next > h.tier ? [NSString stringWithFormat:@(dm_ui("dmRiftHudNext")), h.next] : @(dm_ui("dmRiftHudTop"))) : h.overtime ? @(dm_ui("dmRiftHudOver")) : g ? @(dm_ui("dmRiftHudKill")) : [NSString stringWithFormat:@(dm_ui("dmRiftHudGoal")), (int)(h.progress * 100)]; // 已超时:第二行换成这一句,优先于「击败守护者」/ 进度目标(第一行照旧写第几层 / 守护者现身) | overtime: the second line becomes this sentence, taking priority over "Slay the Rift Guardian" / the progress goal (the first line still says which level / that the Guardian has appeared)
|
||||
NSString *gl = h.done ? (!h.inc ? @(dm_ui("dmRiftHudSame")) : h.next > h.tier ? [NSString stringWithFormat:@(dm_ui("dmRiftHudNext")), h.next] : @(dm_ui("dmRiftHudTop"))) : h.goal == 5 ? [NSString stringWithFormat:@(dm_ui("dmRiftHudOverKillN")), h.gdead, h.gtotal] : h.goal == 4 ? @(dm_ui("dmRiftHudOverKill")) : h.goal == 3 ? @(dm_ui("dmRiftHudOver"))
|
||||
: h.goal == 2 ? [NSString stringWithFormat:@(dm_ui("dmRiftHudKillN")), h.gdead, h.gtotal] : h.goal == 1 ? @(dm_ui("dmRiftHudKill")) : [NSString stringWithFormat:@(dm_ui("dmRiftHudGoal")), (int)(h.progress * 100)]; // 已超时:第二行换成这一句,优先于「击败守护者」/ 进度目标(第一行照旧写第几层 / 守护者现身) | overtime: the second line becomes this sentence, taking priority over "Slay the Rift Guardian" / the progress goal (the first line still says which level / that the Guardian has appeared)
|
||||
set_text(goal, gl, d2font(12 * u), grey, CGRectMake(10 * u, 32 * u, W - 20 * u, 17 * u), kCAAlignmentLeft);
|
||||
CGRect tr = CGRectMake(11 * u, 55 * u, W - 22 * u, 10 * u); // 含 1 单位外框(条 8 + 外框各 1) // 进度条:外框暗边 + 深底,填充金褐(守护者转暗红),每 10% 一道刻痕,两端菱形钉 | Includes the 1-unit outer frame (bar 8 + frame 1 on each side) // Progress bar: dark-edged outer frame + deep background, golden-brown fill (turns dark red for the guardian), a notch every 10%, diamond studs at both ends
|
||||
track.frame = tr; track.backgroundColor = rgb(25, 20, 14, 1).CGColor; track.borderColor = rgb(95, 78, 48, 1).CGColor; track.borderWidth = MAX(1, u);
|
||||
|
||||
@@ -79,16 +79,18 @@ void dm_tc_layout_make(dm_tc_layout *l, float width, float height) {
|
||||
/* 左摇杆是浮动底盘:左下「起摇杆区」里手指落在哪,底盘圆心就落在哪,松手回静止位。
|
||||
静止位:圆心离安全区左界 90(底盘半径 60 + 30)、不小于 120,离屏幕底 115——只是没按时画在哪。
|
||||
起摇杆区:屏宽的左 40% × 屏高的下 55%(左与下到屏幕边:拇指压在刘海那一条上也算);区里我们的圆钮 / 腰带格、原版界面上可点的东西各自优先。
|
||||
夹回:落点贴边时圆心挪回来,整个底盘留在安全区左界以右、底盘下沿离屏幕底不少于 25(不撞系统横条)
|
||||
夹回:只为底盘整圈画在屏内——落点离左沿 / 底沿不到「半径 + 8」时底盘圆心挪回到那条线上;只影响画,轴值仍按手指相对落点算(摇杆头 = 底盘圆心 + 轴值 × 半径)。不让安全区(原先左界取「安全区 + 半径」,刘海机型约 122 点:
|
||||
拇指自然落在离左边 60–120 点的人一落指就带明显的向左分量;左下角没有刘海也没有系统横条)。静止位仍让安全区,那只是没按时画在哪
|
||||
The left stick is a floating base: wherever the finger lands inside the bottom-left "stick-start zone", the base centre goes there, and it returns to the rest position on release.
|
||||
Rest position: centre 90 from the left edge of the safe area (base radius 60 + 30), not less than 120, and 115 from the bottom of the screen - only where it is drawn while not pressed.
|
||||
Stick-start zone: the left 40% of the screen width x the lower 55% of the screen height (reaching the screen edges on the left and bottom: a thumb on the notch strip counts too); inside the zone our round buttons / belt cells and the clickable things of the original UI each take priority.
|
||||
Clamping: when the touch point is near an edge the centre is moved back so that the whole base stays to the right of the safe area's left edge and its lower rim is at least 25 from the bottom of the screen (clear of the system bar) */
|
||||
Clamping: only so that the whole base is drawn on screen - when the touch point is closer than "radius + 8" to the left / bottom edge the base centre is moved back onto that line; it only affects drawing, and the axes are still computed from the finger relative to the touch point (stick knob = base centre + axes x radius). The safe area is not respected (the left bound used to be "safe area + radius", about 122 points on notched devices:
|
||||
a thumb landing naturally 60–120 points from the left edge got a clear leftward component the moment it touched down; the bottom-left corner has neither a notch nor the system bar). The rest position still respects the safe area, which is only where it is drawn while not pressed */
|
||||
l->joy_radius = 60*k;
|
||||
l->joy_x = fmaxf(90*k, g_safe_l + 60*k) + 30*k;
|
||||
l->joy_y = l->height - 115*k;
|
||||
l->joy_zone_r = l->width*0.40f; l->joy_zone_t = l->height*0.45f;
|
||||
l->joy_min_x = g_safe_l + l->joy_radius; l->joy_max_y = l->height - 25*k - l->joy_radius;
|
||||
l->joy_min_x = l->joy_radius + 8*k; l->joy_max_y = l->height - l->joy_radius - 8*k;
|
||||
}
|
||||
|
||||
int dm_tc_hit(const dm_tc_layout *l, float x, float y) {
|
||||
@@ -214,7 +216,7 @@ static void update(dm_tc_state *s) {
|
||||
s->lx = s->ly = 0;
|
||||
if (s->joy_slot < 0) return;
|
||||
dm_tc_finger *f = &s->finger[s->joy_slot];
|
||||
float dx = f->x-s->joy_origin_x, dy = s->joy_origin_y-f->y;
|
||||
float dx = f->x-s->joy_touch_x, dy = s->joy_touch_y-f->y; /* 相对落点,不相对底盘圆心:夹回只影响底盘画在哪,不进算法(贴角落指时圆心在手指右上方,按圆心算会出现手指往右、人往下) | relative to the touch point, not the base centre: clamping only affects where the base is drawn and does not enter the computation (touching down in a corner puts the centre to the upper right of the finger, and computing from the centre would make the character move down while the finger moves right) */
|
||||
/* 输入行程不跟大屏的视觉放大走:拇指不随屏幕变大。满偏 60 点、死区 6 点,手机与 iPad 一致
|
||||
(原先乘视觉倍数,12.9 寸 iPad 要推 105 点 ≈ 20 mm 才满偏,是手机的两倍)。底盘和摇杆头的大小仍按视觉倍数画。
|
||||
Input travel does not follow the visual enlargement on large screens: the thumb does not grow with the screen. Full deflection 60 points, dead zone 6 points, same on phone and iPad
|
||||
@@ -388,7 +390,7 @@ void dm_tc_cancel_finger(dm_tc_state *s, int slot) {
|
||||
if (slot < 0 || slot >= DM_TC_MAX_TOUCH) return;
|
||||
++s->gesture_epoch;
|
||||
if (s->finger[slot].active && s->finger[slot].target == DM_TC_PORTAL) { dm_tc_cancel_portal(s); }
|
||||
if (slot == s->joy_slot && s->finger[slot].active) { s->joy_lost_s = s->last_time_s; s->joy_lost_x = s->finger[slot].x; s->joy_lost_y = s->finger[slot].y; s->joy_lost_ox = s->joy_origin_x; s->joy_lost_oy = s->joy_origin_y; } /* 系统取消了摇杆那根手指:记下,紧接着在附近重新落下的接着当摇杆 | the system cancelled the joystick finger: record it, and a finger landing again nearby right afterwards continues as the joystick */
|
||||
if (slot == s->joy_slot && s->finger[slot].active) { s->joy_lost_s = s->last_time_s; s->joy_lost_x = s->finger[slot].x; s->joy_lost_y = s->finger[slot].y; s->joy_lost_ox = s->joy_origin_x; s->joy_lost_oy = s->joy_origin_y; s->joy_lost_tx = s->joy_touch_x; s->joy_lost_ty = s->joy_touch_y; } /* 系统取消了摇杆那根手指:记下,紧接着在附近重新落下的接着当摇杆 | the system cancelled the joystick finger: record it, and a finger landing again nearby right afterwards continues as the joystick */
|
||||
s->finger[slot] = (dm_tc_finger){.target=DM_TC_NONE};
|
||||
if (slot == s->joy_slot) { s->joy_slot = DM_TC_NONE; s->joy_origin_x = s->joy_origin_y = 0; }
|
||||
if (slot == s->aim_slot) s->aim_slot = DM_TC_NONE;
|
||||
@@ -505,14 +507,14 @@ void dm_tc_begin_at(dm_tc_state *s, int slot, float x, float y, double now_s) {
|
||||
} else if (!s->navigation_mode && !s->joy_block && hit == DM_TC_NONE && s->joy_slot == DM_TC_NONE && x >= 0 && y <= s->layout.height &&
|
||||
((x < s->layout.joy_zone_r && y > s->layout.joy_zone_t) ||
|
||||
(x < s->layout.width*0.43f && y > s->layout.height*0.25f && s->joy_lost_s > 0 && now_s - s->joy_lost_s <= DM_TC_JOY_RESUME_S && hypotf(x - s->joy_lost_x, y - s->joy_lost_y) <= DM_TC_JOY_GRAB_K * s->layout.joy_radius))) {
|
||||
/* 浮动底盘:落在起摇杆区里就起摇杆,底盘圆心 = 落点(贴边时夹回,见布局处),方向与幅度按「手指相对底盘圆心」算,按住后拖到多远都照样识别,
|
||||
/* 浮动底盘:落在起摇杆区里就起摇杆,底盘圆心 = 落点(贴边时夹回,见布局处),方向与幅度按「手指相对落点」算,按住后拖到多远都照样识别,
|
||||
底盘不跟手走;落在区外照旧是点地。这一下若很快原地松开,仍兼作一次点击(dm_tc_end_at):区里的怪、掉落物、NPC 要点得到。
|
||||
摇杆那根手指刚被系统取消(通知横幅、系统手势;dm_tc_cancel_finger 记下时刻与位置),DM_TC_JOY_RESUME_S 内在原处附近重新落下的手指接着当摇杆,
|
||||
哪怕落点已拖出起摇杆区。只开着讲话文字框 / 对话菜单时不起摇杆(joy_block):夹回会让落点 ≠ 圆心、一落下就有方向,那一下只该关框
|
||||
Floating base: a touch inside the stick-start zone starts the stick with the base centre = the touch point (clamped back near the edges, see the layout), direction and magnitude are computed from "finger relative to base centre", and once held, dragging any distance is still recognised;
|
||||
哪怕落点已拖出起摇杆区。只开着讲话文字框 / 对话菜单时不起摇杆(joy_block):那一下只该关框、人不走(落指位移为零本来也不出方向,但手指稍一滑就会走,照旧整根挡掉)
|
||||
Floating base: a touch inside the stick-start zone starts the stick with the base centre = the touch point (clamped near the edges, see the layout), direction and magnitude are computed from "finger relative to the touch point", and once held, dragging any distance is still recognised;
|
||||
the base does not follow the finger; a touch outside the zone is a ground tap as before. If this touch is released quickly in place it still doubles as a tap (dm_tc_end_at): monsters, dropped items and NPCs inside the zone must remain tappable.
|
||||
When the stick finger has just been cancelled by the system (notification banner, system gesture; dm_tc_cancel_finger records the time and position), a finger touching down again near the same place within DM_TC_JOY_RESUME_S continues as the stick,
|
||||
even if the touch point has been dragged out of the stick-start zone. The stick does not start while only a speech text box / dialogue menu is open (joy_block): clamping would make touch point != centre and give a direction the moment it lands, when that touch should only close the box */
|
||||
even if the touch point has been dragged out of the stick-start zone. The stick does not start while only a speech text box / dialogue menu is open (joy_block): that touch should only close the box without moving the character (zero displacement on touch-down gives no direction anyway, but a slight slide would walk, so the whole finger is still blocked) */
|
||||
int resume = s->joy_lost_s > 0 && now_s - s->joy_lost_s <= DM_TC_JOY_RESUME_S && hypotf(x - s->joy_lost_x, y - s->joy_lost_y) <= DM_TC_JOY_GRAB_K * s->layout.joy_radius;
|
||||
s->joy_lost_s = 0;
|
||||
f->target = DM_TC_JOYSTICK;
|
||||
@@ -520,6 +522,7 @@ void dm_tc_begin_at(dm_tc_state *s, int slot, float x, float y, double now_s) {
|
||||
/* 接续的沿用取消前的圆心,不按新落点重定:触摸被系统反复打断又重来的机器上,每重来一次底盘就跳到手指当前位置,看着像底盘追着手指跑 | a continuation keeps the centre from before the cancel instead of re-centring on the new touch point: on devices where touches are repeatedly interrupted by the system and restarted, the base would jump to the finger's current position on every restart and look as if it were chasing the finger */
|
||||
s->joy_origin_x = resume ? s->joy_lost_ox : fmaxf(x, s->layout.joy_min_x);
|
||||
s->joy_origin_y = resume ? s->joy_lost_oy : fminf(y, s->layout.joy_max_y);
|
||||
s->joy_touch_x = resume ? s->joy_lost_tx : x; s->joy_touch_y = resume ? s->joy_lost_ty : y; /* 接续的沿用取消前的落点,同样不按新落点重定 | a continuation keeps the touch point from before the cancel, likewise not re-centred on the new touch point */
|
||||
}
|
||||
update(s);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef struct {
|
||||
float width, height;
|
||||
dm_tc_target target[DM_TC_COUNT];
|
||||
float joy_x, joy_y, joy_radius; /* 没按时底盘的显示位置(静止位)与底盘半径 | where the base is shown while not pressed (rest position), and the base radius */
|
||||
float joy_zone_r, joy_zone_t, joy_min_x, joy_max_y; /* 起摇杆区的右界与上界(左与下到屏幕边);按下后底盘圆心的夹回界:x 不小于、y 不大于 | right and upper bounds of the stick-start zone (left and bottom reach the screen edges); clamp bounds for the base centre once pressed: x not less than, y not greater than */
|
||||
float joy_zone_r, joy_zone_t, joy_min_x, joy_max_y; /* 起摇杆区的右界与上界(左与下到屏幕边);按下后底盘圆心的夹回界:x 不小于、y 不大于(只为底盘整圈画在屏内:屏幕边 + 半径 + 8) | right and upper bounds of the stick-start zone (left and bottom reach the screen edges); clamp bounds for the base centre once pressed: x not less than, y not greater than (only so that the whole base is drawn on screen: screen edge + radius + 8) */
|
||||
dm_tc_target swap; /* 技能组切换键:本地开关,不直接发按键 | Skill set switch key: a local toggle; does not send a key directly */
|
||||
dm_tc_target diff; /* 底部 UI v4 第 0 格难度:点开 / 收起 1–8 选择条,不发按键 | Bottom UI v4 cell 0 difficulty: tap to open / collapse the 1–8 selector bar; sends no key */
|
||||
dm_tc_target pick[8]; /* 选择条 8 格(第 i 格 = 人数档 i+1),在七格上方 | The selector bar's 8 cells (cell i = player-count level i+1), above the seven cells */
|
||||
@@ -125,6 +125,7 @@ typedef struct {
|
||||
int belt_gap_cell; double belt_gap_at; /* 按着第二组技能时要喝药:先把 ZL 和技能键松开、空出 DM_TC_ZL_LEAD_S,到 belt_gap_at 才按腰带键(belt_gap_cell = 等着的那一格,0 = 没有) | to drink a potion while a skill of the second skill set is held: first release ZL and the skill key and leave a gap of DM_TC_ZL_LEAD_S, and only at belt_gap_at press the belt key (belt_gap_cell = the cell that is waiting, 0 = none) */
|
||||
double joy_lost_s; float joy_lost_x, joy_lost_y, joy_lost_ox, joy_lost_oy; /* 摇杆手指被系统取消的时刻与当时的位置(0 = 没有):紧接着在附近重新落下的手指接着当摇杆 | time and position at which the joystick finger was cancelled by the system (0 = none): a finger landing again nearby right afterwards continues as the joystick */
|
||||
int joy_block; /* 讲话文字框单独开着(前端不进面板态):这时落在底座上的手指不起摇杆,照旧只当一次点击(关讲话框)。前端按面板栈写 | speech text box open on its own (the front end does not enter panel state): a finger on the base starts no stick and is still just one click (closes the speech box). Written by the front end from the panel stack */
|
||||
float joy_touch_x, joy_touch_y, joy_lost_tx, joy_lost_ty; /* 摇杆那根手指的落点(方向与幅度一律按「手指相对落点」算;joy_origin 只是底盘画在哪 = 落点夹回屏内之后);被系统取消时记下的落点 | touch point of the stick finger (direction and magnitude are always computed from "finger relative to the touch point"; joy_origin is only where the base is drawn = the touch point clamped onto the screen); the touch point recorded when it was cancelled by the system */
|
||||
double belt_pulse_s; /* 最近一次「给玩家喝」的腰带脉冲还在发的时刻:其间按着的第二组技能连同 ZL 一起让开,收回后 ZL 重新领先 DM_TC_ZL_LEAD_S 技能键才回来 | Time until which the most recent "player drinks" belt pulse is still being sent: during it the held second-set skill gives way together with ZL, and after the release ZL again leads by DM_TC_ZL_LEAD_S before the skill key comes back */
|
||||
int belt_q; /* 此刻有别的脉冲在发 / 别的补发在等:排着,空了再落地(不互相盖掉)。值 = 格 | another pulse is being sent / another resend is pending: queue and fire when free (they never overwrite each other). Value = cell */
|
||||
} dm_tc_state;
|
||||
|
||||
Reference in New Issue
Block a user