예제 #1
0
파일: House.cs 프로젝트: paroxysmal/ACE
        public House(uint slumlord_id, Player player)
        {
            Player = player;

            var house = new HouseData();

            var instance = DatabaseManager.World.GetLandblockInstanceByGuid(slumlord_id);

            if (instance == null)
            {
                return;
            }

            house.Position = new Position(instance.ObjCellId, instance.OriginX, instance.OriginY, instance.OriginZ, instance.AnglesX, instance.AnglesY, instance.AnglesZ, instance.AnglesW);
            house.Type     = HouseType.Cottage;

            var SlumLord = (SlumLord)WorldObjectFactory.CreateNewWorldObject(instance.WeenieClassId);

            if (SlumLord == null)
            {
                Console.WriteLine($"House constructor({slumlord_id:X8}): couldn't build slumlord");
                return;
            }

            house.SetBuyItems(SlumLord.GetBuyItems());
            house.SetRentItems(SlumLord.GetRentItems());

            house.BuyTime  = (uint)(player.HousePurchaseTimestamp ?? 0);
            house.RentTime = GetRentTimestamp();

            HouseData = house;
        }
예제 #2
0
        public GameEventHouseData(Session session, HouseData data)
            : base(GameEventType.HouseData, GameMessageGroup.UIQueue, session)
        {
            //Console.WriteLine("Sending 0x225 - GameEventHouseData");

            Writer.Write(data);
        }
예제 #3
0
        public static Recv_HouseData read(BinaryReader binaryReader)
        {
            Recv_HouseData newObj = new Recv_HouseData();

            newObj.data = HouseData.read(binaryReader);
            return(newObj);
        }
        private string GetHouseColor(HouseData house)
        {
            string houseColor = "white";
            int    priceRange = priceMax - priceMin;
            double priceStep  = priceRange / 3;
            double housePrice = double.Parse(Regex.Match(house.price, @"\d+").Value);

            //Console.WriteLine("House " + h + " price: " + housePrice);

            if (priceRange > 0)
            {
                if (housePrice < (priceMin + priceStep))
                {
                    Console.WriteLine(housePrice + " < " + (priceMin + priceStep));
                    houseColor = "green";
                }
                else if (housePrice < (priceMin + (2 * priceStep)))
                {
                    Console.WriteLine(housePrice + " < " + (priceMin + (2 * priceStep)));
                    houseColor = "yellow";
                }
                else
                {
                    Console.WriteLine(housePrice + " > " + (priceMin + (2 * priceStep)));
                    houseColor = "red";
                }
            }
            //Console.WriteLine("House " + h + " color: " + houseColor);
            return(houseColor);
        }
예제 #5
0
    public void SubmitButton()
    {
        if (input.text != null)
        {
            int id = (int)Convert.ToUInt64(input.text);
            //Debug.Log(houseID);
            if (gameMasterRef.FindHouseID(id) && CheckNoDuplicates(id))
            {
                houseID = id;

                HouseData tempHouse = gameMasterRef.ReturnHouseStats(houseID);

                HouseData newHouse = SetupHouseValue(tempHouse);
                newHouse.SetGameObjectOfSelf_BuyScreen(this.gameObject);
                UpdateUI(newHouse);
                SwitchState(3);
                gameMasterRef.EstablishHouseListing_Send(newHouse);
                gameMasterRef.contentForBuyPanel.GetComponent <BuyContent>().listOfPanels.Add(this.gameObject);
            }
            else
            {
                badHighlight.SetActive(true);
                StartCoroutine(ResetHighlight());
            }
        }
    }
    public void CreateMesh(HouseData houseData)
    {
        this.houseData = houseData;
        myHouse        = new GameObject("House");
        floorCount     = 0;
//		meshFilter = gameObject.GetComponent<MeshFilter> ();
//		if (meshFilter == null) {
        meshFilter = myHouse.AddComponent <MeshFilter> ();
//		}
//		meshRenderer = gameObject.GetComponent<MeshRenderer> ();
//		if (meshRenderer == null) {
        meshRenderer = myHouse.AddComponent <MeshRenderer> ();
//		}
        this.mesh = meshFilter.sharedMesh;
        if (this.mesh == null)
        {
            this.mesh      = new Mesh();
            this.mesh.name = "House";
        }
        materials            = new List <Material> ();
        vertices             = new List <Vector3> ();
        uvs                  = new List <Vector2> ();
        currentVerticesIndex = 0;
        this.mesh.Clear();
        subMeshCount = 0;
    }
예제 #7
0
    public void OnMouseOverCellWithBuiding(UIEmpireCell cell, HouseData houseData)
    {
        cellMouseOver = cell;
        Vector2 startpos     = Vector2.zero;
        Vector2 endPos       = Vector2.zero;
        Vector2 buildingSize = new Vector2(houseData.SizeX, houseData.SizeY);

        GetRectOfBuiding(cell, buildingSize, out startpos, out endPos);

        isCanBuilding = true;

        UIEmpireCursor.Instance.SetColor(Color.white);

        for (int x = (int)startpos.x; x <= endPos.x; x++)
        {
            for (int y = (int)startpos.y; y <= endPos.y; y++)
            {
                Vector2 curCellPos = new Vector2(x, y);
                if (cells.ContainsKey(curCellPos))
                {
                    UIEmpireCell curCell = cells[curCellPos];
                    if (!curCell.CheckBuiding())
                    {
                        CanNotBuilding();
                    }
                }
                else
                {
                    CanNotBuilding();
                }
            }
        }
    }
    public HouseData TryToCreateRoom(HouseData houseData, int x, int z)
    {
        HouseConfig config    = houseData.houseConfig;
        FloorPlan   floorPlan = houseData.floorPlan;
        int         roomWidth = Mathf.Min(config.houseWidth - x - 1,
                                          //10);
                                          randomGenerator.Next(config.roomWidthMax - config.roomWidthMin) + config.roomWidthMin);
        int tmpRoomLength = Mathf.Min(config.houseLength - z - 1,
                                      //10);
                                      randomGenerator.Next(config.roomLengthMax - config.roomLengthMin) + config.roomLengthMin);

//		int roomWidth = 10, roomLength = 10;
        if (x + roomWidth >= config.houseWidth || z + tmpRoomLength >= config.houseLength)
        {
            return(houseData);
        }

        int roomLength = CorrectLength(x, z, floorPlan, tmpRoomLength);

        if (roomWidth < config.roomWidthMin || roomLength < config.roomLengthMin)
        {
            return(houseData);
        }
//		Debug.Log ("Room Width: " + roomWidth);
//		Debug.Log ("Room WidthMin: " + config.roomWidthMin);
//		Debug.Log ("Room Length: " + roomLength);
//		Debug.Log ("Room LengthMin: " + config.roomLengthMin);
        houseData = CreateRoom(x, z, roomWidth, roomLength, houseData);
        return(houseData);
    }
