public override void ApplyToComponent <T>(T component) { var comp = component as HasStatusEffectEffectCondition; comp.Invert = false; comp.Inverse = this.Invert; comp.CheckOwner = this.CheckOwner; comp.DiseaseAge = this.DiseaseAge; comp.StatusEffect = new StatusEffectSelector() { Type = this.StatusSelectorType, }; var selector = comp.StatusEffect; switch (this.StatusSelectorType) { case StatusEffectSelector.Types.StatusFamily: selector.StatusFamily = new StatusEffectFamilySelector() { SelectorValue = this.SelectorValue }; break; case StatusEffectSelector.Types.StatusSpecific: selector.StatusEffect = ResourcesPrefabManager.Instance.GetStatusEffectPrefab(this.SelectorValue); break; case StatusEffectSelector.Types.StatusType: selector.StatusType = new TagSourceSelector(CustomTags.GetTag(this.SelectorValue)); break; } }
/// <summary> /// The tag cloud items add. /// </summary> /// <param name="objTag"> /// The obj tag. /// </param> /// <returns> /// Returns the Tag ID of the new Tag /// </returns> public static int TagCloudItemsAdd(CustomTags objTag) { return (Convert.ToInt32( DataProvider.Instance().ExecuteScalar( "TagCloudItemsAdd", objTag.iTagId, objTag.iWeight, objTag.sTag, objTag.iModulId, objTag.sUrl))); }
public CustomTag CreateTagInstance(string tag, string markup, RootElementMaster rootMaster) { if (string.IsNullOrEmpty(tag)) { throw new ArgumentNullException("Must specify tag"); } if (!CustomTags.ContainsKey(tag)) { return(null); } CustomTagTemplate template = CustomTags[tag]; if (template != null) { if (template.MyRootMaster != rootMaster) { template.MyRootMaster = rootMaster; template.Parse(); } else { if (!template.IsParsed || template.Controls.Count == 0) { template.Parse(); } } } return(new CustomTag(tag, CustomTags[tag], markup)); }
/// <summary> /// Looks up the OsTagTemplate defined for the tag. /// Returns null if tag is not defined. /// </summary> /// <param name="tag"></param> /// <returns></returns> internal CustomTagTemplate GetTagTemplate(string tag) { if (CustomTags.ContainsKey(tag)) { return(CustomTags[tag]); } return(null); }
private void RemoveTag(string tag) { List <CustomTagVM> itemsToRemove = CustomTags.Where(x => x.Tag == tag).ToList(); foreach (CustomTagVM itemToRemove in itemsToRemove) { CustomTags.Remove(itemToRemove); } }
private void AddTag(TextBox textbox) { if (CanAddTag(textbox)) { string tag = textbox?.Text; CustomTags.Add(new CustomTagVM(tag)); textbox.Text = String.Empty; } }
private bool CanAddTag(TextBox textbox) { string tag = textbox?.Text; return(ValidateTag(tag) && TagPresets != null && !TagPresets.Any(x => x.Tag == tag) && !CustomTags.Any(x => x.Tag == tag)); }
public static void BeforePacksLoaded() { ManaBowTag = CustomTags.CreateTag(ManaBowTagString); if (At.GetTypeByName("RaidMode.CharacterEquipment_Update") is Type raidType) { var raidPatch = raidType.GetMethod("Postfix", BindingFlags.Public | BindingFlags.Static); ManaBowPlugin.harmony.Patch(raidPatch, prefix: new HarmonyMethod(typeof(ManaBowManager), nameof(FixRaidModePatch))); } }
protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { if (AffectedStat == null || AffectedStat.Tag == null || AffectedStat.Tag == Tag.None) { base.AffectedStat = new TagSourceSelector(CustomTags.GetTag(Stat.ToString())); } Update(); // refresh mana point value base.ActivateLocally(_affectedCharacter, _infos); }
public override void ApplyToComponent <T>(T component) { var tag = CustomTags.GetTag(ImmunityTag, false); if (tag == Tag.None) { SL.LogWarning($"{this.GetType().Name}: Could not find a tag with the name '{ImmunityTag}'!"); return; } At.SetField(component as AddStatusImmunity, "m_statusImmunity", new TagSourceSelector(tag)); }
public TeleportResult Input(ref Vector3[] path, List <IndexedRaycastHit> hitData) { for (int i = 0; i < hitData.Count; i++) { surface = hitData[i].hit.collider.GetComponent <CustomTags>(); if (surface) { return(ParseHit(ref path, hitData[i], surface)); } } return(new TeleportResult(path[path.Length - 1], Trinary.Unknown)); }
public override BaseGadgetControl AddControl(BaseGadgetControl control) { if (null == control) { return(null); } base.AddControl(control); if (control is CustomTagTemplate) { CustomTags.Add((CustomTagTemplate)control); } return(control); }
public void CreateTag() { if (CustomTags.GetTag(this.TagName, false) != Tag.None) { SL.LogWarning($"Creating Tag '{this.TagName}', but it already exists!"); return; } ; var tag = CustomTags.CreateTag(TagName); if (!string.IsNullOrEmpty(this.OptionalTagUID)) { At.SetField(tag, "m_uid", new UID(this.OptionalTagUID)); } }
void OnTriggerEnter(Collider collider) { CustomTags tagsComp = collider.GetComponent <CustomTags>(); Debug.Assert(tagsComp != null, collider.name + ": has no custom tags component"); List <Tags> tags = tagsComp.tags; if (tags.Contains(Tags.Interactive) || tags.Contains(Tags.Grabbable)) { overlappedObjs.Add(collider.gameObject); //if (selectedObj == null) //{ // SelectObj(collider.gameObject); //} } }
/// <summary> /// Registers a new custom tag to be available for use within a gadget. /// </summary> /// <param name="tagTemplate"></param> /// <returns></returns> public CustomTagTemplate RegisterCustomTag(CustomTagTemplate tagTemplate) { if (null == tagTemplate) { throw new ArgumentNullException(); } if (string.IsNullOrEmpty(tagTemplate.Tag)) { throw new ArgumentException("Custom template does not define a tag"); } CustomTags.Add(tagTemplate.Tag, tagTemplate); if (!tagTemplate.IsParsed) { tagTemplate.Parse(); } return(tagTemplate); }
private void Commit() { if (string.IsNullOrEmpty(CommitMessage)) { MainWindow.Instance.Dispatcher.Invoke(() => { MainWindow.ShowMessage("Not so fast...", "Please provide a commit message", MessageDialogStyle.Affirmative); }); return; } // Tag has been typed in but not added if (!string.IsNullOrEmpty(TagString) && CustomTags.All(x => x.Tag != TagString)) { MessageDialogResult result = MessageDialogResult.Negative; MainWindow.Instance.Dispatcher.Invoke(async() => { result = await MainWindow.ShowMessage("Missing Tag", "You seem to have a tag that has not been added. Do you want to continue without adding the tag?", MessageDialogStyle.AffirmativeAndNegative); }).Wait(); if (result == MessageDialogResult.Negative) { return; } } OperationStatusDialog.Start("Commit"); bool commitSuccessful = _areaVM.Area.Commit(CommitMessage, false, GetCommitTags()); if (commitSuccessful && PushOnCommit) { _areaVM.ExecuteClientCommand((c) => c.Push(), "push", true); } OperationStatusDialog.Finish(); CommitMessage = string.Empty; TagPresets.ForEach(x => x.IsChecked = false); MainWindow.Instance.Dispatcher.Invoke(() => CustomTags.Clear()); Refresh(); }
/// <summary> /// The tag cloud items get by module. /// </summary> /// <param name="iModulId"> /// The module id. /// </param> /// <returns> /// TagCloud Item List /// </returns> public static List <CustomTags> TagCloudItemsGetByModule(int iModulId) { List <CustomTags> tagsList = new List <CustomTags>(); using (IDataReader dr = DataProvider.Instance().ExecuteReader("TagCloudItemsGetByModule", iModulId)) { while (dr.Read()) { CustomTags tag = new CustomTags { iTagId = Convert.ToInt32(dr["TagID"]), iWeight = Convert.ToInt32(dr["Weight"]), sTag = Convert.ToString(dr["Tag"]), sUrl = Convert.ToString(dr["TagUrl"]) }; tagsList.Add(tag); } } return(tagsList); }
private TeleportResult ParseHit(ref Vector3[] path, IndexedRaycastHit indexedHit, CustomTags surface) { this.indexedHit = indexedHit; this.surface = surface; var cutoffPath = new Vector3[cutoffIndex + 1]; for (int i = 0; i < cutoffPath.Length; i++) { cutoffPath[i] = path[i]; } var focus = surface.GetComponent <TeleportPoint>(); hitPoint = focus ? focus.GetPoint() : hit.point; var localCutoffPoint = source.InverseTransformPoint(hitPoint); localCutoffPoint.x = 0; cutoffPath[cutoffPath.Length - 1] = localCutoffPoint; path = cutoffPath; return(new TeleportResult(hitPoint, success, surface.gameObject)); }
public static void SetupTag() { ManaBowTag = CustomTags.CreateTag(ManaBowTagString); }
public void Populate(JMMServerBinary.Contract_AniDB_AnimeDetailed contract, int animeID) { AnimeID = animeID; AnimeTitles = new List <AnimeTitleVM>(); AnimeTitlesSummary = new List <AnimeTitleVM>(); AnimeTitlesMain = new List <AnimeTitleVM>(); AnimeTitlesOfficial = new List <AnimeTitleVM>(); AnimeTitlesSynonym = new List <AnimeTitleVM>(); AnimeTitlesShort = new List <AnimeTitleVM>(); AnimeCategories = new List <AnimeCategoryVM>(); AnimeCategoriesSummary = new List <AnimeCategoryVM>(); AnimeTags = new List <AnimeTagVM>(); AnimeTagsSummary = new List <AnimeTagVM>(); CustomTags.Clear(); try { AniDB_Anime = new AniDB_AnimeVM(contract.AniDBAnime); UserVote = null; if (contract.UserVote != null) { UserVote = new AniDB_VoteVM(contract.UserVote); } UserHasVoted = UserVote != null; UserHasNotVoted = UserVote == null; if (UserVote == null) { UserRating = 0; } else { UserRating = UserVote.VoteValue; } UserRatingFormatted = Utils.FormatAniDBRating((double)UserRating); if (UserVote != null) { UserRatingFormatted += " ("; if (UserVote.VoteType == 1) { UserRatingFormatted += Properties.Resources.VoteTypeAnimePermanent; } if (UserVote.VoteType == 2) { UserRatingFormatted += Properties.Resources.VoteTypeAnimeTemporary; } UserRatingFormatted += ")"; } this.Stat_AllVideoQuality = contract.Stat_AllVideoQuality; this.Stat_AllVideoQuality_Episodes = contract.Stat_AllVideoQuality_Episodes; this.Stat_AudioLanguages = contract.Stat_AudioLanguages; this.Stat_SubtitleLanguages = contract.Stat_SubtitleLanguages; foreach (JMMServerBinary.Contract_AnimeCategory cat in contract.Categories) { AnimeCategoryVM vcat = new AnimeCategoryVM(cat); AnimeCategories.Add(vcat); } AnimeCategories.Sort(); int i = 0; foreach (AnimeCategoryVM cat in AnimeCategories) { if (i <= 5) { AnimeCategoriesSummary.Add(cat); } else { break; } i++; } foreach (JMMServerBinary.Contract_AnimeTag tag in contract.Tags) { AnimeTagVM vtag = new AnimeTagVM(tag); AnimeTags.Add(vtag); } AnimeTags.Sort(); i = 0; foreach (AnimeTagVM tag in AnimeTags) { if (i <= 5) { AnimeTagsSummary.Add(tag); } else { break; } i++; } foreach (JMMServerBinary.Contract_CustomTag ctag in contract.CustomTags) { CustomTagVM vtag = new CustomTagVM(ctag); CustomTags.Add(vtag); } CustomTags.Sort(); ViewCustomTags.Refresh(); foreach (JMMServerBinary.Contract_AnimeTitle title in contract.AnimeTitles) { AnimeTitleVM vtitle = new AnimeTitleVM(title); AnimeTitles.Add(vtitle); if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Main.ToUpper()) { AnimeTitlesMain.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Official.ToUpper()) { AnimeTitlesOfficial.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Synonym.ToUpper()) { AnimeTitlesSynonym.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.ShortName.ToUpper()) { AnimeTitlesShort.Add(vtitle); } } i = 0; foreach (AnimeTitleVM title in AnimeTitlesOfficial) { if (i <= 5) { AnimeTitlesSummary.Add(title); } else { break; } i++; } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
/// <summary> /// The tag cloud items update. /// </summary> /// <param name="objTag"> /// The obj tag. /// </param> public static void TagCloudItemsUpdate(CustomTags objTag) { DataProvider.Instance().ExecuteNonQuery( "TagCloudItemsUpdate", objTag.iTagId, objTag.iWeight, objTag.sTag, objTag.iModulId, objTag.sUrl); }
/// <summary> /// Tests to see if the given tag is a defined custom tag. /// </summary> /// <param name="tag"></param> /// <returns></returns> public bool IsCustomTag(string tag) { return(CustomTags.ContainsKey(tag)); }
private void SL_BeforePacksLoaded() { CustomTags.CreateTag("Ring"); var ringItem = new SL_Equipment { Target_ItemID = 5100500, New_ItemID = TSAR_RING_ITEMID, Name = "Tsar Ring", Description = "An ornately-decorated ring, jeweled with an impressive Tsar.\n\nSome say this ring was summoned by the Creator of Aurai itself.", IKType = Equipment.IKMode.None, EquipSlot = EquipmentSlot.EquipmentSlotIDs.LeftHand, Tags = new List <string> { "Ring" }, StatsHolder = new SL_EquipmentStats { BaseValue = 999, MaxDurability = -1, RawWeight = 0.1f, Mana_Use_Modifier = -5f }, EffectBehaviour = EffectBehaviours.DestroyEffects, SLPackName = "TsarRing", SubfolderName = "TsarRing", AssetBundleName = "tsarring", ItemVisuals_PrefabName = "mdl_itm_Tsar_Ring_v", ItemVisuals_PositionOffset = new Vector3(0.03f, 0.09f, 0.05f), ItemVisuals_RotationOffset = new Vector3(180f, 10f, -90f) }; CustomItems.CreateCustomItem(ringItem); var ringSkill = new SL_AttackSkill { Target_ItemID = 8300251, New_ItemID = 8500999, Name = "Ring Laser", Description = "Requires: Tsar Ring\n\nInvoke the power of the ring, disintegrating anything in it's path.", RequiredWeaponTags = new List <string> { "Ring" }, Cooldown = 10, ManaCost = 10, StaminaCost = 0, DurabilityCost = 0, DurabilityCostPercent = 0, CastType = Character.SpellCastType.Flamethrower, EffectBehaviour = EffectBehaviours.OverrideEffects, StatsHolder = null, SLPackName = "TsarRing", SubfolderName = "RingLaser", EffectTransforms = new List <SL_EffectTransform> { new SL_EffectTransform { TransformName = "ActivationEffects", Effects = new List <SL_Effect> { new SL_PlaySoundEffect { SyncType = Effect.SyncTypes.OwnerSync, Sounds = new List <GlobalAudioManager.Sounds> { GlobalAudioManager.Sounds.CS_Mantis_ManaBlast_Whoosh1 } } } }, new SL_EffectTransform { TransformName = "Effects", Effects = new List <SL_Effect> { new SL_ShootConeBlast { BaseBlast = SL_ShootBlast.BlastPrefabs.EliteImmaculateLaser, CastPosition = Shooter.CastPositionType.Transform, NoAim = true, TargetType = Shooter.TargetTypes.Enemies, TransformName = "ShooterTransform", Radius = 0.8f, RefreshTime = 0.1f, BlastLifespan = 1.0f, InstantiatedAmount = 1, Interruptible = true, MaxHitTargetCount = -1, HitOnShoot = true, NoTargetForwardMultiplier = 5.0f, ImpactSoundMaterial = EquipmentSoundMaterials.Fire, EffectBehaviour = EffectBehaviours.OverrideEffects, BlastEffects = new List <SL_EffectTransform> { new SL_EffectTransform { TransformName = "Effects", Effects = new List <SL_Effect> { new SL_PunctualDamage { Damage = new List <SL_Damage> { new SL_Damage { Type = DamageType.Types.Ethereal, Damage = 5.0f, } }, Knockback = 2f, HitInventory = true } } } } } } } }, }; CustomItems.CreateCustomItem(ringSkill); }
private void SL_BeforePacksLoaded() { CustomTags.CreateTag("Ring"); }
public void Populate(JMMServerBinary.Contract_AniDB_AnimeDetailed contract, int animeID) { AnimeID = animeID; AnimeTitles = new List <AnimeTitleVM>(); AnimeTitlesSummary = new List <AnimeTitleVM>(); AnimeTitlesMain = new List <AnimeTitleVM>(); AnimeTitlesOfficial = new List <AnimeTitleVM>(); AnimeTitlesSynonym = new List <AnimeTitleVM>(); AnimeTitlesShort = new List <AnimeTitleVM>(); AnimeTags = new List <AnimeTagVM>(); AnimeTagsSummary = new List <AnimeTagVM>(); CustomTags.Clear(); try { AniDB_Anime = new AniDB_AnimeVM(contract.AniDBAnime); UserVote = null; if (contract.UserVote != null) { UserVote = new AniDB_VoteVM(contract.UserVote); } UserHasVoted = UserVote != null; UserHasNotVoted = UserVote == null; if (UserVote == null) { UserRating = 0; } else { UserRating = UserVote.VoteValue; } UserRatingFormatted = Utils.FormatAniDBRating((double)UserRating); if (UserVote != null) { UserRatingFormatted += " ("; if (UserVote.VoteType == 1) { UserRatingFormatted += Properties.Resources.VoteTypeAnimePermanent; } if (UserVote.VoteType == 2) { UserRatingFormatted += Properties.Resources.VoteTypeAnimeTemporary; } UserRatingFormatted += ")"; } this.Stat_AllVideoQuality = new HashSet <string>(contract.Stat_AllVideoQuality); this.Stat_AllVideoQuality_Episodes = new HashSet <string>(contract.Stat_AllVideoQuality_Episodes); this.Stat_AudioLanguages = new HashSet <string>(contract.Stat_AudioLanguages); this.Stat_SubtitleLanguages = new HashSet <string>(contract.Stat_SubtitleLanguages); foreach (JMMServerBinary.Contract_AnimeTag tag in contract.Tags) { AnimeTagVM vtag = new AnimeTagVM(tag); AnimeTags.Add(vtag); } //AnimeTags.Sort(); List <SortPropOrFieldAndDirection> sortCriteria = new List <SortPropOrFieldAndDirection>(); sortCriteria.Add(new SortPropOrFieldAndDirection("Weight", true, SortType.eInteger)); AnimeTags = Sorting.MultiSort <AnimeTagVM>(AnimeTags, sortCriteria); int i = 0; /* * foreach (AnimeTagVM tag in AnimeTags) * { * if (i <= 5) * AnimeTagsSummary.Add(tag); * else * break; * i++; * } */ foreach (JMMServerBinary.Contract_CustomTag ctag in contract.CustomTags) { CustomTagVM vtag = new CustomTagVM(ctag); CustomTags.Add(vtag); } CustomTags.Sort(); ViewCustomTags.Refresh(); foreach (JMMServerBinary.Contract_AnimeTitle title in contract.AnimeTitles) { AnimeTitleVM vtitle = new AnimeTitleVM(title); AnimeTitles.Add(vtitle); if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Main.ToUpper()) { AnimeTitlesMain.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Official.ToUpper()) { AnimeTitlesOfficial.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.Synonym.ToUpper()) { AnimeTitlesSynonym.Add(vtitle); } if (title.TitleType.Trim().ToUpper() == Constants.AnimeTitleType.ShortName.ToUpper()) { AnimeTitlesShort.Add(vtitle); } } i = 0; foreach (AnimeTitleVM title in AnimeTitlesOfficial) { if (i <= 5) { AnimeTitlesSummary.Add(title); } else { break; } i++; } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }