private UIDrawing() { Tiles = new ItemsHolder(new RectangleF(80 * 7 + 64, 640 + 121, 1024 + 128 - 16, 128 + 64), 14, 40); _transaprencyForeground = new Graber(new Vector2(512 - 96, 128 + 128), 255, null, TransparencyForeground, GrabShow.percentage, "Foreground transparency"); _transaprencyBackground = new Graber(new Vector2(512 - 96, 128 + 64), 255, null, TransparencyBackground, GrabShow.percentage, "Background transparency"); _transaprencyPhysics = new Graber(new Vector2(512 - 96, 128 + 64 + 128), 255, null, null, GrabShow.percentage, "Physics transparency"); _radio1 = new Radio(null, new Vector2(1024 - 64 - 96, 128 + 64), RadioType.classic); _radio2 = new Radio(null, new Vector2(1024 - 64 - 96, 256), RadioType.classic); _radio3 = new Radio(null, new Vector2(1024 - 64 - 96, 256 + 64), RadioType.classic); _radios = new GroupRadios(0, _radio1, _radio2, _radio3); ForegroundVisibility = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 128), CheckBoxType.visibility, true, null, null); BackgroundVisibility = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 64), CheckBoxType.visibility, false, null, null); PhysicsVisibility = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 64 + 128), CheckBoxType.visibility, false, null, null); TilesPhysics = new ItemsHolder(new RectangleF(80 * 7 + 64, 640 + 121, 1024 + 128 - 16, 128 + 64), 14, 40); for (int x = 0; x < Game1.Tiles.Count; x++) { int y = (int)Math.Floor(x / 14f); Tiles.Items.Add(new ListItemTile(Tiles.Items.Count, Tiles.Boundary, Game1.Tiles[x])); } for (int x = 0; x < Game1.TilesPhysics.Count; x++) { int y = (int)Math.Floor(x / 14f); TilesPhysics.Items.Add(new ListItemTile(TilesPhysics.Items.Count, Tiles.Boundary, Game1.TilesPhysics[x])); } Tiles.Update(); TilesPhysics.Update(); }
private UIAssembly() { _items = new List <GridItem>(); Inventory = new ItemsHolder(new RectangleF(new Vector2(224 * 3 + 64, 48 * 4 * 4), new Vector2(1024, 128)), 3, 224, ChangedSelection, ItemHolderTypes.purple); GridCraft = new Grid(new Point(6), new Vector2(1024 / 2 - (6 * 48) / 2)); XposText = new Vector2(1024 / 2 - (6 * 48) / 2).X; XposTextBase = XposText + 128 + 64; XposTextBonus = XposText + 256 + 64; YposText = 800; }
private UIShop() { Invetory = new ItemsHolder(new RectangleF(new Vector2(224 * 3 + 64, 48 * 4 * 4), new Vector2(160, 128)), 3, 224, ChangedSelection, ItemHolderTypes.blue); _holder = new ItemsHolder(new RectangleF(new Vector2(224 * 3 + 64, 48 * 4 * 4), new Vector2(1024, 128)), 3, 224 + 96, ChangedSelection, ItemHolderTypes.blue); _holder.Items.Add(new ListItemPart(_holder.Items.Count, _holder.Boundary, Module.tier2, 2000, 2000)); _holder.Items.Add(new ListItemPart(_holder.Items.Count, _holder.Boundary, Module.tier3, 2000, 2000)); _holder.Items.Add(new ListItemPart(_holder.Items.Count, _holder.Boundary, Module.test, 100, 20)); _buy = new Button(new Vector2(1024, 128 + 48 * 4 * 4 + 16), "Buy", Buy, null, null, ButtonType.small, true); _holder.Update(); Invetory.Update(); _buy.Update(); }
private UILoadMenu() : base() { _saves = new ItemsHolder(new RectangleF(512 + 256 + 32, 512 + 256 + 192, 512 + 64, 64), 1, 256 + 32, LoadLocked); _btnBack = new Button(new Vector2(Globals.ButtonXPos, Globals.BackButtonPosY), "BACK", null, Globals.ChangeWindowTo, "Main", type: ButtonType.back); _btnLoad = new Button(new Vector2(Globals.ButtonXPos + 1024 + 256, 64), "LOAD", null, Globals.ChangeWindowTo, "Main", ButtonType.small); List <string> paths = CustomSearcher.GetDirectories(Directory.GetCurrentDirectory() + "/Save", "*"); if (paths.Count > 0) { for (int i = 0; i < paths.Count; i++) { string[] directories = paths[i].Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); _saves.Items.Add(new ListItemLoad(i, _saves.Boundary, directories[directories.Length - 2] + "/" + directories[directories.Length - 1] + "/" + directories[directories.Length - 1] + ".png", directories[directories.Length - 1])); } } }
public void SwitchSelectedItem(ItemsHolder holder) { IHolderItem thing = null; if (holder.Items.Any(s => (s as ListItemPartInventory).Type == MouseItem.Item.Type) == true) { thing = holder.Items.Single(s => (s as ListItemPartInventory).Type == MouseItem.Item.Type); } if (thing != null) { (thing as ListItemPartInventory).Amount++; } else { holder.Items.Add(new ListItemPartInventory(holder.Items.Count, holder.Boundary, MouseItem.Item.Type, 1)); } }
private UIEntities() { Items = new List <DropDown>(); Items.Add(new DropDown(typeof(mechFacingCabin), 128 + 64, new Vector2(256))); Items.Add(new DropDown(typeof(mechFacingCabin), 128 + 64, new Vector2(256, 256 + 64))); propertiesHold = new PropertyHolder(); Entities = new ItemsHolder(new RectangleF((256 + 16) * 3 + 64, 640 + 121, 1024 - 128 - 16, 128 + 64), 3, 256 + 16, ChangeSelection); PropertyHolder properties = new PropertyHolder(); properties.AddPropertyText("asfdfssf", "dsfasf"); properties.AddPropertyText("asfdfssf", "dsfasf"); properties.AddPropertyText("asfdfssf", "dsfasf"); properties.AddPropertyText("asfdfssf", "dsfasf"); properties.AddPropertyText("asfdfssf", "dsfasf"); properties.AddPropertyText("asfdfssf", "dsfasf"); PropertyHolder properties2 = new PropertyHolder(); properties2.AddPropertyText("43212", "123213231"); properties2.AddPropertyText("123231", "45645556"); for (int x = 0; x < Game1.EditorEntitiesTargets.Count; x++) { int y = (int)Math.Floor((float)x / Entities.LineHolds); if (x < 3) { Entities.Items.Add(new ListItemEntity(Entities.Items.Count, Entities.Boundary, Game1.EditorEntitiesTargets[x], 3, properties)); } else { Entities.Items.Add(new ListItemEntity(Entities.Items.Count, Entities.Boundary, Game1.EditorEntitiesTargets[x], 3, properties2)); } } }
private UISave() { _foldersFiles = new ItemsHolder(new RectangleF(512, 512 + 128 - 7, (Globals.WinRenderSize.X - (2 * 512 + 96)) / 2, 128 + 64), 1, 28); _roots = new ItemsHolder(new RectangleF(512, 256 + 121, (Globals.WinRenderSize.X - (2 * 512 + 96)) / 2 + 512 + 64, 128 + 64), 1, 28); _path = ""; _directories = new List <string>(); _files = new List <string>(); _allDrives = new List <DriveInfo>(); _block = new TextBlock(new RectangleF(512, 256 - 32, (Globals.WinRenderSize.X - (2 * 512 + 96)) / 2 + 512 + 64, 512 + 96 - 7), _path); _allDrives.AddRange(DriveInfo.GetDrives()); _save = new Button(new Vector2((Globals.WinRenderSize.X - (2 * 512 + 96)) / 2, 512 + 128 + 256 + 32 - 7), "Save", Save, null, null, ButtonType.small, true); _open = new Button(new Vector2((Globals.WinRenderSize.X - (2 * 512 + 96)) / 2 + 128 + 32, 512 + 128 + 256 + 32 - 7), "Open", null, null, null, ButtonType.small); _box = new TextBox("", 512, new Vector2((Globals.WinRenderSize.X - (2 * 512 + 96)) / 2, 512 + 128 + 256 - 32 - 7), textBoxType.fileName, FileNameChange); foreach (DriveInfo drive in _allDrives.Reverse <DriveInfo>()) { if (drive.IsReady == false) { _allDrives.Remove(drive); } } foreach (DriveInfo drive in _allDrives.Reverse <DriveInfo>()) { _roots.Items.Add(new ListItemFileFolder(_allDrives.IndexOf(drive), _roots.Boundary, drive.Name, true, FileFolder.drive)); } string appPath = AppDomain.CurrentDomain.BaseDirectory; string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); _roots.Items.Add(new ListItemFileFolder(_roots.Items.Count, _roots.Boundary, Directory.GetParent(appPath).FullName, false, FileFolder.folder)); _roots.Items.Add(new ListItemFileFolder(_roots.Items.Count, _roots.Boundary, Path.GetFullPath(documentsPath), false, FileFolder.folder)); _roots.Items.Add(new ListItemFileFolder(_roots.Items.Count, _roots.Boundary, Path.GetFullPath(desktopPath), false, FileFolder.folder)); Search(Path.GetPathRoot(Environment.SystemDirectory)); }