-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from xrandox/dev_SotO
SotO Map Comp
- Loading branch information
Showing
20 changed files
with
473 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Teh.choosewaypoint = { | ||
chooseableWaypoints = {}, | ||
isRunning = false, | ||
currentSize = 75, | ||
sizeGrowing = true | ||
} | ||
|
||
Debug:Watch("Teh_ChooseWaypoint", Teh.choosewaypoint) | ||
local MAX_SIZE = 150 | ||
local MIN_SIZE = 75 | ||
|
||
local function startWatcher(marker) | ||
if (next(Teh.choosewaypoint.chooseableWaypoints) == nil) then | ||
marker:GetBehavior("InfoModifier").InfoValue = "You're done! (Hopefully...)" | ||
return | ||
end | ||
Teh.choosewaypoint.isRunning = true | ||
end | ||
|
||
local function stopWatcher(marker) | ||
Teh.choosewaypoint.isRunning = false | ||
Teh.choosewaypoint.currentSize = MIN_SIZE | ||
Teh.choosewaypoint.sizeGrowing = true | ||
Teh.choosewaypoint.chooseableWaypoints[marker.Guid] = nil | ||
marker:Remove() | ||
|
||
for _, m in pairs(Teh.choosewaypoint.chooseableWaypoints) do | ||
m.MapDisplaySize = MIN_SIZE * Mumble.UI.MapScale | ||
m.MapVisibility = false | ||
end | ||
end | ||
|
||
local function waypointWatcher() | ||
for _, marker in pairs(Teh.choosewaypoint.chooseableWaypoints) do | ||
if marker.Focused then | ||
stopWatcher(marker) | ||
return | ||
end | ||
end | ||
end | ||
|
||
local function waypointAnimator(gameTime) | ||
local elapsedSeconds = gameTime.ElapsedGameTime.TotalSeconds | ||
local size = Teh.choosewaypoint.currentSize | ||
local growing = Teh.choosewaypoint.sizeGrowing | ||
local INTERVAL = 180 * elapsedSeconds | ||
|
||
if (growing) then | ||
size = size + INTERVAL; | ||
else | ||
size = size - INTERVAL; | ||
end | ||
Teh.choosewaypoint.currentSize = size | ||
|
||
if (size > MAX_SIZE) then growing = false end | ||
if (size < MIN_SIZE) then growing = true end | ||
Teh.choosewaypoint.sizeGrowing = growing | ||
|
||
for _, marker in pairs(Teh.choosewaypoint.chooseableWaypoints) do | ||
marker.MapVisibility = true | ||
marker.MapDisplaySize = size * Mumble.UI.MapScale | ||
end | ||
end | ||
|
||
local function chooseWaypointTickHandler(gameTime) | ||
if (Teh.choosewaypoint.isRunning) then | ||
waypointAnimator(gameTime) | ||
waypointWatcher() | ||
end | ||
end | ||
|
||
function Teh_ChooseWaypointMarker(marker) | ||
Teh.choosewaypoint.chooseableWaypoints[marker.Guid] = marker | ||
end | ||
|
||
function Teh_ChooseWaypointTrigger(marker, isfocused) | ||
if (isfocused and Teh.choosewaypoint.isRunning == false) then | ||
startWatcher(marker) | ||
end | ||
end | ||
|
||
Event:OnTick(chooseWaypointTickHandler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Teh.disappearingtrails = { | ||
trailGuids = { | ||
"c16VPxgSL0yytSwws/y+Vg==", | ||
"c26VPxgSL0yytSwws/y+Vg==", | ||
"c36VPxgSL0yytSwws/y+Vg==", | ||
"c46VPxgSL0yytSwws/y+Vg==", | ||
}, | ||
colors = {} | ||
} | ||
|
||
Debug:Watch("Teh_DisappearingTrails", Teh.disappearingtrails) | ||
|
||
function Teh_DisappearingTrailTrigger(marker, isfocused, guid) | ||
if (isfocused == true) then | ||
local trail = World:TrailByGuid(guid) | ||
if (trail ~= nil) then | ||
trail:Remove() | ||
Debug:Warn("Removed trail with guid " .. guid) | ||
else | ||
Debug:Warn("Could not find trail to make disappear") | ||
end | ||
end | ||
end | ||
|
||
function Teh_ColorizeDisappearingTrails() | ||
local colorIndex = 1; | ||
for i, guid in ipairs(Teh.disappearingtrails.trailGuids) do | ||
local trail = World:TrailByGuid(guid) | ||
local mainColor = Teh.storage.trailColor | ||
if (trail ~= nil) then | ||
local thisColor = Teh.trailcolors.colors[colorIndex] | ||
|
||
if (thisColor[1] == mainColor) then | ||
colorIndex = colorIndex + 1 | ||
thisColor = Teh.trailcolors.colors[colorIndex] | ||
end | ||
|
||
trail.Tint = thisColor[2] | ||
trail.Texture = I:Texture(Pack, "Data/TehsTrails/Markers/trailwhite.png") | ||
trail.TrailSampleColor = thisColor[2] | ||
trail.InGameVisibility = true | ||
Teh.disappearingtrails.colors[i] = thisColor | ||
colorIndex = colorIndex + 1 | ||
end | ||
end | ||
end | ||
|
||
Teh_ColorizeDisappearingTrails() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.