コード例 #1
0
ファイル: XEditorTool.cs プロジェクト: sylafrs/rugby
    public XArea BeginXArea(string id,GUIStyle style, float minHeight,EArea type,SerializedProperty bobj, float offset)
    {
        GUIStyle buttonStyle = EffectLayerCustom.Xbutton;

        if (!XAreas.ContainsKey(id))
        {
            XAreas.Add(id,new XArea());
        }

        //find my area.
        XArea m = XAreas[id];
        style.stretchWidth = true;
        Rect gotLastRect = GUILayoutUtility.GetRect (new GUIContent (),style,GUILayout.Height (m.LastRect.height));

        GUILayout.BeginArea (m.LastRect,style);
        Rect newRect = EditorGUILayout.BeginVertical();

        //head bar
        EditorGUILayout.BeginHorizontal();
        if (type == EArea.CheckBox || type == EArea.AlwaysToggle)
        {
            if (type == EArea.CheckBox)
            {
                //little trick.
                m.Enable = bobj.boolValue;
                m.Enable = GUILayout.Toggle(m.Enable,GUIContent.none,EffectLayerCustom.Xtoggle, GUILayout.Width(18f),GUILayout.Height(18f));
                bobj.boolValue = m.Enable;
            }
            else
            {
                m.Open = GUILayout.Toggle(m.Open,GUIContent.none,EffectLayerCustom.XToggle2, GUILayout.Width(18f),GUILayout.Height(18f));
                m.Enable = true;
            }
            if (GUILayout.Button (id,buttonStyle,GUILayout.Height(20f)))
                m.Open = !m.Open;
        }
        else if(type == EArea.Texture)
        {

            Texture tex = null;
            string mname = "no material";

            if (MyEditor.Script.Material != null)
            {
                tex = MyEditor.Script.Material.mainTexture;
                mname = MyEditor.Script.Material.name;
            }

            GUILayout.Label(new GUIContent(tex),EffectLayerCustom.XTexture,GUILayout.Width(25f),GUILayout.Height(25f));

            if (GUILayout.Button (mname,buttonStyle,GUILayout.Height(24f)))
                m.Open = !m.Open;

            m.Enable = true;
        }

        //increase a bit, need to do this.
        newRect.height += 3f;

        newRect.height += offset;

        EditorGUILayout.EndHorizontal();
        GUI.enabled = m.Enable;
        if (!m.Open)
        {
            newRect.height = minHeight;
        }

        //calculate area size.
        if (Event.current.type == EventType.Repaint || Event.current.type == EventType.ScrollWheel) {
         newRect.x = gotLastRect.x;
         newRect.y = gotLastRect.y;
         newRect.width = gotLastRect.width;
         newRect.height += style.padding.top+ style.padding.bottom;

         if (m.LastRect != newRect) {
                m.LastRect = newRect;
                MyEditor.Repaint ();
            }
        }

        return m;
    }
コード例 #2
0
ファイル: DsxDataGrid.cs プロジェクト: hansuky/Yuhan
 private ListView GetListView(EArea columnArea)
 {
     switch(columnArea)
     {
         case EArea.Left:       return this.PART_ListViewLeft;
         case EArea.Center:     return this.PART_ListViewCenter;
         case EArea.Right:      return this.PART_ListViewRight;
     }
     return null;
 }
コード例 #3
0
ファイル: XEditorTool.cs プロジェクト: sylafrs/rugby
 public XArea BeginXArea(string id,GUIStyle style, float minHeight,EArea type,SerializedProperty bobj)
 {
     return BeginXArea(id,style,minHeight,type,bobj,0f);
 }
