//AUDIO ADJUSTMENT VIA MAIN MENU

    //AudioLevels has the overall music and SFX fraction volumes as static variables (is a DontDestroyOnLoad)


    //Adjusts Music Volume by Slider
    public void adjustMusicVolume(float volumeFraction)
    {
        //Changes the current background music volume
        audioSources = GameObject.Find("BackgroundMusic").GetComponents <AudioSource>();
        foreach (AudioSource audioSource in audioSources)
        {
            audioSource.volume = audioSource.volume / (AudioLevels.musicVolumeFraction + 0.0001f) * (volumeFraction + 0.0001f);
        }

        //Sets the volume via the slider and stores in a static variable
        AudioLevels.musicVolumeFraction = volumeFraction;
        MenuFunctions.saveSettings();
    }
Esempio n. 2
0
        /// <summary>
        /// The main method.
        /// </summary>
        /// <param name="args">Ignored parameters.</param>
        public static void Main(string[] args)
        {
            HashSet <Contact> addressBook = new HashSet <Contact>();

            string currentDir = Directory.GetCurrentDirectory();
            string fileName   = "AddressBook.json";
            string filePath   = Path.Combine(currentDir, fileName);

            Console.WriteLine("Checking for saved contact file...");
            if (File.Exists(filePath))
            {
                Console.WriteLine("File found. Reading contacts...");

                try {
                    HashSet <Contact> jsonContacts = JSONHandlingFunctions.ReadContactsFromFile(filePath);
                    Console.WriteLine("Contacts read successfully!\n");
                    if (jsonContacts != null)
                    {
                        addressBook = jsonContacts;
                    }
                }
                catch (JsonSerializationException jse)
                {
                    Console.WriteLine(string.Format("Couldn't read contacts: {0}", jse.Message));
                    Console.WriteLine("Using a blank address book.\n");
                }
            }
            else
            {
                Console.WriteLine("File not found. Creating it...");
                File.Create(filePath).Close();
                Console.WriteLine("File created. Using a blank address book.\n");
            }

            Console.WriteLine("Welcome to the Address Book!\n");

            MenuFunctions.ShowHelp();
            Console.WriteLine();

            while (true)
            {
                MenuFunctions.ExecuteOptionChoice(ref addressBook);

                Console.Write("Press any key to return to the main menu...");
                Console.ReadKey();
                Console.Clear();
            }
        }
