Ejemplo n.º 1
0
 public static void Update()
 {
     try {
         if (IsDirty)
         {
             EffectTypes = EffectType.GetAllEffectTypes();
             HeroBonuses = HeroBonus.GetAllHeroBonuses();
             Traits      = Trait.GetAllTraits();
             TraitEffect.AddAllTraitEffectsToTraits();
             AmmoTypes          = AmmoType.GetAllAmmoTypes();
             GunTypes           = GunType.GetAllGunTypes();
             Guns               = Gun.GetAllGuns();
             Items              = Item.GetAllItems();
             Maps               = Map.GetAllMaps();
             Sizes              = Size.GetAllSizes();
             Bases              = Base.GetAllBases();
             Facilities         = Facility.GetAllFacilities();
             MeleeTypes         = MeleeType.GetAllMeleeTypes();
             Melees             = Melee.GetAllMelees();
             PrebuiltFacilities = PrebuiltFacility.GetAllPrebuiltFacilities();
             Mods               = Mod.GetAllMods();
             ModFiles           = ModFile.GetAllModFiles();
             AttachPrebuiltsToBases();
             AttachFilesToMods();
             IsDirty = false;
         }
     }
     catch (Exception ex)
     {
         NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message + '\n' + ex.StackTrace);
     }
 }
Ejemplo n.º 2
0
        public static void AddAllTraitEffectsToTraits()
        {
            DataTable dtTraitEffects = MDatabaseUtilities.CreateDataTable("Select * from TTraitEffects WHERE intStatusID <> 4", Hidden.ExternalConnection);

            foreach (DataRow drRow in dtTraitEffects.Rows)
            {
                Trait clsTrait = AllData.Traits[(int)drRow["intTraitID"]];

                TraitEffect clsNewTraitEffect = new TraitEffect();
                clsNewTraitEffect.blnIsGlobal      = (bool)drRow["blnIsGlobal"];
                clsNewTraitEffect.intTraitEffectID = (int)drRow["intTraitEffectID"];
                clsNewTraitEffect.intSubmitterID   = (int)drRow["intSubmitterID"];
                clsNewTraitEffect.strValue         = (string)drRow["strValue"];
                clsNewTraitEffect.clsType          = AllData.EffectTypes[(int)drRow["intTraitEffectTypeID"]];
                clsTrait.Effects.Add(clsNewTraitEffect.intTraitEffectID, clsNewTraitEffect);
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                clsTrait = Classes.AllData.Traits[int.Parse(Request.QueryString["TID"])];



                if (Request.QueryString["EID"] != "-1")
                {
                    clsTraitEffect = clsTrait.Effects[int.Parse(Request.QueryString["EID"])];
                }
                else
                {
                    clsTraitEffect  = new Classes.TraitEffect();
                    btnFlag.Visible = false;
                };

                cmbEffectType.DataSource     = Classes.AllData.EffectTypes;
                cmbEffectType.DataValueField = "Key";
                cmbEffectType.DataTextField  = "Value";
                cmbEffectType.DataBind();
                if (clsTraitEffect.clsType != null)
                {
                    cmbEffectType.SelectedValue = clsTraitEffect.clsType.intID.ToString();
                }

                txtValue.Text       = clsTraitEffect.strValue;
                chkIsGlobal.Checked = clsTraitEffect.blnIsGlobal;
            }
            if (Session["Submitter"] == null)
            {
                btnSave.Visible   = false;
                btnFlag.Visible   = false;
                btnDelete.Visible = false;
            }
        }