예제 #9
0
        /// <summary>
        /// Load a house from its definition
        /// </summary>
        /// <param name="house"></param>
        public void LoadHouse(HouseData house)
        {
            RenderState.Size = house.Size;

            /**
             * Camera should be at the edge of the screen looking onto the
             * center point of the lot at a 30 degree angle
             */
            /** Size is how many tiles, the last tile has a size too so the actual vertex position is +1) **/
            var worldEdge = house.Size + 1.0f;
            var radius    = RenderState.TileToWorld((worldEdge / 2.0f));
            var opposite  = (float)Math.Cos(MathHelper.ToRadians(30.0f)) * radius;

            Camera.Position = new Vector3(radius * 2, opposite, radius * 2);
            Camera.Target   = new Vector3(radius, 0.0f, radius);
            //Camera.Translation = new Vector3(-radius, 0.0f, -radius);
            Camera.Zoom = 178;

            /**
             * Setup the 2D space
             */
            Model = new HouseModel();
            Model.LoadHouse(house);

            Scene2D.LoadHouse(Model);
            Scene3D.LoadHouse(Model);

            //Center point of the center most tile
            ViewCenter = new Vector2((RenderState.Size / 2.0f) + 30, (RenderState.Size / 2.0f) + 30);
        }
예제 #10
0
 void houseLayerSort()
 {
     for (int i = 0; i < m_giList.Count; i++)
     {
         for (int j = i + 1; j < m_giList.Count; j++)
         {
             if (m_giList[i].hypeLength > m_giList[j].hypeLength)
             {
                 if (m_giList[i].mesh_list[0].y < m_giList[j].mesh_list[0].y)
                 {
                     swap(i, j);
                 }
             }
             else
             {
                 if (m_giList[i].mesh_list[0].y <= m_giList[j].mesh_list[0].y)
                 {
                     HouseData hd = MapBasicData.GetHouseData(m_giList[i].gt);
                     float     w  = hd.width;
                     float     h  = hd.height - 0.4f;
                     if (m_giList[i].mesh_list[0].x + w >= m_giList[j].mesh_list[0].x &&
                         m_giList[i].mesh_list[0].y + h >= m_giList[j].mesh_list[0].y)
                     {
                         swap(i, j);
                     }
                 }
             }
         }
     }
 }
예제 #11
0
    public static HouseData GetHouseData(GoodsType gt)
    {
        HouseData hd = new HouseData();

        if (gt == GoodsType.TABLE)
        {
            hd.InitData(2.4f, 2.66f, 2, 5, new Vector2(0.7f / 2 + 0.12f, 0.4f / 2 + 0.11f));
        }
        else if (gt == GoodsType.CABINET)
        {
            hd.InitData(2.04f, 2.68f, 2, 5, new Vector2(0.7f / 2, 0.4f / 2 + 0.15f));
        }
        else if (gt == GoodsType.ELECTRICBOX)
        {
            hd.InitData(2.01f, 2.18f, 4, 2, new Vector2(0.5f, 0.4f * 2 - 0.1f));
        }
        else if (gt == GoodsType.OXYGENBOTTLE)
        {
            hd.InitData(1.22f, 2.14f, 2, 2, new Vector2(0.27f, 0.4f / 2 + 0.07f));
        }
        else if (gt == GoodsType.ALLOYCABINET)
        {
            hd.InitData(1.63f, 1.79f, 3, 2, new Vector2(0.38f, 0.45f));
        }
        else if (gt == GoodsType.HIGHSTOVE)
        {
            hd.InitData(1.63f, 1.79f, 3, 3, new Vector2(0.1f, 0.3f));
        }
        else if (gt == GoodsType.ELECTRICCABINET)
        {
            hd.InitData(1.63f, 1.79f, 3, 4, new Vector2(0.1f, 0.3f));
        }
        return(hd);
    }
