Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
maphandler.c
Go to the documentation of this file.
1class MapHandler : ScriptedWidgetEventHandler
2{
3 protected Widget m_Root;
4
5 void MapHandler(Widget w)
6 {
7 m_Root = w;
8 m_Root.SetHandler(this);
9 }
10
11 override bool OnKeyDown(Widget w, int x, int y, int key)
12 {
13 if (!super.OnKeyDown(w, x, y, key))
14 return false;
15
16 vector screen_to_map = MapWidget.Cast(w).ScreenToMap(Vector(x,y,0));
17 Print(key);
18 Print(screen_to_map);
19 return true;
20 }
21
22 override bool OnDoubleClick(Widget w, int x, int y, int button)
23 {
24 super.OnDoubleClick(w, x, y, button);
25
26 vector screen_to_map = MapWidget.Cast(w).ScreenToMap(Vector(x,y,0));
27 MapMenu m = MapMenu.Cast(g_Game.GetUIManager().FindMenu(MENU_MAP));
28 int rand = Math.RandomInt(0,eMapMarkerTypes.MARKERTYPE_MAX);
29 //m.AddMarker(screen_to_map,ARGB(255,255,0,0),rand);
30
31 //m.AddUserMark(screen_to_map, "marker", ARGB(255,0,0,255), "\\dz\\gear\\navigation\\data\\map_tree_ca.paa");
32
33 return true;
34 }
35
36 /*void AddMarker(MapWidget w, vector pos, int color, int icon = -1)
37 {
38 w.AddUserMark(pos, "", color, "\\dz\\gear\\navigation\\data\\map_tree_ca.paa");
39 }*/
40};
override bool OnDoubleClick(Widget w, int x, int y, int button)
Definition maphandler.c:22
void MapHandler(Widget w)
Definition maphandler.c:5
override bool OnKeyDown(Widget w, int x, int y, int key)
Definition maphandler.c:11
Widget m_Root
Definition maphandler.c:3
Definition enmath.c:7
DayZGame g_Game
Definition dayzgame.c:3868
proto void Print(void var)
Prints content of variable to console/log.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
const int MENU_MAP
Definition constants.c:191
Icon x
Icon y