# HG changeset patch # User Wuzzy # Date 1543255808 -3600 # Node ID 8fc6ac47f00a6f5749ef72c427f03e9d9b143738 # Parent 79e07510b8e385a871d59ef97f7c89413540f753 Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface diff -r 79e07510b8e3 -r 8fc6ac47f00a share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Mon Nov 26 18:03:39 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Mon Nov 26 19:10:08 2018 +0100 @@ -297,8 +297,14 @@ function DrawClanPowerTag() local zoomL = 1.1 - local xOffset = 45 - local yOffset = 70 + local xOffset, yOffset + if INTERFACE == "touch" then + xOffset = 126 + yOffset = ScreenHeight - 32 + else + xOffset = 45 + yOffset = 70 + end local tValue = clanPower[GetHogClan(CurrentHedgehog)] local tCol = GetClanColor(GetHogClan(CurrentHedgehog)) diff -r 79e07510b8e3 -r 8fc6ac47f00a share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua Mon Nov 26 18:03:39 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua Mon Nov 26 19:10:08 2018 +0100 @@ -2868,7 +2868,12 @@ -- Display the X and Y coordinates of the cursor while the cursor is active function updateCursorCoords() if band(GetState(CurrentHedgehog), gstChooseTarget) ~= 0 and CursorX ~= NO_CURSOR then - local x1, y = 12, 24 + local x1, y + if INTERFACE == "touch" then + x1, y = 126, 32 + else + x1, y = 12, 24 + end if tagCursorX then DeleteVisualGear(tagCursorX) end diff -r 79e07510b8e3 -r 8fc6ac47f00a share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Mon Nov 26 18:03:39 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Mon Nov 26 19:10:08 2018 +0100 @@ -331,28 +331,49 @@ function DrawTag(i) local zoomL = 1.3 - local xOffset = 40 - local yOffset, tValue, tCol + local xOffset, yOffset, tValue, tCol if i == SI.TAG_TIME then - yOffset = 40 + if INTERFACE == "touch" then + xOffset = 60 + yOffset = ScreenHeight - 35 + else + xOffset = 40 + yOffset = 40 + end tCol = SI.colorTimer tValue = SI.TimeLeft elseif i == SI.TAG_BARRELS then zoomL = 1.1 - yOffset = 70 + if INTERFACE == "touch" then + xOffset = 126 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + yOffset = 70 + end tCol = SI.colorAmmo tValue = SI.wepAmmo[SI.wepIndex] elseif i == SI.TAG_SHIELD then zoomL = 1.1 - xOffset = 40 + 35 - yOffset = 70 + if INTERFACE == "touch" then + xOffset = 126 + 35 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + 35 + yOffset = 70 + end tCol = SI.colorShield tValue = SI.shieldHealth - 80 elseif i == SI.TAG_ROUND_SCORE then zoomL = 1.1 - xOffset = 40 - yOffset = 100 + if INTERFACE == "touch" then + xOffset = 126 + 70 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + yOffset = 100 + end tCol = SI.colorScore tValue = SI.roundScore end diff -r 79e07510b8e3 -r 8fc6ac47f00a share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua Mon Nov 26 18:03:39 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua Mon Nov 26 19:10:08 2018 +0100 @@ -281,29 +281,51 @@ function DrawTag(i) - zoomL = 1.3 + local zoomL = 1.3 - xOffset = 40 + local xOffset, yOffset, tValue, tCol if i == 0 then - yOffset = 40 + if INTERFACE == "touch" then + xOffset = 60 + yOffset = ScreenHeight - 35 + else + xOffset = 40 + yOffset = 40 + end tCol = 0xffee00ff tValue = TimeLeft elseif i == 1 then zoomL = 1.1 - yOffset = 70 + if INTERFACE == "touch" then + xOffset = 126 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + yOffset = 70 + end tCol = wepCol[0] tValue = wepAmmo[0] elseif i == 2 then zoomL = 1.1 - xOffset = 40 + 35 - yOffset = 70 + if INTERFACE == "touch" then + xOffset = 126 + 35 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + 35 + yOffset = 70 + end tCol = wepCol[1] tValue = wepAmmo[1] elseif i == 3 then zoomL = 1.1 - xOffset = 40 + 70 - yOffset = 70 + if INTERFACE == "touch" then + xOffset = 126 + 70 + yOffset = ScreenHeight - 37 + else + xOffset = 40 + 70 + yOffset = 70 + end tCol = wepCol[2] tValue = wepAmmo[2] end