示例#1
0
    private void BindReference()
    {
        var root = this.transform;

        // 任务面板
        for (int i = 1; i <= GameConst.COUNT_CLAIM_QUEST; i++)
        {
            string path       = String.Format("Quest/ImgQuest ({0})", i);
            var    questPanel = new QuestPanel();
            questPanel.index        = i - 1;
            questPanel.txtQuestName = root.Find(String.Format("{0}/TxtName", path)).GetComponent <Text>();
            questPanel.materialRoot = root.Find(String.Format("{0}/Materials", path)).GetComponent <RectTransform>();
            questPanel.txtRunTime   = root.Find(String.Format("{0}/TxtRunTime", path)).GetComponent <Text>();
            questPanel.txtTotalTime = root.Find(String.Format("{0}/TxtTotalTime", path)).GetComponent <Text>();
            m_QuestPanels.Add(questPanel);
        }
        // 任务面板 - 新版
        for (int i = 1; i <= GameConst.COUNT_CLAIM_QUEST; i++)
        {
            var go   = root.Find(String.Format("Quest/ImgQuest ({0})", i));
            var view = go.GetComponent <ProcessBlockView>();
            view.Init(i - 1);
            m_PnlProcessBlocks.Add(view);
        }
        // 仓库面板
        for (int i = 1; i <= GameConst.COUNT_STOREHOUSE_MAX; i++)
        {
            var go   = root.Find(String.Format("StoreHouse/Storehouse ({0})", i));
            var view = go.GetComponent <ProcessStorehouseView>();
            view.Init(this, i - 1);
            m_PnlStorehouses.Add(view);
        }
    }
示例#2
0
        public void StartQuest()
        {
            if (wasStarted)
            {
                return;
            }

            questPanel = UIManager.Instance().GetQuestPanel();
            inventory  = PlayerManager.Instance().inventoryManager;
            // TODO QUest manager
//            if (! PlayerManager.instance.StartQuest(this))
//            {
//                Debug.Log("You already have unfinished quest");
//                return;
//            }

            if (onStart != null)
            {
                onStart.Invoke();
            }

            foreach (ConditionBase condition in conditions)
            {
                condition.Init();
                condition.onComplete += OnConditionComplete;
            }

            ShowNewUI();
            wasStarted = true;
        }
示例#3
0
    //퀘스트를 체크하는 곳에서 해당 퀘스트에 해당되는 enum 값을 넘겨서 퀘스트 목록중 해당되는 것을 찾아 값을 올린다
    public void QuestSuccessCheck(QuestType _questTypeIndex, int _value)
    {
        if (questObjects.Count == 0)
        {
            return;
        }

        for (int i = 0; i < questObjects.Count; i++)
        {
            QuestPanel questPanel = questObjects[i].gameObject.GetComponent <QuestPanel> ();

            if (questPanel.questTypeIndex == _questTypeIndex)
            {
                if (questPanel.nCompareCondition < questPanel.nCompleteCondition && questPanel.bIsQuest == true)
                {
                    questPanel.nCompareCondition += _value;
                    questPanel.ShowProgress();
                }

                if (questPanel.nCompareCondition >= questPanel.nCompleteCondition && questPanel.bIsQuest == true)
                {
                    questPanel.nCompareCondition = questPanel.nCompleteCondition;
                    questPanel.ShowProgress();
                    questPanel.bIsQuest = false;
                    expressionMark.SetActive(true);
                    questPanel.QuestCompleteActive();
                }
            }
        }
    }
示例#4
0
    public void CheckQuestDestroy()
    {
        QuestPanel deleteQuestPanel = null;

        for (int i = 0; i < questDay.transform.childCount; i++)
        {
            GameObject go = questDay.transform.GetChild(i).gameObject;
            deleteQuestPanel = go.GetComponent <QuestPanel> ();

            if (deleteQuestPanel.bIsQuest == false)
            {
                deleteQuestPanel.bIsQuest = false;
                deleteQuestPanel.startButton.SetActive(false);
                questObjectPool.ReturnObject(go);
                questObjects.Remove(deleteQuestPanel);
                questPopUpWindow_YesButton.onClick.RemoveListener(CheckQuestDestroy);
                questPopUpWindow_YesButton.onClick.RemoveListener(() => GameObjectSetActive(questPopUpWindow_YesNo, false));
                deleteQuestPanel = null;
            }
        }

        //퀘스트 타이머의 시간이 꺼져있을때
        if (questTimer.isTimeOn == false)
        {
            questTimer.StartQuestTimer();
        }
    }
示例#5
0
 public void EnableMinionPanel()
 {
     MinionPanel.SetActive(true);
     PlayerPanel.SetActive(false);
     ItemsPanel.SetActive(false);
     QuestPanel.SetActive(false);
 }
示例#6
0
    public void CheckCompleteQuestDestroy(int _questPanelIndex)
    {
        QuestPanel deleteQuestPanel = null;

        for (int i = 0; i < questDay.transform.childCount; i++)
        {
            GameObject go = questDay.transform.GetChild(i).gameObject;
            deleteQuestPanel = go.GetComponent <QuestPanel> ();

            if (_questPanelIndex == deleteQuestPanel.nQuestPanelIndex)
            {
                if (deleteQuestPanel.bIsQuest == false)
                {
                    SoundManager.instance.PlaySound(eSoundArray.ES_TouchSound_Menu);
                    deleteQuestPanel.bIsQuest           = true;
                    deleteQuestPanel.nCompareCondition  = 0;
                    deleteQuestPanel.nCompleteCondition = 0;
                    deleteQuestPanel.questTypeIndex     = QuestType.E_QUESTTYPE_NONE;
                    deleteQuestPanel.nMutiplyValue      = 0;
                    deleteQuestPanel.questData          = null;
                    deleteQuestPanel.nQuestIndex        = -1;

                    deleteQuestPanel.completeButton.SetActive(false);
                    questObjectPool.ReturnObject(go);
                    questObjects.Remove(deleteQuestPanel);


                    deleteQuestPanel = null;
                }
            }
        }
        SaveQuestData();
    }
示例#7
0
 //저장되어있던 데이터 배치
 public void QuestSaveDataDispatch()
 {
     for (int i = 0; i < questObjects.Count; i++)
     {
         QuestPanel questPanel = questObjects[i].gameObject.GetComponent <QuestPanel> ();
         questPanel.GetQuest(GameManager.Instance.cQuestSaveListInfo[i], this);
     }
 }
