public void handleInput(MouseInputState input)
 {
     if (this.castle != null)
     {
         if (input.leftdown && input.isScrolling())
         {
             if (input.scrollLeft)
             {
                 this.castle.moveMap(10, 0);
             }
             if (input.scrollRight)
             {
                 this.castle.moveMap(-10, 0);
             }
             if (input.scrollUp)
             {
                 this.castle.moveMap(0, 10);
             }
             if (input.scrollDown)
             {
                 this.castle.moveMap(0, -10);
             }
         }
         if (!input.leftdown)
         {
             this.castle.mouseNotClicked(input.dxMousePos);
         }
         if (input.overDXWindow || this.castle.holdingLeftMouse())
         {
             if (input.rightclick)
             {
                 this.castle.rightClick(input.dxMousePos);
             }
             else
             {
                 this.castle.mouseMoveUpdate(input.dxMousePos, input.leftdown);
             }
         }
         else if (input.wasOverDXWindow)
         {
             CustomTooltipManager.MouseLeaveTooltipAreaMapSpecial();
         }
         if (((input.mousebackward || input.mouseforward) || (GameEngine.Instance.GFX.keyCode == 0x20)) && (this.gameDisplayModeSubMode == GameEngine.GameDisplaySubModes.SUBMODE_DEFAULT))
         {
             this.castle.mouseWheel();
         }
     }
 }
 public void handleInput(MouseInputState input)
 {
     if (this.village != null)
     {
         if (!input.leftdown && input.isScrolling())
         {
             if (input.scrollLeft)
             {
                 this.village.moveMap(10, 0);
             }
             if (input.scrollRight)
             {
                 this.village.moveMap(-10, 0);
             }
             if (input.scrollUp)
             {
                 this.village.moveMap(0, 10);
             }
             if (input.scrollDown)
             {
                 this.village.moveMap(0, -10);
             }
         }
         if (!input.leftdown)
         {
             this.village.mouseNotClicked(input.dxMousePos);
         }
         if (input.overDXWindow || this.village.holdingLeftMouse())
         {
             this.village.mouseMoveUpdate(input.dxMousePos, input.leftdown);
         }
         else if (input.wasOverDXWindow)
         {
             CustomTooltipManager.MouseLeaveTooltipAreaMapSpecial();
         }
         if (input.rightclick)
         {
             this.village.stopPlaceBuilding(true);
         }
     }
 }
 public void handleInput(MouseInputState input)
 {
     if (this.village != null)
     {
         if (!input.leftdown && input.isScrolling())
         {
             if (input.scrollLeft)
             {
                 this.village.moveMap(10, 0);
             }
             if (input.scrollRight)
             {
                 this.village.moveMap(-10, 0);
             }
             if (input.scrollUp)
             {
                 this.village.moveMap(0, 10);
             }
             if (input.scrollDown)
             {
                 this.village.moveMap(0, -10);
             }
         }
         if (!input.leftdown)
         {
             this.village.mouseNotClicked(input.dxMousePos);
         }
         if (input.overDXWindow || this.village.holdingLeftMouse())
         {
             this.village.mouseMoveUpdate(input.dxMousePos, input.leftdown);
         }
         else if (input.wasOverDXWindow)
         {
             CustomTooltipManager.MouseLeaveTooltipAreaMapSpecial();
         }
         if (input.rightclick)
         {
             this.village.stopPlaceBuilding(true);
         }
     }
 }
 public void handleInput(MouseInputState input)
 {
     if (!input.leftdown && input.isScrolling())
     {
         if (input.scrollLeft)
         {
             this.world.moveMap(0.0 - (10.0 / this.world.WorldScale), 0.0);
         }
         if (input.scrollRight)
         {
             this.world.moveMap(10.0 / this.world.WorldScale, 0.0);
         }
         if (input.scrollUp)
         {
             this.world.moveMap(0.0, 0.0 - (10.0 / this.world.WorldScale));
         }
         if (input.scrollDown)
         {
             this.world.moveMap(0.0, 10.0 / this.world.WorldScale);
         }
     }
     if (!input.leftdown)
     {
         this.world.mouseNotClicked(input.dxMousePos);
     }
     if (input.overDXWindow || this.world.holdingLeftMouse())
     {
         if (input.leftdown)
         {
             this.world.leftMouseDown(input.dxMousePos);
         }
         else if (input.rightclick)
         {
             this.world.zoomOut();
         }
         else if (input.mousebackward)
         {
             this.world.stopZoom();
             double num = this.world.getOrigWorldZoom();
             if (num > 26.899999998509884)
             {
                 this.world.setMouseWheelZoomOut(14f);
             }
             else if (num > 13.899999618530273)
             {
                 this.world.setMouseWheelZoomOut(9.5f);
             }
             else if (num > 9.3999996185302734)
             {
                 this.world.setMouseWheelZoomOut(6.5f);
             }
             else if (num > 6.4000000953674316)
             {
                 this.world.setMouseWheelZoomOut(3.5f);
             }
             else if (num > 3.4000000953674316)
             {
                 this.world.setMouseWheelZoomOut(2f);
             }
             else
             {
                 this.world.setMouseWheelZoomOut(0f);
             }
         }
         else if (input.mouseforward)
         {
             this.world.stopZoom();
             double num2 = this.world.getOrigWorldZoom();
             if (num2 < 0.10000000149011612)
             {
                 this.world.changeZoom(2f, input.dxMousePos);
             }
             else if (num2 < 2.0999999046325684)
             {
                 this.world.changeZoom(3.5f, input.dxMousePos);
             }
             else if (num2 < 3.5999999046325684)
             {
                 this.world.changeZoom(6.5f, input.dxMousePos);
             }
             else if (num2 < 6.5999999046325684)
             {
                 this.world.changeZoom(9.5f, input.dxMousePos);
             }
             else if (num2 < 9.6000003814697266)
             {
                 this.world.changeZoom(14f, input.dxMousePos);
             }
             else
             {
                 this.world.changeZoom(27f, input.dxMousePos);
             }
             if (num2 < 26.899999998509884)
             {
                 GameEngine.Instance.playInterfaceSound("WorldMap_mousewheel_zoomin");
             }
             this.world.centreMap(false);
         }
         else
         {
             this.world.moveMouse(input.dxMousePos);
         }
         InterfaceMgr.Instance.mouseMoveDXCardBar(input.dxMousePos);
         GameEngine.Instance.World.freeCardTooltip(input.dxMousePos);
     }
     else
     {
         if (input.wasOverDXWindow)
         {
             CustomTooltipManager.MouseLeaveTooltipAreaMapSpecial();
         }
         if (InterfaceMgr.Instance.ParentForm.Cursor == Cursors.Hand)
         {
             InterfaceMgr.Instance.ParentForm.Cursor = Cursors.Default;
         }
     }
 }
