Example #1
0
        public override string ToString()
        {
            var result = new StringBuilder();

            // todo : header

            result.Append("{");

            var missingBars = 0;

            result.Append(BonesID);

            if (Skins == null || !Skins.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", Skins));
            }

            if (Colors == null || !Colors.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", from entry in Colors
                                          select entry.Key + "=" + entry.Value.ToArgb()));
            }

            if (Scales == null || !Scales.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", Scales));
            }

            if (SubLooks == null || !SubLooks.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                result.Append(string.Join(",", SubLooks.Select(entry => entry)));
            }

            result.Append("}");

            return(result.ToString());
        }
Example #2
0
    private IEnumerator CreateSprites(string _skinID)
    {
        var form = new WWWForm();

        form.AddField("id", _skinID);
        using (var www = UnityWebRequest.Post(Constants.WebServer + "retrieveskinimage.php", form))
        {
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                var bytes = www.downloadHandler.data;

                var texture = new Texture2D(2, 2);
                texture.LoadImage(bytes);

                var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height),
                                           new Vector2(0.5f, 0.5f));
                Skins.PopulateSkinImage(sprite);
                _imageRetrieved = true;
            }
        }
    }
Example #3
0
 private void Start()
 {
     menu          = GameObject.Find("Main Camera").GetComponent <GUIGame>();
     controlCamera = GameObject.Find("Main Camera").GetComponent <ControlCamera>();
     GUIOperations = GameObject.Find("spaceship").GetComponent <GUIOperations>();
     Skins         = GameObject.Find("spaceship").GetComponent <Skins>();
 }
Example #4
0
 public static void BuySkin(Skins skin)
 {
     Debug.Log(skin.ToString());
     PlayerPrefs.SetInt("Skin-" + skin.ToString(), 1);
     PlayerPrefs.SetInt("SkinFree", 0);
     PlayerPrefs.Save();
 }
Example #5
0
    private void Back()
    {
        Skins.gameObject.SetActive(true);
        Particle.gameObject.SetActive(false);
        Skins.SetAsLastSibling();
        FirstButton.GetComponent <Animator>().updateMode = AnimatorUpdateMode.Normal;
        if (ControllerManager.Mouse_Controller == 1)
        {
            EventSystem.current.SetSelectedGameObject(null);
        }
        else
        {
            EventSystem.current.SetSelectedGameObject(null);

            EventSystem.current.SetSelectedGameObject(FirstButton);
        }

        ColorPickerUI.GetComponent <ColorPickerUnityUI>().enabled = false;
        menuAnim.SetBool("Menu", true);
        menuAnim.SetBool("SkinSelectorToSettings", false);
        menuAnim.SetBool("Settings", false);
        menuAnim.SetBool("SettingsToSkinSelector", false);
        menuAnim.SetBool("SkinSelector", false);
        menuAnim.SetBool("MenuToLocations", false);
        menuAnim.SetBool("LocationsToSkinSelector", false);
        menuAnim.SetBool("LocationsToOptions", false);
        menuAnim.SetBool("MenuToMultiplayer", false);
        menuAnim.SetBool("MultiplayerToOptions", false);
        menuAnim.SetBool("MultiplayerToSkinSelector", false);
    }
Example #6
0
 public void Button_EditTeam()
 {
     EditTeam.SetActive(false);
     Characters.SetActive(false);
     Skins.SetActive(false);
     ChaBack.SetActive(true);
 }
        public AppSettingModel()
        {
            this.Header       = "Основные настройки";
            this.Languages    = Generic.GetEnumValues <Languages>();
            this.SkinSettings = Skins.SkinSettings;

            var appConfig = ConfigStorage.Instance.AppConfig;

            this.UpdateReader            = appConfig.UpdateReader;
            this.MinimizeToTray          = appConfig.MinimizeToTray;
            this.Language                = appConfig.Language;
            this.AutoUpdateHours         = appConfig.AutoUpdateInHours.ToString();
            this.Skin                    = Skins.GetSkinSetting(ConfigStorage.Instance.ViewConfig.SkinGuid);
            this.StartAppMinimizedToTray = appConfig.StartMinimizedToTray;

            this.FolderNamingStrategy = new FolderNamingModel();
            using (var context = Repository.GetEntityContext())
            {
#warning DB connection in ctor
                var config = context.Get <DatabaseConfig>().Single();
                this.FolderNamingStrategy.SelectedGuid = config.FolderNamingStrategy;
            }

            this.Sort = new SortModel();
            var appSort = ConfigStorage.Instance.ViewConfig.LibraryFilter.SortDescription;
            if (appSort.PropertyName != null)
            {
                Sort.SelectedDescription = appSort;
            }
        }