示例#8
0
    public void QuestInitStart()
    {
        GameObject quest;

        questPopUpWindow_YesNo.SetActive(false);
        questPopUpWindow_YesButton.onClick.RemoveListener(QuestInitStart);

        //시간이 다 될시
        if (questTimer.isTimeEnd == true)
        {
            nQuestCount = 0;
            AllDestroyQuest();
            questObjects.Clear();
            //Add
            for (int i = 0; i < nQuestMaxHaveCount; i++)
            {
                nQuestCount++;
                quest = questObjectPool.GetObject();
                quest.transform.SetParent(questDay.transform, false);
                quest.transform.localScale = Vector3.one;

                QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
                questObjects.Add(questPanel);
            }

            QuestDataDispatch();                //Data Dispatch

            questTimer.isTimeOn  = false;
            questTimer.isTimeEnd = false;
            questTimer.InitQuestTimer();
        }
        //초기화 버튼을 누를시
        if (isInitConfirm == true)
        {
            nQuestCount = 0;
            AllDestroyQuest();
            questObjects.Clear();
            //Add
            for (int i = 0; i < nQuestMaxHaveCount; i++)
            {
                nQuestCount++;
                quest = questObjectPool.GetObject();
                quest.transform.SetParent(questDay.transform, false);
                quest.transform.localScale = Vector3.one;

                QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
                questObjects.Add(questPanel);
            }

            QuestDataDispatch();                //Data Dispatch

            isInitConfirm       = false;
            questTimer.isTimeOn = false;
            questTimer.InitQuestTimer();
        }
    }
示例#9
0
    //Data 할당
    public void QuestDataDispatch()
    {
        for (int i = 0; i < questObjects.Count; i++)
        {
            QuestPanel questPanel = questObjects[i].gameObject.GetComponent <QuestPanel> ();

            int random = Random.Range(0, nQuestTotalCount);
            questPanel.GetQuest(questDatas [random], this);
        }
    }
示例#10
0
 public void OnclickQuest()
 {
     if (!GameObject.FindGameObjectWithTag("PANEL"))
     {
         QuestPanel chrarter = Instantiate(questPrefab, transform.parent.parent).GetComponent <QuestPanel>();
     }
     else
     {
         PanelManager game = GameObject.FindGameObjectWithTag("PANEL").GetComponent <PanelManager>();
         game.Close();
         QuestPanel chrarter = Instantiate(questPrefab, transform.parent.parent).GetComponent <QuestPanel>();
     }
 }
示例#11
0
    //Data 할당
    public void QuestDataDispatch(int _index)
    {
        nQuestTotalCount = GameManager.Instance.cQusetInfo.Length;


        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 6;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 5;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 4;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 3;
        }



        Debug.Log("Dispatch Quest");

        QuestPanel questPanel = questObjects[_index].gameObject.GetComponent <QuestPanel> ();

        //questPanel.InitQuestValue ();

        int random = Random.Range(0, nQuestTotalCount - 1);

        //Data Input
        questPanel.GetQuest(questDatas [random], this);

        questPanel.questTypeIndex = (QuestType)questDatas [random].nType;



        SaveQuestData();
    }
示例#12
0
    public void OnPointerClick(PointerEventData eventData)
    {
        GameObject getInfoGameObject = eventData.pointerEnter;

        if (getInfoGameObject.gameObject.name == "QuestPanel")
        {
            GameManager.Instance.cQuestSaveListInfo.Clear();
            int curItemCount = questDay.transform.childCount;
            for (int i = 0; i < curItemCount; i++)
            {
                Transform  child           = questDay.transform.GetChild(i);
                QuestPanel childQuestPanel = child.GetComponent <QuestPanel> ();
                GameManager.Instance.cQuestSaveListInfo.Add(childQuestPanel.questData);
            }
            questTimer.SaveTime();



            getInfoGameObject.SetActive(false);
        }

        //Test
        if (getInfoGameObject.gameObject.name == "CompleteButton")
        {
            QuestPanel questPanel = getInfoGameObject.GetComponentInParent <QuestPanel> ();
            questPanel.getGold = questPanel.questData.nCompleteCondition;
            questPanel.textProgressValue.text = questPanel.getGold.ToString() + "/" + questPanel.questData.nCompleteCondition.ToString();
            questPanel.QuestComplete();
            questPanel.bIsQuest = false;
            nQuestMileCount++;

            if (nQuestMileCount == nFirstReward)
            {
                //rewardCheckImage01.color = CheckColor;
                rewardCheckImage01.enabled = true;
            }

            if (nQuestMileCount == nSecondReward)
            {
                //rewardCheckImage02.color = CheckColor;
                rewardCheckImage02.enabled = true;
            }

            if (nQuestMileCount == nThirdReward)
            {
                //rewardCheckImage03.color = CheckColor;
                rewardCheckImage03.enabled = true;
            }
        }
    }
示例#13
0
    //저장되어있던 데이터 배치
    public void QuestSaveDataDispatch()
    {
        for (int i = 0; i < questObjects.Count; i++)
        {
            QuestPanel questPanel = questObjects[i].gameObject.GetComponent <QuestPanel> ();

            if (i == 0)
            {
                questPanel.GetQuest(questDatas [GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01], this,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_ProgressValue,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue);
            }
            if (i == 1)
            {
                questPanel.GetQuest(questDatas [GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02], this,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_ProgressValue,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue);
            }
            if (i == 2)
            {
                questPanel.GetQuest(questDatas [GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03], this,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_ProgressValue,
                                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_MultiplyValue);
            }
        }

        if (GameManager.Instance.cQuestSaveListInfo [0].nCurMileValue != 0)
        {
            nQuestMileCount = GameManager.Instance.cQuestSaveListInfo [0].nCurMileValue;
        }

        if (GameManager.Instance.cQuestSaveListInfo [0].isMileReward01 == true)
        {
            rewardCheckImage01.SetActive(true);
        }
        if (GameManager.Instance.cQuestSaveListInfo [0].isMileReward02 == true)
        {
            rewardCheckImage02.SetActive(true);
        }
        if (GameManager.Instance.cQuestSaveListInfo [0].isMileReward03 == true)
        {
            rewardCheckImage03.SetActive(true);
        }
        SaveQuestData();
    }
示例#14
0
        /// <summary>
        /// Upon changing tab we'll update the tab they selected incase data has updated!
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (tabControl1.SelectedIndex)
            {
            //  Item Tool
            case 0:
                ItemPanel.UpdateList();
                break;

            //  Monster Tool
            case 1:
                MonsterPanel.UpdateList();
                break;

            //  Quest Tool
            case 2:
                QuestPanel.UpdateList();
                break;

            //  Map Tool
            case 3:
                MapPanel.UpdateList();
                break;

            //  NPC Tool
            case 4:
                NPCPanel.UpdateList();
                break;

            //  GameShop Tool
            case 5:
                GameShopPanel.UpdateList();
                break;

            //  DropBuilder Tool
            case 6:
                ConquestPanel.UpdateList();
                break;

            case 7:
                DropPanel.UpdateList();
                break;
            }
        }