Example #5
0
 public void handleInput(MouseInputState input)
 {
     if (!input.leftdown && input.isScrolling())
     {
         if (input.scrollLeft)
         {
             this.world.moveMap(0.0 - (10.0 / this.world.WorldScale), 0.0);
         }
         if (input.scrollRight)
         {
             this.world.moveMap(10.0 / this.world.WorldScale, 0.0);
         }
         if (input.scrollUp)
         {
             this.world.moveMap(0.0, 0.0 - (10.0 / this.world.WorldScale));
         }
         if (input.scrollDown)
         {
             this.world.moveMap(0.0, 10.0 / this.world.WorldScale);
         }
     }
     if (!input.leftdown)
     {
         this.world.mouseNotClicked(input.dxMousePos);
     }
     if (input.overDXWindow || this.world.holdingLeftMouse())
     {
         if (input.leftdown)
         {
             this.world.leftMouseDown(input.dxMousePos);
         }
         else if (input.rightclick)
         {
             this.world.zoomOut();
         }
         else if (input.mousebackward)
         {
             this.world.stopZoom();
             double num = this.world.getOrigWorldZoom();
             if (num > 26.899999998509884)
             {
                 this.world.setMouseWheelZoomOut(14f);
             }
             else if (num > 13.899999618530273)
             {
                 this.world.setMouseWheelZoomOut(9.5f);
             }
             else if (num > 9.3999996185302734)
             {
                 this.world.setMouseWheelZoomOut(6.5f);
             }
             else if (num > 6.4000000953674316)
             {
                 this.world.setMouseWheelZoomOut(3.5f);
             }
             else if (num > 3.4000000953674316)
             {
                 this.world.setMouseWheelZoomOut(2f);
             }
             else
             {
                 this.world.setMouseWheelZoomOut(0f);
             }
         }
         else if (input.mouseforward)
         {
             this.world.stopZoom();
             double num2 = this.world.getOrigWorldZoom();
             if (num2 < 0.10000000149011612)
             {
                 this.world.changeZoom(2f, input.dxMousePos);
             }
             else if (num2 < 2.0999999046325684)
             {
                 this.world.changeZoom(3.5f, input.dxMousePos);
             }
             else if (num2 < 3.5999999046325684)
             {
                 this.world.changeZoom(6.5f, input.dxMousePos);
             }
             else if (num2 < 6.5999999046325684)
             {
                 this.world.changeZoom(9.5f, input.dxMousePos);
             }
             else if (num2 < 9.6000003814697266)
             {
                 this.world.changeZoom(14f, input.dxMousePos);
             }
             else
             {
                 this.world.changeZoom(27f, input.dxMousePos);
             }
             if (num2 < 26.899999998509884)
             {
                 GameEngine.Instance.playInterfaceSound("WorldMap_mousewheel_zoomin");
             }
             this.world.centreMap(false);
         }
         else
         {
             this.world.moveMouse(input.dxMousePos);
         }
         InterfaceMgr.Instance.mouseMoveDXCardBar(input.dxMousePos);
         GameEngine.Instance.World.freeCardTooltip(input.dxMousePos);
     }
     else
     {
         if (input.wasOverDXWindow)
         {
             CustomTooltipManager.MouseLeaveTooltipAreaMapSpecial();
         }
         if (InterfaceMgr.Instance.ParentForm.Cursor == Cursors.Hand)
         {
             InterfaceMgr.Instance.ParentForm.Cursor = Cursors.Default;
         }
     }
 }
 public bool Initialise(GraphicsMgr mgr, int maxRes, int curRes)
 {
     this.inputState = new MouseInputState();
     if (Program.mySettings.LanguageIdent == "de")
     {
         nfi = new CultureInfo("de-DE", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("de-DE", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("de-DE", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("de-DE", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "fr")
     {
         nfi = new CultureInfo("fr-FR", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("fr-FR", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("fr-FR", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("fr-FR", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "ru")
     {
         nfi = new CultureInfo("ru-RU", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("ru-RU", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("ru-RU", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("ru-RU", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "es")
     {
         nfi = new CultureInfo("es-ES", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("es-ES", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("es-ES", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("es-ES", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "pl")
     {
         nfi = new CultureInfo("pl-PL", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("pl-PL", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("pl-PL", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("pl-PL", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "it")
     {
         nfi = new CultureInfo("it-IT", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("it-IT", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("it-IT", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("it-IT", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "tr")
     {
         nfi = new CultureInfo("tr-TR", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("tr-TR", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("tr-TR", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("tr-TR", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else if (Program.mySettings.LanguageIdent == "pt")
     {
         nfi = new CultureInfo("pt-BR", false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo("pt-BR", false).NumberFormat;
         nfi_decimal1 = new CultureInfo("pt-BR", false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo("pt-BR", false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     else
     {
         nfi = new CultureInfo(CultureInfo.CurrentCulture.Name, false).NumberFormat;
         nfi.NumberDecimalDigits = 0;
         nfi_decimal = new CultureInfo(CultureInfo.CurrentCulture.Name, false).NumberFormat;
         nfi_decimal1 = new CultureInfo(CultureInfo.CurrentCulture.Name, false).NumberFormat;
         nfi_decimal1.NumberDecimalDigits = 1;
         nfi_decimal2 = new CultureInfo(CultureInfo.CurrentCulture.Name, false).NumberFormat;
         nfi_decimal2.NumberDecimalDigits = 2;
     }
     NewQuests.loadCSV();
     this.maxResolution = maxRes;
     this.currentResolution = curRes;
     this.gfx = mgr;
     this.m_doReLogin = false;
     this.villageToAbandon = -1;
     if (this.firstCall)
     {
         this.m_tickTimer = new System.Threading.Timer(new TimerCallback(this.TimerCallbackFunction), null, 0x21, 0x21);
     }
     if (this.gfx.InitControl(InterfaceMgr.Instance.getDXBasePanel(), Program.mySettings.AAMode) != null)
     {
         displayDirectXError();
         return false;
     }
     if (this.gfx.calcedAAMode > 0)
     {
         Program.mySettings.AAMode = this.gfx.calcedAAMode;
     }
     this.dxFont1.Family = "Tahoma";
     this.dxFont1.Height = 0x12;
     this.dxFont2.Family = "Arial";
     this.dxFont2.Weight = FontDesc.Weighting.Normal;
     this.dxFont2.Height = 0x12;
     this.gfx.Initialize();
     this.gfx.initRenderCallback(new GraphicsMgr.RenderCallback(this.render));
     this.gfx.initFont(this.dxFont1, this.dxFont2);
     this.m_WorkerThread = new Thread(new ThreadStart(this.loadThread));
     this.m_WorkerThread.Name = "Loader";
     GFXLibrary.Instance.loadResources();
     InterfaceMgr.Instance.mapPanelCreates();
     this.m_WorkerThread.Start();
     if (this.firstCall)
     {
         Thread.Sleep(100);
     }
     this.worldMapTypesData = new WorldMapTypes();
     if (this.firstCall)
     {
         this.audio = new Audio();
         this.audio.initAudio();
         VillageMap.loadVillageSounds();
         Sound.createPlayLists();
     }
     RemoteServices.Instance.set_CommonData_UserCallBack(new RemoteServices.CommonData_UserCallBack(this.remoteConnectionCommonHandler));
     InterfaceMgr.Instance.initInterfaces();
     OptionsPopup.registerCallback(new OptionsPopup.ResolutionChangeCallback(this.resolutionButtonChange));
     this.world.registerWorldZoomCallback(new WorldMap.WorldZoomCallback(this.worldZoomChange));
     this.world.capZoom(0.0);
     InterfaceMgr.Instance.getMainTabBar().registerTabChangeCallback(new MainTabBar2.TabChangeCallback(this.mainTabChange));
     InterfaceMgr.Instance.getVillageTabBar().registerTabChangeCallback(new VillageTabBar2.TabChangeCallback(this.villageTabChange));
     InterfaceMgr.Instance.getFactionTabBar().registerTabChangeCallback(new FactionTabBar2.TabChangeCallback(this.factionTabChange));
     RemoteServices.Instance.set_GetVillageBuildingsList_UserCallBack(new RemoteServices.GetVillageBuildingsList_UserCallBack(this.getVillageBuildingListCallBack));
     this.gfx.BGColor = WorldMap.SEACOLOR;
     this.lastTabID = -1;
     InterfaceMgr.Instance.ignoreStopDraw = true;
     DXPanel.skipPaint = true;
     this.mainTabChange(0);
     DXPanel.skipPaint = false;
     InterfaceMgr.Instance.ignoreStopDraw = false;
     this.firstCall = false;
     this.lastFullTickRegisterTime = this.lastFullTickTime = DXTimer.GetCurrentMilliseconds();
     return true;
 }