wxr
2020-11-04 e6a26ee148587327478d9a82624a820c907b6e16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
using System;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    /// <summary>
    /// 新建场景菜单界面
    /// </summary>
    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<string>() { "" } };
                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;
            };
        }
    }
}