예제 #12
0
    public void Init(UIEmpireManager manager, List <HouseData> listbuilding)
    {
        if (buildings.Count > 0)
        {
            foreach (var building in buildings)
            {
                GameObject.Destroy(building.Value.gameObject);
            }
            buildings.Clear();
        }
        for (int i = 0; i < listbuilding.Count; i++)
        {
            HouseData  buildingtemp = listbuilding[i];
            GameObject buildingObj  = GameObject.Instantiate(buildingObject.buidingPrefab) as GameObject;
            buildingObj.SetActive(true);
            buildingObj.transform.SetParent(buildingObject.buidingRoot.transform);
            buildingObj.transform.localPosition = new Vector3(0, -buildingSize.y * i);
            buildingObj.transform.localScale    = new Vector3(1, 1, 1);
            buildingObj.transform.localRotation = Quaternion.identity;
            UIEmpireBuilding building = buildingObj.GetComponent <UIEmpireBuilding>();
            building.Init(buildingtemp, buildingtemp.Id);

            buildings[buildingtemp.Id] = building;
        }

        buildingObject.rectTranformBackground               = buildingObject.buidingRootBackground.GetComponent <RectTransform>();
        buildingObject.rectTranformBackground.sizeDelta     = new Vector2(80, buildingSize.y * listbuilding.Count);
        buildingObject.rectTranformBackground.localPosition = new Vector3(0, -1000, 0);
    }
        public void HouseGeneratorTestWithHouseholdSpec()
        {
            //setup
            Logger.Get().StartCollectingAllMessages();
            using (DatabaseSetup db = new DatabaseSetup(Utili.GetCurrentMethodAndClass())) {
                Simulator sim = new Simulator(db.ConnectionString);
                using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass())) {
                    //housedata
                    HouseData houseData = new HouseData(Guid.NewGuid().ToStrGuid(),
                                                        "HT01", 10000, 1000, "HouseGeneratorJobHouse");
                    var householdData = new HouseholdData(Guid.NewGuid().ToString(),
                                                          "blub", null, null, null, null,
                                                          HouseholdDataSpecificationType.ByHouseholdName);
                    houseData.Households.Add(householdData);
                    householdData.HouseholdNameSpec =
                        new HouseholdNameSpecification(sim.ModularHouseholds[0].GetJsonReference());
                    HouseCreationAndCalculationJob houseJob =
                        new HouseCreationAndCalculationJob("present", "2019", "trafokreis",
                                                           HouseDefinitionType.HouseData);
                    houseJob.House = houseData;

                    MakeAndCalculateHouseJob(houseJob, sim, wd, db);
                }
            }
        }
        public void ParseHouse(HtmlNode house)
        {
            HtmlNode details = house.SelectSingleNode(".//a[@class='listing__link']");
            HtmlNode head    = details.SelectSingleNode(".//h2");

            string href       = details.Attributes["href"].Value;
            string houseTitle = head.InnerText.Trim().Replace("  ", "").Replace("\n", " ");
            string houseUrl   = pagePrefix + href;

            HouseData houseData      = new HouseData();
            string    houseTitleText = "";

            string[] titleParts = houseTitle.Split(' ');
            for (int t = 0; t < titleParts.Length; t++)
            {
                if (titleParts[t].ToLower() == city.ToLower())
                {
                    continue;
                }
                houseTitleText += titleParts[t].Trim() + " ";
            }
            houseData.title    = houseTitleText.Trim();
            houseData.siteName = "Huurwoningen.nl";
            houseData.url      = houseUrl;

            Console.WriteLine(houseTitle + " (" + houseUrl + ")");
            ParseHousePage(houseUrl, houseData);
            Console.WriteLine();
        }
예제 #15
0
    public void AddHouseToYourList(HouseData theHouse)
    {
        GameObject newAssetPanel = Instantiate(gameMasterRef.buyPanelPrefab, transform.position = new Vector3(0, 0, 5), Quaternion.identity, gameMasterRef.contentForYourAssets.transform);

        theHouse.SetGameObjectOfSelf(newAssetPanel);
        yourHousesBought.Add(theHouse);
        newAssetPanel.GetComponent <BuyPanel>().UpdateUI(theHouse, true);
    }
예제 #16
0
 public PayAdvance(HouseData house)
 {
     this.house = house;
     InitializeComponent();
     Title       = "Pay Advance of " + house.Name;
     owner.Text  = house.OwnerName;
     tenent.Text = house.TenantName;
 }
예제 #17
0
        public static HouseData GetHouseData(House house)
        {
            var houseData = new HouseData();

            houseData.SetRentItems(house.SlumLord.GetRentItems());
            houseData.SetPaidItems(house.SlumLord);

            return(houseData);
        }
예제 #18
0
        public float Prediction(HouseData inputData)
        {
            var size  = inputData;
            var price = mlContext.Model.CreatePredictionEngine <HouseData, Prediction>(model).Predict(size);

            Console.WriteLine($"Predicted price for size: {size.Size * 1000} = {price.Price * 100_000:C}");

            return(price.Price * 100_000);
        }
예제 #19
0
 public HouseData CreateFullHouse(HouseData houseData)
 {
     houseData = CreateNewHouse();
     houseData = GenerateFloorPlan(houseData);
     houseData = GenerateOuterWalls(houseData);
     houseData = GenerateInnerDoors(houseData);
     houseData = GenerateWindowsAndOuterDoors(houseData);
     return(houseData);
 }
예제 #20
0
        public async Task <IActionResult> PostHouse([FromBody] HouseData houseData)//string street, [FromBody] string zip, [FromBody] string houseNumber)
        {
            var street      = houseData.street;
            var zip         = houseData.zip;
            var houseNumber = houseData.houseNumber;

            if (String.IsNullOrWhiteSpace(street))
            {
                return(BadRequest($"Field {nameof(street)} is required"));
            }

            if (String.IsNullOrWhiteSpace(zip))
            {
                return(BadRequest($"Field {nameof(zip)} is required"));
            }

            if (String.IsNullOrWhiteSpace(houseNumber))
            {
                return(BadRequest($"Field {nameof(houseNumber)} is required"));
            }

            int hn = 0;

            if (!int.TryParse(houseNumber, out hn))
            {
                return(BadRequest($"Field {nameof(houseNumber)} is not correct"));
            }

            var streetObj = await _context.Street.FirstOrDefaultAsync(i => i.Name == street);

            if (streetObj == null)
            {
                streetObj = new Street {
                    Name = street
                };
            }
            else
            {
                var streetId     = streetObj.Id;
                var anotherHouse = await _context.House
                                   .FirstOrDefaultAsync(i => i.HouseNumber == hn && i.StreetId == streetId);

                if (anotherHouse != null)
                {
                    return(BadRequest($"Another house with Id: {anotherHouse.Id} has the same address"));
                }
            }
            var house = new House {
                Zip = zip, HouseNumber = hn, Street = streetObj, StreetId = streetObj.Id
            };

            _context.House.Add(house);
            await _context.SaveChangesAsync();

            return(Ok());
        }
