Example #1
0
        public void SaveSkillRotation(List <Skill> list, string playerName)
        {
            DateTime now      = DateTime.Now;
            String   fileName = txtFileName.Text.Trim();

            if (fileName.Length == 0)
            {
                fileName = "(<yyyyMMdd_HHmmss>)<name>";
            }

            StringBuilder buf     = new StringBuilder();
            StringBuilder convBuf = new StringBuilder();
            bool          conv    = false;

            foreach (char c in fileName)
            {
                if (c == '<')
                {
                    conv = true;
                    convBuf.Clear();
                }
                else if (c == '>')
                {
                    conv = false;
                    String strConv = convBuf.ToString();
                    switch (strConv.ToUpper())
                    {
                    // TODO
                    //case "JOB":
                    //    strConv = list[0].job;
                    //    break;
                    case "NAME":
                        strConv = playerName;
                        break;

                    default:
                        strConv = now.ToString(strConv);
                        break;
                    }
                    buf.Append(strConv);
                }
                else
                {
                    if (conv)
                    {
                        convBuf.Append(c);
                    }
                    else
                    {
                        buf.Append(c);
                    }
                }
            }

            strLoadFile = buf.ToString() + ".csv";
            String savePath = GetResourceFileDir() + Path.DirectorySeparatorChar + strLoadFile;

            SkillLoader.save(list, savePath);
            RefleshList();
        }
Example #2
0
        public Skills()
        {
            var skillLoader = new SkillLoader();

            skillLoader.Load();
            skills = skillLoader.Skills;
        }
Example #3
0
        public void ReloadSkillRotation()
        {
            RefleshList();
            String targetFile = GetResourceFileDir() + Path.DirectorySeparatorChar + strLoadFile;

            if (File.Exists(targetFile))
            {
                plugin.SkillView.LoadSkill(SkillLoader.load(targetFile));
            }
        }
Example #4
0
    // Use this for initialization
    void Start()
    {
        base.Start();

        ColorizeMethod colorizer = colorize;

        make_map(23, colorizer, "SkillTile");

        SkillLoader skl = GetComponent <SkillLoader>();

        skl.Build();
        SkillStruct ss = skl.get_struct();

        apply_skills_to_hex_grid_map(ss);
        populate_rest();
        activate_ground_zero();
    }
Example #5
0
        public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
        {
            skillMap = SkillLoader.load();

            SkillView              = new SkillView(this);
            ACTTabControl          = new ACTTabControl(this);
            pluginScreenSpace.Text = Assembly.GetExecutingAssembly().GetName().Name;
            pluginScreenSpace.Controls.Add(ACTTabControl);
            ACTTabControl.InitializeSettings();

            Settings = new DataManager(this);
            Settings.Load();

            ACTTabControl.Show();
            ACTTabControl.ReloadSkillRotation();

            ActGlobals.oFormActMain.OnCombatStart += CombatStarted;
            ActGlobals.oFormActMain.OnCombatEnd   += CombatEnded;
            ActGlobals.oFormActMain.OnLogLineRead += OnLogLineRead;
        }
Example #6
0
    public override void EnterState(EActionState eState)
    {
        base.EnterState(eState);

        if (m_bHasInit)
        {
            return;
        }

        if (m_skillLoader == null)
        {
            m_skillLoader = ConfigManager.Instance.GetLoader <SkillLoader>();
        }

        if (m_lstFixedEffectId == null)
        {
            m_lstFixedEffectId = m_skillLoader.GetFixedEffectIdList(m_skillData.Id);
        }

        if (m_lstFixedEffectId != null && m_lstFixedEffectId.Count > 0)
        {
            for (int i = 0; i < m_lstFixedEffectId.Count; i++)
            {
                var fixedEffectLoaderData = ConfigManager.Instance.GetData <FixedEffectLoader, FixedEffectLoader.Data>(m_lstFixedEffectId[i]);

                GameObject m_effectObj = new GameObject("effect_" + m_skillData.ActionName + "_" + fixedEffectLoaderData.Id);
                m_effectObj.transform.parent        = m_tk2DSpriteAnimator.transform.Find("Effect");
                m_effectObj.transform.localPosition = Vector3.zero;
                tk2dSprite m_effectSprite = Common.GetOrAddComponent <tk2dSprite>(m_effectObj);
                tk2dSpriteCollectionData tk2DSpriteCollectionData = tk2dSystem.LoadResourceByName <tk2dSpriteCollectionData>(fixedEffectLoaderData.CollectionName);
                m_effectSprite.SetSprite(tk2DSpriteCollectionData, 0);
                m_effectSprite.SortingLevel = 3;
                m_effectObj.SetActive(false);
                m_lstEffectObj.Add(m_effectObj);
                m_lstEffectSprite.Add(m_effectSprite);
                m_lstStartFramName.Add(int.Parse(fixedEffectLoaderData.StartFrameName));
                m_lstEndFramName.Add(int.Parse(fixedEffectLoaderData.EndFrameName));
            }
        }
        m_bHasInit = true;
    }
