Ejemplo n.º 1
0
        /// <summary>
        /// Initialize any components required by this state.
        /// </summary>
        public override void Initialize()
        {
            ServiceManager.Game.FormManager.ClearWindow();
            Options options = ServiceManager.Game.Options;

            RendererAssetPool.DrawShadows = GraphicOptions.ShadowMaps;
            mouseCursor = new MouseCursor(options.KeySettings.Pointer);
            mouseCursor.EnableCustomCursor();
            renderer    = ServiceManager.Game.Renderer;
            fps         = new FrameCounter();
            Chat        = new ChatArea();
            Projectiles = new ProjectileManager();
            Tiles       = new TexturedTileGroupManager();
            Utilities   = new UtilityManager();
            cd          = new Countdown();
            Lazers      = new LazerBeamManager(this);
            Scene.Add(Lazers, 0);
            Players            = new PlayerManager();
            currentGameMode    = ServiceManager.Theater.GetCurrentGameMode();
            Flags              = new FlagManager();
            Bases              = new BaseManager();
            EnvironmentEffects = new EnvironmentEffectManager();
            buffbar            = new BuffBar();
            Scores             = new ScoreBoard(currentGameMode, Players);
            input              = new ChatInput(new Vector2(5, ServiceManager.Game.GraphicsDevice.Viewport.Height), 300);//300 is a magic number...Create a chat width variable.
            input.Visible      = false;
            hud              = HUD.GetHudForPlayer(Players.GetLocalPlayer());
            localPlayer      = Players.GetLocalPlayer();
            Scene.MainEntity = localPlayer;
            sky              = ServiceManager.Resources.GetTexture2D("textures\\misc\\background\\sky");
            tips             = new GameTips(new GameContext(CurrentGameMode, localPlayer));
            helpOverlay      = new HelpOverlay();
        }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (message.Count > 0)
     {
         GameTips gameTips = message.Dequeue();
         PopupTips(gameTips);
     }
 }
Ejemplo n.º 3
0
 public FinishView(ITranslations translations, GameSession session)
 {
     Translations     = translations;
     this.session     = session;
     tips             = new List <string> ();
     cached_sessionid = -1;
     game_tips        = new GameTips(translations);
 }
Ejemplo n.º 4
0
 public static void LoadGameTipsEditorFiles()
 {
     try
     {
         DbcStores.InitFiles();
         GameTips.LoadData();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 5
0
    public void Handle(int cmd, byte[] data)
    {
        switch (cmd)
        {
        case MessageConst.Tips.TIPS_RESP_RESULT:
            GameTips gameTips = ProtobufTool.DeSerialize <GameTips>(data);
            message.Enqueue(gameTips);
            break;

        default:
            break;
        }
    }
Ejemplo n.º 6
0
 //Called after creating new level
 public void ChangeLevel()
 {
     //if is new level then create else relocate
     if (CurrentDungeonLevel >= LastOpenedLevel)
     {
         CreateLevel(); //Creating new level
     }
     else
     {
         RelocateToNext(); //Relocation to next opened level
     }
     GameSession.instance.transition.Create(CurrentDungeonLevel, GameTips.GetTip());
 }
Ejemplo n.º 7
0
    public void PopupTips(GameTips gameTips)
    {
        GameResultEnum code = (GameResultEnum)gameTips.resultCode;
        string         tips = GameTipsDic.GetTips(code);

        tips = tips ?? gameTips.resultDes;
        if (gameTips.tipsType == 1)  //定时关闭窗口
        {
            PopupManager.ShowTimerPopUp(tips);
        }
        else if (gameTips.tipsType == 2)    //手动关闭
        {
            PopupManager.ShowClosePopUp(tips);
        }
    }
Ejemplo n.º 8
0
 public void LoadClosestSavedCheckPoint()
 {
     GameMap.GM.GenerateGameField(GameLevelType.CheckPoint);
     GameSession.instance.transition.Create(CurrentDungeonLevel, GameTips.GetTip());
 }