예제 #1
0
        public override bool MouseDown(ScreenEventArgs args)
        {
            _mouseDown = true;

            if (!_viewCity)
            {
                if (new Rectangle(231 + ExtraLeft, (Height - 10), 42, 10).Contains(args.Location))
                {
                    // Rename button
                    CityName name = new CityName(_city.NameId, _city.Name);
                    name.Accept += CityRename;
                    Common.AddScreen(name);
                    return(true);
                }
                if (new Rectangle(2, 1, _cityHeader.Width(), _cityHeader.Height()).Contains(args.Location))
                {
                    MouseArgsOffset(ref args, 2, 1);
                    return(_cityHeader.MouseDown(args));
                }
                if (new Rectangle(127 + ExtraLeft, 23, 82, 82).Contains(args.Location))
                {
                    MouseArgsOffset(ref args, 127 + ExtraLeft, 23);
                    return(_cityMap.MouseDown(args));
                }
                if (new Rectangle(95 + ExtraLeft, 106, 133, 92).Contains(args.Location))
                {
                    MouseArgsOffset(ref args, 95 + ExtraLeft, 106);
                    return(_cityInfo.MouseDown(args));
                }
                if (new Rectangle(211 + ExtraLeft, 1, 107 + ExtraRight, 97).Contains(args.Location))
                {
                    MouseArgsOffset(ref args, 211 + ExtraLeft, 1);
                    if (_cityBuildings.MouseDown(args))
                    {
                        return(true);
                    }
                }
                if (new Rectangle(230 + ExtraLeft, 99, 88, 99).Contains(args.Location))
                {
                    MouseArgsOffset(ref args, 230 + ExtraLeft, 99);
                    if (_cityProduction.MouseDown(args))
                    {
                        return(true);
                    }
                }
            }
            CloseScreen();
            return(true);
        }