示例#1
0
        private void FormQuest_Load(object sender, EventArgs e)
        {
            /*/
             * APIObserver o = APIObserver.Instance;
             *
             * APIReceivedEventHandler rec = ( string apiname, dynamic data ) => Invoke( new APIReceivedEventHandler( APIUpdated ), apiname, data );
             *
             * o.APIList["api_req_quest/clearitemget"].RequestReceived += rec;
             *
             * o.APIList["api_get_member/questlist"].ResponseReceived += rec;
             * //*/

            KCDatabase.Instance.Quest.QuestUpdated += Updated;


            ClearQuestView();

            try {
                int sort = Utility.Configuration.Config.FormQuest.SortParameter;

                QuestView.Sort(QuestView.Columns[sort >> 1], (sort & 1) == 0 ? ListSortDirection.Ascending : ListSortDirection.Descending);
            } catch (Exception) {
                QuestView.Sort(QuestView_Name, ListSortDirection.Ascending);
            }


            Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

            Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormQuest]);
        }
示例#2
0
 // Use this for initialization
 void Awake()
 {
     myTransform = transform;
     initialPos  = myTransform.localPosition;
     gameStage   = myTransform.parent.GetComponent <GameStage>();
     questView   = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }
示例#3
0
    public void LoadStage(string stageNum)
    {
        viewLoader.LoadViewName("QuestView");
        QuestView questView = viewLoader.CurrentView.GetComponent <QuestView>();

        questView.LoadStage(areaNum.ToString(), stageNum);
    }
示例#4
0
    void Start()
    {
        _questView    = Game.Instance.UI.QuestView;
        _dialogueView = Game.Instance.UI.DialogueView;

        _narrative = Game.Instance.Narrative;
        _narrative.StoryProgressed.AddListener(OnProgress);
    }
示例#5
0
 private void QuestView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right && e.RowIndex >= 0)
     {
         QuestView.ClearSelection();
         QuestView.Rows[e.RowIndex].Selected = true;
     }
 }
示例#6
0
    // Use this for initialization
    void Awake()
    {
        questView = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
        BoxCollider2D boxCollider2D = GetComponent <BoxCollider2D>();
        Vector3       localScale    = transform.localScale;

        y = transform.localPosition.y + boxCollider2D.size.y * localScale.y;
    }
示例#7
0
    void Start()
    {
        _questView    = Game.Instance.UI.QuestView;
        _dialogueView = Game.Instance.UI.DialogueView;

        _narrative = Game.Instance.Narrative;
        _narrative.StoryProgressed.AddListener(OnProgress);

        _soundEngine = GameObject.FindGameObjectWithTag(GameConstants.Persistent).GetComponentInChildren <SoundEngine>();
    }
示例#8
0
    void Start()
    {
        Viewer = QuestView.Instance;
        Viewer.Setup();

        /*
         *  Viewer.AddListener(delegate {
         *  GetQuestByName(Viewer.options[Viewer.value].text);
         *  });
         */
    }
示例#9
0
    public void AddQuest(Quest quest)
    {
        m_activeQuests.Add(quest);
        QuestView qv = Instantiate(m_viewPrefab, m_questBoardView);

        qv.transform.localScale = Vector3.one;

        qv.title.text       = quest.questTitle;
        qv.description.text = quest.questDescription;

        m_questViews.Add(qv); // for optional updating progress
    }
示例#10
0
文件: GiveBook.cs 项目: cyndrdev/myah
    void Start()
    {
        if (!books.Any())
        {
            throw new System.Exception();
        }

        _questView    = Game.Instance.UI.QuestView;
        _dialogueView = Game.Instance.UI.DialogueView;

        _narrative = Game.Instance.Narrative;
        _narrative.StoryProgressed.AddListener(OnProgress);

        _storage = Game.Instance.Storage;
    }
		private void OnGameIntroductionComplete(object sender, EventArgs args)
		{
			// Fire up the first Quest!
			_heroes = new List<Hero>();
			_heroes.Add(new Hero(new AvatarClassBarbarian(_chanceProvider)));
			_heroes.Add(new Hero(new AvatarClassDwarf(_chanceProvider)));
			//_heroes.Add(new Hero(new AvatarClassElf(_chanceProvider)));
			//_heroes.Add(new Hero(new AvatarClassWizard(_chanceProvider)));

			TheTrial questOne = new TheTrial(_heroes);
			QuestView questView = new QuestView(questOne, _chanceProvider, _storyTeller);
			questView.HeroesWin += OnQuestHeroesWin;
			questView.HeroesLose += OnQuestHeroesLose;
			_navigationService.Navigate(questView);
		}
