Exemplo n.º 1
0
        private void StyleResponses(int responseID)
        {
            var data     = BaseService.GetPlayerTempData(GetPC());
            var response = GetResponseByID("StylePage", responseID);
            Tuple <int, BuildingType> args = (Tuple <int, BuildingType>)response.CustomData;
            int          styleID           = args.Item1;
            BuildingType type = args.Item2;

            if (styleID == -2)
            {
                DoInteriorPreview();
                EndConversation();
                return;
            }

            if (type == BuildingType.Interior)
            {
                data.StructureItem.SetLocalInt("STRUCTURE_BUILDING_INTERIOR_ID", styleID);
            }
            else
            {
                data.StructureItem.SetLocalInt("STRUCTURE_BUILDING_EXTERIOR_ID", styleID);
                Preview();
            }

            LoadStylePage(type);
        }
Exemplo n.º 2
0
        private void LoadStylePage(BuildingType buildingType)
        {
            var data = BaseService.GetPlayerTempData(GetPC());

            // Header
            int styleID = data.StructureItem.GetLocalInt("STRUCTURE_BUILDING_EXTERIOR_ID");

            if (buildingType == BuildingType.Interior)
            {
                styleID = data.StructureItem.GetLocalInt("STRUCTURE_BUILDING_INTERIOR_ID");
            }

            var    currentStyle = DataService.BuildingStyle.GetByID(styleID);
            string header       = ColorTokenService.Green("Building Style: ") + currentStyle.Name + "\n\n";

            header += "Change the style by selecting from the list below.";

            SetPageHeader("StylePage", header);
            // Responses
            ClearPageResponses("StylePage");

            if (buildingType == BuildingType.Interior)
            {
                AddResponseToPage("StylePage", "Preview Interior", true, new Tuple <int, BuildingType>(-2, BuildingType.Interior));
            }

            var styles = DataService.BuildingStyle.GetAll().Where(x => x.BuildingTypeID == (int)buildingType &&
                                                                  x.BaseStructureID == data.BaseStructureID && x.IsActive).ToList();

            foreach (var style in styles)
            {
                var args = new Tuple <int, BuildingType>(style.ID, buildingType);
                AddResponseToPage("StylePage", style.Name, true, args);
            }
        }