예제 #1
0
 private void changeState()
 {
     if (MODE == Mode.SubjectEdit)
     {
         PropsPanel.Show();
         TaskInfoPanel.Hide();
     }
     if (MODE == Mode.TaskEdit)
     {
         PropsPanel.Hide();
         TaskInfoPanel.Show();
         if (selectednode.Text != "Добавить задание")
         {
             foreach (TaskClass tsk in subject.Tasks)
             {
                 if (selectednode.Text == tsk.Label)
                 {
                     runtime = tsk;
                 }
             }
             HeaderTask.Text  = runtime.Label;
             TextTaskBox.Text = runtime.Text;
             ImageList imglist = new ImageList();
             ImageView.View = View.LargeIcon;
             ImageView.Items.Clear();
             int counter = 0;
             foreach (KeyValuePair <Image, string> img in runtime.Images)
             {
                 imglist.Images.Add(img.Key);
                 ListViewItem item = new ListViewItem();
                 item.Tag = img.Value;
                 if (img.Key.Tag != null)
                 {
                     item.Text = (string)img.Key.Tag;
                 }
                 else
                 {
                     item.Text = "В ресурсах";
                 }
                 item.ImageIndex = counter;
                 counter++;
                 ImageView.Items.Add(item);
             }
             imglist.ImageSize        = new Size(80, 80);
             ImageView.LargeImageList = imglist;
         }
     }
 }
예제 #2
0
    /// <summary>
    /// 显示并更新任务详情面板
    /// </summary>
    /// <param name="task"></param>
    public void UpdateTaskInfoPanel(Task task)
    {
        if (task == null)
        {
            return;
        }
        //m_TaskInfo.gameObject.SetActive(true);
        //m_TaskTitle.text = task.M_TaskTitle;
        //m_TaskContent.text = task.M_TaskContent;
        //m_AwardEXP.text = task.M_AwardEXP == 0 ? "" : task.M_AwardEXP + "";
        //m_AwardCoin.text = task.M_AwardCoin + "";
        uIController.ShowPanel(UIPanelType.TaskInfo);
        TaskInfoPanel tip = uIController.GetPanelByType(UIPanelType.TaskInfo).GetComponent <BasePanel>() as TaskInfoPanel;

        if (tip.M_ShowTask == task)
        {
            return;                        //正在显示的不刷新信息
        }
        tip.M_ShowTask = task;
        tip.UpdateShow();
    }