diff --git a/modsettings/CustomUIAssets.json b/modsettings/CustomUIAssets.json index ff35fc8e..ffc5cddd 100644 --- a/modsettings/CustomUIAssets.json +++ b/modsettings/CustomUIAssets.json @@ -47,7 +47,7 @@ { "Name": "NavigationOverlayIcon", "Type": 0, - "URL": "http://cloud-3.steamusercontent.com/ugc/2038485431575931195/7EDAE98E027FF101263E62E940180E65BE343FEE/" + "URL": "http://cloud-3.steamusercontent.com/ugc/2038485431576357223/9B834B6C40D02D2796C4027D52FFFDF2F1DFBAA5/" }, { "Name": "option-gear", diff --git a/src/core/NavigationOverlayHandler.ttslua b/src/core/NavigationOverlayHandler.ttslua index 53ac3b00..eff1ae0b 100644 --- a/src/core/NavigationOverlayHandler.ttslua +++ b/src/core/NavigationOverlayHandler.ttslua @@ -493,19 +493,26 @@ function loadCamera(player, _, idValue) if cameraParams[newMatIndex][index].distance <= 0 then local divisor, minX, maxX, minZ, maxZ - for _, v in pairs(playmatApi.searchPlaymat(newMatColor)) do + for i, v in pairs(playmatApi.searchPlaymat(newMatColor)) do local bounds = v.hit_object.getBounds() local x1 = bounds['center'][1] - bounds['size'][1] / 2 local x2 = bounds['center'][1] + bounds['size'][1] / 2 local z1 = bounds['center'][3] - bounds['size'][3] / 2 local z2 = bounds['center'][3] + bounds['size'][3] / 2 - minX = math.min(x1, minX) - maxX = math.max(x2, maxX) - minZ = math.min(z1, minZ) - maxZ = math.max(z2, maxZ) + if i == 1 then + minX = x1 + maxX = x2 + minZ = z1 + maxZ = z2 + else + minX = math.min(x1, minX) + maxX = math.max(x2, maxX) + minZ = math.min(z1, minZ) + maxZ = math.max(z2, maxZ) + end end - -- White/Orange + -- White/Orange if index == 3 or index == 4 then divisor = {x = 1, z = 1.6 } -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this) @@ -514,12 +521,14 @@ function loadCamera(player, _, idValue) divisor = {x = 1.6, z = 1} end + local rotation = playmatApi.returnRotation() + -- need to wait if the player color changed Wait.frames( function() player.lookAt({ position = { (minX + maxX) / 2, 0, (minZ + maxZ) / 2 }, pitch = 75.823, - yaw = playmatApi.returnRotation().y + 180, + yaw = rotation.y + 180, distance = 0.64 * math.max((maxX - minX) / divisor.x, (maxZ - minZ) / divisor.z) + 7 }) end, 2) @@ -565,6 +574,7 @@ function resetClaimColors() for i = 1, 4 do for j = 1, 4 do + playermatData[i].claims = {} playermatData[i].claims[j] = (i == j) end end diff --git a/xml/Global.xml b/xml/Global.xml index 5f2c0129..d8c03990 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -29,8 +29,8 @@ outline="#303030" rectAlignment="LowerRight" width="35" - height="183" - offsetXY="-1 80" + height="146" + offsetXY="-1 120" spacing="2">