Skip to content

Commit 5efbf5d

Browse files
authored
Merge pull request #36 from xrandox/dev_SotO
SotO Map Comp
2 parents 04bc62e + 4d3c6a8 commit 5efbf5d

20 files changed

+473
-4
lines changed
19.4 KB
Loading

TehsTrails/Data/TehsTrails/Scripts/alternatemounts.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local MOUNT_IDS = {
99
["griffon"] = 1824207
1010
}
1111

12-
local PARENT_CATEGORIES = { "tt.mc.cm.mm.", "tt.hot.cm.mm.", "tt.pof.cm.mm.", "tt.eod.cm.mm." }
12+
local PARENT_CATEGORIES = { "tt.mc.cm.mm.", "tt.hot.cm.mm.", "tt.pof.cm.mm.", "tt.eod.cm.mm.", "tt.soto.cm.mm." }
1313
local PARENT_PATH = "Data/TehsTrails/Markers/"
1414
local PATH_END = ".png"
1515

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Teh.choosewaypoint = {
2+
chooseableWaypoints = {},
3+
isRunning = false,
4+
currentSize = 75,
5+
sizeGrowing = true
6+
}
7+
8+
Debug:Watch("Teh_ChooseWaypoint", Teh.choosewaypoint)
9+
local MAX_SIZE = 150
10+
local MIN_SIZE = 75
11+
12+
local function startWatcher(marker)
13+
if (next(Teh.choosewaypoint.chooseableWaypoints) == nil) then
14+
marker:GetBehavior("InfoModifier").InfoValue = "You're done! (Hopefully...)"
15+
return
16+
end
17+
Teh.choosewaypoint.isRunning = true
18+
end
19+
20+
local function stopWatcher(marker)
21+
Teh.choosewaypoint.isRunning = false
22+
Teh.choosewaypoint.currentSize = MIN_SIZE
23+
Teh.choosewaypoint.sizeGrowing = true
24+
Teh.choosewaypoint.chooseableWaypoints[marker.Guid] = nil
25+
marker:Remove()
26+
27+
for _, m in pairs(Teh.choosewaypoint.chooseableWaypoints) do
28+
m.MapDisplaySize = MIN_SIZE * Mumble.UI.MapScale
29+
m.MapVisibility = false
30+
end
31+
end
32+
33+
local function waypointWatcher()
34+
for _, marker in pairs(Teh.choosewaypoint.chooseableWaypoints) do
35+
if marker.Focused then
36+
stopWatcher(marker)
37+
return
38+
end
39+
end
40+
end
41+
42+
local function waypointAnimator(gameTime)
43+
local elapsedSeconds = gameTime.ElapsedGameTime.TotalSeconds
44+
local size = Teh.choosewaypoint.currentSize
45+
local growing = Teh.choosewaypoint.sizeGrowing
46+
local INTERVAL = 180 * elapsedSeconds
47+
48+
if (growing) then
49+
size = size + INTERVAL;
50+
else
51+
size = size - INTERVAL;
52+
end
53+
Teh.choosewaypoint.currentSize = size
54+
55+
if (size > MAX_SIZE) then growing = false end
56+
if (size < MIN_SIZE) then growing = true end
57+
Teh.choosewaypoint.sizeGrowing = growing
58+
59+
for _, marker in pairs(Teh.choosewaypoint.chooseableWaypoints) do
60+
marker.MapVisibility = true
61+
marker.MapDisplaySize = size * Mumble.UI.MapScale
62+
end
63+
end
64+
65+
local function chooseWaypointTickHandler(gameTime)
66+
if (Teh.choosewaypoint.isRunning) then
67+
waypointAnimator(gameTime)
68+
waypointWatcher()
69+
end
70+
end
71+
72+
function Teh_ChooseWaypointMarker(marker)
73+
Teh.choosewaypoint.chooseableWaypoints[marker.Guid] = marker
74+
end
75+
76+
function Teh_ChooseWaypointTrigger(marker, isfocused)
77+
if (isfocused and Teh.choosewaypoint.isRunning == false) then
78+
startWatcher(marker)
79+
end
80+
end
81+
82+
Event:OnTick(chooseWaypointTickHandler)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Teh.disappearingtrails = {
2+
trailGuids = {
3+
"c16VPxgSL0yytSwws/y+Vg==",
4+
"c26VPxgSL0yytSwws/y+Vg==",
5+
"c36VPxgSL0yytSwws/y+Vg==",
6+
"c46VPxgSL0yytSwws/y+Vg==",
7+
},
8+
colors = {}
9+
}
10+
11+
Debug:Watch("Teh_DisappearingTrails", Teh.disappearingtrails)
12+
13+
function Teh_DisappearingTrailTrigger(marker, isfocused, guid)
14+
if (isfocused == true) then
15+
local trail = World:TrailByGuid(guid)
16+
if (trail ~= nil) then
17+
trail:Remove()
18+
Debug:Warn("Removed trail with guid " .. guid)
19+
else
20+
Debug:Warn("Could not find trail to make disappear")
21+
end
22+
end
23+
end
24+
25+
function Teh_ColorizeDisappearingTrails()
26+
local colorIndex = 1;
27+
for i, guid in ipairs(Teh.disappearingtrails.trailGuids) do
28+
local trail = World:TrailByGuid(guid)
29+
local mainColor = Teh.storage.trailColor
30+
if (trail ~= nil) then
31+
local thisColor = Teh.trailcolors.colors[colorIndex]
32+
33+
if (thisColor[1] == mainColor) then
34+
colorIndex = colorIndex + 1
35+
thisColor = Teh.trailcolors.colors[colorIndex]
36+
end
37+
38+
trail.Tint = thisColor[2]
39+
trail.Texture = I:Texture(Pack, "Data/TehsTrails/Markers/trailwhite.png")
40+
trail.TrailSampleColor = thisColor[2]
41+
trail.InGameVisibility = true
42+
Teh.disappearingtrails.colors[i] = thisColor
43+
colorIndex = colorIndex + 1
44+
end
45+
end
46+
end
47+
48+
Teh_ColorizeDisappearingTrails()

