private void Callback(object value) { Path path = (Path)target; ContextMenuData data = (ContextMenuData)value; Undo.RecordObject(this, "Changed Path Node Up"); switch (data._menuCommand) { case 0: { path._nodes[data._nodeIndex]._up = Vector3.up; } break; case 1: { path._nodes[data._nodeIndex]._up = Vector3.forward; } break; case 2: { path._nodes[data._nodeIndex]._up = Vector3.right; } break; } }
// Token: 0x06002C69 RID: 11369 RVA: 0x000A62A8 File Offset: 0x000A44A8 public void Set(ContextMenuData data) { if (this.length < data.options_length) { this.option = new ContextClientStageMenuItem[data.options_length]; this.length = data.options_length; } else { while (this.length > data.options_length) { this.option[--this.length].text = null; } } for (int i = 0; i < data.options_length; i++) { this.option[i].name = data.options[i].name; if (data.options[i].utf8_length == 0) { this.option[i].text = string.Empty; } else { this.option[i].text = Encoding.UTF8.GetString(data.options[i].utf8_text, 0, data.options[i].utf8_length); } } }
public void Set(ContextMenuData data) { if (this.length >= data.options_length) { while (this.length > data.options_length) { ContextClientStage contextClientStage = this; int num = contextClientStage.length - 1; int num1 = num; contextClientStage.length = num; this.option[num1].text = null; } } else { this.option = new ContextClientStageMenuItem[data.options_length]; this.length = data.options_length; } for (int i = 0; i < data.options_length; i++) { this.option[i].name = data.options[i].name; if (data.options[i].utf8_length != 0) { this.option[i].text = Encoding.UTF8.GetString(data.options[i].utf8_text, 0, data.options[i].utf8_length); } else { this.option[i].text = string.Empty; } } }
public void initCollection() { contextMenuData.Clear(); foreach (string s in KEY_MENU_ITEMS.GetSubKeyNames()) { ContextMenuData.Add(s); } }
// Token: 0x06002C7C RID: 11388 RVA: 0x000A6670 File Offset: 0x000A4870 private static void Serialize(BitStream stream, object value, params object[] codecOptions) { ContextMenuData contextMenuData = (ContextMenuData)value; stream.Write <int>(contextMenuData.options_length, codecOptions); for (int i = 0; i < contextMenuData.options_length; i++) { stream.Write <int>(contextMenuData.options[i].name, codecOptions); stream.WriteByteArray_MinimumCalls(contextMenuData.options[i].utf8_text, 0, contextMenuData.options[i].utf8_length, codecOptions); } }
public ContextMenuGump(ContextMenuData data) : base(0, 0) { m_Data = data; IResourceProvider provider = ServiceRegistry.GetService <IResourceProvider>(); AFont font = (AFont)provider.GetUnicodeFont(1); m_Background = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x0A3C, 50, font.Height * m_Data.Count + 20)); StringBuilder htmlContextItems = new StringBuilder(); for (int i = 0; i < m_Data.Count; i++) { htmlContextItems.Append(string.Format("<a href='{0}' color='#DDD' hovercolor='#FFF' activecolor='#BBB' style='text-decoration:none;'>{1}</a><br/>", m_Data[i].ResponseCode, m_Data[i].Caption)); } m_MenuItems = (HtmlGumpling)AddControl(new HtmlGumpling(this, 10, 10, 200, font.Height * m_Data.Count, 0, 0, htmlContextItems.ToString())); }
private void FindContextMenu() { contextData.Clear(); // Get context menu Type targetType = target.GetType(); Type contextMenuType = typeof(ContextMenu); MethodInfo[] methods = GetAllMethods(targetType).ToArray(); for (int index = 0; index < methods.GetLength(0); ++index) { MethodInfo methodInfo = methods[index]; foreach (ContextMenu contextMenu in methodInfo.GetCustomAttributes(contextMenuType, false)) { if (contextData.ContainsKey(contextMenu.menuItem)) { var data = contextData[contextMenu.menuItem]; if (contextMenu.validate) { data.validate = methodInfo; } else { data.function = methodInfo; } contextData[data.menuItem] = data; } else { var data = new ContextMenuData(contextMenu.menuItem); if (contextMenu.validate) { data.validate = methodInfo; } else { data.function = methodInfo; } contextData.Add(data.menuItem, data); } } } }
public ContextMenuGump(ContextMenuData data) : base(0, 0) { MetaData.IsModal = true; MetaData.ModalClickOutsideAreaClosesThisControl = true; _data = data; var provider = Service.Get <IResourceProvider>(); var font = (AFont)provider.GetUnicodeFont(1); _background = (ResizePic)AddControl(new ResizePic(this, 0, 0, 0x0A3C, 50, font.Height * _data.Count + 20)); var htmlContextItems = new StringBuilder(); for (var i = 0; i < _data.Count; i++) { htmlContextItems.Append(string.Format("<a href='{0}' color='#DDD' hovercolor='#FFF' activecolor='#BBB' style='text-decoration:none;'>{1}</a><br/>", _data[i].ResponseCode, _data[i].Caption)); } _menuItems = (HtmlGumpling)AddControl(new HtmlGumpling(this, 10, 10, 200, font.Height * _data.Count, 0, 0, htmlContextItems.ToString())); }
public ContextMenuInfo(PacketReader reader) { reader.ReadByte(); // unknown, always 0x00 int subcommand = reader.ReadByte(); // 0x01 for 2D, 0x02 for KR Menu = new ContextMenuData(reader.ReadInt32()); int contextMenuChoiceCount = reader.ReadByte(); for (int i = 0; i < contextMenuChoiceCount; i++) { int iUniqueID = reader.ReadUInt16(); int iClilocID = reader.ReadUInt16() + 3000000; int iFlags = reader.ReadUInt16(); // 0x00=enabled, 0x01=disabled, 0x02=arrow, 0x20 = color int iColor = 0; if ((iFlags & 0x20) == 0x20) { iColor = reader.ReadUInt16(); } Menu.AddItem(iUniqueID, iClilocID, iFlags, iColor); } }
// Token: 0x06002C79 RID: 11385 RVA: 0x000A64DC File Offset: 0x000A46DC public ContextMenuData(IEnumerable <global::ContextActionPrototype> prototypeEnumerable) { if (prototypeEnumerable is ICollection <global::ContextActionPrototype> ) { this.options = new ContextMenuItemData[((ICollection <global::ContextActionPrototype>)prototypeEnumerable).Count]; int num = 0; foreach (global::ContextActionPrototype prototype in prototypeEnumerable) { this.options[num++] = new ContextMenuItemData(prototype); } if (num < this.options.Length) { Array.Resize <ContextMenuItemData>(ref this.options, this.options.Length); } this.options_length = this.options.Length; } else { this.options = ContextMenuData.ToArray(prototypeEnumerable, out this.options_length); } }
private void ContextMenuClick(object userData, string[] options, int selected) { if (selected >= 0) { ContextMenuData data = (ContextMenuData)userData; string text = data.items[selected].text; switch (text) { case "Cut": case "Copy": case "Duplicate": case "Delete": this.m_Host.SendEvent(EditorGUIUtility.CommandEvent(text)); break; case "Paste": this.m_contextMenuMouseDownPosition = new Vector2?(data.mousePosition); this.m_Host.SendEvent(EditorGUIUtility.CommandEvent(text)); break; } } }
public ContextMenuData(IEnumerable <ContextActionPrototype> prototypeEnumerable) { if (!(prototypeEnumerable is ICollection <ContextActionPrototype>)) { this.options = ContextMenuData.ToArray(prototypeEnumerable, out this.options_length); } else { this.options = new ContextMenuItemData[((ICollection <ContextActionPrototype>)prototypeEnumerable).Count]; int num = 0; foreach (ContextActionPrototype contextActionPrototype in prototypeEnumerable) { int num1 = num; num = num1 + 1; this.options[num1] = new ContextMenuItemData(contextActionPrototype); } if (num < (int)this.options.Length) { Array.Resize <ContextMenuItemData>(ref this.options, (int)this.options.Length); } this.options_length = (int)this.options.Length; } }
internal void OnServerMenu(ContextMenuData menu) { this.clientContext.Set(menu); this.OnClientOptionsMade(); }
protected void InitContextMenu() { if (contextData == null) { contextData = new Dictionary <string, ContextMenuData>(); } else { contextData.Clear(); } // Get context menu var targetType = target.GetType(); var methods = GetAllMethods(targetType).ToArray(); for (var index = 0; index < methods.GetLength(0); ++index) { var methodInfo = methods[index]; var contextMenuAttributes = methodInfo.GetCustomAttributes(ContextMenuType, false); var contextMenuLayoutAttributes = methodInfo.GetCustomAttributes(ContextMenuLayoutType, false); for (var i = 0; i < contextMenuAttributes.Length; i++) { var contextMenu = (ContextMenu)contextMenuAttributes[i]; if (contextMenu == null) { continue; } ContextMenuLayoutAttribute layout = null; for (var innerIndex = 0; innerIndex < contextMenuLayoutAttributes.Length; innerIndex++) { var contextMenuLayoutAttribute = (ContextMenuLayoutAttribute)contextMenuLayoutAttributes[innerIndex]; if (contextMenuLayoutAttribute == null) { continue; } layout = contextMenuLayoutAttribute; break; } if (contextData.ContainsKey(contextMenu.menuItem)) { var data = contextData[contextMenu.menuItem]; if (contextMenu.validate) { data.Validate = methodInfo; } else { data.Function = methodInfo; } if (layout != null) { data.Layout = new ContextMenuData.LayoutOptions(layout); } contextData[data.MenuItem] = data; } else { var data = new ContextMenuData(contextMenu.menuItem); if (contextMenu.validate) { data.Validate = methodInfo; } else { data.Function = methodInfo; } if (layout != null) { data.Layout = new ContextMenuData.LayoutOptions(layout); } contextData.Add(data.MenuItem, data); } } } }
private void E(ContextMenuData options, uLink.NetworkMessageInfo info) { Context.ui.OnServerMenu(options); }
private void E(ContextMenuData options, NetworkMessageInfo info) { ui.OnServerMenu(options); }
private void E(ContextMenuData options, uLink.NetworkMessageInfo info) { global::Context.ui.OnServerMenu(options); }