예제 #21
0
        public ActionResult <IEnumerable <string> > Get(string area, float approxSquFeet, float rooms, float bedrooms, float fullbath, float halfbath, string garageType, float garageSpaces)
        {
            var housePriceSample1 = new HouseData()
            {
                Area = area, BedRooms = bedrooms, BedRoomsBsmt = 0, FullBath = fullbath, HalfBath = halfbath, Rooms = rooms, ApproxSquFeet = approxSquFeet, GarageType = garageType, GarageSpaces = garageSpaces
            };
            var price = HousePricePrediction.PredictSinglePrice(housePriceSample1);

            return(new string[] { price });
        }
예제 #22
0
    public void Init(HouseData house, int id)
    {
        _subBuildings = new List <HouseData>();
        ID            = id;
        houseData     = house;

        icon.sprite = Helper.LoadSpriteForBuilding(ID);
        //icon.SetNativeSize();
        txtSize.text = string.Format("{0}x{1}", houseData.SizeX, houseData.SizeY);
    }
예제 #23
0
    public HouseData GenerateInnerDoors(HouseData houseData)
    {
        houseData.roomPairs = new List <RoomPair> ();
        for (int x = 2; x < houseData.floorPlan.roomData.GetLength(0) - 2; x++)
        {
            for (int z = 2; z < houseData.floorPlan.roomData.GetLength(1) - 2; z++)
            {
                if (houseData.floorPlan.area [x, z] == UnitType.INNERWALL_DOWN)                                                 //Mögliche Wand für eine Tür
                {
                    if (houseData.floorPlan.area [x, z - 1] == UnitType.INNERWALL_UP)                                           //Angrenzendes Feld ist das Gegenstück zur Wand
                    {
                        RoomPair roomPair = GetExistingRoomPair(ref houseData.roomPairs, new RoomPair(houseData.floorPlan.roomData[x, z], houseData.floorPlan.roomData[x, z - 1]));
                        roomPair.doorPoints.Add(new Point2DTupel(x, z, x, z - 1));
                    }
                }
                else if (houseData.floorPlan.area [x, z] == UnitType.INNERWALL_UP)                                              //Mögliche Wand für eine Tür
                {
                    if (houseData.floorPlan.area [x, z + 1] == UnitType.INNERWALL_DOWN)                                         //Angrenzendes Feld ist das Gegenstück zur Wand
                    {
                        RoomPair roomPair = GetExistingRoomPair(ref houseData.roomPairs, new RoomPair(houseData.floorPlan.roomData[x, z], houseData.floorPlan.roomData[x, z + 1]));
                        roomPair.doorPoints.Add(new Point2DTupel(x, z, x, z + 1));
                    }
                }
                else if (houseData.floorPlan.area [x, z] == UnitType.INNERWALL_LEFT)                                            //Mögliche Wand für eine Tür
                {
                    if (houseData.floorPlan.area [x + 1, z] == UnitType.INNERWALL_RIGHT)                                        //Angrenzendes Feld ist das Gegenstück zur Wand
                    {
                        RoomPair roomPair = GetExistingRoomPair(ref houseData.roomPairs, new RoomPair(houseData.floorPlan.roomData[x, z], houseData.floorPlan.roomData[x + 1, z]));
                        roomPair.doorPoints.Add(new Point2DTupel(x, z, x + 1, z));
                    }
                }
                else if (houseData.floorPlan.area [x, z] == UnitType.INNERWALL_RIGHT)                                           //Mögliche Wand für eine Tür
                {
                    if (houseData.floorPlan.area [x - 1, z] == UnitType.INNERWALL_LEFT)                                         //Angrenzendes Feld ist das Gegenstück zur Wand
                    {
                        RoomPair roomPair = GetExistingRoomPair(ref houseData.roomPairs, new RoomPair(houseData.floorPlan.roomData[x, z], houseData.floorPlan.roomData[x - 1, z]));
                        roomPair.doorPoints.Add(new Point2DTupel(x, z, x - 1, z));
                    }
                }
            }
        }


        foreach (RoomPair rp in houseData.roomPairs)
        {
            Point2DTupel doorPlaces = rp.doorPoints [randomGenerator.Next(rp.doorPoints.Count)];
            houseData.floorPlan.doorInfo.Add((double)doorPlaces.point1.x * (double)1000 + (double)doorPlaces.point1.z / (double)1000, houseData.floorPlan.area [doorPlaces.point1.x, doorPlaces.point1.z]);
            houseData.floorPlan.doorInfo.Add((double)doorPlaces.point2.x * (double)1000 + (double)doorPlaces.point2.z / (double)1000, houseData.floorPlan.area [doorPlaces.point2.x, doorPlaces.point2.z]);

            houseData.floorPlan.area [doorPlaces.point1.x, doorPlaces.point1.z] = UnitType.DOOR;
            houseData.floorPlan.area [doorPlaces.point2.x, doorPlaces.point2.z] = UnitType.DOOR;
        }

        return(houseData);
    }
 public bool CheckLeftContainsDoor(int tx, int tz, HouseData houseData)
 {
     for (int x = tx - 1; x > 0; x--)
     {
         if (houseData.floorPlan.area [x, tz] != null)
         {
             return(false);
         }
     }
     return(true);
 }
 public bool CheckRightContainsDoor(int tx, int tz, HouseData houseData)
 {
     for (int x = tx + 1; x < houseData.houseConfig.houseWidth; x++)
     {
         if (houseData.floorPlan.area [x, tz] != null)
         {
             return(false);
         }
     }
     return(true);
 }
 public bool CheckDownContainsDoor(int tx, int tz, HouseData houseData)
 {
     for (int z = tz + 1; z < houseData.houseConfig.houseLength; z++)
     {
         if (houseData.floorPlan.area [tx, z] != null)
         {
             return(false);
         }
     }
     return(true);
 }
 public bool CheckUpContainsDoor(int tx, int tz, HouseData houseData)
 {
     for (int z = tz - 1; z > 0; z--)
     {
         if (houseData.floorPlan.area [tx, z] != null)
         {
             return(false);
         }
     }
     return(true);
 }
