public bool SetFlag(FlagAction action, int uid, string flagString) { if (string.IsNullOrEmpty(SelectedMailboxName)) { Error = "Mailbox must be selected before STORE operation. (Account: " + Account.AccountName + ")"; Debug.WriteLine("ImapClient.SetFlag(): Mailbox is not selected. (Account: " + Account.AccountName + ")"); return(false); } string tag = NextTag(); string command = tag + " UID STORE " + uid + " " + ((action == FlagAction.Add) ? "+FLAGS" : "-FLAGS") + " (" + flagString + ")"; if (!SendString(command)) { Debug.WriteLine("ImapClient.SetFlag(): Unable to send command."); return(false); } string response; if (!ReadResponse(tag, out response)) { Debug.WriteLine("ImapClient.SetFlag(): Unable to read response."); return(false); } Trace.WriteLine(response); return(true); }
public void UpdateRefActionFlagInMsgChat() { for (int i = 0; i < Main.Count; i++) { var act = Main[i]; if (act.MsgboxChat != null) { foreach (var chat in act.MsgboxChat) { if (chat.MsgboxChoise != null) { foreach (var choise in chat.MsgboxChoise) { if (choise.Action != null && FlagActions.IndexOf(choise.Action) < 0) { var v = FlagAction.FindFlagAction(FlagActions, choise.Action.Name); if (v != null) { choise.Action = v; } } } } } } } }
protected void RenderFlagState(TextWriter writer) { FlagStatus flagStatus = this.DataSource.GetItemProperty <FlagStatus>(ItemSchema.FlagStatus, FlagStatus.NotFlagged); int itemProperty = this.DataSource.GetItemProperty <int>(ItemSchema.ItemColor, int.MinValue); bool flag = ObjectClass.IsTask(this.DataSource.GetItemClass()); if (flag) { if (this.DataSource.GetItemProperty <bool>(ItemSchema.IsComplete, false)) { flagStatus = FlagStatus.Complete; } else { flagStatus = FlagStatus.Flagged; } } if (flagStatus != FlagStatus.NotFlagged) { ExDateTime itemProperty2 = this.DataSource.GetItemProperty <ExDateTime>(ItemSchema.UtcDueDate, ExDateTime.MinValue); if (itemProperty2 != ExDateTime.MinValue) { writer.Write(" sFlgDt=\""); writer.Write(DateTimeUtilities.GetJavascriptDate(itemProperty2)); writer.Write("\""); } FlagAction flagActionForItem = FlagContextMenu.GetFlagActionForItem(base.UserContext, itemProperty2, flagStatus); writer.Write(" sFA="); writer.Write((int)flagActionForItem); if (itemProperty == -2147483648 && flagStatus == FlagStatus.Flagged && !flag) { writer.Write(" sFS=1"); } } }
public static void DoFlagAction(Flags flagsYaml, List <FlagAction> flagAction, FlagAction action) { if (flagsYaml == null) { return; } flagsYaml.ActionOperation(action); // Check Next ( add) DoFlagActionLoop(flagsYaml, flagAction, action.Next, 0); }
public static FlagAction FindFlagAction(List <FlagAction> flagAction, string key) { for (int k = 0; k < flagAction.Count; k++) { FlagAction f = flagAction[k]; if (f.Name == key) { return(f); } } return(null); }
public void UsingItem(PropertyChar p) { if (p.Count > 0) { p.Count = p.Count - 1; } FlagAction.DoFlagAction(TriggerGame.Instance.WorldFlag, AutoTileMap_Editor.Instance.MapsData.ListFlagAction, p.PropertyBase.ActionUsing); if (p.Count <= 0) { PropertysChar.Remove(p); } ShouldUpdateGUIContent = true; }
public static int IndextFlagAction(List <FlagAction> flagAction, string key) { if (flagAction == null) { return(-1); } if (key == null || key == "") { return(-1); } for (int k = 0; k < flagAction.Count; k++) { FlagAction f = flagAction[k]; if (f.Name == key) { return(k); } } return(-1); }
private void GoNextChoise(ScriptGui.MsgboxChoise choise, int countStack = 0) { // UI InputFieldHelper.Instance.HidePopupAction(); // InputFieldHelper.Instance.HideChatBottom(); // Logic var scriptGameMSG = mScriptGameMSG; // ResumeMainChar(); mScriptGameMSG = null; mMsgboxChat = null; //Check Action Flag if (choise.Action != null && choise.Action.Key != null && scriptGameMSG.Script.FlagActions.IndexOf(choise.Action) > 0 && scriptGameMSG.Flags != null && scriptGameMSG.Flags.ContainsKey(choise.Action.Key)) { FlagAction.DoFlagAction(scriptGameMSG.Flags, scriptGameMSG.Script.FlagActions, choise.Action); } scriptGameMSG.NextActionTo(choise.Next, countStack); }
public void GetFlagMenu() { ExDateTime defaultDate = DateTimeUtilities.GetLocalTime().Date; OwaStoreObjectId owaStoreObjectId = base.GetParameter("id") as OwaStoreObjectId; FlagAction flagAction = FlagAction.None; if (owaStoreObjectId != null) { using (Item item = Utilities.GetItem <Item>(base.UserContext, owaStoreObjectId, FlagEventHandler.prefetchProperties)) { ExDateTime property = ItemUtility.GetProperty <ExDateTime>(item, TaskSchema.DueDate, ExDateTime.MinValue); if (1601 < property.Year) { defaultDate = property; } flagAction = FlagContextMenu.GetFlagActionForItem(base.UserContext, item); } } FlagContextMenu flagContextMenu = new FlagContextMenu(base.UserContext, defaultDate, flagAction); flagContextMenu.Render(this.Writer); }
// Token: 0x06002126 RID: 8486 RVA: 0x000BE56E File Offset: 0x000BC76E public FlagContextMenu(UserContext userContext, ExDateTime defaultDate, FlagAction flagAction) : base("divFlgM", userContext) { this.defaultDate = defaultDate; this.flagAction = flagAction; }
private void DoAction(int scopeIndext, int countStack) { if (countStack > 24) { InputFieldHelper.Instance.ShowNoti(string.Format("Error at Script ({0}): : Over stack scope call!", IdxScript)); EndAction(); return; } ScriptGui.ActionData action = _scriptTarget.ActionDataAt(scopeIndext); switch (action.Format) { case ScriptGui.EFormatScope.End: { if (mIsMain) { Debug.Log("DoAction: End"); } EndAction(); return; } case ScriptGui.EFormatScope.Check: { if (mIsMain) { Debug.Log("DoAction: Check"); } var flagTarget = FlagByTarget(action.Check.Target); string flag = (action.Check.Flag != null ? action.Check.Flag : ""); if (flag == "" || flagTarget == null || flagTarget.ContainsKey(flag) == false) { InputFieldHelper.Instance.ShowNoti(string.Format("Error at Script ({0}): Not found flag {1}", IdxScript, flag)); EndAction(); return; } if (ScriptGui.Compare_A_B(flagTarget[flag], action.Check.Value, (ScriptGui.ECompare)action.Check.Compare)) { var t = action.Check.Right; NextActionTo(t, countStack + 1); } else { if (action.Check.SubCheck != null) { for (int i = 0; i < action.Check.SubCheck.Count; i++) { var subCheck = action.Check.SubCheck[i]; if (subCheck == null) { continue; } if (ScriptGui.Compare_A_B(flagTarget[flag], subCheck.Value, (ScriptGui.ECompare)subCheck.Compare)) { NextActionTo(subCheck.Right, countStack + 1); return; } } } var t = action.Check.Wrong; NextActionTo(t, countStack + 1); } return; } case ScriptGui.EFormatScope.Set: { if (mIsMain) { Debug.Log("DoAction: Set"); } var flagTarget = FlagByTarget(action.Set.Target); List <FlagAction> flagActions = ListFlagActionByTarget(action.Set.Target); FlagAction.DoFlagAction(flagTarget, flagActions, action.Set.Action); var t = action.Set.Next; NextActionTo(t, countStack + 1); return; } case ScriptGui.EFormatScope.MsgboxChat: { if (!mIsMain) { InputFieldHelper.Instance.ShowNoti(string.Format("Error at Script ({0}): Can't using Msg Box Chat on Sub Script", IdxScript)); EndAction(); return; } if (TriggerGame.Instance.MSG.ScriptGameMSG == null || TriggerGame.Instance.MSG.ScriptGameMSG == this) { Debug.Log("MsgboxChat, Name: " + action.Name + ", Index: " + scopeIndext); if (OBJTarget != null && OBJTarget.activeSelf) { AutoTileMap_Editor.Instance.RequestAgentFaceToNpc(OBJTarget, () => { TriggerGame.Instance.StartMsg(this, action, countStack); }); } else { TriggerGame.Instance.StartMsg(this, action, countStack); } } else { EndAction(); } return; } case ScriptGui.EFormatScope.NPC: { var npc = action.NPCAction; DoActionNPC(scopeIndext, countStack, npc); return; } case ScriptGui.EFormatScope.MainChar: { var mainAction = action.MainCharAction; if (!mIsMain) { InputFieldHelper.Instance.ShowNoti(string.Format("Error at Script ({0}): Can't control MainChar on Sub Script", IdxScript)); EndAction(); return; } switch (mainAction.Action) { case ScriptGui.MainCharAction.EAction.WaitMoveToPos: { InputFieldHelper.Instance.HidePopupAction(); InputFieldHelper.Instance.HideChatBottom(); AutoTileMap_Editor.Instance.ResetMainCamWithAni(() => { bool success = TriggerGame.Instance.WaitGoToCheckPoint(this, mainAction.x, mainAction.y, () => { TriggerGame.Instance.SetTip(""); // Next action var t = mainAction.Next; NextActionTo(t, 0); }); if (!success) { EndAction(); } }); break; } case ScriptGui.MainCharAction.EAction.WaitMoveToHouse: { if (mainAction.IdHouse < 0) { EndAction(); return; } InputFieldHelper.Instance.HidePopupAction(); InputFieldHelper.Instance.HideChatBottom(); AutoTileMap_Editor.Instance.ResetMainCamWithAni(() => { bool success = TriggerGame.Instance.WaitEnterHouse(this, mainAction, (int houseIdx) => { // Next action TriggerGame.Instance.SetTip(""); var t = mainAction.Next; NextActionTo(t, 0); }); if (!success) { EndAction(); } }); break; } case ScriptGui.MainCharAction.EAction.WaitInteractionsNPC: { if (mainAction.IdNpc < 0) { EndAction(); return; } InputFieldHelper.Instance.HidePopupAction(); InputFieldHelper.Instance.HideChatBottom(); AutoTileMap_Editor.Instance.ResetMainCamWithAni(() => { bool success = TriggerGame.Instance.WaitInteractionNPC(this, mainAction, (int r) => { // Next action TriggerGame.Instance.SetTip(""); var t = mainAction.Next; NextActionTo(t, 0); return(true); }); if (!success) { EndAction(); } }); break; } case ScriptGui.MainCharAction.EAction.RewardItem: { PropertysGame.Instance.AddItem(AutoTileMap_Editor.Instance.MapsData.Propertys, mainAction.SlugItem); TriggerGame.Instance.SetTip(""); var t = mainAction.Next; NextActionTo(t, 0); return; } case ScriptGui.MainCharAction.EAction.CheckItem: { if (PropertysGame.Instance.IsHaveItem(mainAction.SlugItem)) { NextActionTo(mainAction.Next, 0); } else { NextActionTo(mainAction.Wrong, 0); } return; } case ScriptGui.MainCharAction.EAction.BuyItem: { SerializablePackages.Package package = AutoTileMap_Editor.Instance.MapsData.Packages.PackageBySlug(mainAction.SlugPackage); if (package == null) { EndAction(); } else { // TriggerGame.Instance.StopMainChar(); TriggerGame.Instance.ResetLogChat(); var lastAction = action; ShopGame.Instance.ShowWithData(AutoTileMap_Editor.Instance.MapsData.Propertys, package, () => { // Close dialog NextActionTo(mainAction.Wrong, 0); }, (ControlShop pm) => { // If buy something if (mainAction.Next == null || mainAction.Next == lastAction) { // Try buy orther InputFieldHelper.Instance.ShowChatBottom("Continue shopping?", false, (TypingEffectByLine ty) => { pm.contentPane.visible = true; }); } else { NextActionTo(mainAction.Next, 0); } }); } return; } case ScriptGui.MainCharAction.EAction.WarpTo: { EndAction(); var triggerRef = mainAction.IdWarp; if (triggerRef >= 0 && triggerRef < AutoTileMap_Editor.Instance.MapSelect.WarpsData.Count) { var w = AutoTileMap_Editor.Instance.MapSelect.WarpsData[triggerRef]; Debug.Log("GoTo: " + w.map + "_" + w.x + "_" + w.y); AutoTileMap_Editor.Instance.WarpsTo(w.map, w.x, w.y); // AutoTileMap_Editor.Instance.SetModePlay(true, w.map); } return; } default: { EndAction(); return; } } if (mainAction.Tip != "") { TriggerGame.Instance.SetTip(mainAction.Tip); } break; } default: { EndAction(); break; } } }
public void ActionOperation(FlagAction action) { if (string.IsNullOrEmpty(action.Key)) { return; } string key = action.Key; if (this.ContainsKey(key) == false) { return; } // int operation = action.Operation; // int value = action.Value; ScriptGui.EOperation o = (ScriptGui.EOperation)action.Operation; // if( o == ScriptGui.EOperation.Divi && value == 0){ // InputFieldHelper.Instance.ShowNoti( "Error: Can't division with zero"); // return; // } switch (o) { case ScriptGui.EOperation.Set: { this[key] = action.Value; break; } case ScriptGui.EOperation.Add: { this[key] = this[key] + action.Value; break; } case ScriptGui.EOperation.Sub: { this[key] = this[key] - action.Value; break; } case ScriptGui.EOperation.Multi: { this[key] = this[key] * action.Value; break; } case ScriptGui.EOperation.Divi: { if (action.Value == 0) { this[key] = 0; } else { this[key] = this[key] / action.Value; } break; } case ScriptGui.EOperation.Add_A_B: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { this[key] = this[action.KeyA] + this[action.KeyB]; } break; } case ScriptGui.EOperation.Sub_A_B: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { this[key] = this[action.KeyA] - this[action.KeyB]; } break; } case ScriptGui.EOperation.Multi_A_B: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { this[key] = this[action.KeyA] * this[action.KeyB]; } break; } case ScriptGui.EOperation.Divi_A_B: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { var vB = this[action.KeyB]; if (vB == 0) { this[key] = 0; } else { this[key] = this[action.KeyA] / vB; } } break; } case ScriptGui.EOperation.Divi_A_B_1: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { var vB = this[action.KeyB]; if (vB == 0) { this[key] = 0; } else { this[key] = this[action.KeyA] * 100 / vB; } } break; } case ScriptGui.EOperation.Divi_A_B_2: { if (action.KeyA != null && action.KeyB != null && this.ContainsKey(action.KeyA) && this.ContainsKey(action.KeyB)) { var vA = this[action.KeyA]; var vB = this[action.KeyB]; if (vA + vB == 0) { this[key] = 0; } else { this[key] = vA * 100 / (vA + vB); } } break; } default: { break; } } _onValueCharge(key); }
public bool SetFlag(FlagAction action, int uid, string flagString) { if (string.IsNullOrEmpty(SelectedMailboxName)) { Error = "Mailbox must be selected before STORE operation. (Account: " + Account.AccountName + ")"; Debug.WriteLine("ImapClient.SetFlag(): Mailbox is not selected. (Account: " + Account.AccountName + ")"); return false; } string tag = NextTag(); string command = tag + " UID STORE " + uid + " " + ((action == FlagAction.Add) ? "+FLAGS" : "-FLAGS") + " (" + flagString + ")"; if (!SendString(command)) { Debug.WriteLine("ImapClient.SetFlag(): Unable to send command."); return false; } string response; if (!ReadResponse(tag, out response)) { Debug.WriteLine("ImapClient.SetFlag(): Unable to read response."); return false; } Trace.WriteLine(response); return true; }
public void MapOnGUI(TilesetAON tilesetAON, AutoTileMapSerializeData d, AutoTileMap autoTileMap, AComponent_Button.OnClick closeDialog) { float W_ScopeList = 200; float yGui = 0f; Rect rectMenuLeft = new Rect(0, 0, W_ScopeList, Screen.height); AONGUI.Box(rectMenuLeft, "", tilesetAON.ListStyleBlack); { Rect rect = new Rect(0, 0, W_ScopeList, Screen.height); yGui = 4f; AONGUI.Box(rect, "", tilesetAON.ListStyleBlack); AONGUI.Button(new Rect(4, yGui, 45, 26), "Back", closeDialog); AONGUI.Label(new Rect(54, yGui, W_ScopeList - 54, 26), "Map edit"); yGui += 32f; OnGUIMenuLeft(tilesetAON, ref yGui, rectMenuLeft); } Rect rectContent = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); AONGUI.Box(rectContent, ""); yGui = 0f; if (mMenuLeft == EMenuLeft.General) { OnGuiGeneral(tilesetAON, autoTileMap, rectContent); } else if (mMenuLeft == EMenuLeft.FlagMap) { FlagGui.DisOnGUI(d.FlagMap, ref yGui, rectContent, null, tilesetAON.ListStyleBlack2, "Flag map edit :"); } else if (mMenuLeft == EMenuLeft.Action) { // OnGUITriggerList(tilesetAON, d, eSlotAonTypeObj.Warps, DefineAON.IdSlot_Warps, ref yGui, rectContent); if (d.ListFlagAction == null) { d.ListFlagAction = new List <FlagAction>(); } if (d.ListFlagAction.Count == 0) { d.ListFlagAction.Add(new FlagAction()); } d.ListFlagAction[0].Name = ""; d.ListFlagAction[0].Key = ""; d.ListFlagAction[0].Value = 0; Rect rect = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); bool isWaitUI = false; if (FlagAction.OnGUIFlagActionList(ref yGui, ref isWaitUI, rectContent, d.ListFlagAction, d.FlagMap, tilesetAON.ListStyleBlack2)) { return; } } else if (mMenuLeft == EMenuLeft.Warp) { OnGUITriggerList(tilesetAON, d, eSlotAonTypeObj.Warps, DefineAON.IdSlot_Warps, ref yGui, rectContent); } else if (mMenuLeft == EMenuLeft.NPC) { OnGUITriggerList(tilesetAON, d, eSlotAonTypeObj.Person, DefineAON.IdSlot_NPC, ref yGui, rectContent); } else if (mMenuLeft == EMenuLeft.Script) { OnGUITriggerList(tilesetAON, d, eSlotAonTypeObj.Script, DefineAON.IdSlot_Script, ref yGui, rectContent); } // float yGui = 0f; // bool isUpdateFlag = FlagGui.DisOnGUI( ref d.FlagMap, ref yGui, rect, null, tilesetAON.ListStyleBlack2, "Flag map edit :"); }
public void FlagItem() { FlagAction flagAction = (FlagAction)base.GetParameter("flga"); ExDateTime?dueDate = null; if (flagAction == FlagAction.SpecificDate) { if (!base.IsParameterSet("ddt")) { throw new OwaInvalidRequestException("Due date must be provided if specifying a specific due date"); } dueDate = new ExDateTime?((ExDateTime)base.GetParameter("ddt")); } using (Item item = this.GetItem()) { MessageItem messageItem = item as MessageItem; if (messageItem != null && messageItem.IsDraft) { throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(804173896)); } switch (flagAction) { case FlagAction.MarkComplete: FlagEventHandler.FlagComplete(item); break; case FlagAction.ClearFlag: FlagEventHandler.ClearFlag(item); break; default: dueDate = FlagEventHandler.SetFlag(item, flagAction, dueDate); break; } Utilities.SaveItem(item); PropertyDefinition[] properties = new PropertyDefinition[] { ItemSchema.FlagStatus, ItemSchema.FlagCompleteTime, MessageItemSchema.ReplyTime }; item.Load(properties); InfobarMessage flag = InfobarMessageBuilder.GetFlag(item, base.UserContext); this.Writer.Write("var sIBMsg = \""); if (flag != null) { StringBuilder stringBuilder = new StringBuilder(); StringWriter stringWriter = new StringWriter(stringBuilder); Infobar.RenderMessage(stringWriter, flag, base.UserContext); stringWriter.Close(); Utilities.JavascriptEncode(stringBuilder.ToString(), this.Writer); } this.Writer.Write("\";"); this.Writer.Write("a_sId = \""); Utilities.JavascriptEncode(Utilities.GetIdAsString(item), this.Writer); this.Writer.Write("\";"); this.Writer.Write("a_sCK = \""); Utilities.JavascriptEncode(item.Id.ChangeKeyAsBase64String(), this.Writer); this.Writer.Write("\";"); this.Writer.Write("var dtDD = "); if (dueDate != null) { this.Writer.Write("new Date(\""); this.Writer.Write(DateTimeUtilities.GetJavascriptDate(dueDate.Value)); this.Writer.Write("\");"); } else { this.Writer.Write("0;"); } } }
// Token: 0x06002E13 RID: 11795 RVA: 0x001065BC File Offset: 0x001047BC public static ExDateTime?SetFlag(Item item, FlagAction flagAction, ExDateTime?dueDate) { UserContext userContext = UserContextManager.GetUserContext(); ExDateTime? exDateTime = null; ExDateTime date = DateTimeUtilities.GetLocalTime().Date; int dayOfWeek = DateTimeUtilities.GetDayOfWeek(userContext, date); item.TryGetProperty(ItemSchema.FlagStatus); FlagStatus flagStatus = ItemUtility.GetProperty <FlagStatus>(item, ItemSchema.FlagStatus, FlagStatus.NotFlagged); Task task = item as Task; if (task != null && task.IsComplete) { flagStatus = FlagStatus.Complete; } if (flagAction == FlagAction.Default && flagStatus != FlagStatus.Complete) { flagAction = userContext.UserOptions.FlagAction; } switch (flagAction) { case FlagAction.Default: exDateTime = ItemUtility.GetProperty <ExDateTime?>(item, ItemSchema.UtcStartDate, null); dueDate = ItemUtility.GetProperty <ExDateTime?>(item, ItemSchema.UtcDueDate, null); break; case FlagAction.Today: dueDate = new ExDateTime?(date); dueDate = (exDateTime = dueDate); break; case FlagAction.Tomorrow: dueDate = new ExDateTime?(date.IncrementDays(1)); dueDate = (exDateTime = dueDate); break; case FlagAction.ThisWeek: { int num = 7 - dayOfWeek; int value = 2; if (0 < num && num <= 2) { value = num - 1; } exDateTime = new ExDateTime?(date.IncrementDays(value)); while (date < exDateTime && !DateTimeUtilities.IsWorkingDay(exDateTime.Value, userContext.WorkingHours.WorkDays)) { exDateTime = new ExDateTime?(exDateTime.Value.IncrementDays(-1)); } if (num == 0) { num = 7; } dueDate = new ExDateTime?(date.IncrementDays(num - 1)); while (exDateTime < dueDate) { if (DateTimeUtilities.IsWorkingDay(dueDate.Value, userContext.WorkingHours.WorkDays)) { break; } dueDate = new ExDateTime?(dueDate.Value.IncrementDays(-1)); } break; } case FlagAction.NextWeek: { int num2 = 7 - dayOfWeek; if (num2 == 0) { num2 = 7; } exDateTime = new ExDateTime?(date.IncrementDays(num2)); int num3 = 0; while (num3 < 7 && !DateTimeUtilities.IsWorkingDay(exDateTime.Value, userContext.WorkingHours.WorkDays)) { exDateTime = new ExDateTime?(exDateTime.Value.IncrementDays(1)); num3++; } int num4 = 7 - DateTimeUtilities.GetDayOfWeek(userContext, exDateTime.Value); if (num4 == 7) { num4 = 6; } dueDate = new ExDateTime?(exDateTime.Value.IncrementDays(num4)); while (exDateTime < dueDate) { if (DateTimeUtilities.IsWorkingDay(dueDate.Value, userContext.WorkingHours.WorkDays)) { break; } dueDate = new ExDateTime?(dueDate.Value.IncrementDays(-1)); } break; } case FlagAction.SpecificDate: exDateTime = dueDate; break; } if (task != null) { task.StartDate = exDateTime; task.DueDate = dueDate; if (task.Status == TaskStatus.Completed) { TaskUtilities.SetIncomplete(task, TaskStatus.InProgress); } } else { item.SetFlag(LocalizedStrings.GetNonEncoded(-1950847676), exDateTime, dueDate); } return(dueDate); }
private bool OnGuiBot(SerializablePropertys data, List <FlagAction> listFlagAction, TilesetAON tilesetAON, Rect rect) { if (data == null) { return(false); } float yGui = rect.y + 4; float widthLeft = 200; AONGUI.Label(new Rect(rect.x + 4, yGui + DefineAON.GUI_Y_Label, widthLeft, DefineAON.GUI_Height_Label), "Edit property:"); yGui += 32f; { comboBoxSlug.UpdateListContent(data.AllKey); comboBoxSlug.Empty = "Not selected"; comboBoxSlug.SelectedItemIndex = slugIndext; comboBoxSlug.Rect.x = rect.x; comboBoxSlug.Rect.y = yGui; comboBoxSlug.Rect.width = widthLeft; comboBoxSlug.Rect.height = 32f; comboBoxSlug.Show(rect.height - yGui, "defause", true, false, (int next) => { slugIndext = next; }); } // if(comboBoxSlug.IsDropDownListVisible){ // return true; // } yGui = rect.y + 4; rect.x = rect.x + widthLeft + 4; if (slugIndext < 0 || slugIndext >= data.AllKey.Count) { return(true); } AONGUI.Button(new Rect(rect.x, yGui + DefineAON.GUI_Y_Button, 120, DefineAON.GUI_Height_Button), "Remove by slug", () => { data.Remove(slugIndext); }); SerializablePropertys.Property property = data.PropertyByIndex(slugIndext); AONGUI.Button(new Rect(rect.x + 130, yGui + DefineAON.GUI_Y_Button, 120, DefineAON.GUI_Height_Button), "Duplicate by slug", () => { var n = data.Copy(slugIndext); if (n >= 0) { slugIndext = n; } }); yGui += 32f; AONGUI.Label(new Rect(rect.x, yGui + DefineAON.GUI_Y_Label, 40, DefineAON.GUI_Height_Label), "Name"); AONGUI.TextField(new Rect(rect.x + 40, yGui + DefineAON.GUI_Y_TextField, widthLeft - 40, DefineAON.GUI_Height_TextField), property.Name, (string text) => { property.Name = text; }); yGui += 32f; AONGUI.Label(new Rect(rect.x, yGui + DefineAON.GUI_Y_Label, 40, DefineAON.GUI_Height_Label), "Des"); AONGUI.TextField(new Rect(rect.x + 40, yGui + DefineAON.GUI_Y_TextField, widthLeft - 40, DefineAON.GUI_Height_TextField), property.Des, (string text) => { property.Des = text; }); yGui += 32f; string[] strType = SerializablePropertys.StrEType; AONGUI.SelectionGrid(new Rect(rect.x, yGui, rect.width, 24f), (int)property._Type, strType, strType.Length, tilesetAON.ListStyleGrid, (int next) => { var tNext = (SerializablePropertys.EType)next; if (tNext != property._Type) { property._Type = tNext; } }); yGui += 32f; // if(property.IsItem){ // property.StackInBag = GUI.Toggle(new Rect( rect.x, yGui + DefineAON.GUI_Y_Label, widthLeft, DefineAON.GUI_Height_Label ), property.StackInBag, "Can Stack in bag"); // yGui += 32f; // } // property.CanEquip = GUI.Toggle(new Rect( rect.x, yGui + DefineAON.GUI_Y_Label, widthLeft, DefineAON.GUI_Height_Label ), property.CanEquip, " Can Equip"); if (property.IsOutfit) { // float xGui = rect.x + widthLeft + 4; float xGui = rect.x; AONGUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_Label, 60, DefineAON.GUI_Height_Label), "Item :"); xGui += 60; string[] str = AutoTileMap_Editor.Instance.ItemCharData.StrItemList; var combobox = ComboBoxHelper.Instance.StringN(str); var hash = "item"; int currentItem = ComboBoxHelper.Instance.IndextOfStringN(str, property.RefSlug); if (currentItem == -1) { if (property.RefSlug != null && property.RefSlug != "") { combobox.Empty = property.RefSlug + " (not found)"; } else { combobox.Empty = "NULL"; } } combobox.SelectedItemIndex = currentItem; combobox.Rect.x = xGui; combobox.Rect.y = yGui; combobox.Rect.width = widthLeft; combobox.Rect.height = 32f; float limitHeight = 32f * 6; combobox.Show(limitHeight, hash, (int nextItem) => { property.RefSlug = str[nextItem]; }); if (combobox.IsDropDownWithHash(hash)) { yGui += limitHeight; return(false); } yGui += 32f; } // property.CanUsing = GUI.Toggle(new Rect( rect.x, yGui + DefineAON.GUI_Y_Label, widthLeft, DefineAON.GUI_Height_Label ), property.CanUsing, " Can Using"); if (property.IsItem) { // float xGui = rect.x + widthLeft + 4; float xGui = rect.x; AONGUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_Label, 60, DefineAON.GUI_Height_Label), "Action :"); xGui += 60; var combobox = ComboBoxHelper.Instance.FlagAction(listFlagAction); var hash = "property"; int currentFlagAction = FlagAction.IndextFlagAction(listFlagAction, property.ActionUsing); if (currentFlagAction == -1) { if (property.ActionUsing != null && property.ActionUsing != "") { combobox.Empty = property.ActionUsing + " (not found)"; } else { combobox.Empty = "NULL"; } } combobox.SelectedItemIndex = currentFlagAction; combobox.Rect.x = xGui; combobox.Rect.y = yGui; combobox.Rect.width = widthLeft; combobox.Rect.height = 32f; float limitHeight = 32f * 6; combobox.Show(limitHeight, hash, (int nextAction) => { property.ActionUsing = listFlagAction[nextAction].Name; }); if (combobox.IsDropDownWithHash(hash)) { yGui += limitHeight; return(false); } yGui += 32f; } // property.Consume = GUI.Toggle(new Rect( rect.x, yGui + DefineAON.GUI_Y_Label, widthLeft, DefineAON.GUI_Height_Label ), property.Consume, "Consumable"); // yGui += 32f; if (property.IsPet) { AONGUI.Label(new Rect(rect.x, yGui + DefineAON.GUI_Y_Label, 40, DefineAON.GUI_Height_Label), "Pet"); AONGUI.TextField(new Rect(rect.x + 40, yGui + DefineAON.GUI_Y_TextField, widthLeft - 40, DefineAON.GUI_Height_TextField), property.RefSlug, (string text) => { property.RefSlug = text; }); AONGUI.Button(new Rect(rect.x + widthLeft + 10, yGui + DefineAON.GUI_Y_TextField, 40, DefineAON.GUI_Height_TextField), "Pick", () => { InputFieldHelper.Instance.ShowPickModel((string topic, string pet) => { Debug.Log(topic + "/" + pet); property.RefSlug = topic + "/" + pet; InputFieldHelper.Instance.HidePickModel(); }); }); yGui += 32f; } if (property.IsItem || property.IsCertificates) { AONGUI.Label(new Rect(rect.x, yGui + DefineAON.GUI_Y_Label, 40, DefineAON.GUI_Height_Label), "Icon"); AONGUI.TextField(new Rect(rect.x + 40, yGui + DefineAON.GUI_Y_TextField, widthLeft - 40, DefineAON.GUI_Height_TextField), property.RefIcon, (string text) => { property.RefIcon = text; }); AONGUI.Button(new Rect(rect.x + widthLeft + 10, yGui + DefineAON.GUI_Y_TextField, 40, DefineAON.GUI_Height_TextField), "Pick", () => { InputFieldHelper.Instance.ShowPickIcon((string topic, string icon) => { // Debug.Log(topic + "/" + icon); property.RefIcon = topic + "/" + icon; InputFieldHelper.Instance.HidePickIcon(); }); }); yGui += 32f; } return(false); }
public static bool OnGUIFlagActionList(ref float yGui, ref bool waitUI, Rect rect, List <FlagAction> flagAction, Flags flagsYaml, GUIStyle backgroundTop) { if (backgroundTop != null) { float height_top = 68; AONGUI.Box(new Rect(rect.x, rect.y, rect.width, height_top), "", backgroundTop); } AONGUI.Label(new Rect(rect.x + 4, yGui + DefineAON.GUI_Y_Label, rect.width, DefineAON.GUI_Height_Label), "Action flag edit :"); yGui += 32f; { //Add Key float xGui = rect.x + 4; AONGUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_Label, 90, DefineAON.GUI_Height_Label), "Slug action"); xGui += 94; AONGUI.TextField(new Rect(xGui, yGui + DefineAON.GUI_Y_TextField, 200, DefineAON.GUI_Height_TextField), NameAdd, (string text) => { NameAdd = text; }); xGui += 204; if (NameAdd.Length == 0) { } else { bool isUnique = (IndextFlagAction(flagAction, NameAdd) == -1); if (isUnique) { AONGUI.Button(new Rect(xGui, yGui + DefineAON.GUI_Y_Button, 40, DefineAON.GUI_Height_Button), "Add", () => { flagAction.Add(new FlagAction() { Name = NameAdd }); NameAdd = ""; }); } else { AONGUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_Label, 200, DefineAON.GUI_Height_Label), "Slug should be unique"); } } yGui += 32f; } float size_sub_remove = 70; float size_next = 120; float size_o = 80; float size_v = 50; float size_text = (rect.width - size_sub_remove - size_v - size_o - size_next - 8) / 2; for (int k = 0; k < flagAction.Count; k++) { if (k == 0) { yGui += 32f; continue; } float xGui = rect.x + 4; FlagAction f = flagAction[k]; /* * if(k > 0){ * var name_next = GUI.TextField(new Rect(xGui, yGui + DefineAON.GUI_Y_TextField, size_text - 4, DefineAON.GUI_Height_TextField), f.Name, 25); * if(name_next != f.Name){ * f.Name = name_next; * return true; * } * }else{ * GUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_TextField, size_text - 4, DefineAON.GUI_Height_TextField), f.Name); * } */ if (k == 1) { AONGUI.Label(new Rect(xGui, yGui - 25, size_next, 24), "Slug:"); } AONGUI.Label(new Rect(xGui, yGui + DefineAON.GUI_Y_TextField, size_text - 4, DefineAON.GUI_Height_TextField), f.Name); xGui += size_text; if (k == 1) { AONGUI.Label(new Rect(xGui, yGui - 25, size_next, 24), "Flag:"); } { var comboBoxFlags = FlagGui.Instance.UpdateFlagsData(flagsYaml, f.Key); int index_key = FlagGui.Instance.IndexOfKey(f.Key); comboBoxFlags.SelectedItemIndex = index_key; comboBoxFlags.Rect.x = xGui; comboBoxFlags.Rect.y = yGui; comboBoxFlags.Rect.width = size_text - 4; comboBoxFlags.Rect.height = 32f; // float limitHeight = rect.height - yGui - 32; float limitHeight = 32 * 6f; comboBoxFlags.Show(limitHeight, k.ToString(), (int flagNext) => { f.Key = FlagGui.Instance.KeyFromIndex(flagNext); }); if (comboBoxFlags.IsDropDownWithHash(k.ToString())) { yGui += limitHeight; waitUI = true; return(false); } } xGui += size_text; { //Operation int current = f.Operation; var comboBoxOperation = ComboBoxHelper.Instance.Operation(); comboBoxOperation.SelectedItemIndex = current; comboBoxOperation.Rect.x = xGui; comboBoxOperation.Rect.y = yGui; comboBoxOperation.Rect.width = size_o - 4; comboBoxOperation.Rect.height = 32f; float limitHeight = 32f * comboBoxOperation.ListContent.Length; comboBoxOperation.Show(limitHeight, k.ToString(), false, (int next) => { f.Operation = next; }); if (comboBoxOperation.IsDropDownWithHash(k.ToString())) { yGui += limitHeight; waitUI = true; return(false); } } float xGuiOperation = xGui; xGui += size_o; bool isHasInputValue = f.Operation < (int)AON.RpgMapEditor.ScriptGui.EOperation.Add_A_B; { if (isHasInputValue) { AONGUI.TextField(new Rect(xGui, yGui + DefineAON.GUI_Y_TextField, size_v - 10, DefineAON.GUI_Height_TextField), f.Value.ToString(), 25, (string text) => { f.Value = UtilsAON.StrToIntDef(text); }); } xGui += size_v; { //Next ( add) Action if (k == 1) { AONGUI.Label(new Rect(xGui + 10, yGui - 25, size_next, 24), "Add action:"); } var combobox = ComboBoxHelper.Instance.FlagAction(flagAction); var hash = k.ToString(); int currentFlagAction = FlagAction.IndextFlagAction(flagAction, f.Next); if (currentFlagAction == -1) { if (f.Next != null && f.Next != "") { combobox.Empty = f.Next + " (not found)"; } else { combobox.Empty = "NULL"; } } combobox.SelectedItemIndex = currentFlagAction; combobox.Rect.x = xGui + 10; combobox.Rect.y = yGui + 2; combobox.Rect.width = size_next - 20; combobox.Rect.height = 32f; float limitHeight = 32f * 6; combobox.Show(limitHeight, hash, (int nextAction) => { f.Next = flagAction[nextAction].Name; }); if (combobox.IsDropDownWithHash(hash)) { yGui += limitHeight; waitUI = true; return(false); } xGui += size_next; } AONGUI.Button(new Rect(xGui, yGui + DefineAON.GUI_Y_Button, size_sub_remove - 4, DefineAON.GUI_Height_Button), "Remove", () => { flagAction.RemoveAt(k); }); } /* * xGui += size_sub_e; * if(GUI.Button( new Rect(xGui, yGui + DefineAON.GUI_Y_Button, size_sub_e - 4, DefineAON.GUI_Height_Button), " + ")){ * FlagAction.Insert(k + 1, new FlagAction()); * return true; * } */ if (!isHasInputValue) { yGui += 32f; // float size_ab = (rect.x + rect.width - xGuiOperation - size_sub_remove) / 2; float size_ab = size_o + size_v; xGui = xGuiOperation; AONGUI.Label(new Rect(xGui - size_text, yGui, size_text, DefineAON.GUI_Height_Label), "= " + AON.RpgMapEditor.ScriptGui.StrEOperation[f.Operation]); AONGUI.Label(new Rect(xGui - 25, yGui, 20, DefineAON.GUI_Height_Label), "a ="); { string hash = "a" + k; var comboBoxFlags = FlagGui.Instance.UpdateFlagsData(flagsYaml, f.KeyA); int index_a = FlagGui.Instance.IndexOfKey(f.KeyA); comboBoxFlags.SelectedItemIndex = index_a; comboBoxFlags.Rect.x = xGui; comboBoxFlags.Rect.y = yGui; comboBoxFlags.Rect.width = size_ab; comboBoxFlags.Rect.height = 32f; // float limitHeight = rect.height - yGui - 32; float limitHeight = 32 * 6f; comboBoxFlags.Show(limitHeight, hash, (int flagNext) => { f.KeyA = FlagGui.Instance.KeyFromIndex(flagNext); }); if (comboBoxFlags.IsDropDownWithHash(hash)) { yGui += limitHeight; waitUI = true; return(false); } } // xGui += size_ab; yGui += 32f; AONGUI.Label(new Rect(xGui - 25, yGui, 20, DefineAON.GUI_Height_Label), "b = "); { string hash = "b" + k; var comboBoxFlags = FlagGui.Instance.UpdateFlagsData(flagsYaml, f.KeyB); int index_b = FlagGui.Instance.IndexOfKey(f.KeyB); comboBoxFlags.SelectedItemIndex = index_b; comboBoxFlags.Rect.x = xGui; comboBoxFlags.Rect.y = yGui; comboBoxFlags.Rect.width = size_ab; comboBoxFlags.Rect.height = 32f; // float limitHeight = rect.height - yGui - 32; float limitHeight = 32 * 6f; comboBoxFlags.Show(limitHeight, hash, (int flagNext) => { f.KeyB = FlagGui.Instance.KeyFromIndex(flagNext); }); if (comboBoxFlags.IsDropDownWithHash(hash)) { yGui += limitHeight; waitUI = true; return(false); } // var if_a_next = GUI.TextField(new Rect(rect.x + xGui, yGui + 32 - heighTextField, _w, heighTextField), if_a, 25); } yGui += 32f; yGui += 16f; } else { yGui += 32f; } } return(false); }
// Token: 0x06001F51 RID: 8017 RVA: 0x000B43CC File Offset: 0x000B25CC private void RenderConversationMetaDataExpandos(TextWriter writer, int globalCount, IList <StoreObjectId> itemIds) { base.InternalRenderItemMetaDataExpandos(writer); int itemProperty = this.DataSource.GetItemProperty <int>(ConversationItemSchema.ConversationUnreadMessageCount, 0); writer.Write(" "); writer.Write("iUC"); writer.Write("="); writer.Write(itemProperty); int itemProperty2 = this.DataSource.GetItemProperty <int>(ConversationItemSchema.ConversationMessageCount, 0); writer.Write(" "); writer.Write("iTC"); writer.Write("="); writer.Write(itemProperty2); writer.Write(" "); writer.Write("iGC"); writer.Write("="); writer.Write(globalCount); if (itemIds.Count > 0) { writer.Write(" "); writer.Write("sMID"); writer.Write("=\""); Utilities.HtmlEncode(Utilities.GetItemIdString(itemIds[0], this.parentFolderId), writer); writer.Write("\""); } if (globalCount == 1) { string[] itemProperty3 = this.DataSource.GetItemProperty <string[]>(ConversationItemSchema.ConversationGlobalMessageClasses, null); if (base.UserContext.DraftsFolderId.Equals(this.parentFolderId.StoreObjectId)) { writer.Write(" "); writer.Write("sMS"); writer.Write("=\"Draft\""); } writer.Write(" "); writer.Write("sMT"); writer.Write("=\""); Utilities.HtmlEncode(itemProperty3[0], writer); writer.Write("\""); if (ObjectClass.IsMeetingRequest(itemProperty3[0])) { writer.Write(" fMR=1"); writer.Write(" fRR=1"); } } if (itemProperty > 0) { writer.Write(" "); writer.Write("read"); writer.Write("=\"0\""); } FlagStatus itemProperty4 = (FlagStatus)this.DataSource.GetItemProperty <int>(ConversationItemSchema.ConversationFlagStatus, 0); if (itemProperty4 != FlagStatus.NotFlagged) { ExDateTime itemProperty5 = this.DataSource.GetItemProperty <ExDateTime>(ConversationItemSchema.ConversationFlagCompleteTime, ExDateTime.MinValue); if (itemProperty5 != ExDateTime.MinValue) { writer.Write(" sFlgDt=\""); writer.Write(DateTimeUtilities.GetJavascriptDate(itemProperty5)); writer.Write("\""); } FlagAction flagActionForItem = FlagContextMenu.GetFlagActionForItem(base.UserContext, itemProperty5, itemProperty4); writer.Write(" sFA="); writer.Write((int)flagActionForItem); } if (this.RenderLastModifiedTime) { base.RenderLastModifiedTimeExpando(writer); } }
public void WorldOnGUI(TilesetAON tilesetAON, AutoTileMapData d, AComponent_Button.OnClick onCloseDialog) { // Rect rect Rect rectFull = new Rect(0, 0, Screen.width, Screen.height); AONGUI.Box(rectFull, ""); float W_ScopeList = 200; { Rect rect = new Rect(0, 0, W_ScopeList, Screen.height); float yGui = 4f; AONGUI.Box(rect, "", tilesetAON.ListStyleBlack); AONGUI.Button(new Rect(4, yGui, 45, 26), "Back", onCloseDialog); AONGUI.Label(new Rect(54, yGui, W_ScopeList - 54, 26), "World edit"); yGui += 32f; float w = (W_ScopeList) / 2; AONGUI.Button(new Rect(4, yGui, w - 8, 26), "Save", () => { string title = "Save world data ( not include map)"; FileBrowser.SaveFilePanel(title, title, Application.persistentDataPath, "worlddata.json", new string[] { "json" }, null, (bool canceled, string filePath) => { if (canceled) { return; } File.WriteAllText(filePath, d.GetDataWorld(false)); }); }); AONGUI.Button(new Rect(w + 4, yGui, w - 8, 26), "Load", () => { var title = "Load world data ( not include map)"; var path = Application.persistentDataPath + "/worlddata.json"; FileBrowser.OpenFilePanel(title, path, new string[] { "json" }, null, (bool canceled, string filePath) => { if (canceled) { return; } if (File.Exists(filePath)) { var data = File.ReadAllText(filePath); if (d.LoadDataWorld(data, false) == false) { InputFieldHelper.Instance.ShowNoti("Load error"); } } }); }); yGui += 4f; yGui += 32f; OnGUIMenuLeft(tilesetAON, ref yGui, new Rect(0, 0, W_ScopeList, rectFull.height)); } if (mMenuLeft == EMenuLeft.FlagWorld) { Rect rect = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); float yGui = 0f; FlagGui.DisOnGUI(d.FlagWorld, ref yGui, rect, AutoTileMapData.LockFlagWorld, tilesetAON.ListStyleBlack2, "Flag world edit :"); } else if (mMenuLeft == EMenuLeft.ActionWorld) { if (d.ListFlagAction == null) { d.ListFlagAction = new List <FlagAction>(); } if (d.ListFlagAction.Count == 0) { d.ListFlagAction.Add(new FlagAction()); } d.ListFlagAction[0].Name = ""; d.ListFlagAction[0].Key = ""; d.ListFlagAction[0].Value = 0; Rect rect = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); float yGui = 0f; bool isWaitUI = false; if (FlagAction.OnGUIFlagActionList(ref yGui, ref isWaitUI, rect, d.ListFlagAction, d.FlagWorld, tilesetAON.ListStyleBlack2)) { return; } } else if (mMenuLeft == EMenuLeft.Property) { Rect rect = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); PropertysGUI.Instance.OnGUI(d.Propertys, d.ListFlagAction, tilesetAON, rect); } else if (mMenuLeft == EMenuLeft.Package) { Rect rect = new Rect(W_ScopeList, 0, Screen.width - W_ScopeList, Screen.height); PackagesGUI.Instance.OnGUI(d.Packages, d.Propertys, d.ListFlagAction, tilesetAON, rect); } }