Example #8
0
 /// <summary>
 /// Function invoked after layout.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void PostLayout(Skins.Skin skin)
 {
     foreach (Control child in Children) // ok?
     {
         child.Position(m_Pos);
     }
 }
Example #9
0
 public override void Initialize(IEntity entity)
 {
     BonesId = entity.Look().BonesId;
     Skins.AddRange(entity.Look().Skins);
     IndexedColors.AddRange(entity.Look().IndexedColors);
     Scales.AddRange(entity.Look().Scales);
 }
Example #10
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance        = this;
         itemsDictionary = new Dictionary <string, ShopItem[]>();
         for (int i = 0; i < skins.Length; i++)
         {
             Skins skin = skins[i];
             if (!itemsDictionary.ContainsKey(skin.type))
             {
                 ShopItem[] newList = new ShopItem[skin.items.Length];
                 itemsDictionary.Add(skin.type, newList);
             }
             for (int j = 0; j < skin.items.Length; j++)
             {
                 skin.items[j].index           = j;
                 itemsDictionary[skin.type][j] = skin.items[j];
             }
         }
         dataManager   = DataManager.Instance;
         cubeMesh      = itemsDictionary["Cube"][dataManager.GetUserData().SelectedCube].model;
         cubeMat       = itemsDictionary["Cube"][dataManager.GetUserData().SelectedCube].objectMat;
         platformMat   = itemsDictionary["Platform"][dataManager.GetUserData().SelectedPlatform].objectMat;
         platformMesh  = itemsDictionary["Platform"][dataManager.GetUserData().SelectedPlatform].model;
         backgroundMat = itemsDictionary["Background"][dataManager.GetUserData().SelectedBackground].objectMat;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #11
0
    //public GameController(){
    //    HighestScore = 0;
    //    BallMaterial = null;
    //    BorderMaterials = null;
    //}

    // Use this for initialization
    void Awake()
    {
        //if (gameObject == null)
        //{
        //    DontDestroyOnLoad(gameObject);
        //}
        //else if(gameObject != this)
        //{
        //    Destroy(gameObject);
        //}
        //File.Delete(Application.persistentDataPath + "/playerInfo.dat");
        //UnityEditor.AssetDatabase.Refresh();

        if (!File.Exists(Application.persistentDataPath + "/playerInfo.dat"))

        {
            HighestScore    = 0;
            BallMaterial    = "Ball";
            BorderMaterials = "White";
            Coins           = 0;
            BallLock        = "111111111111111111111";
            BorderLock      = "111111111111111111111";
            Save();
        }
        else
        {
            Skins.loadSkin();
            Skins.loadSkinBall();
        }
    }
Example #12
0
        // Should be in SkinManager, but how to access getMMRowOfPosition from there?
        public void changeSkin(Skins skin)
        {
            ResourceDictionary selectedDictionary = SkinManager.GetSkin(skin);

            App.Current.MainWindow.Resources.MergedDictionaries.Add(selectedDictionary);

            if (_assemblerModel.undoStack().size() == 0)
            {
                _currentTextBox.Foreground = (Brush)FindResource("TextBoxForegroundOff");
            }
            else
            {
                _currentTextBox.Foreground = (Brush)FindResource("TextBoxForegroundOn");
            }

            for (int i = 0; i <= 255; i++)
            {
                getMMRowOfPosition(255 - i).ChangeSkin(selectedDictionary);
            }

            for (int i = 0; i < 5; i++)
            {
                getStackRowOfPosition(i).ChangeSkin(selectedDictionary);
            }

            ValueRow_InstructionPointer.ChangeSkin(selectedDictionary);
            ValueRow_Input.ChangeSkin(selectedDictionary);
            ValueRow_Output.ChangeSkin(selectedDictionary);
            ValueRow_WorkingRegister.ChangeSkin(selectedDictionary);
        }
