/// <summary> /// 使用繪製物件和移動物件建立互動性活動物件 /// </summary> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectActive(DrawBase drawObject, MoveBase moveObject) : base(drawObject, moveObject) { Skills = new SkillCollection(); Energy = new CounterObject(Global.DefaultEnergyLimit, Global.DefaultEnergyLimit, false); EnergyGetPerSec = Global.DefaultEnergyGetPerSec; }
/// <summary> /// 使用繪製物件和移動物件建立基本活動物件 /// </summary> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectBase(DrawBase drawObject, MoveBase moveObject) { Layout = new LayoutSet(); Status = ObjectStatus.Alive; League = LeagueType.None; Life = new CounterObject(-1); Propertys = new PropertyCollection(); DrawObject = drawObject; MoveObject = moveObject; }
/// <summary> /// 新增場景資訊畫面 /// </summary> /// <param name="anchor">訂位位置</param> /// <param name="x">X座標</param> /// <param name="y">Y座標</param> /// <param name="moveObject">移動物件</param> public ObjectUISceneInfo(DirectionType anchor, int x, int y, MoveBase moveObject) : base(anchor, x, y, 220, 150, new DrawUIFrame(Color.AliceBlue, Color.DarkSlateBlue, 2, 20), moveObject) { _DrawCommandHighScore = new DrawUIText(Color.SteelBlue, Color.RoyalBlue, Color.FromArgb(220, 255, 255), Color.SteelBlue, 2, 8, "排行榜", new Font("微軟正黑體", 12), GlobalFormat.MiddleCenter); _DrawCommandHighScoreHover = new DrawUIText(Color.SteelBlue, Color.RoyalBlue, Color.FromArgb(100, 220, 255, 255), Color.SteelBlue, 2, 8, "排行榜", new Font("微軟正黑體", 12), GlobalFormat.MiddleCenter); _CommandHighScore = new ObjectUI(160, 10, 50, 25, _DrawCommandHighScore); _CommandHighScore.DrawObjectHover = _DrawCommandHighScoreHover; _CommandHighScore.Propertys.Add(new PropertyShadow(2, 2)); _CommandHighScore.Layout.Depend.SetObject(this); _CommandHighScore.Layout.Depend.Anchor = DirectionType.Left | DirectionType.Top; _CommandHighScore.Click += (s, e) => { OnHightScoreClick(); }; }
/// <summary> /// 發生於移動物件變更 /// </summary> protected virtual void OnMoveObjectChanged(MoveBase oldValue, MoveBase newValue) { if (oldValue != null) { oldValue.Moving -= MoveObject_Moving; oldValue.BindingUnlock(); oldValue.Binding(Scene); } if (newValue != null) { newValue.Moving += MoveObject_Moving; newValue.Binding(this, true); } if (MoveObjectChanged != null) { MoveObjectChanged(this, oldValue, newValue); } }
/// <summary> /// 使用指定的定位點和移動物件建立介面物件 /// </summary> /// <param name="x">物件左上位置X</param> /// <param name="y">物件左上位置Y</param> /// <param name="width">物件寬度</param> /// <param name="height">物件高度</param> /// <param name="drawObject">繪製物件</param> /// <param name="DrawObjectHover">滑鼠滑過時顯示的繪圖物件(null為不切換)</param> /// <param name="moveObject">移動物件</param> public ObjectUI(DirectionType anchor, int x, int y, int width, int height, DrawBase drawObject, MoveBase moveObject) : base(drawObject, moveObject) { Layout.CollisonShape = ShapeType.Rectangle; Layout.Anchor = anchor; Layout.X = x; Layout.Y = y; Layout.Width = width; Layout.Height = height; Enabled = true; }
/// <summary> /// 新增場景資訊畫面 /// </summary> /// <param name="anchor">訂位位置</param> /// <param name="x">X座標</param> /// <param name="y">Y座標</param> /// <param name="moveObject">移動物件</param> public ObjectUIPlayerInfo(DirectionType anchor, int x, int y, MoveBase moveObject) : base(anchor, x, y, 250, 80, new DrawUIFrame(Color.FromArgb(50, 220, 255, 255), Color.FromArgb(160, 240, 160, 150), 1, 0), moveObject) { _PlayerName = GlobalPlayer.PlayerName; }
/// <summary> /// 建立一個互動性活動物件 /// </summary> /// <param name="x">物件中心位置X</param> /// <param name="y">物件中心位置Y</param> /// <param name="width">物件寬度</param> /// <param name="height">物件高度</param> /// <param name="life">存活時間,小於0為永久</param> /// <param name="collisonShape">碰撞形狀</param> /// <param name="leage">物件所屬陣營,供技能或特性判定</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectActive(float x, float y, int width, int height, int life, LeagueType leage, ShapeType collisonShape, DrawBase drawObject, MoveBase moveObject) : this(drawObject, moveObject) { Layout.CollisonShape = collisonShape; Layout.Anchor = DirectionType.Center; Layout.X = x; Layout.Y = y; Layout.Width = width; Layout.Height = height; League = leage; Life.Limit = life; }
/// <summary> /// 使用指定的配置建立互動性活動物件 /// </summary> /// <param name="layout">配置資訊</param> /// <param name="life">存活時間,小於0為永久</param> /// <param name="leage">物件所屬陣營,供技能或特性判定</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectActive(LayoutSet layout, int life, LeagueType leage, DrawBase drawObject, MoveBase moveObject) : this(drawObject, moveObject) { Layout.CollisonShape = layout.CollisonShape; Layout.Anchor = layout.Anchor; Layout.X = layout.X; Layout.Y = layout.Y; Layout.Width = layout.Width; Layout.Height = layout.Height; League = leage; Life.Limit = life; }
/// <summary> /// 使用顏色建立圓形虛擬物件,會逐漸縮小(放大)並淡出後消失 /// </summary> /// <param name="x">物件位置X</param> /// <param name="y">物件位置Y</param> /// <param name="width">物件寬度</param> /// <param name="height">物件高度</param> /// <param name="fadeTime">淡出時間(毫秒),小於0為永久</param> /// <param name="fadeTime">計時器結束時大小比例</param> /// <param name="fadeTime">計時器結束時透明度</param> /// <param name="color">顏色</param> /// <param name="moveObject">移動物件</param> public ObjectSmoke(float x, float y, int width, int height, int fadeTime, float finelScale, float finelOpacity, Color color, MoveBase moveObject) : this(x, y, width, height, fadeTime, finelScale, finelOpacity, new DrawBrush(color, ShapeType.Ellipse), moveObject) { }
/// <summary> /// 新增虛擬物件,會逐漸縮小(放大)並淡出後消失 /// </summary> /// <param name="x">物件位置X</param> /// <param name="y">物件位置Y</param> /// <param name="width">物件寬度</param> /// <param name="height">物件高度</param> /// <param name="fadeTime">淡出時間(毫秒),小於0為永久</param> /// <param name="finelScale">計時器結束時大小比例</param> /// <param name="finelOpacity">計時器結束時透明度</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectSmoke(float x, float y, int width, int height, int fadeTime, float finelScale, float finelOpacity, DrawBase drawObject, MoveBase moveObject) : base(drawObject, moveObject) { Layout.CollisonShape = ShapeType.Ellipse; Layout.Anchor = DirectionType.Center; Layout.X = x; Layout.Y = y; Layout.Width = width; Layout.Height = height; Propertys.Add(new PropertyDeadSmoke(fadeTime, finelScale, finelOpacity, ObjectDeadType.All)); Kill(null, ObjectDeadType.LifeEnd); }
public ObjectUIHighScore(DirectionType anchor, int x, int y, MoveBase moveObject, ISceneInfo sceneInfo) : base(anchor, x, y, 380, 390, new DrawUIFrame(Color.AliceBlue, Color.CornflowerBlue, 2, 20), moveObject) { Propertys.Add(new PropertyShadow(0, 6, 0.95F, 1)); DrawUIText drawCommandClose = new DrawUIText(Color.RoyalBlue, Color.Gray, Color.FromArgb(175, 220, 230, 255), Color.FromArgb(100, 140, 255), 1, 10, "關 閉", new Font("微軟正黑體", 14), GlobalFormat.MiddleCenter); DrawUIText drawCommandCloseHover = new DrawUIText(Color.RoyalBlue, Color.Gray, Color.FromArgb(220, 255, 250, 235), Color.FromArgb(100, 140, 255), 1, 10, "關 閉", new Font("微軟正黑體", 14), GlobalFormat.MiddleCenter); _CommandClose = new ObjectUI(285, 10, 75, 30, drawCommandClose) { DrawObjectHover = drawCommandCloseHover }; _CommandClose.Propertys.Add(new PropertyShadow(2, 2) { RFix = -0.5F, GFix = -0.5F, BFix = -0.5F, Opacity = 0.2F }); _CommandClose.Layout.Depend.Anchor = DirectionType.TopLeft; _CommandClose.Layout.Depend.SetObject(this); _CommandClose.Click += (s, e) => { OnClose(); }; UIObjects.Add(_CommandClose); if (sceneInfo == null) { return; } _SceneInfo = sceneInfo; int itemWidth = 40; int itemHeight = 25; int left = 15; int top = 15; _SceneButtons = new ObjectUI[sceneInfo.MaxLevel]; for (int i = 0; i < sceneInfo.MaxLevel; i++) { int idx = i + 1; DrawUIFrame drawObject = new DrawUIFrame(Color.FromArgb(175, 255, 255, 255), Color.FromArgb(100, 140, 255), 1, 8) { Scale = 0.8F }; ObjectUI newObject = new ObjectUI(left, top, itemWidth, itemHeight, drawObject); newObject.Layout.Depend.SetObject(this); newObject.Layout.Depend.Anchor = DirectionType.TopLeft; newObject.Propertys.Add(new PropertyShadow(3, 3) { Opacity = 0.2F, ScaleX = 0.95F, ScaleY = 0.95F }); UIObjects.Add(newObject); left += itemWidth; drawObject.AfterDraw += (s, g, r) => { g.DrawString(idx.ToString(), _ItemFont, Brushes.RoyalBlue, r, GlobalFormat.MiddleCenter); }; newObject.GetFocus += (s, e) => { (s as ObjectUI).DrawObject.Colors.SetColor("Border", Color.Red); _HoverLevel = idx; }; newObject.LostFocus += (s, e) => { (s as ObjectUI).DrawObject.Colors.SetColor("Border", Color.FromArgb(100, 140, 255)); _HoverLevel = 0; }; newObject.Click += (s, e) => { SelectedIndex = _HoverLevel; }; _SceneButtons[i] = newObject; } SelectedIndex = 1; DrawUIFrame drawPanel = new DrawUIFrame(Color.FromArgb(180, 220, 240, 250), Color.Empty, 0, 0); ObjectUI panel = new ObjectUI(10, 50, Layout.Width - 20, Layout.Height - 60, drawPanel); panel.Propertys.Add(new PropertyShadow(-2, -2)); panel.Layout.Depend.SetObject(this); panel.Layout.Depend.Anchor = DirectionType.Left | DirectionType.Top; UIObjects.Add(panel); _DrawRects = new DrawUIText[3, 10]; _DrawInfos = new string[3, 10]; int rectLeft = 5, rectTop = 5; int rectHeight = 27; for (int i = 0; i < 10; i++) { _DrawRects[0, i] = new DrawUIText(Color.RoyalBlue, Color.Empty, Color.AliceBlue, Color.Empty, 0, 0, "", _ItemFont2, GlobalFormat.MiddleCenter); _DrawRects[1, i] = new DrawUIText(Color.RoyalBlue, Color.Empty, Color.WhiteSmoke, Color.Empty, 0, 0, "", _ItemFont2, GlobalFormat.MiddleLeft); _DrawRects[2, i] = new DrawUIText(Color.RoyalBlue, Color.Empty, Color.WhiteSmoke, Color.Empty, 0, 0, "", _ItemFont2, GlobalFormat.MiddleRight); ObjectUI object1 = new ObjectUI(rectLeft, rectTop, 35, rectHeight, _DrawRects[0, i]); ObjectUI object2 = new ObjectUI(rectLeft + 40, rectTop, 210, rectHeight, _DrawRects[1, i]); ObjectUI object3 = new ObjectUI(rectLeft + 255, rectTop, 90, rectHeight, _DrawRects[2, i]); object1.Propertys.Add(new PropertyShadow(2, 2)); object2.Propertys.Add(new PropertyShadow(2, 2)); object3.Propertys.Add(new PropertyShadow(2, 2)); object1.Layout.Depend.SetObject(panel); object2.Layout.Depend.SetObject(panel); object3.Layout.Depend.SetObject(panel); object1.Layout.Depend.Anchor = DirectionType.Left | DirectionType.Top; object2.Layout.Depend.Anchor = DirectionType.Left | DirectionType.Top; object3.Layout.Depend.Anchor = DirectionType.Left | DirectionType.Top; UIObjects.Add(object1); UIObjects.Add(object2); UIObjects.Add(object3); rectTop += rectHeight + 5; } _DrawCommandMessage = new DrawUIText(Color.Red, Color.Gray, Color.LightYellow, Color.Black, 1, 0, "連線中...", new Font("微軟正黑體", 20), GlobalFormat.MiddleCenter); _CommandMessage = new ObjectUI(DirectionType.Center, 0, 0, 200, 60, _DrawCommandMessage); _CommandMessage.Layout.Depend.SetObject(this); _CommandMessage.Layout.Depend.Anchor = DirectionType.Center; _CommandMessage.Propertys.Add(new PropertyShadow(2, 4)); UIObjects.Add(_CommandMessage); LoadData(); }
/// <summary> /// 新增虛擬物件,會逐漸縮小直到消失 /// </summary> /// <param name="x">物件位置X</param> /// <param name="y">物件位置Y</param> /// <param name="baseWidth">原始寬度</param> /// <param name="baseHeight">原始高度</param> /// <param name="diffusionWidth">擴散寬度</param> /// <param name="diffusionHeight">擴散高度</param> /// <param name="diffusionTime">擴散時間(毫秒)</param> /// <param name="fadeTime">消失時間(毫秒)</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectWave(float x, float y, int baseWidth, int baseHeight, int diffusionWidth, int diffusionHeight, int diffusionTime, int fadeTime, DrawBase drawObject, MoveBase moveObject) : base(drawObject, moveObject) { Layout.CollisonShape = ShapeType.Ellipse; Layout.Anchor = DirectionType.Center; Layout.X = x; Layout.Y = y; Layout.Width = baseWidth; Layout.Height = baseHeight; BaseWidth = baseWidth; BaseHeight = baseHeight; BaseOpacity = 1; DiffusionWidth = diffusionWidth; DiffusionHeight = diffusionHeight; DiffusionOpacity = 1; FadeOpacity = 1; DiffusionTime = new CounterObject(diffusionTime); FadeTime = new CounterObject(fadeTime); }
/// <summary> /// 使用指定的配置新增虛擬物件,會逐漸縮小直到消失 /// </summary> /// <param name="layout">配置資訊</param> /// <param name="diffusionWidth">擴散寬度</param> /// <param name="diffusionHeight">擴散高度</param> /// <param name="diffusionTime">擴散時間(毫秒)</param> /// <param name="fadeTime">消失時間(毫秒)</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectWave(LayoutSet layout, int diffusionWidth, int diffusionHeight, int diffusionTime, int fadeTime, DrawBase drawObject, MoveBase moveObject) : this(layout.CenterX, layout.CenterY, layout.RectWidth, layout.RectHeight, diffusionWidth, diffusionHeight, diffusionTime, fadeTime, drawObject, moveObject) { }
public ObjectUIGameMenu(DirectionType anchor, int x, int y, MoveBase moveObject, ScenePlayingInfo playingInfo, int mode) : base(anchor, x, y, 380, 240 + playingInfo.ScoreDetail.Count * _DetailHeight, new DrawUIFrame(Color.Empty, Color.DarkSlateBlue, 2, 20), moveObject) { _DrawCommandAction = new DrawUIText(Color.Black, Color.White, Color.FromArgb(150, 255, 255, 255), Color.Black, 2, 10, "", Global.CommandFont, GlobalFormat.MiddleCenter); _DrawCommandActionHover = new DrawUIText(Color.Black, Color.White, Color.FromArgb(200, 255, 255, 220), Color.Black, 2, 10, "", Global.CommandFont, GlobalFormat.MiddleCenter); _UICommandAction = new ObjectUI(210, Layout.Height - 75, 150, 50, _DrawCommandAction); _UICommandAction.DrawObjectHover = _DrawCommandActionHover; _UICommandAction.Layout.Depend.SetObject(this); _UICommandAction.Layout.Depend.Anchor = DirectionType.TopLeft; _UICommandAction.Propertys.Add(new PropertyShadow(-4, 4) { RFix = 0, GFix = 0, BFix = 0 }); _UICommandAction.Click += (s, e) => { OnActionButtonClick(_ActionCommand); }; _DrawCommandBack = new DrawUIText(Color.Black, Color.White, Color.FromArgb(150, 255, 255, 255), Color.Black, 2, 10, "回選單", Global.CommandFont, GlobalFormat.MiddleCenter); _DrawCommandBackHover = new DrawUIText(Color.Black, Color.White, Color.FromArgb(200, 255, 255, 220), Color.Black, 2, 10, "回選單", Global.CommandFont, GlobalFormat.MiddleCenter); _UICommandBack = new ObjectUI(20, Layout.Height - 75, 150, 50, _DrawCommandBack); _UICommandBack.DrawObjectHover = _DrawCommandBackHover; _UICommandBack.Layout.Depend.SetObject(this); _UICommandBack.Layout.Depend.Anchor = DirectionType.TopLeft; _UICommandBack.Propertys.Add(new PropertyShadow(4, 4) { RFix = 0, GFix = 0, BFix = 0 }); _UICommandBack.Click += (s, e) => { OnBackButtonClick(); }; _DrawCommandUpdate = new DrawUIText(Color.Black, Color.White, Color.FromArgb(150, 225, 255, 225), Color.Black, 2, 10, "上傳分數", _UpdateFont, GlobalFormat.MiddleCenter); _DrawCommandUpdateHover = new DrawUIText(Color.Black, Color.White, Color.FromArgb(200, 255, 235, 220), Color.Black, 2, 10, "上傳分數", _UpdateFont, GlobalFormat.MiddleCenter); _UICommandUpdate = new ObjectUI(270, 10, 90, 25, _DrawCommandUpdate); _UICommandUpdate.DrawObjectHover = _DrawCommandUpdateHover; _UICommandUpdate.Layout.Depend.SetObject(this); _UICommandUpdate.Layout.Depend.Anchor = DirectionType.TopLeft; _UICommandUpdate.Propertys.Add(new PropertyShadow(4, 4) { RFix = 0, GFix = 0, BFix = 0 }); _UICommandUpdate.Click += (s, e) => { if (Global.Online) { Global.SQL.AddParameter("@SceneID", PlayingInfo.SceneID); Global.SQL.AddParameter("@Level", PlayingInfo.Level); Global.SQL.AddParameter("@PlayerName", GlobalPlayer.PlayerName); Global.SQL.AddParameter("@Score", PlayingInfo.Score); if (Global.SQL.Run(@"set time_zone = '+8:00'; insert into Score (SceneID,Level,PlayerName,Score,UpdateTime) values (@SceneID,@Level,@PlayerName,@Score,now())")) { _DrawCommandUpdate.Text = "上傳成功"; _DrawCommandUpdateHover.Text = "上傳成功"; _UICommandUpdate.Enabled = false; } else { _DrawCommandUpdate.Text = "上傳失敗"; _DrawCommandUpdateHover.Text = "上傳失敗"; } } else { _DrawCommandUpdate.Text = "不可用"; _DrawCommandUpdateHover.Text = "不可用"; _UICommandUpdate.Enabled = false; } }; UIObjects.Add(_UICommandBack); UIObjects.Add(_UICommandAction); UIObjects.Add(_UICommandUpdate); PlayingInfo = playingInfo; Mode = mode; }
/// <summary> /// 使用指定的定位點和移動物件建立介面物件 /// </summary> /// <param name="x">物件左上位置X</param> /// <param name="y">物件左上位置Y</param> /// <param name="width">物件寬度</param> /// <param name="height">物件高度</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectUIPanel(DirectionType anchor, int x, int y, int width, int height, DrawBase drawObject, MoveBase moveObject) : base(anchor, x, y, width, height, drawObject, moveObject) { UIObjects = new ObjectCollection(); }
/// <summary> /// 使用指定的配置新增虛擬物件,會逐漸縮小(放大)並淡出後消失 /// </summary> /// <param name="layout">配置資訊</param> /// <param name="fadeTime">淡出時間(毫秒),小於0為永久</param> /// <param name="finelScale">計時器結束時大小比例</param> /// <param name="finelOpacity">計時器結束時透明度</param> /// <param name="drawObject">繪製物件</param> /// <param name="moveObject">移動物件</param> public ObjectSmoke(LayoutSet layout, int fadeTime, float finelScale, float finelOpacity, DrawBase drawObject, MoveBase moveObject) : this(layout.CenterX, layout.CenterY, layout.RectWidth, layout.RectHeight, fadeTime, finelScale, finelOpacity, drawObject, moveObject) { }
public ObjectUINameSetting(DirectionType anchor, int x, int y, MoveBase moveObject) : base(anchor, x, y, 310, 125, new DrawUIFrame(Color.AliceBlue, Color.CornflowerBlue, 2, 20), moveObject) { Propertys.Add(new PropertyShadow(0, 6, 0.95F, 1)); // 玩家姓名 _DrawPlayerName = new DrawUITextScroll(Color.Maroon, Color.LightGray, Color.FromArgb(230, 255, 245), Color.CornflowerBlue, 1, 10, GlobalPlayer.PlayerName, new Font("細明體", 12), GlobalFormat.MiddleLeft, 120) { TextPadding = new Padding(10, 10, 0, 5) }; ObjectUI uiPlayerName = new ObjectUI(20, 60, 270, 40, _DrawPlayerName); // 重新選取 DrawUIText drawCommandBuildName = new DrawUIText(Color.CornflowerBlue, Color.Empty, Color.Empty, Color.Empty, 0, 0, "↻", new Font("標楷體", 22, FontStyle.Bold), GlobalFormat.MiddleCenter) { TextPadding = new Padding(0, 10, 0, 0) }; DrawUIText drawCommandBuildNameHover = new DrawUIText(Color.Orange, Color.Empty, Color.Empty, Color.Empty, 0, 0, "↻", new Font("標楷體", 22, FontStyle.Bold), GlobalFormat.MiddleCenter) { TextPadding = new Padding(0, 10, 0, 0) }; ObjectUI uiCommandBuildName = new ObjectUI(250, 60, 40, 40, drawCommandBuildName) { DrawObjectHover = drawCommandBuildNameHover }; DrawUIText drawCommandOK = new DrawUIText(Color.FromArgb(100, 220, 100), Color.Empty, Color.Empty, Color.Empty, 0, 0, "✔", new Font("微軟正黑體", 16, FontStyle.Bold), GlobalFormat.MiddleCenter); DrawUIText drawCommandOKHover = new DrawUIText(Color.FromArgb(0, 180, 0), Color.Empty, Color.Empty, Color.Empty, 0, 0, "✔", new Font("微軟正黑體", 16, FontStyle.Bold), GlobalFormat.MiddleCenter); _CommandOK = new ObjectUI(230, 15, 30, 30, drawCommandOK) { Visible = false, DrawObjectHover = drawCommandOKHover }; _CommandOK.Propertys.Add(new PropertyShadow(2, 2) { RFix = -0.5F, GFix = -0.5F, BFix = -0.5F, Opacity = 0.2F }); DrawUIText drawCommandClose = new DrawUIText(Color.FromArgb(255, 150, 150), Color.Empty, Color.Empty, Color.Empty, 0, 0, "✘", new Font("微軟正黑體", 16, FontStyle.Bold), GlobalFormat.MiddleCenter); DrawUIText drawCommandCloseHover = new DrawUIText(Color.FromArgb(255, 70, 70), Color.Empty, Color.Empty, Color.Empty, 0, 0, "✘", new Font("微軟正黑體", 16, FontStyle.Bold), GlobalFormat.MiddleCenter); _CommandClose = new ObjectUI(260, 15, 30, 30, drawCommandClose) { Visible = !string.IsNullOrWhiteSpace(GlobalPlayer.PlayerName), DrawObjectHover = drawCommandCloseHover }; _CommandClose.Propertys.Add(new PropertyShadow(2, 2) { RFix = -0.5F, GFix = -0.5F, BFix = -0.5F, Opacity = 0.2F }); uiPlayerName.Layout.Depend.Anchor = DirectionType.TopLeft; uiCommandBuildName.Layout.Depend.Anchor = DirectionType.TopLeft; _CommandOK.Layout.Depend.Anchor = DirectionType.TopLeft; _CommandClose.Layout.Depend.Anchor = DirectionType.TopLeft; uiCommandBuildName.Layout.Depend.SetObject(this); uiPlayerName.Layout.Depend.SetObject(this); _CommandOK.Layout.Depend.SetObject(this); _CommandClose.Layout.Depend.SetObject(this); uiCommandBuildName.Click += (s, e) => { _DrawPlayerName.Text = Function.GetRandName(); _CommandOK.Visible = true; }; _CommandOK.Click += (s, e) => { GlobalPlayer.PlayerName = _DrawPlayerName.Text; GlobalPlayer.WriteRegistry(); OnClose(); }; _CommandClose.Click += (s, e) => { OnClose(); }; UIObjects.Add(uiPlayerName); UIObjects.Add(uiCommandBuildName); UIObjects.Add(_CommandOK); UIObjects.Add(_CommandClose); }