private void Restrict(RenderTexture2D sourceTex, RenderTexture2D destTex, RestrictType restrictType)
    {
        if (restrictType == RestrictType.Normal)
        {
            int MGRestrictionHalfWeightingKernel = mComputeRestrict.FindKernel("MGRestrictionHalfWeighting");
            int WIDTH  = destTex.Width;
            int HEIGHT = destTex.Height;

            mComputeRestrict.SetInt("_currentXSize", WIDTH);
            mComputeRestrict.SetInt("_currentYSize", HEIGHT);
            mComputeRestrict.SetTexture(MGRestrictionHalfWeightingKernel, "gSourceTex", sourceTex.Source);
            mComputeRestrict.SetTexture(MGRestrictionHalfWeightingKernel, "gDestinationHalfTex", destTex.Source);
            mComputeRestrict.Dispatch(MGRestrictionHalfWeightingKernel, Mathf.CeilToInt(WIDTH * 1.0f / mGroupThreadSizeX), Mathf.CeilToInt(HEIGHT * 1.0f / mGroupThreadSizeX), 1);
        }
        else if (restrictType == RestrictType.Marker)
        {
            int MGRestrictionForCellMarkerKernel = mComputeRestrict.FindKernel("MGRestrictionForCellMarker");
            int WIDTH  = destTex.Width;
            int HEIGHT = destTex.Height;

            mComputeRestrict.SetInt("_currentXSize", WIDTH);
            mComputeRestrict.SetInt("_currentYSize", HEIGHT);
            mComputeRestrict.SetTexture(MGRestrictionForCellMarkerKernel, "gSourceMarkerTex", sourceTex.Source);
            mComputeRestrict.SetTexture(MGRestrictionForCellMarkerKernel, "gDestinationHalfMarkerTex", destTex.Source);
            mComputeRestrict.Dispatch(MGRestrictionForCellMarkerKernel, Mathf.CeilToInt(WIDTH * 1.0f / mGroupThreadSizeX), Mathf.CeilToInt(HEIGHT * 1.0f / mGroupThreadSizeX), 1);
        }
    }
        public RestrictGump( BitArray ba, RestrictType t )
            : base(50, 50)
        {
            m_Restricted = ba;
            m_type = t;

            Closable=true;
            Dragable=true;
            Resizable=false;

            AddPage(0);

            AddBackground(10, 10, 225, 425, 9380);
            AddLabel(73, 15, 1152, (t == RestrictType.Spells) ? "Restrict Spells" : "Restrict Skills" );
            AddButton(91, 411, 247, 248, 1, GumpButtonType.Reply, 0);
            //Okay Button ->  # 1

            int itemsThisPage = 0;
            int nextPageNumber = 1;

            Object[] ary;// = (t == RestrictType.Skills) ? SkillInfo.Table : SpellRegistry.Types;

            if( t == RestrictType.Skills )
                ary = SkillInfo.Table;
            else
                ary = SpellRegistry.Types;

            for( int i = 0; i < ary.Length; i++ )
            {
                if( ary[i] != null )
                {
                    if( itemsThisPage >= 8 || itemsThisPage == 0)
                    {
                        itemsThisPage = 0;

                        if( nextPageNumber != 1)
                        {
                            AddButton(190, 412, 4005, 4007, 2, GumpButtonType.Page, nextPageNumber);
                            //Forward button -> #2
                        }

                        AddPage( nextPageNumber++ );

                        if( nextPageNumber != 2)
                        {
                            AddButton(29, 412, 4014, 4016, 3, GumpButtonType.Page, nextPageNumber-2);
                            //Back Button -> #3
                        }
                    }

                    AddCheck(40, 55 + ( 45 * itemsThisPage ), 210, 211, ba[i], i + ((t == RestrictType.Spells) ? 100 : 500) );
                    //checkbox -> ID = 100 + i for spells,    500 + i for skills
                    //Console.WriteLine( ary[i].GetType().ToString() );
                    AddLabel(70, 55 + ( 45 * itemsThisPage ) , 0, ((t == RestrictType.Spells) ? ((Type)(ary[i])).Name : ((SkillInfo)(ary[i])).Name ));

                    itemsThisPage++;
                }
            }
        }
Exemple #3
0
        public void Query(SearchType searchType, RestrictType restrict)
        {
            Reset();
            _searchType = searchType;
            _restrict   = restrict;
            _offset     = "";
#if !OFFLINE
            HasMoreItems = true;
#endif
        }
