internal void Show() { // Main Window if( MainWindow == null ) { MainWindow = new Frame(); Vector2 MainWindow_Pos, MainWindow_Size; MainWindow_Size.X = Display.SclX( 200.0f ); MainWindow_Size.Y = Display.SclY( 15.0f ); MainWindow_Pos.X = ( (float)2.0f / 2.0f - MainWindow_Size.X / 2.0f ); MainWindow_Pos.Y = ( (float)2.0f * 0.98f - ( MainWindow_Size.Y ) ); MainWindow.SetPosition( MainWindow_Pos.X, MainWindow_Pos.Y ); MainWindow.SetSize( MainWindow_Size.X, MainWindow_Size.Y ); MainWindow.SetTexture( TextureID.Button ); // Inventory main title //Bar.SetTileSet( GameEnv.GuiTileset ); Bar.SetPosition( Display.SclX( 5.0f ), Display.SclY( 5.0f ) ); Bar.SetSize( MainWindow_Size.X - Display.SclX( 10.0f ), MainWindow_Size.Y- Display.SclY( 10.0f ) ); Bar.SetCompletion( 50.0f ); } GameEnv.GuiManager.AddFrame( MainWindow ); MainWindow.AddFrame( Bar ); Flag_Shown = true; }
public ScreenSlotSelect( VoxelGameEnvironment.Pages page_id ) : base( page_id ) { LogoBlackvoxel = new Frame(); Frame_MainTitle = new FontFrame(); for( int i = 0; i < 16; i++ ) { Slot[i] = new Frame(); SlotTitle[i] = new FontFrame(); SlotStatus[i] = new FontFrame(); } }
//#define SclX(a) (GameEnv.ScreenResolution.X * ((a)/1920.0)) //#define SclY(a) (GameEnv.ScreenResolution.Y * ((a)/1080.0)) internal GraphicUserManager() { TextureManager = null; FirstFrame = new Frame(); FirstFrame.GuiManager = this; FirstFrame.ParentFrame = null; FirstFrame.Show_Frame( false ); // Init MouseOver stack imbrication tables Actual_PointedStack = new Frame[1024]; Previous_PointedStack = new Frame[1024]; Actual_FocusStack = new Frame[1024]; Previous_FocusStack = new Frame[1024]; Actual_StackSize = 0; Previous_StackSize = 0; Actual_FocusStackSize = 0; Previous_FocusStackSize = 0; DragingFrame = null; }
internal void DropItem( Display render, Frame Item, ushort nButton ) { if( Item.FrameType == VoxelUtils.MulticharConst( 'I', 'B', 'O', 'X' ) ) { InventoryBox IbItem; ushort In_VoxelType, Temp_VoxelType; int In_Quantity, Temp_Quantity; IbItem = (InventoryBox)Item; Inventory.Entry entry = IbItem.GetEntry(); In_VoxelType = entry.VoxelType; In_Quantity = entry.Quantity; if( In_VoxelType != activeEntry.VoxelType && entry.Quantity > 0 ) { if( nButton == 1 ) { Temp_VoxelType = In_VoxelType; Temp_Quantity = In_Quantity; entry.VoxelType = activeEntry.VoxelType; entry.Quantity = activeEntry.Quantity; activeEntry.VoxelType = Temp_VoxelType; activeEntry.Quantity = Temp_Quantity; } } else if( In_VoxelType == activeEntry.VoxelType || activeEntry.Quantity == 0 ) { if( nButton == 1 ) { activeEntry.Quantity += In_Quantity; activeEntry.VoxelType = In_VoxelType; entry.Quantity = 0; entry.VoxelType = 0; } if( nButton == 3 ) { int TransfertQuantity = 1; if( render.keyboard[ Key.ShiftLeft] || render.keyboard[Key.ShiftRight] ) TransfertQuantity = 10; if( render.keyboard[Key.ControlLeft] || render.keyboard[Key.ControlRight] ) TransfertQuantity = 100; if( render.keyboard[Key.AltLeft] || render.keyboard[Key.AltRight] ) TransfertQuantity = 1000; if( TransfertQuantity > In_Quantity ) TransfertQuantity = In_Quantity; if( In_Quantity > 0 ) { ( activeEntry.Quantity ) += TransfertQuantity; entry.Quantity = In_Quantity - TransfertQuantity; activeEntry.VoxelType = In_VoxelType; } } } } // printf("Dropped : %lx in %lx\n",(ULong)Item, (ULong)this); }
internal virtual void DropItem( Frame Item, MouseButton nButton ) { }
internal virtual void RemoveFrame( Frame Frame ) { lock ( SubFrameList ) { SubFrameList.Remove( Frame ); } Frame.RemoveAllFrames(); }
internal virtual void AddFrame( Frame Frame ) { lock ( SubFrameList ) { SubFrameList.AddFirst( Frame ); } Frame.GuiManager = GuiManager; Frame.ParentFrame = this; Frame.AddedToFrameCallback( this ); }
internal virtual void AddedToFrameCallback( Frame Frame ) { }
public bool MouseButtonRelease( MouseButton nButton, float Absolute_x, float Absolute_y ) { FirstFrame.MouseButtonRelease( nButton, Absolute_x, Absolute_y ); if( nButton == MouseButton.Button1 ) { if( DragingFrame != null ) { DragingFrame.Flag_Draging = false; DragingFrame = null; } } return true; }
internal void RemoveFrame( Frame Frame ) { FirstFrame.RemoveFrame( Frame ); }
internal void AddFrame( Frame Frame ) { FirstFrame.AddFrame( Frame ); }
internal void FocusStack_AddToStack( Frame Frame ) { if( Actual_FocusStackSize >= 1024 ) return; Actual_FocusStack[Actual_FocusStackSize++] = Frame; }
internal void MouseOverStack_AddToStack( Frame Frame ) { if( Actual_StackSize >= 1024 ) return; Actual_PointedStack[Actual_StackSize++] = Frame; }