# HG changeset patch # User Wuzzy # Date 1479859534 -3600 # Node ID 9e57915f5365613a46eb0a67a3aa98d8faab241a # Parent 6f4b96669f9d488cabb0b2a6cfaf418873c7e0b1 Allow to remove waypoints in Racer with precise key diff -r 6f4b96669f9d -r 9e57915f5365 ChangeLog.txt --- a/ChangeLog.txt Wed Nov 23 00:28:58 2016 +0100 +++ b/ChangeLog.txt Wed Nov 23 01:05:34 2016 +0100 @@ -51,6 +51,7 @@ + Capture The Flag supports setting number of captures with script parameter “capture=” + Show correct ranking and times in stats screen of Racer and TechRacer + Allow to only place 2 waypoints in Racer + + Allow to remove Racer waypoints with precise key + New script parameter “waypointradius=” for Racer set the size of waypoints * Fixed waypoint message in TechRacer and Racer overwriting current weapon selection message * Fixed TechRacer not recording finish if time was >= 100s diff -r 6f4b96669f9d -r 9e57915f5365 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Wed Nov 23 00:28:58 2016 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Wed Nov 23 01:05:34 2016 +0100 @@ -558,7 +558,8 @@ SetAmmoTexts(amAirAttack, loc("Place waypoint"), loc("Racer tool"), loc("Build an awesome race track by placing|waypoints which the hedgehogs have to|touch in any order to finish a round.") .. "|" .. loc("Hedgehogs will start in the first waypoint.") .. "|" .. - loc("Cursor: Place waypoint")) + loc("Cursor: Place waypoint") .. "|" .. + loc("Precise: Remove previous waypoint")) SetAmmoTexts(amSkip, loc("Finish waypoint placement"), loc("Racer tool"), loc("Happy with your race track?|Then stop building and start racing!") .. "|" .. @@ -587,6 +588,27 @@ end end +function onPrecise() + if not racerActive and CurrentHedgehog ~= nil and GetCurAmmoType() == amAirAttack then + DeletePreviousWayPoint() + end +end + +function DeletePreviousWayPoint() + if wpCount > 0 then + wpCount = wpCount - 1 + wpX[wpCount] = nil + wpY[wpCount] = nil + wpCol[wpCount] = nil + DeleteVisualGear(wpCirc[wpCount]) + wpCirc[wpCount] = nil + AddCaption(string.format(loc("Waypoint removed. Available points: %d"), wpLimit-wpCount)) + else + PlaySound(sndDenied) + AddCaption(loc("No waypoint to be removed!")) + end +end + function onSpecialPoint(x,y,flag) if flag == 99 then fastX[fastCount] = x