Example #7
0
        private void btnFileLoad_Click(object sender, EventArgs e)
        {
            if (listFile.SelectedIndex < 0)
            {
                return;
            }

            String targetFile = GetResourceFileDir() + Path.DirectorySeparatorChar + listFile.Text;

            if (!File.Exists(targetFile))
            {
                MessageBox.Show(
                    "No such file or directory (" + targetFile + ")",
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                return;
            }

            plugin.SkillView.LoadSkill(SkillLoader.load(targetFile));
            strLoadFile = listFile.Text;
        }
Example #8
0
        public EntitiesManager Create(string assetsPath, string distPath)
        {
            var localizationsLoader = new LocalizationLoader();
            var localizations       = localizationsLoader.LoadFromAssets(assetsPath);
            var localizationWriter  = new LocalizationWriter();
            var heroItemLoader      = new HeroItemLoader(localizations);
            var heroItemWriter      = new HeroItemWriter();
            var heroItemManager     = new HeroItemManager(assetsPath, distPath, localizations, heroItemLoader, heroItemWriter, localizationWriter);
            var skillLoader         = new SkillLoader(localizations);
            var skillWriter         = new SkillWriter();
            var skillManager        = new SkillManager(assetsPath, distPath, localizations, skillLoader, skillWriter, localizationWriter);

            var shipLoader  = new ShipLoader(localizations);
            var shipWriter  = new ShipWriter();
            var shipManager = new ShipManager(assetsPath, distPath, localizations, shipLoader, shipWriter, localizationWriter);

            var localizationProvider = new LocalizationProvider(localizations);
            var heroWriter           = new HeroWriter();
            var heroLoader           = new HeroLoader(localizations, localizationProvider);
            var heroManager          = new HeroManager(assetsPath, distPath, localizations, heroLoader, heroWriter, localizationWriter);

            return(new EntitiesManager(heroItemManager, skillManager, shipManager, heroManager));
        }
    public void Init()
    {
        //PlayerPrefs.DeleteAll();
        Debug.Log("LOAD XMLs");
        GameStatsLoader gameStatsLoader = new GameStatsLoader();

        GameStatsInfos = gameStatsLoader.GetDict();

        PlayerLoader playerLoader = new PlayerLoader();

        PlayerInfos = playerLoader.GetDict();

        EnemyLoader enemyLoader = new EnemyLoader();

        EnemyInfos = enemyLoader.GetDict();

        WeaponLoader weaponLoader = new WeaponLoader();

        WeaponInfos = weaponLoader.GetDict();

        PowerUpLoader powerUpLoader = new PowerUpLoader();

        PowerUpInfos = powerUpLoader.GetDict();

        HatLoader hatLoader = new HatLoader();

        HatInfos = hatLoader.GetDict();

        SkillLoader skillLoader = new SkillLoader();

        SkillInfos = skillLoader.GetDict();

        if (GameStatsInfos != null)
        {
            gameStatsLoaded = true;
        }
        if (PlayerInfos != null)
        {
            playersLoaded = true;
        }
        if (EnemyInfos != null)
        {
            enemiesLoaded = true;
        }
        if (WeaponInfos != null)
        {
            weaponsLoaded = true;
        }
        if (PowerUpInfos != null)
        {
            powerUpsLoaded = true;
        }
        if (HatInfos != null)
        {
            hatsLoaded = true;
        }
        if (SkillInfos != null)
        {
            skillsLoaded = true;
        }
    }