Ejemplo n.º 1
0
        public bool SetDefaultVerb(Verb verb, FrameworkContentElement span)
        {
            if (verb.GetType().Name == "TraversalVerb")
            {
                span.MouseLeftButtonUp += delegate { verb.Register(new Dictionary <string, object>()
                    {
                        { "target", this }
                    }, true); };
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        protected static bool DisplayDefault(Verb verb, Actor actor, GameObject target, FrameworkContentElement span)
        {
            CheckResult check = verb.Check(target);

            if (check >= CheckResult.RESTRICTED)
            {
                Dictionary <TextBlock, ContextMenuAction> items = new Dictionary <TextBlock, ContextMenuAction>();
                if (check == CheckResult.RESTRICTED)
                {
                    items.Add(WaywardTextParser.ParseAsBlock($@"<gray>{verb.displayLabel}</gray>"), null);
                }
                else
                {
                    items.Add(WaywardTextParser.ParseAsBlock(verb.displayLabel), delegate { return(verb.Register(new Dictionary <string, object>()
                        {
                            { "target", target }
                        }, true)); });
                }
                ContextMenuHelper.AddContextMenuHeader(span, new TextBlock(verb.self.GetData("name upper").span), items, check != CheckResult.RESTRICTED);
            }

            return(true);
        }