void InitTableWidget()
 {
     table                = new TableWidget(game);
     table.font           = font;
     table.ElementsPerRow = game.PureClassic ? 9 : 10;
     table.Init();
 }
        public override void Init()
        {
            table                = new TableWidget(game);
            table.font           = font;
            table.ElementsPerRow = game.PureClassic ? 9 : 10;
            table.Init();

            // Can't immediately move to selected here, because cursor visibility
            // might be toggled after Init() is called. This causes the cursor to
            // be moved back to the middle of the window.
            deferredSelect = true;

            game.Events.BlockPermissionsChanged += OnBlockChanged;
            game.Events.BlockDefinitionChanged  += OnBlockChanged;
            Keyboard.KeyRepeat              = true;
            game.Graphics.ContextLost      += ContextLost;
            game.Graphics.ContextRecreated += ContextRecreated;
        }
Esempio n. 3
0
        public override void Init()
        {
            table                = new TableWidget(game);
            table.font           = font;
            table.ElementsPerRow = game.PureClassic ? 9 : 10;
            table.Init();

            // User is holding invalid block
            if (table.SelectedIndex == -1)
            {
                table.MakeDescTex(game.Inventory.Selected);
            }

            game.Events.BlockPermissionsChanged += OnBlockChanged;
            game.Events.BlockDefinitionChanged  += OnBlockChanged;
            game.Keyboard.KeyRepeat              = true;
            game.Graphics.ContextLost           += ContextLost;
            game.Graphics.ContextRecreated      += ContextRecreated;
        }