lotrointerface.com
Search Downloads

LoTROInterface SVN LotroMaps

[/] [trunk/] [DigitalUtopia/] [LotroMaps/] [Main.lua] - Rev 43

Compare with Previous | Blame | View Log


import "Turbine.UI";
import "Turbine.UI.Lotro";
import "Turbine.Gameplay";
import "DigitalUtopia.Utilsx";
import "DigitalUtopia.LotroMaps";
import "DigitalUtopia.DUInterface";

local mapInfo={
        mapName="Lothlorien",
        minZoom=4,
        maxZoom=7,
        coordMinX=-82,
        coordMinY=4.6,
        coordMaxX=-61,
        coordMaxY=20.4,
        tileInfo={
                nil,
                nil,
                nil,
                {
                        maxTileX=3,
                        maxTileY=2,
                        mapWidth=1024,
                        mapHeight=768,
                        bounds={
                                minX=412,
                                minY=309,
                                maxX=612,
                                maxY=459
                        }
                },
                {
                        maxTileX=7,
                        maxTileY=5,
                        mapWidth=2048,
                        mapHeight=1536,
                        bounds={
                                minX=504,
                                minY=379,
                                maxX=1544,
                                maxY=1157
                        }
                },
                {
                        maxTileX=15,
                        maxTileY=11,
                        mapWidth=4096,
                        mapHeight=3072,
                        bounds={
                                minX=688,
                                minY=519,
                                maxX=3408,
                                maxY=2499
                        }
                },
                {
                        maxTileX=31,
                        maxTileY=23,
                        mapWidth=8192,
                        mapHeight=6144,
                        bounds={
                                minX=1056,
                                minY=799,
                                maxX=7136,
                                maxY=5345
                        }
                }
        }               
};
mWindow=Turbine.UI.Window();
mWindow:SetVisible(true);
mWindow:SetSize(668,510);
mWindow:SetPosition(0,150);
mWindow:SetMouseVisible(false);
mWindow:SetWantsUpdates(true);
lmap=Map(mapInfo,4,"Parchment");

lmap:SetParent(mWindow);
lmap:SetPosition(0,20);
topBar=Turbine.UI.Control();
topBar:SetParent(mWindow);
topBar:SetSize(640,20);
topBar:SetPosition(0,0)
topBar:SetBackColor(Turbine.UI.Color(.2,0,0,0));
botBar=Turbine.UI.Control();
botBar:SetParent(mWindow);
botBar:SetSize(640,10);
botBar:SetPosition(0,490)
botBar:SetBackColor(Turbine.UI.Color(.2,0,0,0));
sideBar=Turbine.UI.Control();
sideBar:SetParent(mWindow);
sideBar:SetSize(28,510);
sideBar:SetPosition(640,0);
tt=Turbine.UI.Control();
tt:SetParent(sideBar);
tt:SetSize(28,20);
tt:SetPosition(-3,-2);
tt:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_top.tga");
tt:SetMouseVisible(false);
tb=Turbine.UI.Control();
tb:SetParent(sideBar);
tb:SetSize(28,20);
tb:SetPosition(-3,481);
tb:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_bottom.tga");
tb:SetMouseVisible(false);
tm=Turbine.UI.Control();
tm:SetParent(sideBar);
tm:SetSize(28,188);
tm:SetPosition(-3,18);
tm:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_mid.tga");
tm:SetMouseVisible(false);
tlabel=Turbine.UI.Control();
tlabel:SetParent(sideBar);
tlabel:SetZOrder(10);
tlabel:SetMouseVisible(false);
tlabel:SetSize(28,99);
tlabel:SetPosition(-3,206);
tlabel:SetBackground("DigitalUtopia/LotroMaps/Resources/label.tga");
tmb=Turbine.UI.Control();
tmb:SetParent(sideBar);
tmb:SetSize(28,176);
tmb:SetPosition(-3,305);
tmb:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_mid.tga");
tmb:SetMouseVisible(false);
clabel=Turbine.UI.Label();
clabel:SetParent(mWindow);
clabel:SetSize(200,20);
clabel:SetPosition((lmap:GetWidth()/2)-(clabel:GetWidth()/2),0);
clabel:SetFont(Turbine.UI.Lotro.Font.Verdana14);
clabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter);
clabel:SetText("testing");
clabel:SetBackColor(Turbine.UI.Color(.4,0,0,0));
ddb=ClearDdb({"Parchment","Terrain"});
ddb:SetPosition(((mWindow:GetLeft()+mWindow:GetWidth())-ddb.mainBox:GetWidth())-55,0);
ddb:SetParent(mWindow);
fadeInTimer=DigitalUtopia.Utilsx.Timer();
fadeInTimer.AutoReset=true;
fadeInTimer.Interval=0.033
timerOn=false;
windowOpen=false;
mddb=ClearDdb({"Lothlorien"});
mddb:SetPosition(0,0);
mddb:SetParent(mWindow);
mddb.SetDisabled(true);
ddb.IndexChanged=function(sender,args)
lmap:SetTileType(args.Name);
end

mWindow.Update=function(sender,args)
        clabel:SetText(lmap.coordY..", "..lmap.coordX);
end

lmap.initialized=function()
        mWindow:SetLeft(-640);
end

sideBar.MouseEnter=function(sender,args)
        tt:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_top_over.tga");
        tb:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_bottom_over.tga");
        tm:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_mid_over.tga");
        tlabel:SetBackground("DigitalUtopia/LotroMaps/Resources/label_over.tga");
end

sideBar.MouseLeave=function(sender,args)
        tt:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_top.tga");
        tb:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_bottom.tga");
        tm:SetBackground("DigitalUtopia/LotroMaps/Resources/tab_mid.tga");
        tlabel:SetBackground("DigitalUtopia/LotroMaps/Resources/label.tga");
end


sideBar.MouseClick=function(sender,args)
        if(timerOn==false)then
                fadeInTimer.Start();
                timerOn=true;
        end
end

fadeInTimer.TimerElapsed=function(sender,args)
        
        winRate=640/7;
        
        if(windowOpen==false)then
                mWindow:SetLeft(-640+(fadeInTimer.count * winRate))
                
                if(mWindow:GetLeft()==0)then
                        fadeInTimer.Stop();
                        timerOn=false;
                        windowOpen=true;
                end
        else
                mWindow:SetLeft(0-(fadeInTimer.count * winRate))
                
                if(mWindow:GetLeft()==-640)then
                        fadeInTimer.Stop();
                        timerOn=false;
                        windowOpen=false;
                end
        
        end
        

end

Compare with Previous | Blame


All times are GMT -5. The time now is 08:22 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui