Update lua versions
[ryzomcore.git] / ryzom / client / data / gamedev / interfaces_v3 / compass.lua
blobdf4727b1c9b5b0922e3def16aaae5156f7c6fb3f
1 -- In this file we define functions that serves for compass window
3 if (game==nil) then
4 game= {};
5 end
8 function game:areInSilan()
9 polygons = {{8128,-10208}, {11368,-10208}, {11392,-12392}, {8096,-12368}}
10 local x,y = getPlayerPos()
11 for i = 1, 4 do
12 local z = point_inside_poly(x, y, polygons)
13 if z == true then
14 return true
15 end
16 end
17 return false
18 end
20 function game:updateCompass()
21 if game.InGameDbInitialized == false then
22 return
23 end
25 local calendar_win = getUI("ui:interface:compass:calendar")
26 local format_date = "%d %m %Y %H:%M"
27 format_date = findReplaceAll(format_date, "%m", i18n.get("uiMonth"..getTimestampHuman("%m")):toUtf8())
28 calendar_win.tooltip = getUCtf8(getTimestampHuman(format_date))
29 end
32 function game:displayDynE()
33 local win = getUI("ui:interface:app2453")
34 if win ~= nil and win.active == true then
35 win.active = false
36 else
37 AppZone:launchApp(2453)
38 end
39 end
41 function game:displayCalendar()
42 local win = getUI("ui:interface:webig")
43 if win ~= nil and win.active == true then
44 win.active = false
45 else
46 win.active = true
47 end
48 end
50 setOnDraw(getUI("ui:interface:compass"), "game:updateCompass()")
52 -- VERSION --
53 RYZOM_COMPASS_VERSION = 10469