Exemple #1
0
        public void ShowMenu(MenuData menuData)
        {
            ClearBuffer();
            OutputText(menuData.Caption + "<br/>");
            foreach (var option in menuData.Options)
            {
                OutputText(string.Format("{0}: {1}<br/>", option.Key, option.Value));
            }
            string response;
            do
            {
                response = Console.ReadLine();
            } while (!menuData.Options.ContainsKey(response));

            Thread newThread = new Thread(() =>
            {
                m_game.SetMenuResponse(response);
                ClearBuffer();
            });
            newThread.Start();
        }
Exemple #2
0
        internal string DisplayMenu(string caption, IDictionary<string, string> options, bool allowCancel, bool async)
        {
            Print(caption);

            MenuData menuData = new MenuData(caption, options, allowCancel);
            m_menuOptions = options;

            m_playerUI.ShowMenu(menuData);

            if (async)
            {
                return string.Empty;
            }

            m_callbacks.Pop(CallbackManager.CallbackTypes.Menu);
            m_menuOptions = null;

            ChangeThreadState(ThreadState.Waiting);

            lock (m_waitForResponseLock)
            {
                Monitor.Wait(m_waitForResponseLock);
            }

            ChangeThreadState(ThreadState.Working);

            return m_menuResponse;
        }
Exemple #3
0
 public void ShowMenu(MenuData menuData)
 {
     Logging.Log.DebugFormat("{0} Showing menu", GameId);
     ShowMenuDelegate(menuData.Caption, menuData.Options, menuData.AllowCancel);
 }
Exemple #4
0
 public void SetWindowMenu(MenuData menuData)
 {
     // Do nothing
 }
Exemple #5
0
 public void SetWindowMenu(MenuData menuData)
 {
 }
Exemple #6
0
 public void ShowMenu(MenuData menuData)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
 public void SetWindowMenu(MenuData menuData)
 {
 }
Exemple #8
0
 public void ShowMenu(MenuData menuData)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 public void ShowMenu(MenuData menuData)
 {
     LatestMenu = menuData;
 }