コード例 #4
0
    protected void tablaCursos_RowCreated(object sender, GridViewRowEventArgs e)
    {
        GridViewRow fila = e.Row;

        if (fila.Cells.Count > 1)
        {
            TableCell celdaNombreCurso  = fila.Cells[0];
            TableCell celdaArea         = fila.Cells[1];
            TableCell celdaCalificacion = fila.Cells[5];
            TableCell celdaEditar       = fila.Cells[6];
            TableCell celdaEditarTema   = fila.Cells[7];
            TableCell celdaExpulsar     = fila.Cells[8];
            TableCell celdaCalificar    = fila.Cells[9];
            TableCell celdaChat         = fila.Cells[10];

            string nombreArea = celdaArea.Text;

            Image iconoArea = new Image();


            ImageButton botonEditarCurso = new ImageButton();
            ImageButton botonEditarTema  = new ImageButton();
            ImageButton botonExpulsar    = new ImageButton();
            ImageButton botonCalificar   = new ImageButton();
            ImageButton botonChat        = new ImageButton();

            botonEditarCurso.ImageUrl = "~/Recursos/GestionCursos/Editar Curso.png";
            botonExpulsar.ImageUrl    = "~/Recursos/GestionCursos/Expulsar Usuarios.png";
            botonEditarTema.ImageUrl  = "~/Recursos/GestionCursos/Crear y Editar Temas.png";
            botonCalificar.ImageUrl   = "~/Recursos/GestionCursos/Calificar Exámenes.png";
            botonChat.ImageUrl        = "~/Recursos/GestionCursos/Chat.png";

            iconoArea.Width         = 32;
            iconoArea.Height        = 32;
            botonEditarCurso.Width  = 32;
            botonEditarCurso.Height = 32;
            botonExpulsar.Width     = 32;
            botonExpulsar.Height    = 32;
            botonEditarTema.Width   = 32;
            botonEditarTema.Height  = 32;
            botonCalificar.Width    = 32;
            botonCalificar.Height   = 32;
            botonChat.Width         = 32;
            botonChat.Height        = 32;

            botonEditarCurso.Click += new ImageClickEventHandler(EditarCurso);
            botonEditarTema.Click  += new ImageClickEventHandler(CrearYEditarTemas);
            botonExpulsar.Click    += new ImageClickEventHandler(ExpulsarAlumnos);
            botonCalificar.Click   += new ImageClickEventHandler(CalificarExamenes);
            botonChat.Click        += new ImageClickEventHandler(VerChat);

            if (fila.RowIndex > -1)
            {
                LinkButton hiperEnlaceInfoCurso = new LinkButton();
                hiperEnlaceInfoCurso.Text   = celdaNombreCurso.Text;
                hiperEnlaceInfoCurso.Click += new EventHandler(VerInformacionCurso);

                celdaNombreCurso.Controls.Add(hiperEnlaceInfoCurso);


                int calificacion = Int32.Parse(celdaCalificacion.Text);
                ASP.controles_estrellas_estrellas_ascx estrellasMostradas = new ASP.controles_estrellas_estrellas_ascx();
                estrellasMostradas.Calificacion = calificacion;
                celdaCalificacion.Controls.Add(estrellasMostradas);
                celdaCalificacion.Enabled = false;

                Buscador buscador = new Buscador();

                EArea area = buscador.GetAreasSrc().Where(x => x.Area == nombreArea).FirstOrDefault();

                iconoArea.ImageUrl = area.Icono;

                celdaArea.Controls.Add(iconoArea);

                celdaEditar.Controls.Add(botonEditarCurso);
                celdaExpulsar.Controls.Add(botonExpulsar);
                celdaEditarTema.Controls.Add(botonEditarTema);
                celdaCalificar.Controls.Add(botonCalificar);
                celdaChat.Controls.Add(botonChat);
            }
        }
    }