Example #13
0
        private void Stats_Load(object sender, System.EventArgs e)
        {
            Skins skin = new Skins();

            if (skin.skinLoader)
            {
                try
                {
                    BackColor     = skin.BackGround_Color; // Фон программы
                    Ico.BackColor = BackColor;

                    // Шрифты
                    {
                        Label[] lbls = new Label[] { label1, label2, label3, label4, CommentsCount, errCount, rinneCount, activCount };
                        foreach (Label lbl in lbls)
                        {
                            lbl.BackColor = skin.BackGround_Color;
                            lbl.ForeColor = skin.Font_Color;
                        }
                    }

                    // Боксы
                    {
                        GroupBox[] Boxs = new GroupBox[] { groupBox1 };
                        foreach (GroupBox Box in Boxs)
                        {
                            Box.ForeColor = skin.Font_Color;
                        }
                    }
                }
                catch { }
            }
        }
Example #14
0
    public void unlockBorder()
    {
        GameController.Load();

        string s = "abcde";

        Debug.Log("example: " + s.Substring(2, 1));
        string middle = GameController.BorderLock.Substring(index, 1);

        Debug.Log("this is startindex: " + index + " this is endindex: " + 1 + " this is middle " + middle);
        if (middle == "1")
        {
            //if there is more coins
            if (GameController.Coins >= amountCoins)
            {
                GameController.Coins -= amountCoins;
                string start = GameController.BorderLock.Substring(0, index);
                string end   = GameController.BorderLock.Substring(index + 1);
                GameController.BorderLock = start + "0" + end;

                //GameController.Save();
                Skins.saveSkin(str);
            }
        }
        else
        {
            Skins.saveSkin(str);
        }
    }
Example #15
0
        public static Skins ValidateSkins(string Directory)
        {
            try
            {
                string json       = File.ReadAllText(Path.Combine(Directory, "skins.json"));
                Skins  skins_meta = JsonConvert.DeserializeObject <Skins>(json);
                if (skins_meta == null)
                {
                    return(null);
                }
                if (skins_meta.skins == null)
                {
                    return(null);
                }

                foreach (var skin in skins_meta.skins)
                {
                    skin.skin_directory = Directory;
                }

                return(skins_meta);
            }
            catch
            {
                return(new Skins());
            }
        }
 protected override void OnInitSkins()
 {
     Skins.Add("Xerath");
     Skins.Add("Runeborn Xerath");
     Skins.Add("Battlecast Xerath");
     Skins.Add("Scorched Earth Xerath");
 }
Example #17
0
    void Customize()
    {
        Skins.gameObject.SetActive(true);
        Particle.gameObject.SetActive(false);
        Skins.SetAsLastSibling();
        Invoke("ActiveColorUI", 0.7f);
        if (ControllerManager.Mouse_Controller == 1)
        {
            EventSystem.current.SetSelectedGameObject(null);
        }
        else
        {
            EventSystem.current.SetSelectedGameObject(null);
            EventSystem.current.SetSelectedGameObject(skinbutton);
        }

        if (Input.GetButtonDown("X"))
        {
            EventSystem.current.SetSelectedGameObject(null);
            EventSystem.current.SetSelectedGameObject(ColorPickerButton);
        }
        if (Input.GetButtonDown("Y"))
        {
            EventSystem.current.SetSelectedGameObject(null);
            EventSystem.current.SetSelectedGameObject(skinbutton);
        }
        menuAnim.SetBool("Menu", false);
        menuAnim.SetBool("SkinSelector", true);
        menuAnim.SetBool("SkinSelectorToSettings", false);
        menuAnim.SetBool("SettingsToSkinSelector", true);
        menuAnim.SetBool("LocationsToSkinSelector", true);
        menuAnim.SetBool("MultiplayerToSkinSelector", true);
    }
    public void SetSprite(int skinId)
    {
        if (skinId == 1)
        {
            skinBall = skinList[0];
        }
        if (skinId == 2)
        {
            skinBall = skinList[1];
        }
        if (skinId == 3)
        {
            skinBall = skinList[2];
        }
        if (skinId == 4)
        {
            skinBall = skinList[3];
        }
        if (skinId == 5)
        {
            skinBall = skinList[4];
        }

        skinBall.skinId = skinId;
        sprite.sprite   = skinBall.skinSprite;
    }