示例#15
0
    public void QuestDataDispatchInit(int _index)
    {
        nQuestTotalCount = GameManager.Instance.cQusetInfo.Length;

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 6;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 5;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 4;
        }

        if (GameManager.Instance.cBossPanelListInfo [0].isUnlockIceBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true &&
            GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == true && GameManager.Instance.cBossPanelListInfo [0].isUnlockSasinBoss == false)
        {
            nQuestTotalCount -= 3;
        }


        Debug.Log("Dispatch Quest");
        QuestPanel questPanel = questObjects[_index].gameObject.GetComponent <QuestPanel> ();


        int random = Random.Range(0, nQuestTotalCount - 1);

        questPanel.GetQuest(questDatas [random], this);


        isInGameOnOff = true;
    }
示例#16
0
    //게임을 시작하고 저장되어 있고 처음 퀘스트를 켰을때
    public void QuestSaveInitStart()
    {
        GameObject quest;

        nQuestCount = 0;
        AllDestroyQuest();
        questObjects.Clear();

        int nCurSaveQuestCount = 0;

        if (GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01 >= 0)
        {
            nCurSaveQuestCount++;
        }
        if (GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02 >= 0)
        {
            nCurSaveQuestCount++;
        }
        if (GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03 >= 0)
        {
            nCurSaveQuestCount++;
        }


        //Add
        for (int i = 0; i < nCurSaveQuestCount; i++)
        {
            nQuestCount++;
            quest = questObjectPool.GetObject();
            quest.transform.SetParent(questDay.transform, false);
            quest.transform.localScale = Vector3.one;

            QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
            questPanel.nQuestPanelIndex = i;
            questObjects.Add(questPanel);
        }

        QuestSaveDataDispatch();                //Data Dispatch

        questTimer.LoadTimeAndCheckTimeEnd();
        isInitConfirm = false;
    }
示例#17
0
    //게임을 시작하고 처음 퀘스트를 켰을때
    public void QuestSaveInitStart()
    {
        GameObject quest;

        nQuestCount = 0;
        AllDestroyQuest();
        questObjects.Clear();
        //Add
        for (int i = 0; i < GameManager.Instance.cQuestSaveListInfo.Count; i++)
        {
            nQuestCount++;
            quest = questObjectPool.GetObject();
            quest.transform.SetParent(questDay.transform, false);
            quest.transform.localScale = Vector3.one;

            QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
            questObjects.Add(questPanel);
        }

        QuestSaveDataDispatch();                //Data Dispatch

        isInitConfirm = false;
    }