Esempio n. 3
0
    private void Start()
    {
        upButton.gameObject.SetActive(false);

        print("attempting to fade");
        StartCoroutine(Fade.instance.FadeIn(0.5f));


        MusicManager.instance.PlaySong(Music.Comic);

        switching = false;

        menuFunctions = GetComponent <MenuFunctions>();

        Cursor.visible = true;
    }
        /// <summary>
        /// 数据审核
        /// </summary>
        /// <param name="_application"></param>
        public void CheckData(IApplication _application)
        {
            List <MD_CheckRule> _rules;

            if (FilterDefine == null)
            {
                return;
            }
            PropertyManager cm_Meta2 = (PropertyManager)this.BindingContext[FilterDefine, ""];

            cm_Meta2.EndCurrentEdit();


            string _msg = "";

            if (!this.sinoSZUC_FixConditionPanel1.IsValid(ref _msg))
            {
                XtraMessageBox.Show(_msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            MDQuery_Request _request = GetQueryRequest();

            if (this._ruleList != null)
            {
                _rules = GetRuleList();
            }
            else
            {
                _rules = new List <MD_CheckRule>();
            }

            //if (_rules.Count < 1)
            //{
            //    XtraMessageBox.Show("请选择规则!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}

            string            _SelectRootDWDM = this.sinoUC_OrgComboBox1.DWDM.ToString();
            DC_DataCheckParam _dcParam        = new DC_DataCheckParam(_request, _rules, _SelectRootDWDM, FilterDefine);
            frmDataCheck      _frm            = MenuFunctions.AddPage <frmDataCheck>(Guid.NewGuid().ToString(), _application);

            if (_frm != null)
            {
                _frm.Init("数据审核", "审核功能", _dcParam);
            }
        }
Esempio n. 5
0
    public IEnumerator FadeOut(float time, string str)
    {
        float timer   = 0f;
        float percent = 0f;

        screen.color = new Color(screen.color.r, screen.color.g, screen.color.b, 0);

        while (timer <= time)
        {
            timer       += Time.deltaTime;
            percent      = timer / time;
            screen.color = new Color(screen.color.r, screen.color.g, screen.color.b, percent);
            yield return(null);
        }

        MenuFunctions.LoadGame(str);
    }
Esempio n. 6
0
        static public bool DoCommand(string _menuID, string _commandName, string _commandTitle, string _param, IApplication _application)
        {
            switch (_commandName)
            {
            case "CreateReport":                      //报表生成
                frmCreateReport _form = new frmCreateReport(_commandTitle, _param);
                _application.AddForm(Guid.NewGuid().ToString(), _form);
                break;

            case "BrowseReport":                     //报表浏览
                frmBrowseReport _bf = new frmBrowseReport(_commandTitle, _param);
                _application.AddForm(Guid.NewGuid().ToString(), _bf);
                break;

            case "ReportGuideLineQuery":
                string _title = StrUtils.GetMetaByName2("标题", _param);
                frmReportGuideLineQuery _frm = MenuFunctions.AddPage <frmReportGuideLineQuery>(_title, _application);
                if (_frm != null)
                {
                    _frm.Init(_title, "报表指标查询", _param);
                }

                break;

            case "DataCheck":                      //数据审核
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmCheckSearch _frm_DataCheck = MenuFunctions.AddPage <frmCheckSearch>(_title, _application);
                if (_frm_DataCheck != null)
                {
                    _frm_DataCheck.Init(_title, "数据审核", _param);
                }
                break;

            case "DataCheckBoard":                    //审核公告
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmDataCheckBoard _frmBoard = MenuFunctions.AddPage <frmDataCheckBoard>(_title, _application);
                if (_frmBoard != null)
                {
                    _frmBoard.Init(_title, "审核公告", _param);
                }
                break;
            }
            return(true);
        }
Esempio n. 7
0
        private void DataSh()
        {
            int _index = bandedGridView1.FocusedRowHandle;

            if (_index < 0)
            {
                return;
            }

            DataRow           _dr     = bandedGridView1.GetDataRow(_index);
            string            _mainid = _dr["MAINID"].ToString();
            string            _title  = string.Format("数据审核[{0}]", _mainid);
            frm_DataCheckInfo _frm    = MenuFunctions.AddPage <frm_DataCheckInfo>(_title, _application);

            if (_frm != null)
            {
                _frm.Init(_title, "数据审核", _mainid, CheckParam.Request, _queryModel, _dr);
            }
        }
Esempio n. 8
0
        static public bool DoCommand(string _menuID, string _commandName, string _commandTitle, string _param, IApplication _application)
        {
            string _title;

            switch (_commandName)
            {
            case "RoleManager":                      //角色管理
                frmRoleDefine _rdf = new frmRoleDefine(_param);
                _application.AddForm("角色管理", _rdf);
                break;

            case "PostManager":                     //岗位管理
                frmPostDefine _pdf = new frmPostDefine();
                _application.AddForm("岗位管理", _pdf);
                break;

            case "UserManager":                     //用户管理
                string        _canAdd = StrUtils.GetMetaByName2("可添加", _param);
                frmUserDefine _f      = new frmUserDefine(_commandTitle, _canAdd);
                _application.AddForm("用户管理", _f);
                break;

            case "UserMobileManager":                     //用户手机管理
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmUserMobile _frmUserMobile = MenuFunctions.AddPage <frmUserMobile>(_title, _application);
                if (_frmUserMobile != null)
                {
                    _frmUserMobile.Init(_title, "企业涉案", _param);
                }
                break;

            case "UserMappingCUPAA":     //三统一用户映射
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmUserMapping_CUPAA _f_UM_CUPAA = MenuFunctions.AddPage <frmUserMapping_CUPAA>(_title, _application);
                if (_f_UM_CUPAA != null)
                {
                    _f_UM_CUPAA.Init(_title, "三统一用户映射", _param);
                }
                break;
            }
            return(true);
        }
    public static void SaveFunction(MenuFunctions current)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path;

        //Custom File Name
        Debug.Log("File Name2: " + SessionData.myFileName);

        //Daniel
        if (SessionData.myFileName == null)
        {
            path = Application.persistentDataPath + "/NewTheatre.vt";
            SessionData.myFileName = "NewTheatre";
            int tempInt = 1;
            while (File.Exists(path))
            {
                path = Application.persistentDataPath + "/NewTheatre" + tempInt + ".vt";
                SessionData.myFileName = "NewTheatre" + tempInt;
                tempInt++;
            }
        }

        path = Application.persistentDataPath + "/" + SessionData.myFileName + ".vt";

        //Ariel
        FileStream stream;

        if (File.Exists(path))
        {
            stream = new FileStream(path, FileMode.Open);
        }
        else
        {
            stream = new FileStream(path, FileMode.Create);
        }
        Save data = new Save(current);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Esempio n. 10
0
        public static bool showMenu()
        {
            Console.Clear();
            Console.WriteLine();
            Console.WriteLine(" ----- Menu Principal ----- ");
            Console.WriteLine();

            Console.WriteLine(" Escolha uma opção:");
            Console.WriteLine();

            Console.WriteLine(" 1 - Gerenciar Planos");
            Console.WriteLine(" 2 - Gerenciar Usúarios");
            Console.WriteLine(" 3 - Gerenciar Tipos de Plano");
            Console.WriteLine(" 4 - Gerenciar Status de Plano");
            Console.WriteLine(" 0 - Sair");

            Console.WriteLine();

            Console.Write(" Opção: ");

            return(MenuFunctions.ReadMainMenu(Console.ReadLine()));
        }
    public void adjustSFXVolume(float volumeFraction)
    {
        //Changes the current SFX tracks volumes and all other AudioSourcers not BGmusic and Dialogue
        audioSources = FindObjectsOfType <AudioSource>();
        ///////
        ///
        foreach (AudioSource audioSource in audioSources)
        {
            if (audioSource.name == "BackgroundMusic" || audioSource.name == "Dialogue Manager")
            {
                continue;
            }

            else
            {
                audioSource.volume = audioSource.volume / (AudioLevels.sfxVolumeFraction + 0.0001f) * (volumeFraction + 0.0001f);
            }
        }

        AudioLevels.sfxVolumeFraction = volumeFraction; //Sets the volume via the slider and stores in a static variable
        MenuFunctions.saveSettings();
    }
Esempio n. 12
0
        private HtmlGenericControl buildMenuItem(string ResourceSet, string resourceKeyPrefix, CodeTorch.Core.MenuItem item)
        {
            HtmlGenericControl menuItem = new HtmlGenericControl("li");
            HyperLink          link     = new HyperLink();
            string             url      = item.Location;
            string             context  = item.Context;

            if (url != String.Empty)
            {
                link.NavigateUrl = Common.CreateUrlWithQueryStringContext(url, context);
            }

            bool isSelected = IsMenuItemSelected(url);

            if (!String.IsNullOrEmpty(item.CssClass))
            {
                if (isSelected)
                {
                    menuItem.Attributes.Add("class", String.Format("{0} selected", item.CssClass));
                }
                else
                {
                    menuItem.Attributes.Add("class", item.CssClass);
                }
            }
            else
            {
                if (isSelected)
                {
                    menuItem.Attributes.Add("class", "selected");
                }
            }

            link.Text = MenuFunctions.GetMenuItemText(app, this.Page, ResourceSet, resourceKeyPrefix, item.Code, item.Name);

            menuItem.Controls.Add(link);
            return(menuItem);
        }
Esempio n. 13
0
    void Start()
    {
        // Select playlists from database
        Load();

        // Set selected elements
        MenuFunctions.SetSelected();

        // Display playlists
        Display();

        // Close database connection
        Database.Close();

        // Show or hide start button
        MenuManager.ToggleStart();

        // Set start button
        if (Settings.Active.File != null)
        {
            GameObject.Find("Start/Button/Text").GetComponent <Text>().text = Settings.MenuManager.LangManager.getString("continue");
        }
    }
Esempio n. 14
0
    //The following was a unit test designed to debug the save conditions for the playback function.
    public static void SaveFunctionForPlayback(MenuFunctions current, int sceneOrder)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path;

        //Custom File Name
        //Daniel
        if (!File.Exists(Application.persistentDataPath + "/playbackTemp.vt"))
        {
            path = Application.persistentDataPath + "/playbackTemp.vt";
            SessionData.myFileName = "PlaybackTemp";
            Debug.Log("File Exists? " + File.Exists(path));
            while (File.Exists(path))
            {
                path = Application.persistentDataPath + "/playbackTemp" + sceneOrder + ".vt";
                SessionData.myFileName = "playbackTemp" + sceneOrder;
            }
        }

        //Ariel
        path = Application.persistentDataPath + "/playbackTemp.vt";
        Debug.Log(path);
        FileStream stream;

        if (File.Exists(path))
        {
            stream = new FileStream(path, FileMode.Open);
        }
        else
        {
            stream = new FileStream(path, FileMode.Create);
        }
        Save data = new Save(current);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Esempio n. 15
0
    //This is used in the Load function, it takes the list of SaveableScenes from the JSON file,
    //and repurposes the serialized data to refill the SceneList in the program.
    public void saveableScenesIntoScenes(SaveableScene scene, MenuFunctions current)
    {
        //getID
        SceneID = scene.saveSceneID;

        //get the start positions
        int start = 0;

        foreach (float[,] floatVec3s in scene.saveStartPositions)
        {
            Vector3 tempVec3 = new Vector3(floatVec3s[start, 0], floatVec3s[start, 1], floatVec3s[start, 1]);
            startPos.Add(tempVec3);
            start++;
        }


        //get the positions

        foreach (List <float[, ]> floatVec3Nexts in scene.savePositions)
        {
            List <Vector3> tempListToPutInNextPos = new List <Vector3>();
            //Debug to check the positions of the saveable Scene
            int objectIndex = 0;
            foreach (float[,] pos2 in floatVec3Nexts)
            {
                Debug.Log("[SCENE CLASS] Actor " + objectIndex + " Saveable Scene Pos: (" + pos2[0, 0] + ", " + pos2[0, 1] + ", " + pos2[0, 2] + ")");

                Vector3 tempVec = new Vector3(pos2[objectIndex, 0], pos2[objectIndex, 1], pos2[objectIndex, 2]);
                Debug.Log("[SCENE CLASS] Actor " + objectIndex + " Scene Pos: " + tempVec);


                tempListToPutInNextPos.Add(tempVec);
                if (objectIndex > objects.Count)
                {
                    objectIndex = 0;
                }
                else
                {
                    objectIndex++;
                }
            }

            positions.Add(tempListToPutInNextPos);
        }

        Debug.Log("positions.Count" + positions.Count);

        //get the objects
        int tempPrefabCheck = 0;

        foreach (string tagString in scene.tagsForObjects)
        {
            if (tagString.Equals("Player"))
            {
                GameObject buildObject = Instantiate(current.actorDrop.prefabList[scene.prefabIndexesForObjects[tempPrefabCheck]], startPos[tempPrefabCheck], Quaternion.identity);
                objects.Add(buildObject);
                buildObject.SetActive(false);
            }
            else if (tagString.Equals("Props"))
            {
                GameObject buildObject = Instantiate(current.propDrop.prefabList[scene.prefabIndexesForObjects[tempPrefabCheck]], startPos[tempPrefabCheck], Quaternion.identity);
                objects.Add(buildObject);
                buildObject.SetActive(false);
            }


            tempPrefabCheck++;
        }
    }
Esempio n. 16
0
        static public bool DoCommand(string _menuID, string _commandName, string _commandTitle, string _param, IApplication _application)
        {
            string _modelName;
            string _guidLines;
            string _glqTitle;
            string _title;

            switch (_commandName)
            {
            case "RelationQuery":
                _modelName = StrUtils.GetMetaByName("查询模型", _param);
                frmSinoSZ_RelationQuery _f = new frmSinoSZ_RelationQuery(_modelName, _param);
                _f.Tag = _menuID;
                _application.AddForm(Guid.NewGuid().ToString(), _f);
                break;

            case "FixQuery":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmFixQuery _frmFixQuery = MenuFunctions.AddPage <frmFixQuery>(_title, _application);
                if (_frmFixQuery != null)
                {
                    _frmFixQuery.Init(_title, _title, _param);
                }
                break;

            case "SingleGuideLineQuery":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmGuideLineQuery_Single _frmSingleGuideLine = MenuFunctions.AddPage <frmGuideLineQuery_Single>(_title, _application);
                if (_frmSingleGuideLine != null)
                {
                    _frmSingleGuideLine.Init(_title, _title, _param);
                }
                break;

            case "DataCompare":

                frmDataCompare _f2 = new frmDataCompare(_param);
                _application.AddForm(Guid.NewGuid().ToString(), _f2);
                break;

            case "DataSearch":
                _modelName = StrUtils.GetMetaByName("查询模型", _param);
                frmDataSearch _f3 = new frmDataSearch(_modelName);
                _application.AddForm(Guid.NewGuid().ToString(), _f3);
                break;

            case "GuideLineQuery":
                _guidLines = StrUtils.GetMetaByName("指标ID", _param);
                _glqTitle  = StrUtils.GetMetaByName("标题", _param);
                frmGuideLineQuery _f4 = new frmGuideLineQuery((_glqTitle == "") ? _commandTitle : _glqTitle, _guidLines);
                _application.AddForm(Guid.NewGuid().ToString(), _f4);
                break;

            case "GuideLineQueryEx":
                _guidLines = StrUtils.GetMetaByName("指标ID", _param);
                _glqTitle  = StrUtils.GetMetaByName("标题", _param);
                frmGuideLineQueryEx _f4ex = new frmGuideLineQueryEx((_glqTitle == "") ? _commandTitle : _glqTitle, _guidLines);
                _application.AddForm(Guid.NewGuid().ToString(), _f4ex);
                break;

            case "GuideLineShow":
                string _guidLineID = StrUtils.GetMetaByName2("指标ID", _param);
                string _params     = StrUtils.GetMetaByName2("参数", _param);
                bool   _canGroup   = (StrUtils.GetMetaByName2("可分组", _param).ToUpper() == "TRUE");
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmGuideLineQueryWithoutInput _f5 = new frmGuideLineQueryWithoutInput(_title, _guidLineID, _params, _canGroup);
                _application.AddForm(_title, _f5);
                break;

            case "GuideLineGroupShow":
                frmGuideLineGroupShow _f6 = new frmGuideLineGroupShow(_param);
                _application.AddForm(_commandTitle, _f6);
                break;

            case "GuideLineGroupShow2":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmGuideLineGroupShow2 _f7 = new frmGuideLineGroupShow2(_param);
                _application.AddForm(_title, _f7);
                break;

            case "PortalShow":
                frmPortal _fPortal = new frmPortal(_param, _application);
                _application.AddForm(_commandTitle, _fPortal);
                break;

            case "RelationQueryTask":
                _modelName = StrUtils.GetMetaByName("查询模型", _param);
                frmSinoSZ_RelationQuery_Task _f8 = new frmSinoSZ_RelationQuery_Task(_modelName, _param);
                _application.AddForm(Guid.NewGuid().ToString(), _f8);
                break;

            case "QueryTaskList":
                frmSinoSZ_TaskList _f9 = new frmSinoSZ_TaskList();
                _application.AddForm(_commandTitle, _f9);
                break;

            case "TreeComboPortalShow":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmTreeComboPortal _frm = MenuFunctions.AddPage <frmTreeComboPortal>(_title, _application);
                if (_frm != null)
                {
                    _frm.Init(_title, _title, _param);
                }
                break;

            case "AlertMonitor":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmAlertMonitor _frmAert = MenuFunctions.AddPage <frmAlertMonitor>(_title, _application);
                if (_frmAert != null)
                {
                    _frmAert.Init(_title, _title, _param);
                }
                break;

            case "ParameterSetting":
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmGuideLineSetting _frmSetting = MenuFunctions.AddPage <frmGuideLineSetting>(_title, _application);
                if (_frmSetting != null)
                {
                    _frmSetting.Init(_title, _title, _param);
                }
                break;
            }
            return(true);
        }
Esempio n. 17
0
        private static void DoGlobalDefine(IApplication _application)
        {
            string _frmName = "GlobalDefine";

            MenuFunctions.AddPage <frmGlobalManager>(_frmName, _application);
        }
Esempio n. 18
0
        private static void DoNodeDefine(IApplication _application)
        {
            string _frmName = "NodeDefine";

            MenuFunctions.AddPage <frmNodeManager>(_frmName, _application);
        }
Esempio n. 19
0
        private static void DoGuideLineDefine(IApplication _application)
        {
            string _frmName = Guid.NewGuid().ToString();

            MenuFunctions.AddPage <frmGuideLineManager>(_frmName, _application);
        }
Esempio n. 20
0
 public JoinLevelMenuItem(MenuFunctions function, String text, SpriteFont font, Level aLevel, RemoteGame game)
     : base(function, text, font, aLevel)
 {
     remoteGame = game;
 }
Esempio n. 21
0
 // Use this for initialization
 void Start()
 {
     menuFunctions  = FindObjectOfType(typeof(MenuFunctions)) as MenuFunctions;
     scoreResources = FindObjectsOfType(typeof(ScoreResource)) as ScoreResource[];
     source         = GetComponent <AudioSource> ();
 }
Esempio n. 22
0
    //This function is a modified constructor class. A Saveable scene can be created when the MenuFunctions class creates
    //A scene.
    public SaveableScene(Scene scene, MenuFunctions current)
    {
        int i = 0;

        foreach (GameObject variable in scene.objects)
        {
            tagsForObjects.Add(variable.tag);

            if (variable.tag.Equals("Player"))
            {
                if (variable == current.actorDrop.prefabList[1])
                {
                    prefabIndexesForObjects.Add(1);
                }
                else
                {
                    prefabIndexesForObjects.Add(2);
                }
            }
            else if (variable.tag.Equals("Props"))
            {
                foreach (GameObject propVariable in current.propDrop.prefabList)
                {
                    if (propVariable == variable)
                    {
                        prefabIndexesForObjects.Add(current.propDrop.prefabList.IndexOf(propVariable));
                        break;
                    }
                }
            }

            //get scene ID
            saveSceneID = scene.getSceneID();

            //Start Position conversion
            temp       = new float[scene.objects.Count, 3];
            temp[i, 0] = scene.startPos[i].x;
            temp[i, 1] = scene.startPos[i].y;
            temp[i, 2] = scene.startPos[i].z;
            saveStartPositions.Add(temp);

            //Other position conversion

            foreach (List <Vector3> vec3List in scene.positions)
            {
                int j = 0; //j isn't putting the positions for each gameobject; why?
                Debug.Log("[SAVEABLE SCENES] scene.objects Count: " + scene.objects.Count);
                tempForSavePositions = new List <float[, ]>();
                foreach (Vector3 vec3 in vec3List)
                {
                    if (j >= scene.objects.Count)
                    {
                        break;
                    }

                    temp       = new float[scene.objects.Count, 3];
                    temp[j, 0] = vec3.x;
                    temp[j, 1] = vec3.y;
                    temp[j, 2] = vec3.z;
                    Debug.Log("[SAVEABLE SCENES] scene.position for actor " + j + ": (" + vec3.x + ", " + vec3.y + ", " + vec3.z + ") added!");
                    tempForSavePositions.Add(temp);
                    j++;
                }
                savePositions.Add(tempForSavePositions);
                Debug.Log("[SAVEABLE SCENES] scene.positions Count: " + scene.positions.Count);
            }
        }
    }
Esempio n. 23
0
 public LevelMenuItem(MenuFunctions function, String text, SpriteFont font, Level aLevel)
     : base(function, text, font)
 {
     level = aLevel;
 }
Esempio n. 24
0
 /**
  * Constructs a new MenuItem.
  *
  * @param function The function that should be performed by the item.
  * @param text The text to render for the item.
  * @param font The font to use to render the item's text.
  */
 public MenuItem(MenuFunctions function, String text, SpriteFont font)
 {
     initialise(function, text, font, 1.0f, 0, 0);
 }
Esempio n. 25
0
        static public bool DoCommand(string _menuID, string _commandName, string _commandTitle, string _param, IApplication _application)
        {
            string _title;

            switch (_commandName)
            {
            case "IISRecycle":
                frmResetIISApp _frmIIS = MenuFunctions.AddPage <frmResetIISApp>("内存回收", _application);
                if (_frmIIS != null)
                {
                    _frmIIS.Init("内存回收", "内存回收", _param);
                }
                break;

            case "WinServiceWatch":
                frmResetWindowsService _frmWinService = MenuFunctions.AddPage <frmResetWindowsService>("服务查看", _application);
                if (_frmWinService != null)
                {
                    _frmWinService.Init("服务查看", "服务查看", _param);
                }
                break;

            case "OrganizeExtInfo":
                frmOrganizeExtInfo _frmOrgExt = MenuFunctions.AddPage <frmOrganizeExtInfo>("组织机构信息维护", _application);
                if (_frmOrgExt != null)
                {
                    _frmOrgExt.Init("组织机构信息维护", "机构信息维护", _param);
                }
                break;

            case "UserLog":
                frmUserLog _rdf = new frmUserLog();
                _application.AddForm("用户操作日志", _rdf);
                break;

            case "QueryLog":
                frmQueryLog _fql = new frmQueryLog();
                _application.AddForm("数据查询日志", _fql);
                break;

            case "SystemLog":
                frmSystemLog _syslog = new frmSystemLog();
                _application.AddForm("系统处理日志", _syslog);
                break;

            case "Notify":
                frmNotifyInfo _frm = MenuFunctions.AddPage <frmNotifyInfo>("通知通告", _application);
                if (_frm != null)
                {
                    _frm.Init("通知通告", "通知通告", "");
                }
                break;

            case "InterfaceManager_SJJH":
                frmIM_SJJH _frmIM_SJJH = MenuFunctions.AddPage <frmIM_SJJH>("数据交换接口管理", _application);
                if (_frmIM_SJJH != null)
                {
                    _frmIM_SJJH.Init("数据交换接口管理", "数据交换接口管理", "");
                }
                break;

            case "FSDataLoadAlertMailSet":      //数据加载监控提示邮件设置
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmFsAlertMainSet _frmFsAlert = MenuFunctions.AddPage <frmFsAlertMainSet>(_title, _application);
                if (_frmFsAlert != null)
                {
                    _frmFsAlert.Init(_title, "邮件设置", _param);
                }
                break;

            case "TaskManager":     //后台任务管理器
                _title = StrUtils.GetMetaByName2("标题", _param);
                frmTaskManager _frmTaskManager = MenuFunctions.AddPage <frmTaskManager>(_title, _application);
                if (_frmTaskManager != null)
                {
                    _frmTaskManager.Init(_title, "任务管理", _param);
                }
                break;

            case "WorkCalendar":    //工作日历
                _title = "工作日历";
                WorkCalenderForm _frmWorkCalenderForm = MenuFunctions.AddPage <WorkCalenderForm>(_title, _application);
                if (_frmWorkCalenderForm != null)
                {
                    _frmWorkCalenderForm.Init(_title, "工作日历", _param);
                }
                break;

            case "GDSManager":
                _title = "通用接口管理";
                frmGDSManager _frmGDSManager = MenuFunctions.AddPage <frmGDSManager>(_title, _application);
                if (_frmGDSManager != null)
                {
                    _frmGDSManager.Init(_title, _title, _param);
                }
                break;
            }
            return(true);
        }
Esempio n. 26
0
        private void DoCompare()
        {
            //开始数据比对
            string _errorMsg = "";

            if (_excelReader == null)
            {
                MessageBox.Show("未打开EXCEL文件!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //取结果集字段
            if (!this.sinoSZUC_MD_Model_FieldList1.CheckItems(ref _errorMsg))
            {
                XtraMessageBox.Show(string.Format("选择比对结果不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (!this.sinoSZUC_CompareConditionPanel1.CheckInput(ref _errorMsg))
            {
                XtraMessageBox.Show(string.Format("筛选条件或比对条件不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            MC_CompareRequsetFactory _rf = new MC_CompareRequsetFactory();

            _rf.QueryModelName = this.QueryModelName;
            this.sinoSZUC_CompareConditionPanel1.InsertConditions2QueryRequest(_rf);
            this.sinoSZUC_MD_Model_FieldList1.InsertResultFields2QueryRequest(_rf);
            MDCompare_Request _compareRequest = _rf.GetCompareQueryRequest();

            //if (_queryResult._resultItems.Count < 1)
            //{
            //        MessageBox.Show("未选择结果字段!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //        return;
            //}
            //SinoProgressControler.BeginProgress();
            ////SinoProgressControler.ShowMessage = "正在加载比对目标数据....";
            ////1.将需要比对的目标文件的数据加载入DataTable
            //ArrayList _usedExcelRowList = GetUsedExcelRows();
            ////ArrayList _usedExcelRowList = this._ExcelColumnNames;

            ////2.设置别名
            //ReBuildAlias(ref _usedExcelRowList);

            ////2.将表达式进行处理
            //CompareConditionClass _CompareCon = new CompareConditionClass();
            //_CompareCon.Express = textEdit1.EditValue.ToString();
            //foreach (UC_CompareConditionItem _uc in this.panel14.Controls)
            //{
            //        if (!_uc.CheckInput())
            //        {
            //                MessageBox.Show("比对条件错误!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //                return;
            //        }
            //        CompareConditionItemClass _item = _uc.GetCondition();
            //        _CompareCon.AddItem(_item);
            //}

            //_CompareCon.QueryView = (QueryView_Class)comboBoxEdit1.SelectedItem;
            //QueryCondition_Class _qcc = this.uC_RelationConditionPanel1.GetConditions();
            //foreach (Meta_ConditionItem_Class _mcc in _qcc.ConditionItems)
            //{
            //        _mcc.Column.Table_Meta.AliasName = _mcc.Column.Table_Meta.TableName;
            //}

            ////3.导入数据到DataTable
            //DataTable _importdt = SessionClass.IMetaData.GetImportTableTemp();
            //if (this._excelReader != null)
            //{
            //        _excelReader.OpenReportTempalte();
            //        _excelReader.InsertExcelData(_usedExcelRowList, ref _importdt);
            //        _excelReader.CloseReportTemplate();
            //}

            ////3.调用后台服务进行比对,并返回结果的DataSet
            //QueryResult_Class _mainRes = this.uC_CompareResultPanl1.GetMainTableResults();
            //ArrayList _childRes = this.uC_CompareResultPanl1.GetChildResults();

            //DataSet _CompareResult = SessionClass.IMetaData.CompareData2(_CompareCon, _importdt, _mainRes, _childRes, _qcc, _usedExcelRowList);
            ////4.将结果显示出来

            //SinoProgressControler.EndProgress();
            //CompareResultForm_D2E _f = new CompareResultForm_D2E(_CompareCon.QueryView, _mainRes, _childRes, _importdt, _CompareResult, _usedExcelRowList);
            //SessionClass.mainForm.AddPage("比对结果", 0, _f);

            _compareRequest.ExcelData        = _excelReader.GetData();
            _compareRequest.ColumnDictionary = _excelReader.CreateColumnDictionary();
            frmDataCompareResult _frmResult = MenuFunctions.AddPage <frmDataCompareResult>(Guid.NewGuid().ToString(), Application);

            if (_frmResult != null)
            {
                _frmResult.Init("数据比对结果", "", _compareRequest, _excelReader.GetColumns());
            }
        }
Esempio n. 27
0
 /**
  * Initilises the item.
  *
  * @param function The function that should be performed by the item.
  * @param text The text to render for the item.
  * @param font The font to use to render the item's text.
  * @param scale The scale of the item's text.
  * @param x The x coordinate of the item in pixels.
  * @param y the y coordinate of the item in pixels.
  */
 private void initialise(MenuFunctions function, String text, SpriteFont font, float scale, int x, int y)
 {
     this.function = function;
     this.text = text;
     this.scale = scale;
     this.font = font;
     isSelected = false;
     pos= new Vector2(x, y);
     defaultColor = Color.White;
     selectedColor = Color.Red;
 }
Esempio n. 28
0
        private void CreateMenu()
        {
            MenuController.EnableMenuToggleKeyOnKeyboard   = false;
            MenuController.EnableMenuToggleKeyOnController = false;

            MenuFunctions.CreatorMenu = new Menu("Create Character", "Create A New Character")
            {
                Visible = false
            };
            MenuController.AddMenu(MenuFunctions.CreatorMenu);

            #region GenderSelection
            List <string> genderList = new List <string>()
            {
                "Male", "Female"
            };
            MenuListItem genderListItem = new MenuListItem("Gender Selection", genderList, 0, "Select which gender you want");
            MenuFunctions.CreatorMenu.AddMenuItem(genderListItem);
            #endregion

            #region InheritanceMenu
            Inheritance.CreateMenu();
            //Labels for buttons
            Inheritance.InheritanceButton.Label = "→→→";
            //adding button items
            MenuFunctions.CreatorMenu.AddMenuItem(Inheritance.InheritanceButton);
            //adding inheritance as a sub menu to the main menu
            MenuController.BindMenuItem(MenuFunctions.CreatorMenu, Inheritance.InheritanceMenu, Inheritance.InheritanceButton);
            #endregion

            #region FaceFeaturesMenu
            FaceFeatures.CreateMenu();
            //Labels for buttons
            FaceFeatures.FaceFeaturesButton.Label = "→→→";
            //adding button items
            MenuFunctions.CreatorMenu.AddMenuItem(FaceFeatures.FaceFeaturesButton);
            //adding face features as a sub menu to the main menu
            MenuController.BindMenuItem(MenuFunctions.CreatorMenu, FaceFeatures.FaceFeaturesMenu, FaceFeatures.FaceFeaturesButton);
            #endregion

            #region AppearanceMenu
            Appearance.CreateMenu();
            //Labels for buttons
            Appearance.AppearanceButton.Label = "→→→";
            //adding button items
            MenuFunctions.CreatorMenu.AddMenuItem(Appearance.AppearanceButton);
            //adding appearance as a sub menu to the main menu
            MenuController.BindMenuItem(MenuFunctions.CreatorMenu, Appearance.AppearanceMenu, Appearance.AppearanceButton);
            #endregion

            #region ClothingMenu
            Clothing.CreateMenu();
            //Labels for buttons
            Clothing.ClothingButton.Label = "→→→";
            //adding button items
            MenuFunctions.CreatorMenu.AddMenuItem(Clothing.ClothingButton);
            //adding clothing as a sub menu to the main menu
            MenuController.BindMenuItem(MenuFunctions.CreatorMenu, Clothing.ClothingMenu, Clothing.ClothingButton);
            #endregion

            #region PropsMenu
            Props.CreateMenu();
            //Labels for buttons
            Props.PropsButton.Label = "→→→";
            //adding button items
            MenuFunctions.CreatorMenu.AddMenuItem(Props.PropsButton);
            //adding props as a sub menu to the main menu
            MenuController.BindMenuItem(MenuFunctions.CreatorMenu, Props.PropsMenu, Props.PropsButton);
            #endregion

            MenuItem saveButton = new MenuItem("Save Character", "Save your character.");
            MenuItem exitNoSave = new MenuItem("Exit Without Saving", "Are you sure? All unsaved work will be lost.");
            MenuFunctions.CreatorMenu.AddMenuItem(saveButton);
            MenuFunctions.CreatorMenu.AddMenuItem(exitNoSave);

            /*
             ########################################################
             #                   Event handlers
             ########################################################
             */

            // Handles events for gender selection
            #region GenderSelectionEvents
            MenuFunctions.CreatorMenu.OnListItemSelect += async(_menu, _listItem, _listIndex, _itemIndex) =>
            {
                if (_listIndex == 1)
                {
                    await Functions.ChangeGenderDialog(false);
                }

                if (_listIndex == 0)
                {
                    await Functions.ChangeGenderDialog(true);
                }

                // Code in here would get executed whenever a list item is pressed.
                DebugLog.Log($"OnListItemSelect: [{_menu}, {_listItem}, {_listIndex}, {_itemIndex}]", false, false, DebugLog.LogLevel.info);
            };
            #endregion

            // handle button presses for the createCharacter menu.
            MenuFunctions.CreatorMenu.OnItemSelect += async(sender, item, index) =>
            {
                if (item == saveButton) // save ped
                {
                    bool confirm = false;
                    AddTextEntry("save_message_first_line", "Are you sure you want to save your character?");
                    AddTextEntry("save_message_second_line", "This will close the creator!");
                    MenuFunctions.CreatorMenu.CloseMenu();

                    // wait for confirmation or cancel input.
                    while (true)
                    {
                        await BaseScript.Delay(0);

                        int unk  = 1;
                        int unk2 = 1;
                        SetWarningMessage("save_message_first_line", 20, "save_message_second_line", true, 0, ref unk, ref unk2, true, 0);
                        if (IsControlJustPressed(2, 201) || IsControlJustPressed(2, 217)) // continue/accept
                        {
                            confirm = true;
                            break;
                        }
                        else if (IsControlJustPressed(2, 202)) // cancel
                        {
                            break;
                        }
                    }

                    // if confirmed to discard changes quit the editor.
                    if (confirm)
                    {
                        if (await SavePed())
                        {
                            while (!MenuController.IsAnyMenuOpen())
                            {
                                await BaseScript.Delay(0);
                            }

                            while (IsControlPressed(2, 201) || IsControlPressed(2, 217) || IsDisabledControlPressed(2, 201) || IsDisabledControlPressed(2, 217))
                            {
                                await BaseScript.Delay(0);
                            }
                            await BaseScript.Delay(100);
                        }
                        MenuFunctions.EndMenu();
                    }
                    else // otherwise cancel and go back to the editor.
                    {
                        await BaseScript.Delay(100);

                        MenuFunctions.CreatorMenu.OpenMenu();
                    }
                }
                else if (item == exitNoSave) // exit without saving
                {
                    bool confirm = false;
                    AddTextEntry("warning_message_first_line", "Are you sure you want to exit the character creator?");
                    AddTextEntry("warning_message_second_line", "You will lose all (unsaved) customization!");
                    MenuFunctions.CreatorMenu.CloseMenu();

                    // wait for confirmation or cancel input.
                    while (true)
                    {
                        await BaseScript.Delay(0);

                        int unk  = 1;
                        int unk2 = 1;
                        SetWarningMessage("warning_message_first_line", 20, "warning_message_second_line", true, 0, ref unk, ref unk2, true, 0);
                        if (IsControlJustPressed(2, 201) || IsControlJustPressed(2, 217)) // continue/accept
                        {
                            confirm = true;
                            break;
                        }
                        else if (IsControlJustPressed(2, 202)) // cancel
                        {
                            break;
                        }
                    }

                    // if confirmed to discard changes quit the editor.
                    if (confirm)
                    {
                        while (IsControlPressed(2, 201) || IsControlPressed(2, 217) || IsDisabledControlPressed(2, 201) || IsDisabledControlPressed(2, 217))
                        {
                            await BaseScript.Delay(0);
                        }
                        await BaseScript.Delay(100);

                        MenuFunctions.EndMenu();
                    }
                    else // otherwise cancel and go back to the editor.
                    {
                        await BaseScript.Delay(100);

                        MenuFunctions.CreatorMenu.OpenMenu();
                    }
                }
                else if (item == Inheritance.InheritanceButton) // update the inheritance menu anytime it's opened to prevent some weird glitch where old data is used.
                {
                    var data = Game.PlayerPed.GetHeadBlendData();
                    Inheritance.inheritanceDads.ListIndex    = data.FirstFaceShape;
                    Inheritance.inheritanceMoms.ListIndex    = data.SecondFaceShape;
                    Inheritance.inheritanceShapeMix.Position = (int)(data.ParentFaceShapePercent * 10f);
                    Inheritance.inheritanceSkinMix.Position  = (int)(data.ParentSkinTonePercent * 10f);
                    Inheritance.InheritanceMenu.RefreshIndex();
                }
            };
        }
 //Daniel
 //Function to call SaveSystem class via pause menu.
 public void SaveDataViaPause(MenuFunctions myMenu)
 {
     SaveSystem.SaveFunction(myMenu);
 }