private void reset(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos) { if (Common.Instance.IsValidTarget(targetId)) { SelectedItem = TargetList[targetId]; } else { if (null == TargetList) { SelectedItem = null; } else if (TargetList.Length > 0) { SelectedItem = TargetList[0]; } else { SelectedItem = null; } } IsBlush = isBlush; Face = face; Costume = costume; Position = pos; }
private EditTargetAppear() { _faceList = new List <Sugarism.EFace>(); Array arr = Enum.GetValues(typeof(Sugarism.EFace)); foreach (var v in arr) { Sugarism.EFace item = (Sugarism.EFace)v; _faceList.Add(item); } _costumeList = new List <Sugarism.ECostume>(); arr = Enum.GetValues(typeof(Sugarism.ECostume)); foreach (var v in arr) { Sugarism.ECostume item = (Sugarism.ECostume)v; _costumeList.Add(item); } _posList = new List <Sugarism.EPosition>(); arr = Enum.GetValues(typeof(Sugarism.EPosition)); foreach (var v in arr) { Sugarism.EPosition item = (Sugarism.EPosition)v; _posList.Add(item); } }
// callback handler private void onCmdAppear(int characterId, Sugarism.EPosition position) { //InputPanel.Hide(); StoryCharacterPanel.Set(characterId, position); //Invoke(ON_TIMER_NAME, 0.1f); }
private void onCmdTargetAppear(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition position) { //InputPanel.Hide(); StoryCharacterPanel.Set(targetId, isBlush, face, costume, position); //Invoke(ON_TIMER_NAME, 0.1f); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((null == value) || (false == (value is Sugarism.EPosition))) { return(string.Empty); } Sugarism.EPosition pos = (Sugarism.EPosition)value; return(pos.ToString()); }
private EditAppear() { _posList = new List <Sugarism.EPosition>(); Array arr = Enum.GetValues(typeof(Sugarism.EPosition)); foreach (var v in arr) { Sugarism.EPosition item = (Sugarism.EPosition)v; _posList.Add(item); } }
/// <summary> /// Show View.Popup.EditAppear. /// </summary> /// <param name="characterId">Character Id before editing.</param> /// <param name="pos">Position before editing.</param> /// <returns>Whether edit or not.</returns> public bool Show(int characterId, Sugarism.EPosition pos) { reset(characterId, pos); View.Popup.EditAppear view = new View.Popup.EditAppear(this); bool?result = view.ShowDialog(); switch (result) { case true: return(true); default: return(false); } }
public void Set(int characterId, Sugarism.EPosition pos) { Hide(); if (false == ExtCharacter.IsValid(characterId)) { Log.Error(string.Format("invalid character Id; {0}", characterId)); return; } Character c = Manager.Instance.DT.Character[characterId]; setBaseShape(c.image); setBlush(false); setFaceExpression(false); setCostume(false); set(pos); Show(); }
private void set(Sugarism.EPosition pos) { float posX = 0.0f; float posY = _rect.anchoredPosition.y; float scale = 1.0f; switch (pos) { case Sugarism.EPosition.Middle: posX = 0.0f; scale = 1.0f; break; case Sugarism.EPosition.Left: posX -= DELTA_POS_X; scale = 1.0f; break; case Sugarism.EPosition.Right: posX += DELTA_POS_X; scale = 1.0f; break; case Sugarism.EPosition.Front: posX = 0.0f; scale += DELTA_SCALE; break; case Sugarism.EPosition.Back: posX = 0.0f; scale -= DELTA_SCALE; break; default: return; } _rect.anchoredPosition = new Vector2(posX, posY); _rect.localScale = new Vector2(scale, scale); }
private void reset(int characterId, Sugarism.EPosition pos) { if (Common.Instance.IsValidCharacter(characterId)) { SelectedItem = CharacterList[characterId]; } else { if (null == CharacterList) { SelectedItem = null; } else if (CharacterList.Length > 0) { SelectedItem = CharacterList[0]; } else { SelectedItem = null; } } Position = pos; }
public void Set(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos) { Hide(); if (false == ExtTarget.isValid(targetId)) { Log.Error(string.Format("invalid target id; {0}", targetId)); return; } Target target = Manager.Instance.DT.Target[targetId]; setBaseShape(target.baseShape); if (isBlush) { setBlush(target.blush); setBlush(target.blushPosX, target.blushPosY); } setBlush(isBlush); base.setFaceExpression(get(ref target, face)); setFaceExpression(target.faceExpPosX, target.faceExpPosY); setFaceExpression(true); base.setCostume(get(ref target, costume)); setCostume(true); set(pos); Show(); }
/// <summary> /// Show View.Popup.EditTargetAppear. /// </summary> /// <param name="targetId">Target Id before editing.</param> /// <param name="isBlush">IsBlush before editing</param> /// <param name="face">Face before editing.</param> /// <param name="costume">Costume before editing.</param> /// <param name="pos">Position before editing.</param> /// <returns>Whether edit or not.</returns> public bool Show(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos) { reset(targetId, isBlush, face, costume, pos); View.Popup.EditTargetAppear view = new View.Popup.EditTargetAppear(this); bool?result = view.ShowDialog(); switch (result) { case true: return(true); default: return(false); } }
public void Invoke(int characterId, Sugarism.EPosition position) { _event.Invoke(characterId, position); }
// default handler private void onCmdAppear(int characterId, Sugarism.EPosition position) { Log.Debug(string.Format("onCmdAppear; characterId({0}), pos({1})", characterId, position)); }
public void Invoke(int targetId, bool isBlush, Sugarism.EFace face , Sugarism.ECostume costume, Sugarism.EPosition position) { _event.Invoke(targetId, isBlush, face, costume, position); }
// default handler private void onCmdTargetAppear(int targetId, bool isBlush, Sugarism.EFace face , Sugarism.ECostume costume, Sugarism.EPosition position) { Log.Debug(string.Format("onCmdTargetAppear; targetId({0}, face({1}), blush({2}), costume({3}), pos({4})", targetId, face, isBlush, costume, position)); }