Example #1
0
        public void BuildPanel(PanelBuilder panel, string title, Player player = null)
        {
            try
            {
                //addHeader
                if (reqs.Count == 0)
                {
                    return;
                }

                panel.AddHeaderLabel(title);

                //add req
                foreach (var req in reqs)
                {
                    BaseReq r = OLib.GetReq(req[0]);
                    if (player == null)
                    {
                        panel.AddLabel(r.Desc(null, req[1]));
                    }
                    else
                    {
                        panel.AddImageLabel(r.Desc(player, req[1]), r.Check(player, req[1]));
                    }
                }
            }
            catch (Exception e)
            {
                ExceptionHelper.ShowException(e);
            }
        }
Example #2
0
        /// <summary>
        /// Return the description, why the check its not working
        /// </summary>
        /// <param name="player"></param>
        /// <param name="reqs"></param>
        /// <param name="onMap"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns>the error message or null</returns>
        public static string Desc(Player player, Dictionary <string, string> reqs)
        {
            foreach (KeyValuePair <string, string> req in reqs)
            {
                BaseReq br = OLib.GetReq(req.Key);

                //can use it?
                if (!br.Check(player, req.Value))
                {
                    return(br.Desc(player, req.Value));
                }
            }

            return(null);
        }
Example #3
0
        /// <summary>
        /// Return the description, why the check its not working or null
        /// </summary>
        /// <param name="player"></param>
        /// <param name="reqs"></param>
        /// <param name="onMap"></param>
        /// <param name="pos"></param>
        /// <returns>the error message or null</returns>
        public static string Desc(Player player, Dictionary <string, string> reqs, MapElementInfo onMap, NVector pos)
        {
            foreach (KeyValuePair <string, string> req in reqs)
            {
                BaseReq br = OLib.GetReq(req.Key);

                //can use it?
                if (!br.Check(player, onMap, req.Value, pos))
                {
                    return(br.Desc(player, onMap, req.Value, pos));
                }
            }

            return(null);
        }
Example #4
0
        /// <summary>
        /// Return the description, why the check its not working or null
        /// </summary>
        /// <param name="player"></param>
        /// <param name="reqs"></param>
        /// <param name="onMap"></param>
        /// <param name="pos"></param>
        /// <returns>the error message or null</returns>
        public string Desc(Player player, MapElementInfo onMap, NVector pos)
        {
            foreach (var req in reqs)
            {
                BaseReq br = OLib.GetReq(req[0]);

                //can use it?
                if (!br.Check(player, onMap, req[1], pos))
                {
                    return(br.Desc(player, onMap, req[1], pos));
                }
            }

            return(null);
        }
Example #5
0
        /// <summary>
        /// Return the description, why the check its not working
        /// </summary>
        /// <param name="player"></param>
        /// <returns>the error message or null</returns>
        public string Desc(Player player)
        {
            foreach (var req in reqs)
            {
                BaseReq br = OLib.GetReq(req[0]);

                //can use it?
                if (!br.Check(player, req[1]))
                {
                    return(br.Desc(player, req[1]));
                }
            }

            return(null);
        }
Example #6
0
        public void BuildPanel(PanelBuilder panel, string title, MapElementInfo onMap, NVector pos)
        {
            try
            {
                //addHeader
                if (reqs.Count == 0)
                {
                    return;
                }

                panel.AddHeaderLabel(title);

                //add req
                foreach (var req in reqs)
                {
                    BaseReq r = OLib.GetReq(req[0]);
                    panel.AddImageLabel(r.Desc(S.ActPlayer(), onMap, req[1], pos), r.Check(S.ActPlayer(), onMap, req[1], pos));
                }
            }
            catch (Exception e)
            {
                ExceptionHelper.ShowException(e);
            }
        }