예제 #28
0
        public ActionResult <IEnumerable <string> > Get()
        {
            var housePriceSample1 = new HouseData()
            {
                Area = "76", BedRooms = 3, BedRoomsBsmt = 0, FullBath = 2, HalfBath = 0, Rooms = 7, ApproxSquFeet = 1300, GarageType = "Attached", GarageSpaces = 2
            };
            //var price = HousePricePrediction.PredictSinglePrice(housePriceSample1, @"MLNETModels\housePriceModel.zip");
            var price = HousePricePrediction.PredictSinglePrice(housePriceSample1);

            return(new string[] { price });
        }
예제 #29
0
        public SettleDues(HouseData houseDetails, PayOnlineModel payOnlineModel)
        {
            this.houseDetails = houseDetails;
            InitializeComponent();
            Title       = "Settle Dues of " + houseDetails.name;
            owner.Text  = houseDetails.owner_name;
            tenent.Text = houseDetails.tenant_name;
            var service = DependencyService.Get <IDuesService>();
            var result  = service.GetSettleDues(houseDetails.house_id, payOnlineModel);

            this.setlDuesMdel = result.Result;
        }
예제 #30
0
    private void MakeHouse(IntPoint2D tileLoc)
    {
        GameObject house = housePool.GetActualHouse(tileLoc);
        HouseData  data  = new HouseData(tileLoc);

        this.scenarioInfo.MakeHouse(tileLoc, house);
        HouseManager houseMgr = house.GetComponent <HouseManager> () as HouseManager;

        houseMgr.AssignHouseData(data);
        houseMgr.StartUpdates();
        popMgr.AddHouse(tileLoc, houseMgr);
    }