Example #19
0
 public static void LoadAll()
 {
     Skins.LoadAll();
     frozenSkin_Material.MakeAvailable();
     frozenSkin_Pixmap.MakeAvailable();
     frozenSkin_Texture.MakeAvailable();
 }
Example #20
0
 public SerializablePlayer(Player player)
 {
     UserID     = player.UserID;
     FortressID = player.Fortress.ID;
     Score      = player.Score;
     Skin       = player.Skin;
 }
Example #21
0
        public void GetEquip(List <string> buffer, int section, bool clear = false)
        {
            if (buffer.Count > 0)
            {
                buffer.Clear();
            }

            switch (section)
            {
            case 5:
                Weapons.ForEach(x => buffer.Add(x.ToString()));
                break;

            case 6:
                Skins.ForEach(x => buffer.Add(x.ToString()));
                break;

            case 7:
                Hats.ForEach(x => buffer.Add(x.ToString()));
                break;

            case 8:
                Perks.ForEach(x => buffer.Add(x.ToString()));
                break;

            case 9:
                Items.ForEach(x => buffer.Add(x.ToString()));
                break;
            }

            int  min;
            int  max;
            Type enm;

            GetEqInfo(section, out min, out max, out enm);

            int sz = max - min;

            if (sz < 0 || enm == null)
            {
                return;
            }

            if (buffer == m_ReusableBuffer || clear)
            {
                buffer.Clear();
            }

            for (int i = 0; i <= sz; i++)
            {
                int    eidx = Equip[min + i];
                string str  = eidx != EQP_NONE?Enum.GetName(enm, Equip[min + i]) : "None";

                if (str != null && !buffer.Contains(str))
                {
                    buffer.Add(str);
                }
            }
        }
