From df3906c03db154e8622b7caeaa3bf93b67c6d40a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 15 十月 2021 10:25:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/newBranch1' into CJL-Linphone --- HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs | 131 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 131 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs new file mode 100644 index 0000000..5b6e62f --- /dev/null +++ b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs @@ -0,0 +1,131 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class SceneControlZone :FrameLayout + { + Scene scene; + Button btnIcon; + Button btnName; + Button btnFromFloor; + Button btnCollectionIcon; + + public SceneControlZone(Scene inParScene) + { + scene = inParScene; + Gravity = Gravity.CenterHorizontal; + Width = Application.GetRealWidth(343); + Height = Application.GetRealHeight(65); + Radius = (uint)Application.GetMinRealAverage(12); + BorderColor = 0x00FFFFFF; + BorderWidth = 1; + BackgroundColor = CSS_Color.MainBackgroundColor; + Tag = "Scene-" + scene.sid; + } + + + /// <summary> + /// 鍔犺浇鍔熻兘绫诲瀷鎺у埗鍗$墖 + /// </summary> + public void LoadView() + { + btnIcon = new Button() + { + X = Application.GetRealWidth(10), + Y = Application.GetRealHeight(15), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + }; + this.AddChidren(btnIcon); + + btnName = new Button() + { + X = Application.GetRealWidth(8 + 10 + 32), + Y = Application.GetRealHeight(10), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(24), + Text = scene.name, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + }; + this.AddChidren(btnName); + + btnFromFloor = new Button() + { + X = Application.GetRealWidth(8 + 10 + 32), + Y = Application.GetRealHeight(10 + 24), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(18), + Text = scene.GetRoomListName(), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + this.AddChidren(btnFromFloor); + + btnCollectionIcon = new Button() + { + X = Application.GetRealWidth(299), + Y = Application.GetRealHeight(10), + Width = Application.GetMinRealAverage(40), + Height = Application.GetMinRealAverage(40), + SelectedImagePath = "Collection/CollectionIcon.png", + UnSelectedImagePath = "Collection/CollectionGrayIcon.png", + IsSelected = scene.collect + }; + this.AddChidren(btnCollectionIcon); + + btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; + if (scene.sceneType == SceneType.MovieScene) + { + Button movieIcon = new Button() + { + X = Application.GetRealWidth(52), + Y = Application.GetRealHeight(14), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + UnSelectedImagePath = "FunctionIcon/Scene/MovieMark.png", + }; + this.AddChidren(movieIcon); + btnName.X = Application.GetRealWidth(52 + 16); + } + //鍔犺浇鍦烘櫙鎺у埗浜嬩欢 + LoadEvent_ControlScene(btnName, btnFromFloor, scene); + + LoadEvent_FunctionCollection(btnCollectionIcon, scene); + } + + + /// <summary> + /// 鍔犺浇鍔熻兘鏀惰棌鎸夐挳浜嬩欢 + /// </summary> + void LoadEvent_FunctionCollection(Button btnCollectionIcon, Scene scene) + { + btnCollectionIcon.MouseUpEventHandler += (sender, e) => + { + btnCollectionIcon.IsSelected = scene.collect = !btnCollectionIcon.IsSelected; + scene.CollectScene(); + }; + } + /// <summary> + /// 鍔犺浇鍦烘櫙鎺у埗浜嬩欢 + /// </summary> + void LoadEvent_ControlScene(Button btnName, Button btnFromFloor, Scene scene) + { + EventHandler<MouseEventArgs> upEvent = (sender, e) => { + DriverLayer.Control.Ins.ControlScene(scene); + string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); + new PublicAssmebly().TipMsgAutoClose(msg, false); + }; + btnName.MouseUpEventHandler = upEvent; + btnFromFloor.MouseUpEventHandler = upEvent; + this.MouseUpEventHandler = upEvent; + } + + + } +} -- Gitblit v1.8.0