modClassEventListener = {}; function modClassEventListener:loadMap(name) self.name = "PathTractor" --print("load_listener") self.installPath = g_modsDirectory.."/Path_Tractor" local configFile = self.installPath.."/".."modDesc.xml" local xmlFile = loadXMLFile("File",configFile) if xmlFile ~= nil then local x,y = Utils.getVectorFromString(Utils.getNoNil(getXMLString(xmlFile, "modDesc.config.extraMenu#pos"),"0.012 0.01")) local width,height = Utils.getVectorFromString(Utils.getNoNil(getXMLString(xmlFile, "modDesc.config.extraMenu#dim"),"0.6375 0.325")) PathTractor.extraHelpOverlay = Overlay:new("hudExtraHelpOverlay", "dataS/missions/hud_help_base.png", x,y, width, height) PathTractor.hudArrow = Overlay:new("HudArrow", "dataS/missions/pda_map_arrow.png", x + width - 0.052, y + height - 0.077, 0.05, 0.05 * 1.5) local config ={} config.turn = math.floor(getXMLFloat(xmlFile, "modDesc.config.speed#turn")) config.field = math.floor(getXMLFloat(xmlFile, "modDesc.config.speed#field")) config.road = math.floor(getXMLFloat(xmlFile, "modDesc.config.speed#road")) PathTractor.config = config end delete(xmlFile) end; function modClassEventListener:deleteMap() -- print("map " .. self.loadedMap .. " was deleted"); end; function modClassEventListener:mouseEvent(posX, posY, isDown, isUp, button) end; function modClassEventListener:keyEvent(unicode, sym, modifier, isDown) end; function modClassEventListener:update(dt) --printCallstack() end; function modClassEventListener:draw() end; addModEventListener(modClassEventListener); --// durch dieses InputBinding Update werden die Namen der F Tasten im HUD korrekt angezeigt InputBinding.getButtonKeyName = function(l_5_0) local key = InputBinding.getButtonKey(l_5_0) if Input.KEY_f1 <= key and key <= Input.KEY_f15 then return "F" .. key - Input.KEY_f1 + 1 end if key == Input.KEY_shift then return "Shift" end if Input.KEY_KP_0 <= key and key <= Input.KEY_KP_9 then return "Numpad" .. key - Input.KEY_KP_0 end if key == Input.KEY_KP_period then return "Numpad ." end if key == Input.KEY_KP_divide then return "Numpad /" end if key == Input.KEY_KP_multiply then return "Numpad *" end if key == Input.KEY_KP_minus then return "Numpad -" end if key == Input.KEY_KP_plus then return "Numpad +" end if key == Input.KEY_KP_enter then return "Numpad Enter" end if key == Input.KEY_KP_equals then return "Numpad =" end if key == Input.KEY_return then return "Enter" end if key == Input.KEY_space then return "Space" end return string.upper(string.char(key)) end