/// <summary> /// ワープ先をEnterで変化 /// </summary> protected void WarpSetting() { if (asd.Engine.Keyboard.GetKeyState(asd.Keys.LeftShift) == asd.KeyState.Push || asd.Engine.Keyboard.GetKeyState(asd.Keys.RightShift) == asd.KeyState.Push) { var warp = WarpZone.WarpList.Find(w => w.Position == MakePos); if (warp == null) { return; } if (IsWarpSearching == false) { ModeText.Text = "ワープ先の位置選択"; WarpRoot = warp; IsWarpSearching = true; } //warp先を決定 else { ModeText.Text = "ワープ元の位置選択"; var warpRoot = WarpZone.WarpList.Find(w => w.Position == WarpRoot.Position); warpRoot.ChangeWarpPos(warp); IsWarpSearching = false; } } else if (asd.Engine.Keyboard.GetKeyState(asd.Keys.R) == asd.KeyState.Push) { ModeText.Text = ""; WarpRoot = null;//一応 IsWarpSearching = false; IsWarpSetting = false; } }
/// <summary> /// warpPotionの変化とかはこれを通して /// </summary> /// <param name="warp">ワープ先</param> public void ChangeWarpPos(WarpZone warp) { WarpPos = warp.Position; WarpID = warp.InstanceID; RemoveChild(WarpIDText); WarpIDText = new GeneralText(Position + Adjust * new asd.Vector2DF(0, Program.CellLarge), "→" + warp.InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(WarpIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); }
protected override void OnUpdated() { if (IsStageMaking) { PointX = (int)asd.Engine.Mouse.Position.X / CellLarge; PointY = (int)asd.Engine.Mouse.Position.Y / CellLarge; MakePos = new asd.Vector2DF(PointX * CellLarge + CellLarge / 2, PointY * CellLarge + CellLarge / 2); if (PositionCheck(MakePos) && !IsWarpSetting) { MakingCheck(); ChangeNum(); SelectedTexture.Position = MakePos; } else if (IsWarpSetting) { SelectedTexture.Position = new asd.Vector2DF(-300, -300);//画面外で見えなくすることで消した感じを出す WarpSetting(); } //ctrl+Sでセーブ if ((asd.Engine.Keyboard.GetKeyState(asd.Keys.LeftControl) == asd.KeyState.Hold || asd.Engine.Keyboard.GetKeyState(asd.Keys.RightControl) == asd.KeyState.Hold) && asd.Engine.Keyboard.GetKeyState(asd.Keys.S) == asd.KeyState.Push) { SaveStage(); } if (asd.Engine.Keyboard.GetKeyState(asd.Keys.Space) == asd.KeyState.Push) { TestPlay(); } } if (IsLoaded)//load後に一回だけ呼びたい { //ワープ先のろーでぃんぐみたいな処理 WarpZone.ChangeAllID(); foreach (var data in WarpData) { var warp = WarpZone.WarpList.Find(w => w.Position == new asd.Vector2DF(data[0] * CellLarge + CellLarge / 2, data[1] * CellLarge + CellLarge / 2)); warp.ChangeWarpPos(WarpZone.WarpList.Find(w => w.Position == new asd.Vector2DF(data[2] * CellLarge + CellLarge / 2, data[3] * CellLarge + CellLarge / 2))); } IsLoaded = false; } base.OnUpdated(); }