Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Friedberg mit FeldauftragsMod
--
-- SampleModMap
--
-- @author Stefan Geiger
-- @date 12/07/10
--
-- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
--
--
-- ModMap "Friedberg" by HatzFan, 11/2015
Friedberg = {}
local Friedberg_mt = Class(Friedberg, Mission00);
function Friedberg:new(baseDirectory, customMt)
local mt = customMt;
if mt == nil then
mt = Friedberg_mt;
end;
local additionalFruitTypesPath = Utils.getFilename('map/scripts/additionalFruitTypes.lua', baseDirectory);
print("loading AdditionalFruitTypes")
if fileExists(additionalFruitTypesPath) then
source(additionalFruitTypesPath);
AdditionalFruitTypes:run(baseDirectory);
else
print("AdditionalFruitTypes.lua not found!")
end;
local kalkSolidhudFile = Utils.getFilename("map/_include/huds/kalkSolidHUD.dds", baseDirectory);
if _G["SoilManagement"] == nil then Sprayer.registerSprayType("kalk", g_i18n:getText("kalkSolid"), 0.3, 10, true, kalkSolidhudFile, kalkSolidhudFile, 0.0002) end;
local self = Friedberg:superClass():new(baseDirectory, mt);
return self;
end;
function Friedberg:delete()
Friedberg:superClass().delete(self);
end;
function Friedberg:load()
g_currentMission.mapSupportsFieldWorkAssignments = true;
self:startLoadingTask();
self.environment = Environment:new(Utils.getFilename("$data/sky/sky_day_night.i3d", self.baseDirectory), true, 8, true, true);
self.helpIconsBase = nil;
self.collectableGoldCoinsObject = nil;
self.fieldDefinitionBase = nil;
self.vehicleShopBase = nil;
self.AnimationMapConfig = {"map/scripts/AnimationMap.xml", self.baseDirectory};
self:loadMap(Utils.getFilename("map/map01.i3d", self.baseDirectory), true, self.loadCareerMap01Finished, self);
end;
function Friedberg:loadCareerMap01Finished(node, arguments)
if self.cancelLoading then
return;
end
local startedRepeat = startFrameRepeatMode();
trcScreenFlip();
self:loadMapXMLFile(Utils.getFilename("Friedberg.xml", self.baseDirectory));
trcScreenFlip();
self:loadTyreTrackSystem(Utils.getFilename("$data/vehicles/shared/tyreTrackMaterialHolder.i3d", self.baseDirectory));
trcScreenFlip();
self:loadI3D("$data/vehicles/particleAnimations/particle_materialHolder.i3d");
trcScreenFlip();
self:loadI3D("$data/vehicles/fillPlanes/fillPlane_materialHolder.i3d");
trcScreenFlip();
self.ingameMap:loadMap(Utils.getFilename("pda_map.png", self.baseDirectory), 2048, 2048);
trcScreenFlip();
g_statisticView:setMapViewsMap(Utils.getFilename("pda_map.png", self.baseDirectory), 2048, 2048);
trcScreenFlip();
-- ATMs .
self.ingameMap:createMapHotspot("Bank", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_bank.png", self.baseDirectory), -429, 2, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Bank", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_bank.png", self.baseDirectory), -319, -111, nil, nil, false, false, false, 0, true);
-- shops .
self.ingameMap:createMapHotspot("Shop", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_shop.png", self.baseDirectory), -469, -34, nil, nil, false, false, false, 0, true);
local gardenCenterHotspot = self.ingameMap:createMapHotspot("Shop", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_shop.png", self.baseDirectory), -379, -1, nil, nil, false, false, true, 0, true);
gardenCenterHotspot.fullViewName = g_i18n:getText("gardenCenter");
-- egg sellpoints .
self.ingameMap:createMapHotspot("Eggs", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_eggs.png", self.baseDirectory), -316, -182, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Eggs", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_eggs.png", self.baseDirectory), -575, 268, nil, nil, false, false, false, 0, true);
-- farm silos .
self.ingameMap:createMapHotspot("TipPlace", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_tipPlace.png", self.baseDirectory), -13, 46, nil, nil, false, false, false, 0, true);
-- bga .
self.ingameMap:createMapHotspot("TipPlace", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_tipPlace.png", self.baseDirectory), -132, -401, nil, nil, false, false, false, 0, true);
-- grass heaps .
self.ingameMap:createMapHotspot("TipPlace", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_tipPlaceGreen.png", self.baseDirectory), -120, -89, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("TipPlace", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_tipPlaceGreen.png", self.baseDirectory), -88, 396, nil, nil, false, false, false, 0, true);
-- livestock .
self.ingameMap:createMapHotspot("Cows", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_cows.png", self.baseDirectory), -231, -388, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Cows", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_cows.png", self.baseDirectory), -74, 52, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Sheep", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_sheep.png", self.baseDirectory), -163, 67, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Chickens", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_chickens.png", self.baseDirectory), 21, -9, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Pigs", Utils.getFilename("map/_include/huds/hud_pda_spot_pig.png", self.baseDirectory), 200.6, 195.9, nil, nil, false, false, false, 0, true);
self.ingameMap:createMapHotspot("Cows", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_cows.png", self.baseDirectory), 154.6, 184.6, nil, nil, false, false, false, 0, true);
-- spinnery .
self.ingameMap:createMapHotspot("woolDeliveryHotspot", Utils.getFilename("$dataS2/menu/hud/hud_pda_spot_spinnery.png", self.baseDirectory), -365, -116, nil, nil, false, false, false, 0, true);
trcScreenFlip();
Friedberg:superClass().load(self);
trcScreenFlip();
if startedRepeat then
endFrameRepeatMode();
end
self:finishLoadingTask();
end;
function Friedberg:onStartMission()
Friedberg:superClass().onStartMission(self);
end;
function Friedberg:mouseEvent(posX, posY, isDown, isUp, button)
Friedberg:superClass().mouseEvent(self, posX, posY, isDown, isUp, button);
end;
function Friedberg:keyEvent(unicode, sym, modifier, isDown)
Friedberg:superClass().keyEvent(self, unicode, sym, modifier, isDown);
end;
function Friedberg:update(dt)
Friedberg:superClass().update(self, dt);
end;
function Friedberg:draw()
Friedberg:superClass().draw(self);
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.