コード例 #5
0
ファイル: GameHelper.cs プロジェクト: LaiYizhou/CrapsOffline
    /// <summary>
    /// EArea lastChipEArea = EArea.Count means : para lastChipEArea is null
    /// </summary>
    /// <param name="eGameStage"></param>
    /// <param name="lastChipEArea"></param>
    /// <returns></returns>
    public List <EArea> GetValidAreaList(EGameStage eGameStage, EArea lastChipEArea = EArea.Count)
    {
        if (lastChipEArea == EArea.Count)
        {
            List <EArea> currentChipsTableAreaList = CanvasControl.Instance.gameCrap.CurrentAllChipsTableAreaList;
            List <EArea> resAreaList = new List <EArea>();

            if (CanvasControl.Instance.gameCrap.CurrentGameStage == EGameStage.PointOff_ComePointOff ||
                CanvasControl.Instance.gameCrap.CurrentGameStage == EGameStage.PointOff_ComePointOn)
            {
                if (currentChipsTableAreaList.Contains(EArea.PassLine) ||
                    currentChipsTableAreaList.Contains(EArea.DontPassH) ||
                    currentChipsTableAreaList.Contains(EArea.DontPassV))
                {
                    resAreaList.AddRange(basicPassAreaList);
                    resAreaList.AddRange(singleRollAreaList);
                    resAreaList.AddRange(multiRollAreaList);
                }
                else
                {
                    resAreaList.AddRange(basicPassAreaList);
                }

                return(resAreaList);
            }

            if (CanvasControl.Instance.gameCrap.CurrentGameStage == EGameStage.PointOn_ComePointOff)
            {
                resAreaList.AddRange(basicComeAreaList);
                resAreaList.AddRange(singleRollAreaList);
                resAreaList.AddRange(multiRollAreaList);

                if (currentChipsTableAreaList.Contains(EArea.PassLine))
                {
                    resAreaList.Add(EArea.PassOdds);
                }

                if (currentChipsTableAreaList.Contains(EArea.DontPassH) ||
                    currentChipsTableAreaList.Contains(EArea.DontPassV))
                {
                    resAreaList.Add(EArea.DontPassOdds);
                }

                return(resAreaList);
            }

            if (CanvasControl.Instance.gameCrap.CurrentGameStage == EGameStage.PointOn_ComePointOn)
            {
                resAreaList.AddRange(basicComeAreaList);
                resAreaList.AddRange(singleRollAreaList);
                resAreaList.AddRange(multiRollAreaList);

                if (currentChipsTableAreaList.Contains(EArea.PassLine))
                {
                    resAreaList.Add(EArea.PassOdds);
                }

                if (currentChipsTableAreaList.Contains(EArea.DontPassH) ||
                    currentChipsTableAreaList.Contains(EArea.DontPassV))
                {
                    resAreaList.Add(EArea.DontPassOdds);
                }

                foreach (EArea eArea in currentChipsTableAreaList)
                {
                    if (allComeOddsAreaList.Contains(eArea) || allDontComeOddsAreaList.Contains(eArea))
                    {
                        resAreaList.Add(eArea);
                    }
                }

                return(resAreaList);
            }
        }

        return(null);
    }
コード例 #6
0
ファイル: GameHelper.cs プロジェクト: LaiYizhou/CrapsOffline
    public long GetOdds(Chip chip, EArea eArea, DiceState diceState)
    {
        if (areaOddsDictionary.ContainsKey(eArea))
        {
            float value = areaOddsDictionary[eArea];

            if (value > 0)
            {
                return((long)((value + 1) * chip.Value));
            }
            else if (value < 0)
            {
                return((long)((-value + 1) * chip.Value - chip.Value * 0.05f));
            }
            else
            {
                if (eArea == EArea.Field)
                {
                    if (diceState.Sum == 3 || diceState.Sum == 4 || diceState.Sum == 9 || diceState.Sum == 10 ||
                        diceState.Sum == 11)
                    {
                        return(2L * chip.Value);
                    }
                    else if (diceState.Sum == 2 || diceState.Sum == 12)
                    {
                        return(3L * chip.Value);
                    }
                }
                else if (eArea == EArea.PassOdds)
                {
                    if (diceState.Sum == 4 || diceState.Sum == 10)
                    {
                        return((long)((2.0f / 1.0f + 1) * chip.Value));
                    }
                    else if (diceState.Sum == 5 || diceState.Sum == 9)
                    {
                        return((long)((3.0f / 2.0f + 1) * chip.Value));
                    }
                    else if (diceState.Sum == 6 || diceState.Sum == 8)
                    {
                        return((long)((6.0f / 5.0f + 1) * chip.Value));
                    }
                }
                else if (eArea == EArea.DontPassOdds)
                {
                    if (CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 4 ||
                        CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 10)
                    {
                        return((long)((1.0f / 2.0f + 1) * chip.Value));
                    }
                    else if (CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 5 ||
                             CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 9)
                    {
                        return((long)((2.0f / 3.0f + 1) * chip.Value));
                    }
                    else if (CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 6 ||
                             CanvasControl.Instance.gameCrap.CurrentCrapsPointValue == 8)
                    {
                        return((long)((5.0f / 6.0f + 1) * chip.Value));
                    }
                }
            }
        }

        return(0L);
    }
