diff --git a/iggy-shim/build/.ninja_deps b/iggy-shim/build/.ninja_deps index e55a1ae..7d27ed0 100644 Binary files a/iggy-shim/build/.ninja_deps and b/iggy-shim/build/.ninja_deps differ diff --git a/iggy-shim/build/.ninja_log b/iggy-shim/build/.ninja_log index 94bfacf..b894897 100644 --- a/iggy-shim/build/.ninja_log +++ b/iggy-shim/build/.ninja_log @@ -9,3 +9,6 @@ 1 972 1783450570988894511 CMakeFiles/iggy_shim.dir/src/ui_renderer.cpp.obj a0824e5e1d5925f 972 1221 1783450572191715761 iggy_shim_w64.dll 54dc552610f77fab 972 1221 1783450572191715761 iggy_shim_w64.lib 54dc552610f77fab +3 1223 1783451017557865198 CMakeFiles/iggy_shim.dir/src/ui_renderer.cpp.obj a0824e5e1d5925f +1223 1472 1783451019009884485 iggy_shim_w64.dll 54dc552610f77fab +1223 1472 1783451019009884485 iggy_shim_w64.lib 54dc552610f77fab diff --git a/iggy-shim/build/iggy_shim_w64.dll b/iggy-shim/build/iggy_shim_w64.dll index 2bb9da8..d1b132c 100755 Binary files a/iggy-shim/build/iggy_shim_w64.dll and b/iggy-shim/build/iggy_shim_w64.dll differ diff --git a/iggy-shim/src/ui_renderer.cpp b/iggy-shim/src/ui_renderer.cpp index 9968d46..9b89e5c 100644 --- a/iggy-shim/src/ui_renderer.cpp +++ b/iggy-shim/src/ui_renderer.cpp @@ -214,6 +214,9 @@ static std::string frameFile(const IggyObjectNode &n) { static void drawNode(GDrawFunctions *gd, IggyObjectNode &n, float ox, float oy, float sx, float sy, float alpha) { if (!n.visible || n.alpha <= 0.001) return; + // list items are laid out in screen pixels from the list origin, so they + // don't inherit the (often large) bundle scale of the list container. + if (n.props.count(u"__listItem")) { sx = 1.f; sy = 1.f; } float nx = ox + (float)n.x * sx; float ny = oy + (float)n.y * sy; float nsx = sx * (float)n.scaleX; @@ -228,22 +231,32 @@ static void drawNode(GDrawFunctions *gd, IggyObjectNode &n, float ox, float oy, drawQuadRaw(tex, nx, ny, tex->w * nsx, tex->h * nsy, na); } - // focus highlight for buttons without distinct frame art auto focusedIt = n.props.find(u"__focused"); bool focused = focusedIt != n.props.end() && focusedIt->second.asBool(); + bool isListItem = n.props.count(u"__listItem") != 0; // label text (set by the game via Init/SetLabel) auto labelIt = n.props.find(u"label"); if (labelIt != n.props.end() && labelIt->second.type == shim::Value::Type::String && !labelIt->second.str.empty() && textHaveFont()) { - float fontPx = 22.0f * nsy; + // list items use a fixed size (they inherit the list's large bundle + // scale otherwise); regular controls scale with the display. + float fontPx = isListItem ? 26.0f : 22.0f * nsy; float tw = textMeasure(labelIt->second.str, fontPx); float boxW = tex && tex->w ? tex->w * nsx : 0.f; float boxH = tex && tex->h ? tex->h * nsy : fontPx; float tx = nx + (boxW > tw ? (boxW - tw) / 2 : 0); float ty = ny + (boxH - fontPx) * 0.5f; - float white[4] = {1, 1, 1, na}; - float yellow[4] = {1, 1, 0.35f, na}; + + // LCE-style selection bar behind the focused control + if (focused) { + float barX = tx - 14, barY = ty - 6; + float barW = tw + 28, barH = fontPx + 12; + float bar[4] = {0.28f * na, 0.42f * na, 0.75f * na, 0.65f * na}; // premult blue + rawQuad(nullptr, barX, barY, barW, barH, bar, false); + } + float white[4] = {na, na, na, na}; + float yellow[4] = {na, na, 0.32f * na, na}; textDraw(gd, labelIt->second.str, tx, ty, fontPx, focused ? yellow : white); }