示例#12
0
        void Updated()
        {
            if (!KCDatabase.Instance.Quest.IsLoaded)
            {
                return;
            }

            QuestView.SuspendLayout();

            QuestView.Rows.Clear();

            foreach (var q in KCDatabase.Instance.Quest.Quests.Values)
            {
                if (MenuMain_ShowRunningOnly.Checked && !(q.State == 2 || q.State == 3))
                {
                    continue;
                }

                switch (q.Type)
                {
                case 2:
                case 4:
                case 5:
                    if (!MenuMain_ShowDaily.Checked)
                    {
                        continue;
                    }
                    break;

                case 3:
                    if (!MenuMain_ShowWeekly.Checked)
                    {
                        continue;
                    }
                    break;

                case 6:
                    if (!MenuMain_ShowMonthly.Checked)
                    {
                        continue;
                    }
                    break;

                default:
                    if (!MenuMain_ShowOnce.Checked)
                    {
                        continue;
                    }
                    break;
                }


                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(QuestView);


                row.Cells[QuestView_State.Index].Value      = (q.State == 3) ? ((bool?)null) : (q.State == 2);
                row.Cells[QuestView_Type.Index].Value       = q.Type;
                row.Cells[QuestView_Category.Index].Value   = q.Category;
                row.Cells[QuestView_Category.Index].Style   = CSCategories[Math.Min(q.Category - 1, 8 - 1)];
                row.Cells[QuestView_Name.Index].Value       = q.QuestID;
                row.Cells[QuestView_Name.Index].ToolTipText = string.Format("{0} : {1}\r\n{2}", q.QuestID, q.Name, q.Description);

                {
                    string value;
                    double tag;

                    if (q.State == 3)
                    {
                        value = "達成!";
                        tag   = 1.0;
                    }
                    else
                    {
                        if (KCDatabase.Instance.QuestProgress.Progresses.ContainsKey(q.QuestID))
                        {
                            var p = KCDatabase.Instance.QuestProgress.Progresses[q.QuestID];

                            value = p.ToString();
                            tag   = p.ProgressPercentage;
                        }
                        else
                        {
                            switch (q.Progress)
                            {
                            case 0:
                                value = "-";
                                tag   = 0.0;
                                break;

                            case 1:
                                value = "50%以上";
                                tag   = 0.5;
                                break;

                            case 2:
                                value = "80%以上";
                                tag   = 0.8;
                                break;

                            default:
                                value = "???";
                                tag   = 0.0;
                                break;
                            }
                        }
                    }

                    row.Cells[QuestView_Progress.Index].Value = value;
                    row.Cells[QuestView_Progress.Index].Tag   = tag;
                }

                QuestView.Rows.Add(row);
            }


            if (KCDatabase.Instance.Quest.Quests.Count != KCDatabase.Instance.Quest.Count)
            {
                int index = QuestView.Rows.Add();
                QuestView.Rows[index].Cells[QuestView_State.Index].Value = null;
                QuestView.Rows[index].Cells[QuestView_Name.Index].Value  = string.Format("(未取得の任務 x {0})", (KCDatabase.Instance.Quest.Count - KCDatabase.Instance.Quest.Quests.Count));
            }

            if (KCDatabase.Instance.Quest.Quests.Count == 0)
            {
                int index = QuestView.Rows.Add();
                QuestView.Rows[index].Cells[QuestView_State.Index].Value = null;
                QuestView.Rows[index].Cells[QuestView_Name.Index].Value  = "(任務完遂!)";
            }

            //更新時にソートする
            if (QuestView.SortedColumn != null)
            {
                QuestView.Sort(QuestView.SortedColumn, QuestView.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending);
            }

            QuestView.ResumeLayout();
        }
示例#13
0
 void Awake()
 {
     myTransform = this.transform;
     startAngle  = myTransform.localEulerAngles.z;
     questView   = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }
示例#14
0
 // Use this for initialization
 void Awake()
 {
     questView = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }
示例#15
0
 // Use this for initialization
 void Awake()
 {
     currentItem = numItemClear;
     questView   = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }
示例#16
0
 // Use this for initialization
 void Awake()
 {
     myTransform = transform;
     questView   = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }
示例#17
0
        void Updated()
        {
            if (!KCDatabase.Instance.Quest.IsLoaded)
            {
                return;
            }

            QuestView.SuspendLayout();

            QuestView.Rows.Clear();

            foreach (var q in KCDatabase.Instance.Quest.Quests.Values)
            {
                if (MenuMain_ShowRunningOnly.Checked && !(q.State == 2 || q.State == 3))
                {
                    continue;
                }

                switch (q.Type)
                {
                case 1:
                    if (!MenuMain_ShowDaily.Checked)
                    {
                        continue;
                    }
                    break;

                case 2:
                    if (!MenuMain_ShowWeekly.Checked)
                    {
                        continue;
                    }
                    break;

                case 3:
                    if (!MenuMain_ShowMonthly.Checked)
                    {
                        continue;
                    }
                    break;

                case 4:
                default:
                    if (!MenuMain_ShowOnce.Checked)
                    {
                        continue;
                    }
                    break;

                case 5:
                    if (q.QuestID == 211 || q.QuestID == 212)
                    {                               // 空母3か輸送5
                        if (!MenuMain_ShowDaily.Checked)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        if (!MenuMain_ShowOther.Checked)
                        {
                            continue;
                        }
                    }
                    break;
                }


                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(QuestView);
                row.Height = 21;

                row.Cells[QuestView_State.Index].Value    = (q.State == 3) ? ((bool?)null) : (q.State == 2);
                row.Cells[QuestView_Type.Index].Value     = q.Type;
                row.Cells[QuestView_Category.Index].Value = q.Category;
                row.Cells[QuestView_Category.Index].Style = CSCategories[Math.Min(q.Category - 1, 8 - 1)];
                row.Cells[QuestView_Name.Index].Value     = q.QuestID;
                {
                    var progress = KCDatabase.Instance.QuestProgress[q.QuestID];
                    row.Cells[QuestView_Name.Index].ToolTipText = $"{q.QuestID} : {q.Name}\r\n{q.Description}\r\n{progress?.GetClearCondition() ?? ""}";
                }
                {
                    string value;
                    double tag;

                    if (q.State == 3)
                    {
                        value = "Complete!";
                        tag   = 1.0;
                    }
                    else
                    {
                        if (KCDatabase.Instance.QuestProgress.Progresses.ContainsKey(q.QuestID))
                        {
                            var p = KCDatabase.Instance.QuestProgress[q.QuestID];

                            value = p.ToString();
                            tag   = p.ProgressPercentage;
                        }
                        else
                        {
                            switch (q.Progress)
                            {
                            case 0:
                                value = "-";
                                tag   = 0.0;
                                break;

                            case 1:
                                value = GeneralRes.Over50;
                                tag   = 0.5;
                                break;

                            case 2:
                                value = GeneralRes.Over80;
                                tag   = 0.8;
                                break;

                            default:
                                value = "???";
                                tag   = 0.0;
                                break;
                            }
                        }
                    }

                    row.Cells[QuestView_Progress.Index].Value = value;
                    row.Cells[QuestView_Progress.Index].Tag   = tag;
                }

                QuestView.Rows.Add(row);
            }


            if (KCDatabase.Instance.Quest.Quests.Count < KCDatabase.Instance.Quest.Count)
            {
                int index = QuestView.Rows.Add();
                QuestView.Rows[index].Cells[QuestView_State.Index].Value = null;
                QuestView.Rows[index].Cells[QuestView_Name.Index].Value  = string.Format("(other quest x {0})", (KCDatabase.Instance.Quest.Count - KCDatabase.Instance.Quest.Quests.Count));
            }

            if (KCDatabase.Instance.Quest.Quests.Count == 0)
            {
                int index = QuestView.Rows.Add();
                QuestView.Rows[index].Cells[QuestView_State.Index].Value = null;
                QuestView.Rows[index].Cells[QuestView_Name.Index].Value  = GeneralRes.AllComplete;
            }

            //更新時にソートする
            if (QuestView.SortedColumn != null)
            {
                QuestView.Sort(QuestView.SortedColumn, QuestView.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending);
            }


            QuestView.ResumeLayout();
        }
示例#18
0
 void Awake()
 {
     spriteRender = GetComponent <SpriteRenderer>();
     questView    = ViewLoader.Instance.CurrentView.GetComponent <QuestView>();
 }