feat(mobile): optimize touch skill layout and add auto-hunt HUD and combat entries
This commit is contained in:
+15
-14
@@ -16,25 +16,26 @@ struct TouchLayout {
|
||||
|
||||
inline TouchLayout make_touch_layout(float width, float height, float safe_inset, float minimum_target) {
|
||||
TouchLayout layout{};
|
||||
layout.scale = std::max(minimum_target / 52.0f,
|
||||
layout.scale = std::max(minimum_target / 44.0f,
|
||||
std::clamp(std::min(height / 600.0f, (width - 2 * safe_inset) / 800.0f), 0.65f, 1.35f));
|
||||
const float s = layout.scale;
|
||||
const float ax = width - safe_inset - 78 * s;
|
||||
// Leave the original status/menu strip clear below the lowest skill.
|
||||
const float ay = height - 136 * s;
|
||||
layout.buttons[0] = {ax, ay, 44 * s};
|
||||
// PORT: D2R Mobile's main-button + single skill arc arrangement, extended to six slots.
|
||||
// 24-degree spacing at radius 176 keeps even the expanded (1.25x) hit circles separate.
|
||||
const float ax = width - safe_inset - 74 * s;
|
||||
// Lowered attack button for thumb resting near the bottom edge.
|
||||
const float ay = height - 88 * s;
|
||||
layout.buttons[0] = {ax, ay, 42 * s};
|
||||
// Compact single-layer skill arc in the upper-left of attack button:
|
||||
// 20-degree spacing from 170 to 270 degrees at radius 140 keeps the skills tightly
|
||||
// wrapped around the attack button without encroaching on the minimap or screen center.
|
||||
for (int slot = 0; slot < 6; ++slot) {
|
||||
const float angle = (160.0f + 24.0f * slot) * 3.14159265f / 180.0f;
|
||||
layout.buttons[slot + 1] = {ax + std::cos(angle) * 176 * s,
|
||||
ay + std::sin(angle) * 176 * s, 28 * s};
|
||||
const float angle = (170.0f + 20.0f * slot) * 3.14159265f / 180.0f;
|
||||
layout.buttons[slot + 1] = {ax + std::cos(angle) * 140 * s,
|
||||
ay + std::sin(angle) * 140 * s, 22 * s};
|
||||
}
|
||||
// Keep the settings/toggle action outside the arc, away from repeated attack taps.
|
||||
layout.buttons[7] = {ax - 246 * s, ay - 84 * s, 26 * s};
|
||||
// Auto hunt button nestled compactly just outside the skill arc.
|
||||
layout.buttons[7] = {ax - 195 * s, ay - 50 * s, 22 * s};
|
||||
const float item_center = std::min(width / 2, layout.buttons[1].x - 114 * s);
|
||||
layout.buttons[8] = {item_center - 36 * s, height - 38 * s, 28 * s};
|
||||
layout.buttons[9] = {item_center + 36 * s, height - 38 * s, 28 * s};
|
||||
layout.buttons[8] = {item_center - 36 * s, height - 38 * s, 24 * s};
|
||||
layout.buttons[9] = {item_center + 36 * s, height - 38 * s, 24 * s};
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user