private async void Save() { if (string.IsNullOrEmpty(PlantName) || string.IsNullOrEmpty(PlantStage) || string.IsNullOrEmpty(PlantMedium)) { EmptyFields = "Red"; } else { await App.Database.SavePlantAsync(new Plant { PlantName = PlantName, PlantStage = PlantStage, PlantMedium = PlantMedium, PlantDate = PlantDate, PlantStrain = PlantStrain, PlantType = PlantType.ToString(), }); await Shell.Current.GoToAsync("//PlantsTab"); PlantName = string.Empty; PlantStage = emptyfields; PlantDate = System.DateTime.Now; IsVisible = false; EmptyFields = "Transparent"; } }
public FarmSeed(PlantType plantType) : base(0xDCF) { //TODO seeds either are like // ginseng seeds, garlic seeds etc. //or seeds are just seeds and select what you want to plant from a craft gump this.PlantType = plantType; this.Name = PlantType.ToString() + " seeds"; Weight = 0.1; Stackable = true; }
public override void OnSingleClick(Mobile from) { if (m_PlantStatus >= PlantStatus.DeadTwigs) { base.OnSingleClick(from); } else if (m_PlantStatus >= PlantStatus.FullGrownPlant) { PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType); if (m_PlantStatus < PlantStatus.DecorativePlant) { if (typeInfo.ContainsPlant) { LabelTo(from, string.Format("{0} {1} {2}", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } else { LabelTo(from, string.Format("{0} bright {1} {2} plant", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } } else { LabelTo(from, string.Format("Decorative {0} {1}", PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } } else if (m_PlantStatus >= PlantStatus.Seed) { if (m_ShowType) { PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType); if (typeInfo.ContainsPlant && m_PlantStatus == PlantStatus.Plant) { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } else { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3} {4}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower(), PlantType.ToString().ToLower())); } } else { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower())); } } else { LabelTo(from, string.Format("Bowl of {0} dirt ", m_PlantSystem.GetLocalizedDirtStatus().ToLower())); } }