TehsTrails/Data/TehsTrails/Scripts/staticcategories.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Teh.static = {
55
eod = { 1422, 1428, 1438, 1442, 1452 },
66
hot = { 1043, 1045, 1052 },
77
pof = { 1210, 1211, 1226, 1228 },
8-
all = { 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 39, 50, 51, 53, 54, 62, 65, 73, 91, 139, 218, 326, 1043, 1045, 1052, 1210, 1211, 1226, 1228, 1422, 1428, 1438, 1442, 1452 }
8+
soto = { 1510, 1517 },
9+
all = { 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 39, 50, 51, 53, 54, 62, 65, 73, 91, 139, 218, 326, 1043, 1045, 1052, 1210, 1211, 1226, 1228, 1422, 1428, 1438, 1442, 1452, 1510, 1517 }
910
},
1011
-- Category types we want shown always, according to which areas they should be shown in
1112
categories = {
@@ -39,6 +40,9 @@ Teh.static = {
3940
},
4041
pof = {
4142

43+
},
44+
soto = {
45+
4246
}
4347
}
4448
}
@@ -105,4 +109,9 @@ elseif (mapIsIn(maps.hot, mapID)) then
105109
elseif (mapIsIn(maps.pof, mapID)) then
106110
markerFromTable(categories.pof)
107111
markerFromTable(categories.all)
112+
113+
-- SotO maps
114+
elseif (mapIsIn(maps.soto, mapID)) then
115+
markerFromTable(categories.soto)
116+
markerFromTable(categories.all)
108117
end

TehsTrails/Data/TehsTrails/Scripts/tutorial.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Teh.tutorial = {
145145
shown = false
146146
}
147147

148-
Debug:Watch("tutorial", Teh.tutorial)
148+
Debug:Watch("Teh_Tutorial", Teh.tutorial)
149149

150150
local function showTutorial()
151151
-- First we make the outer markers
6.22 KB
Binary file not shown.
368 Bytes
Binary file not shown.
476 Bytes
Binary file not shown.
752 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)