コード例 #7
0
ファイル: XEditorTool.cs プロジェクト: rahul-sinha1908/rugby
    public XArea BeginXArea(string id, GUIStyle style, float minHeight, EArea type, SerializedProperty bobj, float offset)
    {
        GUIStyle buttonStyle = EffectLayerCustom.Xbutton;

        if (!XAreas.ContainsKey(id))
        {
            XAreas.Add(id, new XArea());
        }

        //find my area.
        XArea m = XAreas[id];

        style.stretchWidth = true;
        Rect gotLastRect = GUILayoutUtility.GetRect(new GUIContent(), style, GUILayout.Height(m.LastRect.height));


        GUILayout.BeginArea(m.LastRect, style);
        Rect newRect = EditorGUILayout.BeginVertical();

        //head bar
        EditorGUILayout.BeginHorizontal();
        if (type == EArea.CheckBox || type == EArea.AlwaysToggle)
        {
            if (type == EArea.CheckBox)
            {
                //little trick.
                m.Enable       = bobj.boolValue;
                m.Enable       = GUILayout.Toggle(m.Enable, GUIContent.none, EffectLayerCustom.Xtoggle, GUILayout.Width(18f), GUILayout.Height(18f));
                bobj.boolValue = m.Enable;
            }
            else
            {
                m.Open   = GUILayout.Toggle(m.Open, GUIContent.none, EffectLayerCustom.XToggle2, GUILayout.Width(18f), GUILayout.Height(18f));
                m.Enable = true;
            }
            if (GUILayout.Button(id, buttonStyle, GUILayout.Height(20f)))
            {
                m.Open = !m.Open;
            }
        }
        else if (type == EArea.Texture)
        {
            Texture tex   = null;
            string  mname = "no material";

            if (MyEditor.Script.Material != null)
            {
                tex   = MyEditor.Script.Material.mainTexture;
                mname = MyEditor.Script.Material.name;
            }

            GUILayout.Label(new GUIContent(tex), EffectLayerCustom.XTexture, GUILayout.Width(25f), GUILayout.Height(25f));

            if (GUILayout.Button(mname, buttonStyle, GUILayout.Height(24f)))
            {
                m.Open = !m.Open;
            }

            m.Enable = true;
        }

        //increase a bit, need to do this.
        newRect.height += 3f;

        newRect.height += offset;

        EditorGUILayout.EndHorizontal();
        GUI.enabled = m.Enable;
        if (!m.Open)
        {
            newRect.height = minHeight;
        }

        //calculate area size.
        if (Event.current.type == EventType.Repaint || Event.current.type == EventType.ScrollWheel)
        {
            newRect.x       = gotLastRect.x;
            newRect.y       = gotLastRect.y;
            newRect.width   = gotLastRect.width;
            newRect.height += style.padding.top + style.padding.bottom;

            if (m.LastRect != newRect)
            {
                m.LastRect = newRect;
                MyEditor.Repaint();
            }
        }

        return(m);
    }
コード例 #8
0
ファイル: XEditorTool.cs プロジェクト: rahul-sinha1908/rugby
 public XArea BeginXArea(string id, GUIStyle style, float minHeight, EArea type, SerializedProperty bobj)
 {
     return(BeginXArea(id, style, minHeight, type, bobj, 0f));
 }