Exemple #4
0
        public PixivFollow(string userId, RestrictType restrict, IPixivClient pixivClient, IQueryCacheService queryCacheService)
        {
            _userId            = userId;
            _restrict          = restrict;
            _pixivClient       = pixivClient;
            _queryCacheService = queryCacheService;
            Users   = new ObservableCollection <IUserPreview>();
            _offset = "";
#if OFFLINE
            HasMoreItems = false;
#else
            HasMoreItems = true;
#endif
        }
Exemple #5
0
        internal static string ToParamString(this RestrictType restrict)
        {
            switch (restrict)
            {
            case RestrictType.All:
                return("all");

            case RestrictType.Public:
                return("public");

            case RestrictType.Private:
                return("private");

            default:
                throw new ArgumentOutOfRangeException(nameof(restrict), restrict, null);
            }
        }
Exemple #6
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Completed != null)
            {
                XmlElement   result       = null;
                RestrictType restrictType = RestrictType.PropertyEquals;

                XmlHelper h = new XmlHelper("<Restrict/>");

                if (rbPropertyEquals.Checked)
                {
                    restrictType = RestrictType.PropertyEquals;
                    h.SetAttribute(".", "Property", txtPropertyName.Text);
                    h.SetAttribute(".", "Value", txtPropertyValue.Text);
                }

                if (rbRoleContain.Checked)
                {
                    restrictType = RestrictType.RoleContain;
                    h.SetAttribute(".", "Role", txtRole.Text);
                }

                if (rbDB.Checked)
                {
                    restrictType = RestrictType.SQL;
                    XmlElement      element = h.GetElement(".");
                    XmlCDataSection section = element.OwnerDocument.CreateCDataSection(txtSQL.Text);
                    element.AppendChild(section);
                }

                h.SetAttribute(".", "Type", restrictType.ToString());
                result = h.GetElement(".");

                Completed.Invoke(this, new RestrictEventArgs(result, restrictType));
            }
            this.Close();
        }
        public RestrictGump(BitArray ba, RestrictType t)
            : base(50, 50)
        {
            m_Restricted = ba;
            m_type       = t;

            Closable  = true;
            Dragable  = true;
            Resizable = false;

            AddPage(0);

            AddBackground(10, 10, 225, 425, 9380);
            AddLabel(73, 15, 1152, (t == RestrictType.Spells) ? "Restrict Spells" : "Restrict Skills");
            AddButton(91, 411, 247, 248, 1, GumpButtonType.Reply, 0);
            //Okay Button ->  # 1



            int itemsThisPage  = 0;
            int nextPageNumber = 1;

            Object[] ary;            // = (t == RestrictType.Skills) ? SkillInfo.Table : SpellRegistry.Types;

            if (t == RestrictType.Skills)
            {
                ary = SkillInfo.Table;
            }
            else
            {
                ary = SpellRegistry.Types;
            }


            for (int i = 0; i < ary.Length; i++)
            {
                if (ary[i] != null)
                {
                    if (itemsThisPage >= 8 || itemsThisPage == 0)
                    {
                        itemsThisPage = 0;

                        if (nextPageNumber != 1)
                        {
                            AddButton(190, 412, 4005, 4007, 2, GumpButtonType.Page, nextPageNumber);
                            //Forward button -> #2
                        }

                        AddPage(nextPageNumber++);

                        if (nextPageNumber != 2)
                        {
                            AddButton(29, 412, 4014, 4016, 3, GumpButtonType.Page, nextPageNumber - 2);
                            //Back Button -> #3
                        }
                    }

                    AddCheck(40, 55 + (45 * itemsThisPage), 210, 211, ba[i], i + ((t == RestrictType.Spells) ? 100 : 500));
                    //checkbox -> ID = 100 + i for spells,    500 + i for skills
                    //Console.WriteLine( ary[i].GetType().ToString() );
                    AddLabel(70, 55 + (45 * itemsThisPage), 0, ((t == RestrictType.Spells) ? ((Type)(ary[i])).Name : ((SkillInfo)(ary[i])).Name));

                    itemsThisPage++;
                }
            }
        }
Exemple #8
0
        public RestrictGump(BitArray ba, RestrictType t)
            : base(50, 50)
        {
            m_Restricted = ba;
            m_type       = t;

            Closable  = true;
            Dragable  = true;
            Resizable = false;

            AddPage(0);

            AddBackground(10, 10, 225, 425, 9380);
            AddLabel(73, 15, 1152, (t == RestrictType.Spells) ? "Restrict Spells" : "Restrict Skills");
            AddButton(91, 411, 247, 248, 1, GumpButtonType.Reply, 0);
            //Okay Button ->  # 1

            int itemsThisPage  = 0;
            int nextPageNumber = 1;

            Object[] ary;            // = (t == RestrictType.Skills) ? SkillInfo.Table : SpellRegistry.Types;

            if (t == RestrictType.Skills)
            {
                ary = SkillInfo.Table;
            }
            else
            {
                ary = SpellRegistry.Types;
            }

            // in the case where the static Spell or Skill table changed, only loop over the smaller set
            int MaxIterations = Math.Min(ary.Length, ba.Count);

            // report this so that we can recreate these controllers with an updated set of spells/skills
            Misc.Diagnostics.Assert(ary.Length == ba.Count, "Bit array size does not match Spell/Skill array size.");

            try
            {
                for (int i = 0; i < MaxIterations; i++)
                {
                    if (ary[i] != null)
                    {
                        if (itemsThisPage >= 8 || itemsThisPage == 0)
                        {
                            itemsThisPage = 0;

                            if (nextPageNumber != 1)
                            {
                                AddButton(190, 412, 4005, 4007, 2, GumpButtonType.Page, nextPageNumber);
                                //Forward button -> #2
                            }

                            AddPage(nextPageNumber++);

                            if (nextPageNumber != 2)
                            {
                                AddButton(29, 412, 4014, 4016, 3, GumpButtonType.Page, nextPageNumber - 2);
                                //Back Button -> #3
                            }
                        }

                        AddCheck(40, 55 + (45 * itemsThisPage), 210, 211, ba[i], i + ((t == RestrictType.Spells) ? 100 : 500));
                        AddLabel(70, 55 + (45 * itemsThisPage), 0, ((t == RestrictType.Spells) ? ((Type)(ary[i])).Name : ((SkillInfo)(ary[i])).Name));

                        itemsThisPage++;
                    }
                }
            }
            catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
        }
		public RestrictGump(BitArray ba, RestrictType t)
			: base(50, 50)
		{
			m_Restricted = ba;
			m_type = t;

			Closable = true;
			Dragable = true;
			Resizable = false;

			AddPage(0);

			AddBackground(10, 10, 225, 425, 9380);
			AddLabel(73, 15, 1152, (t == RestrictType.Spells) ? "Restrict Spells" : "Restrict Skills");
			AddButton(91, 411, 247, 248, 1, GumpButtonType.Reply, 0);
			//Okay Button ->  # 1

			int itemsThisPage = 0;
			int nextPageNumber = 1;

			Object[] ary;// = (t == RestrictType.Skills) ? SkillInfo.Table : SpellRegistry.Types;

			if (t == RestrictType.Skills)
				ary = SkillInfo.Table;
			else
				ary = SpellRegistry.Types;

			// in the case where the static Spell or Skill table changed, only loop over the smaller set
			int MaxIterations = Math.Min(ary.Length, ba.Count);

			// report this so that we can recreate these controllers with an updated set of spells/skills
			Misc.Diagnostics.Assert(ary.Length == ba.Count, "Bit array size does not match Spell/Skill array size.");

			try
			{
				for (int i = 0; i < MaxIterations; i++)
				{
					if (ary[i] != null)
					{
						if (itemsThisPage >= 8 || itemsThisPage == 0)
						{
							itemsThisPage = 0;

							if (nextPageNumber != 1)
							{
								AddButton(190, 412, 4005, 4007, 2, GumpButtonType.Page, nextPageNumber);
								//Forward button -> #2
							}

							AddPage(nextPageNumber++);

							if (nextPageNumber != 2)
							{
								AddButton(29, 412, 4014, 4016, 3, GumpButtonType.Page, nextPageNumber - 2);
								//Back Button -> #3
							}
						}

						AddCheck(40, 55 + (45 * itemsThisPage), 210, 211, ba[i], i + ((t == RestrictType.Spells) ? 100 : 500));
						AddLabel(70, 55 + (45 * itemsThisPage), 0, ((t == RestrictType.Spells) ? ((Type)(ary[i])).Name : ((SkillInfo)(ary[i])).Name));

						itemsThisPage++;
					}
				}
			}
			catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
		}
Exemple #10
0
 internal RestrictEventArgs(XmlElement result, RestrictType restrictType)
 {
     Result       = result;
     RestrictType = restrictType;
 }
 internal RestrictEventArgs(XmlElement result, RestrictType restrictType)
 {
     Result = result;            
     RestrictType = restrictType;
 }
 public STeleportRestrict(RestrictType type, int data1, int data2)
 {
     m_RestrictType = type;
     m_Data1        = data1;
     m_Data2        = data2;
 }
 public STeleportRestrict(RestrictType type)
 {
     m_RestrictType = type;
     m_Data1        = 0;
     m_Data2        = 0;
 }