示例#18
0
        private async void createFile(IFile file)
        {
            try
            {
                var dgv = new DataGridView();

                if (file.GetType() == typeof(QuestFile))
                {
                    file = file ?? new QuestFile("");
                    Program.LoadedFiles.Add(file);
                    Extensions.FileType = FileType.QuestFile;

                    var mainTab = new TabPage("QuestFile");
                    var qTab    = new TabPage("Quests");
                    var dTab    = new TabPage("Dialouges");
                    mainTab.BackColor = Color.White;
                    dTab.BackColor    = Color.White;
                    qTab.BackColor    = Color.White;

                    var tc = new TabControl();
                    tc.Dock         = DockStyle.Fill;
                    qTab.Padding    = new Padding(0, 5, 0, 0);
                    dTab.Padding    = new Padding(0, 5, 0, 0);
                    mainTab.Padding = new Padding(0, 5, 0, 0);

                    tc.TabPages.Add(qTab);
                    tc.TabPages.Add(dTab);

                    mainTab.Controls.Add(tc);

                    var qPanel = new QuestPanel((QuestFile)file);
                    qPanel.Dock = DockStyle.Fill;
                    qTab.Controls.Add(qPanel);
                    mainTab.Controls.Add(tc);

                    tcFiles.TabPages.Add(mainTab);
                    tcFiles.SelectedIndex = tcFiles.TabPages.Count - 1;
                }

                else if (file.GetType() == typeof(SHNFile))
                {
                    dgv                 = new DataGridView();
                    dgv.Dock            = DockStyle.Fill;
                    dgv.BackgroundColor = Color.WhiteSmoke;
                    dgv.DoubleBuffered(true);
                    dgv.DataSource = file;

                    ((SHNFile)file).CreateFile();

                    dgv.CellEnter += File_CellEnter;

                    var tab = new TabPage(((DataTable)file).TableName);
                    ((DataTable)file).RowChanged += new DataRowChangeEventHandler(File_RowChanged);
                    tab.Controls.Add(dgv);

                    tcFiles.TabPages.Add(tab);
                    tcFiles.SelectedIndex = tcFiles.TabPages.Count - 1;
                }

                else if (file.GetType() == typeof(ShineFile))
                {
                    var mainTab  = new TabPage(((ShineFile)file).DataSetName);
                    var tcTables = new TabControl();
                    tcTables.Dock = DockStyle.Fill;

                    tcTables.SelectedIndexChanged += new EventHandler((object s, EventArgs e) =>
                    {
                        ((ShineFile)file).SelectedIndex = tcTables.SelectedIndex;
                    });

                    mainTab.Controls.Add(tcTables);
                    tcFiles.TabPages.Add(mainTab);
                    mainTab.BackColor = Color.White;

                    tcFiles.SelectedIndex = tcFiles.TabCount - 1;

                    foreach (var table in ((ShineFile)file).Tables)
                    {
                        dgv                 = new DataGridView();
                        dgv.Dock            = DockStyle.Fill;
                        dgv.BackgroundColor = Color.WhiteSmoke;
                        dgv.DoubleBuffered(true);
                        dgv.DataSource = table;

                        dgv.CellEnter += File_CellEnter;

                        var tab = new TabPage(((DataTable)table).TableName);
                        ((DataTable)table).RowChanged += new DataRowChangeEventHandler(File_RowChanged);
                        tab.Controls.Add(dgv);

                        tcTables.TabPages.Add(tab);
                    }
                }

                updateFileInfo();
            }
            catch (Exception ex)
            {
                pbProgress.Visible = false;
                pbProgress.Value   = 0;
                lblStatus.Text     = "Ready";
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#19
0
    public void SaveQuestData()
    {
        if (questObjects.Count != 0)
        {
            Debug.Log("Save Local Quest Data");

            GameManager.Instance.cQuestSaveListInfo [0].bIsGoogleSave = false;

            for (int i = 0; i < questObjects.Count; i++)
            {
                if (questObjects.Count == 1)
                {
                    //Debug.Log ("QuestObjetc Count : 1");
                    if (i == 0)
                    {
                        QuestPanel questPanel = questObjects [0].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02 = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_ProgressValue = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = -1;

                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03 = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_ProgressValue = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = -1;
                }
                else if (questObjects.Count == 2)
                {
                    //Debug.Log ("QuestObjetc Count : 2");
                    if (i == 0)
                    {
                        QuestPanel questPanel = questObjects [0].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }
                    if (i == 1)
                    {
                        QuestPanel questPanel = questObjects [1].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }

                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03 = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_ProgressValue = -1;
                    GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_MultiplyValue = -1;
                }
                else
                {
                    //Debug.Log ("QuestObjetc Count : 3");
                    if (i == 0)
                    {
                        QuestPanel questPanel = questObjects [0].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex01_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }
                    if (i == 1)
                    {
                        QuestPanel questPanel = questObjects [1].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex02_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }
                    if (i == 2)
                    {
                        QuestPanel questPanel = questObjects [2].gameObject.GetComponent <QuestPanel> ();
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03 = questPanel.nQuestIndex;
                        GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_ProgressValue = questPanel.nCompareCondition;
                        if (questPanel.nMutiplyValue <= 0)
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_MultiplyValue = 1;
                        }
                        else
                        {
                            GameManager.Instance.cQuestSaveListInfo [0].nQuestIndex03_MultiplyValue = questPanel.nMutiplyValue;
                        }
                    }
                }
            }
            GameManager.Instance.cQuestSaveListInfo [0].nCurMileValue     = nQuestMileCount;
            GameManager.Instance.cQuestSaveListInfo [0].isMileReward01    = isMileOn01;
            GameManager.Instance.cQuestSaveListInfo [0].isMileReward02    = isMileOn02;
            GameManager.Instance.cQuestSaveListInfo [0].isMileReward03    = isMileOn03;
            GameManager.Instance.cQuestSaveListInfo [0].isMileRewardGet01 = isMile01Get;
            GameManager.Instance.cQuestSaveListInfo [0].isMileRewardGet02 = isMile02Get;
            GameManager.Instance.cQuestSaveListInfo [0].isMileRewardGet03 = isMile03Get;

            GameManager.Instance.SaveQuestList();
        }
        else
        {
            Debug.Log("Not Save Data");
        }
    }
示例#20
0
        /// <summary>
        /// Initializes all the menu panels and links them togther. Call this in the Game's
        /// create cycle. Lots of hard coding here! - we'll have to adjust it if the game's
        /// viewport size changes.
        /// </summary>
        public static void init()
        {
            if (initialized)
                return;

            //initialize static variables
            components = new List<Sprite>();
            panelStack = new Stack<Panel>();
            activePanel = menuBody;
            menuOpen = false;
            initialized = true;

            // places list
            placesScreen = new PlacesPanel(200, 480, 440, 380);
            placesScreen.setPopLocations(200, 480, 200, 100);
            placesScreen.setScrolling(7, 1);
            placesScreen.loadEntriesFromFile(Directories.TEXTDATA + "PlacesJournalInfo.txt");
            components.Add(placesScreen);

            // people list
            peopleScreen = new PeoplePanel(200, 480, 440, 380);
            peopleScreen.setPopLocations(200, 480, 200, 100);
            peopleScreen.setScrolling(7, 1);
            peopleScreen.loadEntriesFromFile(Directories.TEXTDATA + "PeopleJournalInfo.txt");
            components.Add(peopleScreen);

            // quest list
            questScreen = new QuestPanel(200, 480, 440, 380);
            questScreen.setPopLocations(200, 480, 200, 100);
            questScreen.setScrolling(7, 1);
            questScreen.loadEntriesFromFile(Directories.TEXTDATA + "QuestJournalInfo.txt");
            components.Add(questScreen);

            // journal prompt
            DialogPanel journalPrompt = new DialogPanel(200, -100, 440, 100);
            journalPrompt.setMessage("What type of info do you need?");
            journalPrompt.setRefreshMessage(journalPrompt.getMessage());
            ScreenSpecifierEntry questEntry = new ScreenSpecifierEntry("Quests", journalPrompt, questScreen);
            questEntry.setNewMessage("Looking up past and current quests...");
            questEntry.setOtherPanels(peopleScreen, placesScreen);
            ScreenSpecifierEntry peopleEntry = new ScreenSpecifierEntry("People", journalPrompt, peopleScreen);
            peopleEntry.setNewMessage("Looking up intel on individuals...");
            peopleEntry.setOtherPanels(questScreen, placesScreen);
            ScreenSpecifierEntry placesEntry = new ScreenSpecifierEntry("Places", journalPrompt, placesScreen);
            placesEntry.setNewMessage("Looking up intel on locations...");
            placesEntry.setOtherPanels(questScreen, peopleScreen);
            journalPrompt.loadEntries(questEntry, peopleEntry, placesEntry);
            journalPrompt.setPopLocations(200, -100, 200, 0);
            journalPrompt.setYMargin(20);
            journalPrompt.setYDivider(journalPrompt.getHeight() - 30);
            components.Add(journalPrompt);

            // clues info screen
            TextPanel cluesInfoScreen = new TextPanel(400, -200, 240, 200);
            cluesInfoScreen.setMessage("Info about the clue here.");
            cluesInfoScreen.setPopLocations(400, -200, 400, 0);
            components.Add(cluesInfoScreen);

            // clues list
            ListPanel cluesScreen = new CluePanel(200, 480, 200, 480, cluesInfoScreen);
            cluesScreen.setPopLocations(200, 480, 200, 0);
            components.Add(cluesScreen);

            // inventory item info screen
            TextPanel inventoryInfoScreen = new TextPanel(200, 480, 440, 150);
            inventoryInfoScreen.setMessage("This is where information about the item will appear.");
            inventoryInfoScreen.setPopLocations(200, 480, 200, 330);
            components.Add(inventoryInfoScreen);

            // inventory screen
            inventoryScreen = new InventoryPanel(200, -330, 440, 330);
            inventoryScreen.setMessagePanel(inventoryInfoScreen);
            inventoryScreen.loadEntriesFromFile(Directories.TEXTDATA + "ItemInfo.txt");
            inventoryScreen.setScrolling(5, 2);
            inventoryScreen.setPopLocations(200, -330, 200, 0);
            components.Add(inventoryScreen);

            // reputation screen
            ReputationPanel reputationScreen = new ReputationPanel(200, 480, 440, 480);
            reputationScreen.setPopLocations(200, 480, 200, 0);
            components.Add(reputationScreen);

            // sound config screen
            SoundConfigPanel soundConfigScreen = new SoundConfigPanel(200, 480, 440, 380);
            soundConfigScreen.setPopLocations(200, 480, 200, 100);
            components.Add(soundConfigScreen);

            // key config screen
            KeyConfigPanel keyConfigScreen = new KeyConfigPanel(200, 480, 440, 380);
            KeyModifierEntry keyAction = new KeyModifierEntry("Talk/Action/Confirm", keyConfigScreen, KeyInputType.Action);
            KeyModifierEntry keyCancel = new KeyModifierEntry("Go Back/Cancel", keyConfigScreen, KeyInputType.Cancel);
            KeyModifierEntry keyShoot = new KeyModifierEntry("Shoot", keyConfigScreen, KeyInputType.Shoot);
            KeyModifierEntry keyPickpocket = new KeyModifierEntry("Pickpocket", keyConfigScreen, KeyInputType.Pickpocket);
            KeyModifierEntry keyUp = new KeyModifierEntry("Move Up", keyConfigScreen, KeyInputType.MoveNorth);
            KeyModifierEntry keyDown = new KeyModifierEntry("Move Down", keyConfigScreen, KeyInputType.MoveSouth);
            KeyModifierEntry keyLeft = new KeyModifierEntry("Move Left", keyConfigScreen, KeyInputType.MoveWest);
            KeyModifierEntry keyRight = new KeyModifierEntry("Move Right", keyConfigScreen, KeyInputType.MoveEast);
            KeyModifierEntry keyToggleMenu = new KeyModifierEntry("Toggle Menu", keyConfigScreen, KeyInputType.MenuToggle);
            keyConfigScreen.loadEntries(keyAction, keyCancel, keyShoot, keyPickpocket, keyUp, keyDown, keyLeft, keyRight, keyToggleMenu);
            keyConfigScreen.alignEntriesVertical();
            keyConfigScreen.setPopLocations(200, 480, 200, 100);
            components.Add(keyConfigScreen);

            // config prompt
            DialogPanel configPrompt = new DialogPanel(200, -100, 440, 100);
            keyConfigScreen.setPreviousPanel(configPrompt);
            configPrompt.setMessage("What would you like to configure?");
            configPrompt.setRefreshMessage(configPrompt.getMessage());
            ScreenSpecifierEntry keyEntry = new ScreenSpecifierEntry("Key Controls", configPrompt, keyConfigScreen);
            keyEntry.setNewMessage("Configuring key controls... Press [" +
                Enum.GetName(typeof(Keys), KeyboardManager.getKeyControl(KeyInputType.Action)) +
                "] to modify the key.");
            keyEntry.setOtherPanels(soundConfigScreen);
            ScreenSpecifierEntry soundEntry = new ScreenSpecifierEntry("Sound", configPrompt, soundConfigScreen);
            soundEntry.setNewMessage("Configuring sound settings...");
            soundEntry.setOtherPanels(keyConfigScreen);
            configPrompt.loadEntries(keyEntry, soundEntry);
            configPrompt.setPopLocations(200, -100, 200, 0);
            configPrompt.setYMargin(20);
            configPrompt.setYDivider(configPrompt.getHeight() - 30);
            components.Add(configPrompt);

            // save file data screen
            SaveDataPanel saveScreen = new SaveDataPanel(200, 480, 440, 380);
            saveScreen.setScrolling(5, 1);
            saveScreen.loadSaveData();
            saveScreen.setPopLocations(200, 480, 200, 100);
            components.Add(saveScreen);

            // save/load prompt
            DialogPanel savePrompt = new DialogPanel(200, -100, 440, 100);
            saveScreen.setPreviousPanel(savePrompt);
            savePrompt.setMessage("Would you like to save the current game or load an older game?");
            savePrompt.setRefreshMessage(savePrompt.getMessage());
            SaveTypeSpecifierEntry saveEntry = new SaveTypeSpecifierEntry("Save", savePrompt, saveScreen);
            saveEntry.setSaveType(true);
            saveEntry.setNewMessage("Saving current progress...select a file to overwrite.");
            SaveTypeSpecifierEntry loadEntry = new SaveTypeSpecifierEntry("Load", savePrompt, saveScreen);
            loadEntry.setSaveType(false);
            loadEntry.setNewMessage("Loading another save file...select a file to load.");
            savePrompt.loadEntries(saveEntry, loadEntry);
            //savePrompt.alignEntriesHorizontal();
            savePrompt.setPopLocations(200, -100, 200, 0);
            savePrompt.setYMargin(20);
            savePrompt.setYDivider(savePrompt.getHeight() - 30);
            components.Add(savePrompt);

            // exit game prompt
            DialogPanel exitPrompt = new DialogPanel(200, 480, 350, 200);
            exitPrompt.setMessage("Are you sure you want to exit the game? All unsaved progress will be lost.");
            ExitEntry cancelEntry = new ExitEntry("Cancel", false);
            ExitEntry exitEntry = new ExitEntry("Quit Game", true);
            exitPrompt.loadEntries(cancelEntry, exitEntry);
            exitPrompt.setPopLocations(200, 480, 200, 280);
            components.Add(exitPrompt);

            // main menu
            menuBody = new ListPanel(-200, 0, 200, 480);
            SubMenuFocusEntry menuBodyJournal = new SubMenuFocusEntry("Journal", journalPrompt);
            SubMenuFocusEntry menuBodyClues = new SubMenuFocusEntry("Clues", cluesScreen);
            SubMenuFocusEntry menuBodyInventory = new SubMenuFocusEntry("Inventory", inventoryScreen);
            //SubMenuFocusEntry menuBodyEquip = new SubMenuFocusEntry("Equip", null);
            SubMenuFocusEntry menuBodyReputation = new SubMenuFocusEntry("Reputation", reputationScreen);
            SubMenuFocusEntry menuBodyConfig = new SubMenuFocusEntry("Config", configPrompt);
            SubMenuFocusEntry menuBodySave = new SubMenuFocusEntry("Save/Load", savePrompt);
            SubMenuFocusEntry menuBodyExit = new SubMenuFocusEntry("Exit Game", exitPrompt);
            menuBody.loadEntries(menuBodyJournal, menuBodyClues, menuBodyInventory, /*menuBodyEquip,*/
                menuBodyReputation, menuBodyConfig, menuBodySave, menuBodyExit);
            menuBody.alignEntriesVertical();
            menuBody.setPopLocations(-200, 0, 0, 0);
            components.Add(menuBody);

            // menu cursor
            menuArrow = new CursorArrow(-175, 67);
            menuArrow.setPopLocations(menuBody.getHideX() + 25, menuBody.getHideY() + 67,
                menuBody.getAppearX() + 25, menuBody.getAppearY() + 67);
            components.Add(menuArrow);

            // journal entry info screen
            // this panel "covers" the menu cursor, so it goes last
            components.Add(JournalInfoPanel.instance);

            //group panels that pop in and out together
            PanelGroup pg0 = new PanelGroup(menuBody);
            PanelGroup pg1 = new PanelGroup(journalPrompt, questScreen, peopleScreen, placesScreen);
            PanelGroup pg1a = new PanelGroup(JournalInfoPanel.instance);
            PanelGroup pg2 = new PanelGroup(cluesScreen, cluesInfoScreen);
            PanelGroup pg3 = new PanelGroup(inventoryScreen, inventoryInfoScreen);
            PanelGroup pg4 = new PanelGroup(reputationScreen);
            PanelGroup pg5 = new PanelGroup(configPrompt, keyConfigScreen, soundConfigScreen);
            PanelGroup pg6 = new PanelGroup(saveScreen, savePrompt);
            PanelGroup pg7 = new PanelGroup(exitPrompt);

            PanelGroupSorter.addPanelGroups(pg0, pg1, pg1a, pg2, pg3, pg4, pg5, pg6, pg7);
        }
示例#21
0
    public void OnclickRightBT()
    {
        QuestPanel questPanel = Instantiate(questPrefab, transform.parent).GetComponent <QuestPanel>();

        Close();
    }
示例#22
0
        private async void openFile(string fileName)
        {
            try
            {
                dynamic file = null;
                var     dgv  = new DataGridView();

                // Display the hidden progressbar in the statusbar.
                pbProgress.Visible = true;

                // Determine what file type it is and cast to the appropriate type.
                switch (Path.GetExtension(fileName))
                {
                case ".shn":
                    if (Path.GetFileNameWithoutExtension(fileName).ToLower() == "questdata")
                    {
                        file = new QuestFile(fileName);
                        Program.LoadedFiles.Add(file);
                        Extensions.FileType = FileType.QuestFile;

                        var mainTab = new TabPage("QuestFile");
                        var qTab    = new TabPage("Quests");
                        var dTab    = new TabPage("Dialouges");
                        mainTab.BackColor = Color.White;
                        dTab.BackColor    = Color.White;
                        qTab.BackColor    = Color.White;

                        var tc = new TabControl();
                        tc.Dock         = DockStyle.Fill;
                        qTab.Padding    = new Padding(0, 5, 0, 0);
                        dTab.Padding    = new Padding(0, 5, 0, 0);
                        mainTab.Padding = new Padding(0, 5, 0, 0);

                        tc.TabPages.Add(qTab);
                        tc.TabPages.Add(dTab);

                        mainTab.Controls.Add(tc);

                        var qPanel = new QuestPanel(file);
                        qPanel.Dock    = DockStyle.Fill;
                        qTab.BackColor = Color.White;
                        qTab.Controls.Add(qPanel);

                        tcFiles.TabPages.Add(mainTab);
                        tcFiles.SelectedIndex = tcFiles.TabPages.Count - 1;

                        pbProgress.Visible = false;
                        pbProgress.Value   = 0;
                        lblStatus.Text     = "Ready";
                        updateFileInfo();

                        return;
                    }

                    file = new SHNFile(fileName);
                    Extensions.FileType = FileType.SHNFile;

                    break;

                case ".txt":
                    file = new ShineFile(fileName);
                    Extensions.FileType = FileType.ShineFile;

                    break;

                default:
                    throw new Exception("File type not supported");
                }

                lblStatus.Text = "Reading " + Path.GetFileName(fileName);

                // Await the asynchronous Load method and display the reported progress in our progressbar.
                await Task.Run(() => file.Load(new Progress <int>(value =>
                                                                  mainStatusStrip.Invoke(new MethodInvoker(() =>
                {
                    pbProgress.Value = value;
                }))
                                                                  )));

                Program.LoadedFiles.Add(file);

                if (file.GetType() == typeof(SHNFile))
                {
                    dgv                 = new DataGridView();
                    dgv.Dock            = DockStyle.Fill;
                    dgv.BackgroundColor = Color.WhiteSmoke;
                    dgv.DoubleBuffered(true);
                    dgv.DataSource = file;

                    dgv.CellEnter += File_CellEnter;

                    var tab = new TabPage(file.TableName);
                    file.RowChanged += new DataRowChangeEventHandler(File_RowChanged);
                    tab.Controls.Add(dgv);

                    tcFiles.TabPages.Add(tab);
                    tcFiles.SelectedIndex = tcFiles.TabPages.Count - 1;
                }

                else if (file.GetType() == typeof(ShineFile))
                {
                    var mainTab  = new TabPage(file.DataSetName);
                    var tcTables = new TabControl();
                    tcTables.Dock = DockStyle.Fill;

                    tcTables.SelectedIndexChanged += new EventHandler((object s, EventArgs e) =>
                    {
                        file.SelectedIndex = tcTables.SelectedIndex;
                    });

                    mainTab.Controls.Add(tcTables);
                    tcFiles.TabPages.Add(mainTab);
                    mainTab.BackColor = Color.White;

                    tcFiles.SelectedIndex = tcFiles.TabCount - 1;

                    foreach (var table in file.Tables)
                    {
                        dgv                 = new DataGridView();
                        dgv.Dock            = DockStyle.Fill;
                        dgv.BackgroundColor = Color.WhiteSmoke;
                        dgv.DoubleBuffered(true);
                        dgv.DataSource = table;

                        dgv.CellEnter += File_CellEnter;

                        var tab = new TabPage(table.TableName);
                        table.RowChanged += new DataRowChangeEventHandler(File_RowChanged);
                        tab.Controls.Add(dgv);

                        tcTables.TabPages.Add(tab);
                    }
                }


                // Hide and reset the progressbar.
                pbProgress.Visible = false;
                pbProgress.Value   = 0;
                lblStatus.Text     = "Ready";
                updateFileInfo();
            }
            catch (Exception ex)
            {
                pbProgress.Visible = false;
                pbProgress.Value   = 0;
                lblStatus.Text     = "Ready";
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#23
0
    //퀘스트 초기화 시작
    public void QuestInitStart()
    {
        GameObject quest;

        questAdsPopUpWindow_YesNo.SetActive(false);


        //처음 퀘스트 켜질시
        if (GameManager.Instance.cQuestSaveListInfo [0].bIsFirstActive == true)
        {
            Debug.Log("Quest Fire Dispatch");
            GameManager.Instance.cQuestSaveListInfo [0].bIsFirstActive = false;

            nQuestCount = 0;
            AllDestroyQuest();
            questObjects.Clear();
            //Add
            for (int i = 0; i < nQuestMaxHaveCount; i++)
            {
                quest = questObjectPool.GetObject();
                quest.transform.SetParent(questDay.transform, false);
                quest.transform.localScale = Vector3.one;

                QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
                questPanel.nQuestPanelIndex = i;

                questPanel.bIsQuest = true;

                questPanel.nCompareCondition  = 0;
                questPanel.nCompleteCondition = 0;
                questPanel.questTypeIndex     = QuestType.E_QUESTTYPE_NONE;
                questPanel.nMutiplyValue      = 0;
                questPanel.questData          = null;
                questPanel.nQuestIndex        = -1;

                int nQuestIndex = GetQuestRandomIndex();
                questPanel.GetQuest(GameManager.Instance.cQusetInfo [nQuestIndex], this);

                questObjects.Add(questPanel);
            }


            SaveQuestData();
            questTimer.isTimeOn  = false;
            questTimer.isTimeEnd = false;
            questTimer.InitQuestTimer();              //Timer On
            questTimer.addQuestToEmptySpace.SetActive(false);
            questTimer.SaveTime();                    //Save Time
            return;
        }

        //시간이 다 안되고 초기화 버튼을 누를시
        if (questTimer.isTimeEnd == false && isInitConfirm == true)
        {
            Debug.Log("NoTime And Init Call!");
            nQuestCount = 0;


            //개수가 최대 개수와 같으면 경고창을 띄운다
            if (questObjects.Count >= nQuestMaxHaveCount)
            {
                ShowEmptyQuestFull();
                questTimer.isTimeOn  = false;
                questTimer.isTimeEnd = false;
                questTimer.InitQuestTimer();
                return;
            }

            for (int i = questObjects.Count; questObjects.Count < nQuestMaxHaveCount; i++)
            {
                nQuestCount++;
                quest = questObjectPool.GetObject();
                quest.transform.SetParent(questDay.transform, false);
                quest.transform.localScale = Vector3.one;

                QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
                questPanel.nQuestPanelIndex = i;
                questPanel.bIsQuest         = true;

                questPanel.nCompareCondition  = 0;
                questPanel.nCompleteCondition = 0;
                questPanel.questTypeIndex     = QuestType.E_QUESTTYPE_NONE;
                questPanel.nMutiplyValue      = 0;
                questPanel.questData          = null;
                questPanel.nQuestIndex        = -1;

                int nQuestIndex = GetQuestRandomIndex();
                questPanel.GetQuest(GameManager.Instance.cQusetInfo [nQuestIndex], this);

                questObjects.Add(questPanel);
            }


            SaveQuestData();
            questTimer.isTimeOn  = false;
            questTimer.isTimeEnd = false;
            questTimer.InitQuestTimer();
            questTimer.addQuestToEmptySpace.SetActive(false);
            return;
        }

        //초기화 버튼을 누를시 빈곳에 랜덤으로 넣어준다
        if (isInitConfirm == true && questTimer.isTimeEnd == true)
        {
            nQuestCount = 0;

            isInitConfirm       = false;
            questTimer.isTimeOn = false;
            questTimer.InitQuestTimer();

            //개수가 최대 개수와 같으면 경고창을 띄운다
            if (questObjects.Count >= nQuestMaxHaveCount)
            {
                ShowEmptyQuestFull();
                questTimer.isTimeOn  = false;
                questTimer.isTimeEnd = false;
                questTimer.InitQuestTimer();
                return;
            }

            for (int i = questObjects.Count; i < nQuestMaxHaveCount; i++)
            {
                nQuestCount++;
                quest = questObjectPool.GetObject();
                quest.transform.SetParent(questDay.transform, false);
                quest.transform.localScale = Vector3.one;

                QuestPanel questPanel = quest.gameObject.GetComponent <QuestPanel> ();
                questPanel.bIsQuest = true;

                questPanel.nCompareCondition  = 0;
                questPanel.nCompleteCondition = 0;
                questPanel.questTypeIndex     = QuestType.E_QUESTTYPE_NONE;
                questPanel.nMutiplyValue      = 0;
                questPanel.questData          = null;
                questPanel.nQuestIndex        = -1;

                int nQuestIndex = GetQuestRandomIndex();
                questPanel.GetQuest(GameManager.Instance.cQusetInfo [nQuestIndex], this);
                questObjects.Add(questPanel);
                //QuestDataDispatch (i);	//Data Dispatch
            }
            SaveQuestData();

            questTimer.isTimeOn  = false;
            questTimer.isTimeEnd = false;
            questTimer.InitQuestTimer();
            questTimer.addQuestToEmptySpace.SetActive(false);

            return;
        }
        //
    }
示例#24
0
        void update_element()
        {
            RPGPanel.Controls.Clear();

            Control ctrl  = null;
            int     level = get_party_level();

            if (fPoint.Element is Encounter)
            {
                EncounterPanel panel = new EncounterPanel();
                panel.Encounter  = fPoint.Element as Encounter;
                panel.PartyLevel = level;

                ctrl = panel;
            }

            if (fPoint.Element is SkillChallenge)
            {
                SkillChallengePanel panel = new SkillChallengePanel();
                panel.Challenge  = fPoint.Element as SkillChallenge;
                panel.PartyLevel = level;

                ctrl = panel;
            }

            if (fPoint.Element is TrapElement)
            {
                TrapElementPanel panel = new TrapElementPanel();
                panel.Trap = fPoint.Element as TrapElement;

                ctrl = panel;
            }

            if (fPoint.Element is Quest)
            {
                QuestPanel panel = new QuestPanel();
                panel.Quest = fPoint.Element as Quest;

                ctrl = panel;
            }

            if (fPoint.Element is MapElement)
            {
                MapElementPanel panel = new MapElementPanel();
                panel.MapElement = fPoint.Element as MapElement;

                ctrl = panel;
            }

            if (ctrl == null)
            {
                WebBrowser browser = new WebBrowser();
                browser.IsWebBrowserContextMenuEnabled = false;
                browser.ScriptErrorsSuppressed         = true;
                browser.WebBrowserShortcutsEnabled     = false;
                browser.ScrollBarsEnabled = false;
                browser.DocumentText      = get_element_html();
                browser.Navigating       += new WebBrowserNavigatingEventHandler(element_select);
                ctrl = browser;
            }

            if (ctrl != null)
            {
                ctrl.Dock = DockStyle.Fill;
                RPGPanel.Controls.Add(ctrl);
            }
        }
示例#25
0
 /// <summary>
 /// The Constructor of the Tool
 /// </summary>
 public MirDataTool()
 {
     InitializeComponent();
     FormClosing += MirDataTool_FormClosing;
     KeyDown     += MirDataTool_KeyDown;
     #region Warn the user of mis matching data!
     DialogResult dialogResult = MessageBox.Show(string.Format("This tool requires all Data match if they are going to interact with one another.\r\n" +
                                                               "This Means Map Info and Game Shop contents will hold incorrect values.\r\n" +
                                                               "It is advised you export the data from the Server and then work on that externally." +
                                                               "Do you wish to continue?"), "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
     if (dialogResult == DialogResult.No)
     {
         Close();
     }
     #endregion
     #region First time run?
     if (Program.firstRun)
     {
         ConfigForm form = new ConfigForm(ToolVersion);
         form.ShowDialog();
     }
     #endregion
     #region Tool Version check
     if (ToolVersion > Settings.ToolVersion)
     {
         ConfigForm form = new ConfigForm(ToolVersion);
         form.ShowDialog();
     }
     #endregion
     #region Initial File Checks
     if ((!File.Exists(Settings.DatabasePath + "ItemInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "QuestInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "MonsterInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "MapInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "NPCInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "GameShopInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "ConquestInfo.dat")) ||
         (!File.Exists(Settings.DatabasePath + "CraftInfo.dat")))
     {
         DialogResult result = MessageBox.Show(string.Format("One or more .dat files could not be found!\r\n" +
                                                             "Clicking Yes will bring up the Config dialog for you to locate the .dat file(s).\r\n" +
                                                             "Clicking No will allow you to create a new .dat file.\r\n" +
                                                             "Clicking Cancel will close the Tool."),
                                               ".dat(s) not found!",
                                               MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             ConfigForm form = new ConfigForm(ToolVersion);
             form.ShowDialog();
         }
         else
         {
             #region Data file creation
             if (!File.Exists(Settings.DatabasePath + "ItemInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "ItemInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 ItemIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "QuestInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "QuestInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 QuestIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "MonsterInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "MonsterInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 MonsterIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "MapInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "MapInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 MapIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "NPCInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "NPCInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 NPCIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "GameShopInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "GameShopInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 GameShopIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "ConquestInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "ConquestInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 ConquestIndex = 0;
             }
             if (!File.Exists(Settings.DatabasePath + "CraftInfo.dat"))
             {
                 using (FileStream stream = File.Create(Settings.DatabasePath + "CraftInfo.dat"))
                 {
                     using (BinaryWriter writer = new BinaryWriter(stream))
                     {
                         writer.Write(0);
                     }
                 }
                 CraftIndex = 0;
             }
             #endregion
         }
     }
     else
     {
         string ReadResult = "";
         #region Load Data
         int highestIndex = 0;
         if (File.Exists(Settings.DatabasePath + "ItemInfo.dat"))
         {
             List <ItemInfo> temp = new List <ItemInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "ItemInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new ItemInfo(reader, Settings.DatabaseVersion, Settings.CustomDatabaseVersion));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             ItemIndex = highestIndex;
             ItemPanel.ItemInfoList = temp;
             ReadResult            += string.Format("{0} Items loaded, Next Item Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "QuestInfo.dat"))
         {
             highestIndex = 0;
             List <QuestInfo> temp = new List <QuestInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "QuestInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new QuestInfo(reader));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             QuestIndex = highestIndex;
             QuestPanel.QuestInfoList = temp;
             ReadResult += string.Format("{0} Quests loaded, Next Quest Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "MonsterInfo.dat"))
         {
             highestIndex = 0;
             List <MonsterInfo> temp = new List <MonsterInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "MonsterInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new MonsterInfo(reader));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             MonsterIndex = highestIndex;
             MonsterPanel.MonsterInfoList = temp;
             ReadResult += string.Format("{0} Monsters loaded, Next Monster Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "MapInfo.dat"))
         {
             highestIndex = 0;
             List <MapInfo> temp = new List <MapInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "MapInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new MapInfo(reader));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             MapIndex             = highestIndex;
             MapPanel.MapInfoList = temp;
             ReadResult          += string.Format("{0} Maps loaded, Next Map Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "NPCInfo.dat"))
         {
             highestIndex = 0;
             List <NPCInfo> temp = new List <NPCInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "NPCInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new NPCInfo(reader));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             NPCIndex             = highestIndex;
             NPCPanel.NPCInfoList = temp;
             ReadResult          += string.Format("{0} NPCs loaded, Next NPC Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "GameShopInfo.dat"))
         {
             highestIndex = 0;
             List <GameShopItem> temp = new List <GameShopItem>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "GameShopInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new GameShopItem(reader, true));
                         if (temp[i].GIndex > highestIndex)
                         {
                             highestIndex = temp[i].GIndex;
                         }
                     }
                 }
             }
             GameShopIndex = highestIndex;
             GameShopPanel.GameShopInfoList = temp;
             ReadResult += string.Format("{0} GameShop Items loaded, Next GameShop Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "ConquestInfo.dat"))
         {
             highestIndex = 0;
             List <ConquestInfo> temp = new List <ConquestInfo>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "ConquestInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new ConquestInfo(reader));
                         if (temp[i].Index > highestIndex)
                         {
                             highestIndex = temp[i].Index;
                         }
                     }
                 }
             }
             ConquestIndex = highestIndex;
             ConquestPanel.ConquestInfos = temp;
             ReadResult += string.Format("{0} Conquests loaded, Next Conquest Index {1}.\r\n", temp.Count, highestIndex + 1);
         }
         if (File.Exists(Settings.DatabasePath + "CraftInfo.dat"))
         {
             highestIndex = 0;
             List <CraftItem> temp = new List <CraftItem>();
             using (FileStream stream = File.OpenRead(Settings.DatabasePath + "CraftInfo.dat"))
             {
                 using (BinaryReader reader = new BinaryReader(stream))
                 {
                     int count = reader.ReadInt32();
                     for (int i = 0; i < count; i++)
                     {
                         temp.Add(new CraftItem(reader));
                         if (temp[i].Recipie > (byte)highestIndex)
                         {
                             highestIndex = (int)temp[i].Recipie;
                         }
                     }
                 }
             }
             CraftIndex = highestIndex;
             CraftToolPanel.CraftItems = temp;
             ReadResult += string.Format("{0} Crafts loaded, Next Craft Index {1}\r\n", temp.Count, highestIndex + 1);
         }
         #endregion
         MessageBox.Show(ReadResult);
     }
     #endregion
     #region Interface Update check
     if (itemToolPanel.ItemInfoList.Count > 0)
     {
         itemToolPanel.UpdateList();
     }
     #endregion
     #region Set Child Control Parent as the MirDataTool to share functions and interact with each other.
     ConquestPanel.SetChild(this);
     DropPanel.SetChild(this);
     GameShopPanel.SetChild(this);
     ItemPanel.SetChild(this);
     MapPanel.SetChild(this);
     MonsterPanel.SetChild(this);
     NPCPanel.SetChild(this);
     QuestPanel.SetChild(this);
     CraftToolPanel.SetChild(this);
     #endregion
 }