예제 #31
0
 public void init(bool resized)
 {
     int height = base.Height;
     NumberFormatInfo nFI = GameEngine.NFI;
     instance = this;
     this.inHouseVote = false;
     base.clearControls();
     if (GameEngine.Instance.World.testGloryPointsUpdate())
     {
         RemoteServices.Instance.set_GetHouseGloryPoints_UserCallBack(new RemoteServices.GetHouseGloryPoints_UserCallBack(this.GetHouseGloryPointsCallBack));
         RemoteServices.Instance.GetHouseGloryPoints();
     }
     this.sidebar.addSideBar(8, this);
     HouseData data = null;
     try
     {
         data = GameEngine.Instance.World.HouseInfo[SelectedHouse];
         this.m_houseLeaderFactionID = data.leadingFactionID;
     }
     catch (Exception)
     {
         data = new HouseData();
         this.m_houseLeaderFactionID = -1;
     }
     this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5);
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size = new Size(base.Width - 200, height);
     base.addControl(this.mainBackgroundImage);
     this.backgroundFade.Image = (Image) GFXLibrary.background_top;
     this.backgroundFade.Position = new Point(0, 0);
     this.backgroundFade.Size = new Size(base.Width - 200, this.backgroundFade.Image.Height);
     this.mainBackgroundImage.addControl(this.backgroundFade);
     this.backImage1.Image = (Image) GFXLibrary.faction_tanback;
     this.backImage1.Position = new Point((this.mainBackgroundImage.Size.Width - this.backImage1.Size.Width) - 0x19, 12);
     this.mainBackgroundImage.addControl(this.backImage1);
     this.backImage2.Image = (Image) GFXLibrary.faction_title_band;
     this.backImage2.Position = new Point(20, 20);
     this.mainBackgroundImage.addControl(this.backImage2);
     this.barImage1.Image = (Image) GFXLibrary.faction_bar_tan_1_heavier;
     this.barImage1.Position = new Point(0xc9, 70);
     this.mainBackgroundImage.addControl(this.barImage1);
     this.barImage2.Image = (Image) GFXLibrary.faction_bar_tan_1_lighter;
     this.barImage2.Position = new Point(0xc9, 0x5e);
     this.mainBackgroundImage.addControl(this.barImage2);
     this.barImage3.Image = (Image) GFXLibrary.faction_bar_tan_1_heavier;
     this.barImage3.Position = new Point(0xc9, 0x76);
     this.mainBackgroundImage.addControl(this.barImage3);
     this.barImage4.Image = (Image) GFXLibrary.faction_bar_tan_2_heavier;
     this.barImage4.Position = new Point(460, 70);
     this.mainBackgroundImage.addControl(this.barImage4);
     this.barImage5.Image = (Image) GFXLibrary.faction_bar_tan_2_lighter;
     this.barImage5.Position = new Point(460, 0x5e);
     this.mainBackgroundImage.addControl(this.barImage5);
     this.barImage6.Image = (Image) GFXLibrary.faction_bar_tan_2_heavier;
     this.barImage6.Position = new Point(460, 0x76);
     this.mainBackgroundImage.addControl(this.barImage6);
     this.houseNameLabel.Text = SK.Text("STATS_CATEGORY_TITLE_HOUSE", "House") + " " + SelectedHouse.ToString();
     this.houseNameLabel.Color = ARGBColors.Black;
     this.houseNameLabel.Position = new Point(0xcd, 10);
     this.houseNameLabel.Size = new Size(600, 40);
     this.houseNameLabel.Font = FontManager.GetFont("Arial", 20f, FontStyle.Regular);
     this.houseNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.houseNameLabel);
     this.houseMottoLabel.Text = "\"" + CustomTooltipManager.getHouseMotto(SelectedHouse) + "\"";
     this.houseMottoLabel.Color = ARGBColors.Black;
     this.houseMottoLabel.Position = new Point(0xcd, 0x29);
     this.houseMottoLabel.Size = new Size(600, 40);
     this.houseMottoLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.houseMottoLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.houseMottoLabel);
     this.houseImage.Image = (Image) GFXLibrary.house_circles_large[SelectedHouse - 1];
     this.houseImage.Position = new Point(0x20, 0x18);
     this.mainBackgroundImage.addControl(this.houseImage);
     this.data1Label.Text = SK.Text("GENERIC_Factions", "Factions");
     this.data1Label.Color = ARGBColors.Black;
     this.data1Label.Position = new Point(210, 0x49);
     this.data1Label.Size = new Size(600, 40);
     this.data1Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data1Label);
     if (SelectedHouse == 0)
     {
         this.data1LabelValue.Text = GameEngine.Instance.World.countHouseMembers(SelectedHouse).ToString("N", nFI);
     }
     else
     {
         this.data1LabelValue.Text = data.numFactions.ToString("N", nFI);
     }
     this.data1LabelValue.Color = ARGBColors.Black;
     this.data1LabelValue.Position = new Point(200, 0x49);
     this.data1LabelValue.Size = new Size(230, 40);
     this.data1LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data1LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.mainBackgroundImage.addControl(this.data1LabelValue);
     this.data2Label.Text = SK.Text("FactionInvites_Total_Points", "Total Points");
     this.data2Label.Color = ARGBColors.Black;
     this.data2Label.Position = new Point(210, 0x61);
     this.data2Label.Size = new Size(600, 40);
     this.data2Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data2Label);
     this.data2LabelValue.Text = data.points.ToString("N", nFI);
     this.data2LabelValue.Color = ARGBColors.Black;
     this.data2LabelValue.Position = new Point(200, 0x61);
     this.data2LabelValue.Size = new Size(230, 40);
     this.data2LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data2LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.mainBackgroundImage.addControl(this.data2LabelValue);
     this.data3Label.Text = SK.Text("FactionInvites_Members", "Members");
     this.data3Label.Color = ARGBColors.Black;
     this.data3Label.Position = new Point(210, 0x79);
     this.data3Label.Size = new Size(600, 40);
     this.data3Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data3Label);
     this.data3LabelValue.Text = GameEngine.Instance.World.getNumHouseMembers(SelectedHouse).ToString("N", nFI);
     this.data3LabelValue.Color = ARGBColors.Black;
     this.data3LabelValue.Position = new Point(200, 0x79);
     this.data3LabelValue.Size = new Size(230, 40);
     this.data3LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data3LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.mainBackgroundImage.addControl(this.data3LabelValue);
     this.data4Label.Text = SK.Text("FactionInvites_Marshall", "Marshall");
     this.data4Label.Color = ARGBColors.Black;
     this.data4Label.Position = new Point(0x1d3, 0x49);
     this.data4Label.Size = new Size(600, 40);
     this.data4Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data4Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data4Label);
     this.data4LabelValue.Text = data.leaderUserName;
     this.data4LabelValue.Color = ARGBColors.Black;
     this.data4LabelValue.Position = new Point(0x205, 0x49);
     this.data4LabelValue.Size = new Size(230, 40);
     this.data4LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data4LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.mainBackgroundImage.addControl(this.data4LabelValue);
     this.data5Label.Text = SK.Text("STATS_CATEGORY_TITLE_FACTION", "Faction");
     this.data5Label.Color = ARGBColors.Black;
     this.data5Label.Position = new Point(0x1d3, 0x61);
     this.data5Label.Size = new Size(600, 40);
     this.data5Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data5Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data5Label);
     this.data5LabelValue.Text = "";
     if (data.leadingFactionID >= 0)
     {
         FactionData data2 = GameEngine.Instance.World.getFaction(data.leadingFactionID);
         if (data2 != null)
         {
             this.data5LabelValue.Text = data2.factionName;
         }
     }
     this.data5LabelValue.Color = ARGBColors.Black;
     this.data5LabelValue.Position = new Point(0x205, 0x4b);
     this.data5LabelValue.Size = new Size(230, 60);
     this.data5LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data5LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT;
     this.mainBackgroundImage.addControl(this.data5LabelValue);
     int num2 = GameEngine.Instance.World.getGloryRank(SelectedHouse);
     if (num2 >= 0)
     {
         this.gloryImage.Image = (Image) GFXLibrary.glory_frame;
         this.gloryImage.Position = new Point(490, 10);
         this.mainBackgroundImage.addControl(this.gloryImage);
         this.data6Label.Text = SK.Text("FactionInvites_Glory_Rank", "Glory Rank");
         this.data6Label.Color = ARGBColors.Black;
         this.data6Label.Position = new Point(0x1f9, 0x1b);
         this.data6Label.Size = new Size(600, 40);
         this.data6Label.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         this.data6Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.mainBackgroundImage.addControl(this.data6Label);
         this.data6LabelValue.Text = (num2 + 1).ToString("N", nFI);
         this.data6LabelValue.Color = ARGBColors.Black;
         this.data6LabelValue.Position = new Point(0x2b6, 0x1b);
         this.data6LabelValue.Size = new Size(0x1d, 40);
         this.data6LabelValue.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         this.data6LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.mainBackgroundImage.addControl(this.data6LabelValue);
     }
     this.data7Label.Text = SK.Text("FactionInvites_Glory Victories", "Glory Victories");
     this.data7Label.Color = ARGBColors.Black;
     this.data7Label.Position = new Point(0x1d3, 0x79);
     this.data7Label.Size = new Size(600, 40);
     this.data7Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data7Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.mainBackgroundImage.addControl(this.data7Label);
     this.data7LabelValue.Text = data.numVictories.ToString("N", nFI);
     this.data7LabelValue.Color = ARGBColors.Black;
     this.data7LabelValue.Position = new Point(0x205, 0x79);
     this.data7LabelValue.Size = new Size(230, 40);
     this.data7LabelValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.data7LabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.mainBackgroundImage.addControl(this.data7LabelValue);
     this.headerLabelsImage.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 0x1c);
     this.headerLabelsImage.Position = new Point(0x19, 0x9f);
     this.mainBackgroundImage.addControl(this.headerLabelsImage);
     this.headerLabelsImage.Create((Image) GFXLibrary.mail2_field_bar_mail_left, (Image) GFXLibrary.mail2_field_bar_mail_middle, (Image) GFXLibrary.mail2_field_bar_mail_right);
     this.divider1Image.Image = (Image) GFXLibrary.mail2_field_bar_mail_divider;
     this.divider1Image.Position = new Point(290, 0);
     this.headerLabelsImage.addControl(this.divider1Image);
     this.divider2Image.Image = (Image) GFXLibrary.mail2_field_bar_mail_divider;
     this.divider2Image.Position = new Point(440, 0);
     this.headerLabelsImage.addControl(this.divider2Image);
     this.factionLabel.Text = SK.Text("STATS_CATEGORY_TITLE_FACTION", "Faction");
     this.factionLabel.Color = ARGBColors.Black;
     this.factionLabel.Position = new Point(9, -2);
     this.factionLabel.Size = new Size(0x143, this.headerLabelsImage.Height);
     this.factionLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.factionLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.headerLabelsImage.addControl(this.factionLabel);
     this.pointsLabel.Text = SK.Text("FactionsPanel_Points", "Points");
     this.pointsLabel.Color = ARGBColors.Black;
     this.pointsLabel.Position = new Point(0x127, -2);
     this.pointsLabel.Size = new Size(140, this.headerLabelsImage.Height);
     this.pointsLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.pointsLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.headerLabelsImage.addControl(this.pointsLabel);
     InterfaceMgr.Instance.setVillageHeading(SK.Text("STATS_CATEGORY_TITLE_HOUSE", "House") + " " + SelectedHouse.ToString());
     FactionData yourFaction = GameEngine.Instance.World.YourFaction;
     int index = 0;
     if (yourFaction != null)
     {
         index = yourFaction.houseID;
     }
     bool flag = false;
     int num4 = GameEngine.Instance.World.getYourFactionRank();
     if ((index != 0) && (index == SelectedHouse))
     {
         this.leaderVisited();
         if ((GameEngine.Instance.World.HouseVoteInfo != null) && (GameEngine.Instance.World.HouseVoteInfo.appliedToHouseID > 0))
         {
             int appliedToHouseID = GameEngine.Instance.World.HouseVoteInfo.appliedToHouseID;
         }
         switch (num4)
         {
             case 1:
                 this.leaveHouseButton.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal;
                 this.leaveHouseButton.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over;
                 this.leaveHouseButton.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed;
                 this.leaveHouseButton.Position = new Point(560, height - 30);
                 this.leaveHouseButton.Text.Text = SK.Text("FactionsPanel_Leave_House", "Leave House");
                 this.leaveHouseButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
                 this.leaveHouseButton.TextYOffset = -3;
                 this.leaveHouseButton.Text.Color = ARGBColors.Black;
                 this.leaveHouseButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.leaveHouseClick), "HouseInfoPanel_leave");
                 this.mainBackgroundImage.addControl(this.leaveHouseButton);
                 flag = true;
                 break;
             // TODO: case 1 должен включать case 2
             // case 1:
             case 2:
             {
                 string str = "";
                 TimeSpan span = (TimeSpan) (VillageMap.getCurrentServerTime() - yourFaction.lastHouseDate);
                 if ((span.TotalDays < 1.0) && (VillageMap.getCurrentServerTime().Day == yourFaction.lastHouseDate.Day))
                 {
                     str = SK.Text("FactionsPanel_Today", "Today");
                 }
                 else if ((span.TotalDays < 2.0) && (VillageMap.getCurrentServerTime().Day == yourFaction.lastHouseDate.AddDays(1.0).Day))
                 {
                     str = SK.Text("FactionsPanel_Yesterday", "Yesterday");
                 }
                 else
                 {
                     int totalDays = (int) span.TotalDays;
                     if (totalDays < 2)
                     {
                         totalDays = 2;
                     }
                     str = totalDays.ToString() + " " + SK.Text("FactionsPanel_X_Days_Ago", "Days ago");
                 }
                 this.lastVisitLabel.Text = SK.Text("FactionsPanel_Last_General_Visit", "Last General Visit") + " : " + str;
                 this.lastVisitLabel.Color = ARGBColors.Black;
                 this.lastVisitLabel.Position = new Point(10, height - 0x19);
                 this.lastVisitLabel.Size = new Size(400, 40);
                 this.lastVisitLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
                 this.lastVisitLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                 this.mainBackgroundImage.addControl(this.lastVisitLabel);
                 flag = true;
                 break;
             }
         }
         this.divider3Image.Image = (Image) GFXLibrary.mail2_field_bar_mail_divider;
         this.divider3Image.Position = new Point(610, 0);
         this.headerLabelsImage.addControl(this.divider3Image);
         this.membershipVoteLabel.Text = SK.Text("FactionsPanel_Membership_Vote", "Membership Vote");
         this.membershipVoteLabel.Color = ARGBColors.Black;
         this.membershipVoteLabel.Position = new Point(0x1bd, -2);
         this.membershipVoteLabel.Size = new Size(160, this.headerLabelsImage.Height);
         this.membershipVoteLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
         this.membershipVoteLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.headerLabelsImage.addControl(this.membershipVoteLabel);
         this.leadershipVoteLabel.Text = SK.Text("FactionsPanel_Leadership_Vote", "Leadership Vote");
         this.leadershipVoteLabel.Color = ARGBColors.Black;
         this.leadershipVoteLabel.Position = new Point(0x253, -2);
         this.leadershipVoteLabel.Size = new Size(160, this.headerLabelsImage.Height);
         this.leadershipVoteLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
         this.leadershipVoteLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.headerLabelsImage.addControl(this.leadershipVoteLabel);
         if ((GameEngine.Instance.World.getYourHouseRank() == 10) && (num4 == 1))
         {
             this.sendProclamationButton.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal;
             this.sendProclamationButton.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over;
             this.sendProclamationButton.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed;
             this.sendProclamationButton.Position = new Point(330, height - 30);
             this.sendProclamationButton.Text.Text = SK.Text("Capitials_Proclamation", "Send Proclamation");
             this.sendProclamationButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
             this.sendProclamationButton.TextYOffset = -3;
             this.sendProclamationButton.Text.Color = ARGBColors.Black;
             this.sendProclamationButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendProclamation), "HouseInfoPanel_sendProclamation");
             this.mainBackgroundImage.addControl(this.sendProclamationButton);
             DateTime lastProclomationDate = GameEngine.Instance.World.HouseInfo[index].lastProclomationDate;
             TimeSpan span2 = (TimeSpan) (VillageMap.getCurrentServerTime() - lastProclomationDate);
             this.nextProclamationLabel.Text = SK.Text("FactionsPanel_Next_Proclamation_Time", "Next proclamation available in") + " : ";
             this.nextProclamationLabel.Color = ARGBColors.White;
             this.nextProclamationLabel.Position = new Point(330, height - 0x20);
             this.nextProclamationLabel.Size = new Size(160, this.headerLabelsImage.Height);
             this.nextProclamationLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
             this.nextProclamationLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
             this.mainBackgroundImage.addControl(this.nextProclamationLabel);
             if (span2.TotalDays >= 1.0)
             {
                 this.sendProclamationButton.Enabled = true;
                 this.sendProclamationButton.Visible = true;
                 this.nextProclamationLabel.Visible = false;
             }
             else
             {
                 TimeSpan span3 = TimeSpan.FromDays(1.0) - span2;
                 this.sendProclamationButton.Enabled = false;
                 this.sendProclamationButton.Visible = false;
                 this.nextProclamationLabel.Text = this.nextProclamationLabel.Text + TimeSpan.FromSeconds((double) ((((span3.Hours * 60) * 60) + (span3.Minutes * 60)) + span3.Seconds)).ToString();
                 this.nextProclamationLabel.Visible = true;
             }
         }
     }
     else if (index > 0)
     {
         bool flag2 = false;
         if ((num4 == 1) && (GameEngine.Instance.World.getYourHouseRank() == 10))
         {
             flag2 = true;
         }
         if (flag2)
         {
             this.diplomacyButton.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal;
             this.diplomacyButton.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over;
             this.diplomacyButton.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed;
             this.diplomacyButton.Position = new Point(0x22f, height - 30);
             this.diplomacyButton.Text.Text = "";
             this.diplomacyButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
             this.diplomacyButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
             this.diplomacyButton.TextYOffset = -3;
             this.diplomacyButton.Text.Color = ARGBColors.Black;
             this.diplomacyButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.diplomacyClicked), "HouseInfoPanel_diplomacy");
             this.mainBackgroundImage.addControl(this.diplomacyButton);
             flag = true;
         }
         else
         {
             this.diplomacyLabel.Text = "";
             this.diplomacyLabel.Color = ARGBColors.Black;
             this.diplomacyLabel.Position = new Point(520, height - 0x19);
             this.diplomacyLabel.Size = new Size(240, 40);
             this.diplomacyLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
             this.diplomacyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
             this.mainBackgroundImage.addControl(this.diplomacyLabel);
             flag = true;
         }
     }
     this.wallScrollArea.Position = new Point(0x19, 0xbc);
     if (flag)
     {
         this.wallScrollArea.Size = new Size(0x2c1, height - 240);
         this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x2c1, height - 240));
     }
     else
     {
         this.wallScrollArea.Size = new Size(0x2c1, height - 0xbc);
         this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x2c1, height - 0xbc));
     }
     this.mainBackgroundImage.addControl(this.wallScrollArea);
     this.mouseWheelOverlay.Position = this.wallScrollArea.Position;
     this.mouseWheelOverlay.Size = this.wallScrollArea.Size;
     this.mouseWheelOverlay.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved));
     this.mainBackgroundImage.addControl(this.mouseWheelOverlay);
     int num11 = this.wallScrollBar.Value;
     this.wallScrollBar.Position = new Point(0x2dd, 0xbc);
     if (flag)
     {
         this.wallScrollBar.Size = new Size(0x18, height - 240);
     }
     else
     {
         this.wallScrollBar.Size = new Size(0x18, height - 0xbc);
     }
     this.mainBackgroundImage.addControl(this.wallScrollBar);
     this.wallScrollBar.Value = 0;
     this.wallScrollBar.Max = 100;
     this.wallScrollBar.NumVisibleLines = 0x19;
     this.wallScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom);
     this.wallScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved));
     this.addFactions();
 }