Exemplo n.º 1
0
 private void SetQuest(QuestLabels labels, QuestStatus quest)
 {
     labels.Color.BackColor = quest.Color;
     labels.Name.Text       = quest.Name;
     labels.Progress.Text   = $"{quest.Progress:D}%";
     ToolTip.SetToolTip(labels.Name, quest.ToToolTip());
 }
Exemplo n.º 2
0
 public void CreateLabels(int lines)
 {
     _lines  = LimitLines(lines);
     _labels = new QuestLabels[_lines];
     SuspendLayout();
     Height = Scaler.ScaleHeight(TopMargin * 2 + LineHeight * _lines);
     for (var i = 0; i < _lines; i++)
     {
         var y = TopMargin + i * LineHeight;
         _labels[i] = new QuestLabels
         {
             Color = new Label
             {
                 Location = new Point(LeftMargin, y + 1),
                 Size     = new Size(4, LabelHeight - 1)
             },
             Name = new Label
             {
                 Location = new Point(LeftMargin + 4, y),
                 Size     = new Size(193, LabelHeight)
             },
             Count = new GrowLeftLabel
             {
                 Location = new Point(LeftMargin + 189, y),
                 GrowLeft = true
             },
             Progress = new Label
             {
                 Location  = new Point(LeftMargin + 186, y),
                 Size      = new Size(29, LabelHeight),
                 TextAlign = ContentAlignment.MiddleRight
             }
         };
         _labels[i].Arrange(this);
         _labels[i].Scale();
     }
     ResumeLayout();
     SetupListScroller();
 }
Exemplo n.º 3
0
 public void OpenQuest()
 {
     if (QuestPanel.activeSelf)
     {
         return;
     }
     RemoveButtons();
     foreach (Text text in DetailsPanel.GetComponentsInChildren <Text>())
     {
         text.text = null;
     }
     foreach (Quest quest in CurrentQuests)
     {
         if (quest.Status == 1)
         {
             GameObject newQuest = QuestBtnPool.GetObject();
             newQuest.transform.SetParent(QuestContent);
             QuestLabels questLabel = newQuest.GetComponent <QuestLabels>();
             questLabel.Setup(quest);
             newQuest.GetComponent <RectTransform>().localScale = btnPrefab.GetComponent <RectTransform>().localScale;
         }
     }
     QuestPanel.gameObject.SetActive(true);
 }
Exemplo n.º 4
0
 private void ClearQuest(QuestLabels labels)
 {
     labels.Color.BackColor = DefaultBackColor;
     labels.Name.Text       = labels.Progress.Text = "";
     ToolTip.SetToolTip(labels.Name, "");
 }