示例#1
0
    void ToggleRunOnStartup()
    {
        bool isRun = !DataModel.Instance.Data.isRunOnStartup;

        DataModel.Instance.Data.isRunOnStartup = isRun;
        DataModel.Instance.SaveData();
        _runOnStart.Image = isRun ? _enableImage : null;
        if (isRun)
        {
            Rainity.AddToStartup();
        }
        else
        {
            Rainity.RemoveFromStartup();
        }
    }
示例#2
0
    public void OnSettingBtnClick(int index)
    {
        //on top
        if (index == (int)BtnType.TOP)
        {
            top = !top;
            ResourcesManager.instance.SetTop(top);
        }
        //on mute
        if (index == (int)BtnType.MUTE)
        {
            mut = !mut;
            ResourcesManager.instance.SetMute(mut);
        }
        //onstarup
        if (index == (int)BtnType.STARUP)
        {
            if (starup)
            {
                Rainity.RemoveFromStartup();
                PlayerPrefs.DeleteKey(mikomiko);
                starup = false;
            }
            else
            {
                PlayerPrefs.SetString(mikomiko, "Pekora");
                Rainity.AddToStartup();
                starup = true;
            }
        }

        //on chatbubble
        if (index == (int)BtnType.CHATBUBBLE)
        {
            chatbubble = !chatbubble;
            ResourcesManager.instance.SetChatBubble(chatbubble);
        }

        if (index == (int)BtnType.CPURAM)
        {
            cpu = !cpu;
            GameEngine.instance.SetCPURAM(cpu);
        }

        RefreshBtn();
        ResourcesManager.instance.SaveConfigToJsonConfig();
    }
    void ToggleRunOnStartup()
    {
        bool isRun = !DataModel.Instance.Data.isRunOnStartup;

        DataModel.Instance.Data.isRunOnStartup = isRun;
        DataModel.Instance.SaveData();
        DataModel.Instance.ReloadData();
        if (isRun)
        {
            Rainity.AddToStartup();
            UIDialog.Instance.ShowDialog("开启开机自启", 3);
        }
        else
        {
            Rainity.RemoveFromStartup();
            UIDialog.Instance.ShowDialog("关闭开机自启", 3);
        }
    }