Example #22
0
        public ActionResult DeleteConfirmed(int id)
        {
            Skins skins = db.Skins.Find(id);

            db.Skins.Remove(skins);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #23
0
        /// <summary>
        /// Lays out the control's interior according to alignment, padding, dock etc.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Layout(Skins.Skin skin)
        {
            if (null == Parent)
                return;

            //Move to our current position to force clamping - is this a hack?
            MoveTo(X, Y);
        }
Example #24
0
        // --- Skins.

        public void AddSkin(Skin skin)
        {
            if (skin == null)
            {
                throw new ArgumentNullException("skin cannot be null.");
            }
            Skins.Add(skin);
        }
Example #25
0
    // Start is called before the first frame update
    void Start()
    {
        skinChangerObject = GameObject.Find("SkinHandler").GetComponent <Skins>();

        rend = GetComponent <Renderer>();

        ChangeTheme();
    }
Example #26
0
 protected override void OnInitSkins()
 {
     Skins.Add("Ahri");
     Skins.Add("Dynasty Ahri");
     Skins.Add("Midnight Ahri");
     Skins.Add("Foxfire Ahri");
     Skins.Add("Popstar Ahri");
 }
Example #27
0
 /// <summary>
 /// Lays out the control's interior according to alignment, padding, dock etc.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Layout(Skins.Skin skin)
 {
     base.Layout(skin);
     if (AutoSizeToContents)
     {
         DoSizeToContents();
     }
 }
Example #28
0
    void Start()
    {
        Skins activeSkin = DataHolder.GetActiveSkin();

        if (activeSkin == Skins.Knight)
        {
            animator.runtimeAnimatorController = knightAnimator;
        }
    }
Example #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Canvas"/> class.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        public Canvas(Skins.Skin skin)
        {
            SetBounds(0, 0, 10000, 10000);
            SetSkin(skin);
            Scale = 1.0f;
            BackgroundColor = Color.White;
            ShouldDrawBackground = false;

            m_DisposeQueue = new List<IDisposable>();
        }
Example #30
0
 public ActionResult Edit([Bind(Include = "ID,Prix,Probabilité,Rang")] Skins skins)
 {
     if (ModelState.IsValid)
     {
         db.Entry(skins).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(skins));
 }
Example #31
0
        /// <summary>
        /// Lays out the control's interior according to alignment, padding, dock etc.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Layout(Skins.Skin skin)
        {
            base.Layout(skin);

            Align.PlaceDownLeft(m_Button, m_Label, 10);
            Align.CenterHorizontally(m_Button);
            m_InnerPanel.SizeToChildren();
            m_InnerPanel.Height += 10;
            SizeToChildren();
        }
Example #32
0
 private void Start()
 {
     LaserPosition = new Vector2(0f, 0.5f);
     Stats         = GameObject.Find("spaceship").GetComponent <statystyki>();
     Countdown     = GameObject.Find("Main Camera").GetComponent <SetCountdown>();
     ShipControl   = GameObject.Find("spaceship").GetComponent <ShipControl>();
     Skins         = GameObject.Find("spaceship").GetComponent <Skins>();
     LaserSkin     = GameObject.Find("laser_life").GetComponent <SpriteRenderer>();
     GravityBullet = GetComponent <Rigidbody2D>();
     SetSkinLaser();
 }
Example #33
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #34
0
 protected override void Layout(Skins.Skin skin)
 {
     // ugly stuff because we don't have anchoring without docking (docking resizes children)
     if (m_Label.Height > m_RadioButton.Height) // usually radio is smaller than label so it gets repositioned to avoid clipping with negative Y
     {
         m_RadioButton.Y = (m_Label.Height - m_RadioButton.Height)/2;
     }
     Align.PlaceRightBottom(m_Label, m_RadioButton);
     SizeToChildren();
     base.Layout(skin);
 }
Example #35
0
    //Call this once when the game opens or the current objective is cleared.
    void PickRandomObjective()
    {
        //Reset progress/goal variables
        progressAmount = 0;
        goalAmount     = 0;
        subObjectiveID = -1;

        //Pick a random objective
        objectiveID = Random.Range(0, (int)Objective.FIND_POWERUP + 1);

        //Make sure theme is unlocked when using a beat level theme objective
        if (objectiveID == (int)Objective.BEAT_THEMED_LEVELS)
        {
            //Make sure theme exists
            List <Skins.Themes> themesAvailable = Skins.GetThemePool();

            //Now select a random element from that list of unlocked themes
            subObjectiveID = (int)themesAvailable[Random.Range(0, themesAvailable.Count)];
        }


        if (objectiveID == (int)Objective.FIND_POWERUP)
        {
            subObjectiveID = Random.Range(0, 3);
        }



        switch (objectiveID)
        {
        case 0:
        case 1:
            goalAmount = 10;
            break;

        case 2:
        case 3:
            goalAmount = 5;
            break;

        case 4:
            goalAmount = 2;
            break;

        case 5:
            goalAmount = 3;
            break;
        }


        objectiveSet = true;
    }
Example #36
0
    //Update the snake skin and colour variable. Called whenever the player swaps skins beforet the game starts.
    public void ChangeSnakeSkin()
    {
        //Make sure object exists
        if (!skinObject)
        {
            skinObject = GameObject.Find("SkinHandler").GetComponent <Skins>();
        }
        if (!rend)
        {
            rend = GetComponent <Renderer>();
        }

        //Update the skin, but not if it's random (index would be out of range)
        if (Skins.snakeSkin != Skins.SnakeSkins.RANDOM)
        {
            Debug.Log("Changing to skin index " + Skins.snakeSkin);
            rend.material = skinObject.snakeSkins[(int)Skins.snakeSkin];
            GetComponent <DeathCheck>().regColor = rend.material.color;

            //Update food objects too
            GameObject[] foodObjects = GameObject.FindGameObjectsWithTag("Food");

            foreach (GameObject item in foodObjects)
            {
                item.GetComponent <SnakeFood>().ChangeSkin();
            }

            //Recolour the link to be a darkened version of this skin
            //0/103
            //190/248
            //118/71
            Renderer linkRend = segmentLinkReference.GetComponent <Renderer>();
            if (Skins.snakeSkin != Skins.SnakeSkins.DEFAULT)
            {
                linkRend.material.color = (rend.material.color * new Color(0.5f, 0.5f, 0.5f, 1.0f));
                //Color darkenedCol = linkRend.material.color;
                //darkenedCol = new Color(darkenedCol.r * 1.145f, darkenedCol.g * 0.766f, darkenedCol.b * 1.661f);
                //linkRend.material.color = darkenedCol;
            }
            else //Default colour isn't quite a darkened version of the default snake. Set it here.
            {
                linkRend.material.color = new Color(0.0f, 190.0f / 255.0f, 118.0f / 255.0f);
            }
        }
        else
        {
            Debug.Log("Randomness failed");
            //Out of index Failsafe for when its random but a skin hasnt been picked yet.
            //Skins.CheckForRandomization(true);
            //ChangeSnakeSkin();
        }
    }
Example #37
0
 public StateHandler()
 {
     _score = 0;
     _gamestate = GameState.Menu;
     _menustate = MenuState.MainMenu;
     _levelstate = LevelState.Level1;
     _transitionstate = TransitionState.LevelStart;
     _characterstate = CharacterState.Standing;
     _characterskin = Skins.Mario;
     _nextgamestate = GameState.Menu;
     _nextmenustate = MenuState.MainMenu;
     _nextlevelstate = LevelState.Level1;
     _nexttransitionstate = TransitionState.LevelStart;
     _nextcharacterstate = CharacterState.Standing;
     _nextcharacterskin = Skins.Mario;
     _cursor = MenuCursor.PlayGame;
     _keyscursor = 1;
     _skinscursor = 1;
 }
Example #38
0
File: Tile.cs Project: tritao/flood
        protected override void PostLayout(Skins.Skin skin)
        {
            var  bounds = InnerBounds;
            var pos = new Point( bounds.X, bounds.Y );

            foreach (var pChild in Children){
                if ( pChild.Dock != Pos.None ) continue;

                pChild.SetPosition( pos.X + (m_TileSize.X/2) - (pChild.Width/2), pos.Y + (m_TileSize.Y/2) - (pChild.Height/2) );

                pos.X = pos.X + m_TileSize.X;
                if (pos.X + m_TileSize.X > bounds.X + bounds.Width)
                {
                        pos.X = bounds.X;
                        pos.Y += m_TileSize.Y;
                }

            }
        }
Example #39
0
        /// <summary>
        /// Renders the control using specified skin.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Render(Skins.Skin skin)
        {
            if (m_Alt)
            {
                if (IsDepressed || ToggleState)
                    Skin.Renderer.DrawColor = skin.Colors.Category.LineAlt.Button_Selected;
                else if (IsHovered)
                    Skin.Renderer.DrawColor = skin.Colors.Category.LineAlt.Button_Hover;
                else
                    Skin.Renderer.DrawColor = skin.Colors.Category.LineAlt.Button;
            }
            else
            {
                if (IsDepressed || ToggleState)
                    Skin.Renderer.DrawColor = skin.Colors.Category.Line.Button_Selected;
                else if (IsHovered)
                    Skin.Renderer.DrawColor = skin.Colors.Category.Line.Button_Hover;
                else
                    Skin.Renderer.DrawColor = skin.Colors.Category.Line.Button;
            }

            skin.Renderer.DrawFilledRect(RenderBounds);
        }
Example #40
0
        protected virtual void LayoutVertical(Skins.Skin skin)
        {
            int w = Width;
            int h = Height;

            if (m_Panel[0] != null)
            {
                Margin m = m_Panel[0].Margin;
                if (m_Scale[0])
                    m_Panel[0].SetBounds(m.Left, m.Top, w - m.Left - m.Right, (h*0.5f) - m.Top - m.Bottom);
                else
                    m_Panel[0].Position(Pos.Center, 0, (int) (h*-0.25f));
            }

            if (m_Panel[1] != null)
            {
                Margin m = m_Panel[1].Margin;
                if (m_Scale[1])
                    m_Panel[1].SetBounds(m.Left, m.Top + (h*0.5f), w - m.Left - m.Right, (h*0.5f) - m.Top - m.Bottom);
                else
                    m_Panel[1].Position(Pos.Center, 0, (int) (h*0.25f));
            }
        }
Example #41
0
        /// <summary>
        /// Renders the currently visible tooltip.
        /// </summary>
        /// <param name="skin"></param>
        public static void RenderToolTip(Skins.Skin skin)
        {
            if (null == g_ToolTip) return;

            Renderers.Renderer render = skin.Renderer;

            Point oldRenderOffset = render.RenderOffset;
            Point mousePos = Input.InputHandler.MousePosition;
            Rectangle bounds = g_ToolTip.ToolTip.Bounds;

            Rectangle offset = Util.FloatRect(mousePos.X - bounds.Width*0.5f, mousePos.Y - bounds.Height - 10,
                                                 bounds.Width, bounds.Height);
            offset = Util.ClampRectToRect(offset, g_ToolTip.GetCanvas().Bounds);

            //Calculate offset on screen bounds
            render.AddRenderOffset(offset);
            render.EndClip();

            skin.DrawToolTip(g_ToolTip.ToolTip);
            g_ToolTip.ToolTip.DoRender(skin);

            render.RenderOffset = oldRenderOffset;
        }
Example #42
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawModalControl(this);
 }
Example #43
0
 /// <summary>
 /// Lays out the control's interior according to alignment, padding, dock etc.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Layout(Skins.Skin skin)
 {
     SetBounds(0, 0, GetCanvas().Width, GetCanvas().Height);
 }
Example #44
0
        public static void RenderOverlay(Canvas canvas, Skins.Skin skin)
        {
            if (CurrentPackage == null)
                return;
            if (CurrentPackage.DrawControl == null)
                return;

            var old = skin.Renderer.RenderOffset;

            skin.Renderer.AddRenderOffset(new Rectangle(
                m_MouseX - SourceControl.X - CurrentPackage.HoldOffset.X,
                m_MouseY - SourceControl.Y - CurrentPackage.HoldOffset.Y, 0, 0));
            CurrentPackage.DrawControl.DoRender(skin);

            skin.Renderer.RenderOffset = old;
        }
Example #45
0
        /// <summary>
        /// Lays out the control's interior according to alignment, padding, dock etc.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Layout(Skins.Skin skin)
        {
            Vector2i largestTab = new Vector2i(5, 5);

            int num = 0;
            foreach (var child in Children)
            {
                TabButton button = child as TabButton;
                if (null == button) continue;

                button.SizeToContents();

                Margin m = new Margin();
                int notFirst = num > 0 ? -1 : 0;

                if (Dock == Pos.Top)
                {
                    m.Left = notFirst;
                    button.Dock = Pos.Left;
                }

                if (Dock == Pos.Left)
                {
                    m.Top = notFirst;
                    button.Dock = Pos.Top;
                }

                if (Dock == Pos.Right)
                {
                    m.Top = notFirst;
                    button.Dock = Pos.Top;
                }

                if (Dock == Pos.Bottom)
                {
                    m.Left = notFirst;
                    button.Dock = Pos.Left;
                }

                largestTab.X = Math.Max(largestTab.X, button.Width);
                largestTab.Y = Math.Max(largestTab.Y, button.Height);

                button.Margin = m;
                num++;
            }

            if (Dock == Pos.Top || Dock == Pos.Bottom)
                SetSize(Width, largestTab.Y);

            if (Dock == Pos.Left || Dock == Pos.Right)
                SetSize(largestTab.X, Height);

            base.Layout(skin);
        }
Example #46
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     if (ShouldDrawBackground)
         skin.DrawTreeControl(this);
 }
Example #47
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawMenuDivider(this);
 }
Example #48
0
 /// <summary>
 /// Renders the focus overlay.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void RenderFocus(Skins.Skin skin)
 {
     // nothing
 }
Example #49
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawCategoryInner(this, m_HeaderButton.ToggleState);
     base.Render(skin);
 }
Example #50
0
        /// <summary>
        /// Function invoked after layout.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void PostLayout(Skins.Skin skin)
        {
            if (IsCollapsed)
            {
                Height = m_HeaderButton.Height;
            }
            else
            {
                SizeToChildren(false, true);
            }

            // alternate row coloring
            bool b = true;
            foreach (Control child in Children)
            {
                CategoryButton button = child as CategoryButton;
                if (button == null)
                    continue;

                button.m_Alt = b;
                button.UpdateColors();
                b = !b;
            }
        }
Example #51
0
        /// <summary>
        /// Renders over the actual control (overlays).
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void RenderOver(Skins.Skin skin)
        {
            if (!m_DrawHover)
                return;

            Renderers.Renderer render = skin.Renderer;
            render.DrawColor = new Color(255, 200, 255, 20);
            render.DrawFilledRect(RenderBounds);

            if (m_HoverRect.Width == 0)
                return;

            render.DrawColor = new Color(255, 200, 255, 100);
            render.DrawFilledRect(m_HoverRect);

            render.DrawColor = new Color(255, 200, 255, 200);
            render.DrawLinedRect(m_HoverRect);
        }
Example #52
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawPropertyTreeNode(this, m_InnerPanel.X, m_InnerPanel.Y);
 }
Example #53
0
        /// <summary>
        /// Lays out the control's interior according to alignment, padding, dock etc.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Layout(Skins.Skin skin)
        {
            base.Layout(skin);

            RefreshCursorBounds();
        }
Example #54
0
 /// <summary>
 /// Lays out the control's interior according to alignment, padding, dock etc.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Layout(Skins.Skin skin)
 {
     m_Button.Position(Pos.Right|Pos.CenterV, 4, 0);
     base.Layout(skin);
 }
Example #55
0
        /// <summary>
        /// Renders the control using specified skin.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Render(Skins.Skin skin)
        {
            base.Render(skin);

            if (ShouldDrawBackground)
                skin.DrawTextBox(this);

            if (!HasFocus) return;

            // Draw selection.. if selected..
            if (m_CursorPos != m_CursorEnd)
            {
                skin.Renderer.DrawColor = Color.FromArgb(200, 50, 170, 255);
                skin.Renderer.DrawFilledRect(m_SelectionBounds);
            }

            // Draw caret
            float time = Platform.Neutral.GetTimeInSeconds() - m_LastInputTime;

            if ((time % 1.0f) <= 0.5f)
            {
                skin.Renderer.DrawColor = Color.Black;
                skin.Renderer.DrawFilledRect(m_CaretBounds);
            }
        }
Example #56
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawComboBox(this, IsDepressed, IsOpen);
 }
Example #57
0
        /// <summary>
        /// Lays out the control's interior according to alignment, padding, dock etc.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void Layout(Skins.Skin skin)
        {
            base.Layout(skin);

            SizeToChildren(false, true);
            SetSize(Width, Height + 5);

            GroupBox groupBox = FindChildByName("ResultGroupBox", true) as GroupBox;
            if (groupBox != null)
                groupBox.SetPosition(groupBox.X, Height * 0.5f - groupBox.Height * 0.5f);

            //UpdateControls(); // this spams events continuously every tick
        }
Example #58
0
 /// <summary>
 /// Renders the focus overlay.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void RenderFocus(Skins.Skin skin)
 {
 }
Example #59
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     skin.DrawRadioButton(this, IsChecked, IsDepressed);
 }
Example #60
0
 /// <summary>
 /// Renders the control using specified skin.
 /// </summary>
 /// <param name="skin">Skin to use.</param>
 protected override void Render(Skins.Skin skin)
 {
     base.Render(skin);
     skin.Renderer.DrawColor = m_DrawColor;
     skin.Renderer.DrawTexturedRect(m_Texture, RenderBounds, m_uv[0], m_uv[1], m_uv[2], m_uv[3]);
 }