using System; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI { /// /// 新建场景菜单界面 /// public partial class NewSceneMenuListPage : FrameLayout { FrameLayout bodyView; Button btnAddSceneBg; Button btnCatchSceneBg; Button btnMovieSceneBg; Action action; public NewSceneMenuListPage(Action act) { action = act; bodyView = this; } public void LoadPage() { bodyView.BackgroundColor = CSS_Color.BackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)).LoadTopView(); #region 添加场景 FrameLayout addSceneView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(67), Width = Application.GetRealWidth(361), Height = Application.GetRealWidth(202), Radius = (uint)Application.GetRealWidth(12), }; bodyView.AddChidren(addSceneView); ImageView addSceneImageView = new ImageView() { Gravity = Gravity.CenterHorizontal, Radius = (uint)Application.GetRealWidth(12), ImagePath = "Intelligence/CreateScene1Bg.png", }; addSceneView.AddChidren(addSceneImageView); btnAddSceneBg = new Button() { Radius = (uint)Application.GetRealWidth(12), }; addSceneView.AddChidren(btnAddSceneBg); Button btnAddSceneText = new Button() { Y = Application.GetRealWidth(126), Height = Application.GetRealWidth(68), TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, TextAlignment = TextAlignment.Center, TextID = StringId.AddScene, }; addSceneView.AddChidren(btnAddSceneText); #endregion #region 捕获场景 FrameLayout catchSceneView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y =addSceneView.Bottom,//+ Application.GetRealWidth(10), Width = Application.GetRealWidth(361), Height = Application.GetRealWidth(202), Radius = (uint)Application.GetRealWidth(12), }; bodyView.AddChidren(catchSceneView); ImageView catchSceneImageView = new ImageView() { Gravity = Gravity.CenterHorizontal, Radius = (uint)Application.GetRealWidth(12), ImagePath = "Intelligence/CreateScene2Bg.png", }; catchSceneView.AddChidren(catchSceneImageView); btnCatchSceneBg = new Button() { Radius = (uint)Application.GetRealWidth(12), }; catchSceneView.AddChidren(btnCatchSceneBg); Button btnCatchSceneText = new Button() { Y = Application.GetRealWidth(126), Height = Application.GetRealWidth(68), TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, TextAlignment = TextAlignment.Center, TextID = StringId.CatchScene, }; catchSceneView.AddChidren(btnCatchSceneText); #endregion #region 电影场景 FrameLayout movieSceneView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = catchSceneView.Bottom ,//+ Application.GetRealHeight(10), Width = Application.GetRealWidth(361), Height = Application.GetRealWidth(202), Radius = (uint)Application.GetRealWidth(12), }; bodyView.AddChidren(movieSceneView); ImageView movieSceneImageView = new ImageView() { Gravity = Gravity.CenterHorizontal, Radius = (uint)Application.GetRealWidth(12), ImagePath = "Intelligence/CreateScene3Bg.png", }; movieSceneView.AddChidren(movieSceneImageView); btnMovieSceneBg = new Button() { Radius = (uint)Application.GetRealWidth(12), }; movieSceneView.AddChidren(btnMovieSceneBg); Button btnMovieSceneText = new Button() { Y = Application.GetRealWidth(126), Height = Application.GetRealWidth(68), TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, TextAlignment = TextAlignment.Center, TextID = StringId.MovieScene, }; movieSceneView.AddChidren(btnMovieSceneText); #endregion LoadEventList(); } } //---------------- public partial class NewSceneMenuListPage { void LoadEventList() { LoadEvent_SkipAddScenePage(); } void LoadEvent_SkipAddScenePage() { btnAddSceneBg.MouseUpEventHandler = (sender, e) => { Action backAction = () => { this.RemoveFromParent(); action(); }; var scene = new Entity.Scene() { roomIdList = new System.Collections.Generic.List() { "" } }; scene.NewSid(); scene.name = Language.StringByID(StringId.Scene) + " " + (1 + Entity.DB_ResidenceData.functionList.scenes.Count).ToString(); var aep = new SceneEditPage(scene,backAction); MainPage.BasePageView.AddChidren(aep); aep.LoadPage(StringId.NewScene); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } } }