public static void AddBackground(Cell c, Color color, BackgroundType type) { Aspose.Cells.Style style = c.GetStyle(); style.Pattern = type; style.ForegroundColor = color; c.SetStyle(style); }
public void Create_screen(int screen_to_load) // creates screen from number in parameter { End_Of_Level_Cooldown = 0; End_Of_Level = false; Reset_screen(); // resets screen data screen = screen_to_load; Current_screen = screenFactory.Create_screen(screen); // gets new data for next screen //adds data next screen to guimanager Background = Current_screen.Background; this.Fallable_Objects = Current_screen.Fallable_Objects; this.Stable_Objects = Current_screen.Stable_Objects; this.Gui_stuff = Current_screen.gui_stuff; this.Interacting_Objects = Current_screen.Interacting_Objects; //Plays the corresponding sounds if (Current_screen.islevel == true) { sound_handler.PlayBackground(ChooseBackGroundMusic.game_cry); Controls_Cooldown = 0.8f; } else { sound_handler.PlayBackground(ChooseBackGroundMusic.menu); } }
void DrawClearFlags() { // Converts between ClearFlags and Background Type. BackgroundType backgroundType = GetBackgroundType((CameraClearFlags)settings.clearFlags.intValue); EditorGUI.BeginChangeCheck(); BackgroundType selectedType = (BackgroundType)EditorGUILayout.IntPopup(Styles.backgroundType, (int)backgroundType, Styles.cameraBackgroundType, Styles.cameraBackgroundValues); if (EditorGUI.EndChangeCheck()) { CameraClearFlags selectedClearFlags; switch (selectedType) { case BackgroundType.Skybox: selectedClearFlags = CameraClearFlags.Skybox; break; case BackgroundType.DontCare: selectedClearFlags = CameraClearFlags.Nothing; break; default: selectedClearFlags = CameraClearFlags.SolidColor; break; } settings.clearFlags.intValue = (int)selectedClearFlags; } }
protected GameObject SetBackground(BackgroundType type) { GameObject go = mBackgroundImagesManager.SetBackground(gameObject, type); AddBackgroundImages(go); return(go); }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; SCGArgsList = (ArrayList)ArgsList[24]; SCGSetList = (ArrayList)ArgsList[25]; PersonalConfigList = (ArrayList)ArgsList[28]; cpg = (int)PageInfoList[18]; pg = (int)PageInfoList[19]; ConfigRead = (bool)SCGArgsList[0]; timerTypeSwitch = (TimerType)SCGArgsList[1]; debugSwitch = (bool)SCGArgsList[2]; staffTriggerEventSwitch = (bool)SCGArgsList[3]; TimerConfigClicked = (bool)SCGSetList[0]; MiscConfigClicked = (bool)SCGSetList[1]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; ActiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[2]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; ActiveTextEntryTextColor = (int)PersonalConfigList[9]; }
public void SetBackground(string background) { BackgroundType backgroundType = BackgroundType.brownMetal; switch (background) { case "brownMetal": backgroundType = BackgroundType.brownMetal; break; case "concrete": backgroundType = BackgroundType.concrete; break; case "plateMetal": backgroundType = BackgroundType.plateMetal; break; case "stones": backgroundType = BackgroundType.stones; break; case "wood": backgroundType = BackgroundType.wood; break; } backgroundPlane.renderer.material = backgrounds[(int)backgroundType].background; }
/// <summary> /// Creates a new background as per of the collection, initializes from the given xnaMugen.IO.TextSection. /// </summary> /// <param name="section">The text section used to create and initialize the created background.</param> /// <returns>The created background, if it could be created; null otherwise.</returns> public void CreateBackground(TextSection section) { if (section == null) { throw new ArgumentNullException("section"); } BackgroundType bgtype = section.GetAttribute <BackgroundType>("type"); Base background = null; switch (bgtype) { case BackgroundType.Static: background = new Static(section, m_spritemanager.Clone()); break; case BackgroundType.Parallax: background = new Parallax(section, m_spritemanager.Clone()); break; case BackgroundType.Animated: background = new Animated(section, m_spritemanager.Clone(), m_animationmanager.Clone()); break; case BackgroundType.None: default: Log.Write(LogLevel.Error, LogSystem.BackgroundCollection, "Cannot create background with TextSection: {0}", section); return; } background.Reset(); m_backgrounds.Add(background); }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; PersonalConfigList = (ArrayList)ArgsList[28]; EAGArgsList = (ArrayList)ArgsList[29]; cpg = (int)PageInfoList[28]; pg = (int)PageInfoList[29]; index = (int)EAGArgsList[0]; AddAccount = (bool)EAGArgsList[1]; accessSwitch = (Access)EAGArgsList[2]; accountsMgmtSwitch = (bool)EAGArgsList[3]; systemConfigSwitch = (bool)EAGArgsList[4]; accountName = (string)EAGArgsList[5]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; ActiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[2]; InactiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[3]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; ActiveTextEntryTextColor = (int)PersonalConfigList[9]; InactiveTextEntryTextColor = (int)PersonalConfigList[10]; FlagTextColor = (TextColor)PersonalConfigList[14]; }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; PersonalConfigList = (ArrayList)ArgsList[28]; cpg = (int)PageInfoList[36]; pg = (int)PageInfoList[37]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; ActiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[2]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; ActiveTextEntryTextColor = (int)PersonalConfigList[9]; sortSearchFor = (string)PersonalConfigList[15]; sortSearchType = (SortSearchType)PersonalConfigList[16]; sortOrder = (SortOrder)PersonalConfigList[17]; sortType = (SortSearchType)PersonalConfigList[18]; sortSearchCaseSensitive = (bool)PersonalConfigList[19]; sortSearchFlagged = (bool)PersonalConfigList[20]; sortSearchBadLocation = (bool)PersonalConfigList[21]; sortSearchDupeSpawners = (bool)PersonalConfigList[22]; }
private GameObject ConstructIcon(GameObject target, BackgroundType bgType, int rewardAmount) { GameObject gameObject = new GameObject(); gameObject = UnityEngine.Object.Instantiate <GameObject>(this.bgDictionary[bgType]); target.transform.parent = gameObject.transform; target.transform.localPosition = Vector3.back * 0.1f; target.transform.localRotation = Quaternion.identity; target.transform.localScale = Vector3.one; if (bgType == LootWheelRewardingRoutine.BackgroundType.Regular) { Transform transform = gameObject.transform.Find("Label"); Transform transform2 = gameObject.transform.Find("Text"); if (rewardAmount > 1) { TextMesh[] componentsInChildren = transform2.gameObject.GetComponentsInChildren <TextMesh>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].text = rewardAmount.ToString(); } } else { transform.gameObject.SetActive(false); transform2.gameObject.SetActive(false); } } return(gameObject); }
private void BeginWork(BackgroundType type, object argument) { activeSearcher = null; fullDetail = null; switch (type) { case BackgroundType.Search: if (argument is Searcher searcher) { mainStatusLabel.Text = $"Searching for {searcher.Type}..."; mainProgressBar.Visible = true; mainProgressBar.Value = 0; activeSearcher = searcher; } break; case BackgroundType.Detail: mainStatusLabel.Text = $"Getting full detail..."; break; default: return; } EnableUI(false); progressTimer.Start(); backgroundType = type; mainBackgroundWorker.RunWorkerAsync(argument); }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; HideSpawnerList = (ArrayList)ArgsList[6]; FileName = (string)ArgsList[7]; PageInfoList = (ArrayList)ArgsList[12]; MSGCheckBoxesList = (ArrayList)ArgsList[13]; FMCheckBoxesList = (ArrayList)ArgsList[15]; PersonalConfigList = (ArrayList)ArgsList[28]; cpg = (int)PageInfoList[6]; pg = (int)PageInfoList[7]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; SettingsCheckBoxesList = (ArrayList)ArgsList[17]; megaSpawner = (MegaSpawner)ArgsList[19]; AVSArgsList = (ArrayList)ArgsList[22]; AVSSetList = (ArrayList)ArgsList[23]; PersonalConfigList = (ArrayList)ArgsList[28]; cpg = (int)PageInfoList[12]; pg = (int)PageInfoList[13]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; FlagTextColor = (TextColor)PersonalConfigList[14]; }
public string CreateRelativeBackgroundPath(string imageName, BackgroundType backgroundType, BackgroundSizeType size) { BackgroundSizeFolders backgroundSizeFolders; switch (backgroundType) { case BackgroundType.Standard: backgroundSizeFolders = _folderConfiguration.Backgrounds.Standards; break; case BackgroundType.Custom: default: backgroundSizeFolders = _folderConfiguration.Backgrounds.Customs; break; } var name = Path.GetFileNameWithoutExtension(imageName); var ext = Path.GetExtension(imageName); var relativeFolder = ""; switch (size) { case BackgroundSizeType.Original: relativeFolder = backgroundSizeFolders.Originals.GetFullHashPath(); break; case BackgroundSizeType.Mobile: relativeFolder = backgroundSizeFolders.Mobiles.GetFullHashPath(); break; } return(Path.Combine(relativeFolder, name + $"_{size.ToString().ToLower()}" + ext)); }
public void LoadBackgrounds(WzImage mapImage, Board mapBoard) { WzSubProperty bgParent = (WzSubProperty)mapImage["back"]; WzSubProperty bgProp; int i = 0; while ((bgProp = (WzSubProperty)bgParent[(i++).ToString()]) != null) { int x = InfoTool.GetInt(bgProp["x"]); int y = InfoTool.GetInt(bgProp["y"]); int rx = InfoTool.GetInt(bgProp["rx"]); int ry = InfoTool.GetInt(bgProp["ry"]); int cx = InfoTool.GetInt(bgProp["cx"]); int cy = InfoTool.GetInt(bgProp["cy"]); int a = InfoTool.GetInt(bgProp["a"]); BackgroundType type = (BackgroundType)InfoTool.GetInt(bgProp["type"]); bool front = InfoTool.GetBool(bgProp["front"]); bool? flip_t = InfoTool.GetOptionalBool(bgProp["f"]); bool flip = flip_t.HasValue ? flip_t.Value : false; string bS = InfoTool.GetString(bgProp["bS"]); bool ani = InfoTool.GetBool(bgProp["ani"]); string no = InfoTool.GetInt(bgProp["no"]).ToString(); BackgroundInfo bgInfo = BackgroundInfo.Get(bS, ani, no); if (bgInfo == null) { continue; } IList list = front ? mapBoard.BoardItems.FrontBackgrounds : mapBoard.BoardItems.BackBackgrounds; list.Add((BackgroundInstance)bgInfo.CreateInstance(mapBoard, x, y, i, rx, ry, cx, cy, type, a, front, flip)); } }
private static void FormatLine(TMListResponse tm, int rowCount, ref Worksheet ws) { Color color = Color.White; BackgroundType type = BackgroundType.Solid; if (tm.NumEntries == 0) { color = Color.LightGray; type = BackgroundType.DiagonalStripe; } if (tm.FriendlyName.ToLower().Contains("master")) { color = Color.LightPink; } int colCount = 0; while (ws.Cells[0, colCount].Value != null) { Cell c = ws.Cells[rowCount, colCount]; Helper.AddBackground(c, color, type); colCount++; } }
public async Task ChangeBackgroundByDefaultValueAsync(BackgroundType type) { var list = new List <ICBBackground>(); switch (type) { case BackgroundType.BING_IMAGE: list.Add(await GetBingImageAsync()); break; case BackgroundType.PICTURE: list.Add(new CBPictureBackground(Common.DEFAULT_PHOTO)); break; case BackgroundType.SOLID_COLOR: list.Add(new CBSolidColorBackground("#555555")); break; case BackgroundType.SLIDE_SHOW: list.Add(new CBPictureBackground(Common.DEFAULT_PHOTO)); break; case BackgroundType.YOUTUBE: list.Add(new CBYoutubeBackground("")); break; } ChangeBackground(type, list); }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; AVSArgsList = (ArrayList)ArgsList[22]; PersonalConfigList = (ArrayList)ArgsList[28]; AITCCheckBoxesList = (ArrayList)ArgsList[31]; SEGArgsList = (ArrayList)ArgsList[32]; cpg = (int)PageInfoList[30]; pg = (int)PageInfoList[31]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; ActiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[2]; InactiveTEBGTypeConfig = (BackgroundType)PersonalConfigList[3]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; ActiveTextEntryTextColor = (int)PersonalConfigList[9]; InactiveTextEntryTextColor = (int)PersonalConfigList[10]; addItem = (string)AVSArgsList[23]; InsideItemList = (ArrayList)AVSArgsList[27]; }
public static int CalculatePCEffectiveLevel(NWPlayer player, int skillRank, SkillType skill) { int effectiveLevel = skillRank; BackgroundType background = (BackgroundType)player.Class1; switch (skill) { case SkillType.Armorsmith: if (background == BackgroundType.Armorsmith) effectiveLevel++; break; case SkillType.Cooking: if (background == BackgroundType.Chef) effectiveLevel++; break; case SkillType.Weaponsmith: if (background == BackgroundType.Weaponsmith) effectiveLevel++; break; case SkillType.Engineering: if (background == BackgroundType.Engineer) effectiveLevel++; break; case SkillType.Fabrication: if (background == BackgroundType.Fabricator) effectiveLevel++; break; } return effectiveLevel; }
/// <summary> /// /// </summary> /// <param name="cx"></param> /// <param name="cy"></param> /// <param name="rx"></param> /// <param name="ry"></param> /// <param name="type"></param> /// <param name="a"></param> /// <param name="front"></param> /// <param name="frame0"></param> /// <param name="screenMode">The screen resolution to display this background object. (0 = all res)</param> public BackgroundItem(int cx, int cy, int rx, int ry, BackgroundType type, int a, bool front, IDXObject frame0, bool flip, int screenMode) : base(frame0, flip) { int CurTickCount = Environment.TickCount; this.LastShiftIncreaseX = CurTickCount; this.LastShiftIncreaseY = CurTickCount; this.rx = rx; this.cx = cx; this.ry = ry; this.cy = cy; this.type = type; this.a = a; this.front = front; this.screenMode = screenMode; color = new Color(0xFF, 0xFF, 0xFF, a); if (frame0.Height <= 1 && frame0.Width <= 1) { this.disabledBackground = true; // removed from Map.wz/bg, but entry still presist in maps } else { this.disabledBackground = false; } CheckBGData(); }
private void GetArgsList() { Help = (bool)ArgsList[0]; DisplayMessages = (bool)ArgsList[1]; MessagesTitle = (string)ArgsList[2]; OldMessagesTitle = (string)ArgsList[3]; Messages = (string)ArgsList[4]; OldMessages = (string)ArgsList[5]; PageInfoList = (ArrayList)ArgsList[12]; ESGArgsList = (ArrayList)ArgsList[21]; AVSArgsList = (ArrayList)ArgsList[22]; PersonalConfigList = (ArrayList)ArgsList[28]; FromWhere = (FromGump)ArgsList[30]; SEGArgsList = (ArrayList)ArgsList[32]; cpg = (int)PageInfoList[22]; pg = (int)PageInfoList[23]; entryType = (string)ESGArgsList[6]; addItem = (string)AVSArgsList[23]; InsideItemList = (ArrayList)AVSArgsList[27]; insideIndex = (int)AVSArgsList[28]; StyleTypeConfig = (StyleType)PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType)PersonalConfigList[1]; DefaultTextColor = (TextColor)PersonalConfigList[4]; TitleTextColor = (TextColor)PersonalConfigList[5]; MessagesTextColor = (TextColor)PersonalConfigList[6]; CommandButtonsTextColor = (TextColor)PersonalConfigList[7]; PageNumberTextColor = (int)PersonalConfigList[8]; searchType = (SearchType)SEGArgsList[0]; SearchFor = (string)SEGArgsList[1]; }
public void CopyBackgrounds(string sourceFolder, BackgroundType backgroundType, BackgroundSizeType copyToNewSize) { _logger.LogInformation($"{nameof(MediaService)}.{nameof(CopyBackgrounds)}.Start"); if (string.IsNullOrEmpty(sourceFolder)) { throw new Exception("SourceUrl is null or empty"); } var fullSourcePath = Path.Combine(_fileManager.GetAbsoluteMediaRootPath(), sourceFolder); var fullNewPath = Path.Combine(_fileManager.GetAbsoluteMediaRootPath(), CreateBackgroundPath(backgroundType, copyToNewSize)); Size size; switch (copyToNewSize) { case BackgroundSizeType.Original: size = null; break; case BackgroundSizeType.Mobile: size = new MobileBackgroundSizeFolder(null).Size; break; default: throw new Exception("Such BackgrodunSizeType does not exist."); } var files = Directory.GetFiles(fullSourcePath); foreach (var file in files) { var fileName = Path.GetFileNameWithoutExtension(file); var ext = Path.GetExtension(file); if (fileName.Contains("original")) { fileName = fileName.Replace("original", copyToNewSize.ToString().ToLower()); } else { fileName = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 10) + "_" + copyToNewSize.ToString().ToLower(); } var fullNewFilePath = Path.Combine(fullNewPath, fileName + ext); if (!File.Exists(fullNewFilePath)) { if (size == null) { CopyFile(file, fullNewFilePath); } else { ResizeImage(file, fullNewFilePath, size.Height, size.Width); } } } _logger.LogInformation($"{nameof(MediaService)}.{nameof(CopyBackgrounds)}.End"); }
private void m_BackgroundTypeCombo_SelectedIndexChanged(object sender, System.EventArgs e) { BackgroundType type = (BackgroundType)m_BackgroundTypeCombo.SelectedIndex; nToolbar1.BackgroundType = type; nToolbar2.BackgroundType = type; nToolbar3.BackgroundType = type; }
public StyleState(StyleStateType stateType, BackgroundType backgroundType, string backgroundTextureId, Color backgroundColor, Color textColor) { _stateType = stateType; _backgroundType = backgroundType; _backgroundTextureId = backgroundTextureId; _backgroundColor = backgroundColor; _textColor = textColor; }
public Background GetBackground(BackgroundType type, Transform parent) { var background = Instantiate <Background>(BackgroundPrefab, parent); background.CurrentBackground = type; return(background); }
// Update is called once per frame void Update() { if (CurrentBackground != _CurrentBackground) { _CurrentBackground = CurrentBackground; BackgroundManager.UpdateBackground(this); } }
/// <summary> /// Constructs a persistent HTTP URL for a background /// </summary> public static Task <HttpUrl> GetBackgroundUrlAsync( this Client client, string name = default, BackgroundType type = default) { return(client.ExecuteAsync(new GetBackgroundUrl { Name = name, Type = type })); }
public OsbSprite GetBackgroundSprite(BackgroundType type) { OsbSprite sprite = GetLayer(Layers.HitobjectBackground).CreateSprite(GetBackground(type)); sprite.Scale(0, 854.0f / MainStoryboard.Instance.GetMapsetBitmap(GetBackground(type)).Width); sprite.Fade(0, 0); return(sprite); }
public List <SizedUrl <BackgroundSizeType> > UploadBackground(string url, BackgroundType backgroundType) { return(UploadBackground(url, backgroundType, x => new WebClient { Headers = new WebHeaderCollection { "User-Agent: Other" } }.DownloadFile(new Uri(url), x))); }
/// <summary> /// Changes the background selected by the user; adds background to the list of installed backgrounds /// </summary> public static Task <Background> SetBackgroundAsync( this Client client, InputBackground background = default, BackgroundType type = default, bool forDarkTheme = default) { return(client.ExecuteAsync(new SetBackground { Background = background, Type = type, ForDarkTheme = forDarkTheme })); }
public static ImageSource GetImage(string name, BackgroundType bgType) { try { return ImageCache.Instance.GetImageUsingUri("pack://application:,,,/ILSpy.Debugger.Plugin;component/Images/" + name + ".png", bgType); } catch { // resource not found return null; } }
public Background(BackgroundType type) { _type = type; _textures = new Texture[MAX_LAYERS]; _movementFactors = new Vector2f[MAX_LAYERS]; _shapes = new RectangleShape[MAX_LAYERS]; for (int i = 0; i < MAX_LAYERS; i++) { _shapes[i] = new RectangleShape(); } }
public static void InitializeMenuItem(IList<BreakpointBookmark> bpms, MenuItem menuItem, BackgroundType bgType) { menuItem.IsEnabled = bpms.Count > 0; if (bpms.IsEnabled()) { menuItem.Header = bpms.Count <= 1 ? "_Disable Breakpoint" : "_Disable Breakpoints"; menuItem.Icon = ImageService.LoadImage(ImageService.GetImage("DisableEnableBreakpoint", bgType), 16, 16); } else { menuItem.Header = bpms.Count <= 1 ? "Enab_le Breakpoint" : "Enab_le Breakpoints"; menuItem.Icon = ImageService.LoadImage(ImageService.GetImage("DisableEnableBreakpoint", bgType), 16, 16); } }
public BackgroundInstance(Board board, SerializationForm json) : base(board, json) { flip = json.flip; _a = json.a; _cx = json.cx; _cy = json.cy; _rx = json.rx; _ry = json.ry; _front = json.front; _type = json.type; baseInfo = BackgroundInfo.Get(json.bs, json.ani, json.no); }
private string GetBackgroundTypeString(BackgroundType type) { switch (type) { case BackgroundType.HorizontalGradient: return "Horizontal Gradient"; case BackgroundType.VerticalGradient: return "Vertical Gradient"; case BackgroundType.Image: return "Image"; default: return "Solid Color"; } }
public virtual void ResetToDefaultConfiguration() { horizontalContentAlignment = AlignmentHorizontal.Left; verticalContentAlignment = AlignmentVertical.Top; horizontalContentOffset = 0; verticalContentOffset = 0; depth = 1; constrainToBounds = false; backgroundType = BackgroundType.SolidColor; backgroundColor = Color.white; backgroundImage = null; backgroundImageStyle = "RoundedBackground"; extendedBackgroundWidth = 0; extendedBackgroundHeight = 0; }
public BackgroundInstance(BackgroundInfo baseInfo, Board board, int x, int y, int z, int rx, int ry, int cx, int cy, BackgroundType type, int a, bool front, bool flip) : base(board, x, y, z) { this.baseInfo = baseInfo; this.flip = flip; _rx = rx; _ry = ry; _cx = cx; _cy = cy; _a = a; _type = type; _front = front; if (flip) BaseX -= Width - 2 * Origin.X; }
public Background(Game game, BackgroundType backgroundType) : base(game) { string textureName = ""; switch (backgroundType) { case BackgroundType.Grass: default: textureName = "grass"; break; } var texturePath = "Resources/Battlesystem/background" + textureName; LoadContent(texturePath); }
public ScreenshotTask(IntPtr window, bool clipboard, string file, bool resize, int resizeX, int resizeY, BackgroundType backType, Color backColour, int checkerSize, bool mouse) { WindowHandle = window; ClipboardNotDisk = clipboard; DiskSaveDirectory = file; DoResize = resize; ResizeX = resizeX; ResizeY = resizeY; Background = backType; BackgroundColour = backColour; CheckerboardSize = checkerSize; CaptureMouse = mouse; }
public ColourConfiguration(ColourConfiguration config) { this.cycleColour = config.getCycleColour (); //this.currentColour this.cycle = config.getCycle (); this.pulseCount = config.getPulseCount (); //this.pulseLength this.pulse = config.getPulse (); this.pulseSpeed = config.getPulseSpeed (); //this.pulseSpeedCount this.fadeColour = config.getFadeColour (); this.baseRed = config.getBaseRed (); this.baseGreen = config.getBaseGreen (); this.baseBlue = config.getBaseBlue (); this.backgroundType = config.getBackgroundType (); }
public NewImageDialog (int initialWidth, int initialHeight, BackgroundType initial_bg_type, bool isClipboardSize) : base (string.Empty, PintaCore.Chrome.MainWindow, DialogFlags.Modal, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, Gtk.Stock.Ok, Gtk.ResponseType.Ok) { Title = Catalog.GetString ("New Image"); WindowPosition = Gtk.WindowPosition.CenterOnParent; // We don't show the background color option if it's the same as "White" allow_background_color = PintaCore.Palette.SecondaryColor.ToColorBgra () != ColorBgra.White; BorderWidth = 4; VBox.Spacing = 4; Resizable = false; DefaultResponse = ResponseType.Ok; Icon = PintaCore.Resources.GetIcon (Stock.New, 16); AlternativeButtonOrder = new int[] { (int)ResponseType.Ok, (int)ResponseType.Cancel }; has_clipboard = isClipboardSize; clipboard_size = new Gdk.Size (initialWidth, initialHeight); InitializePresets (); BuildDialog (); if (initial_bg_type == BackgroundType.SecondaryColor && allow_background_color) secondary_bg_radio.Active = true; else if (initial_bg_type == BackgroundType.Transparent) trans_bg_radio.Active = true; else white_bg_radio.Active = true; width_entry.Text = initialWidth.ToString (); height_entry.Text = initialHeight.ToString (); width_entry.GrabFocus (); width_entry.SelectRegion (0, width_entry.Text.Length); WireUpEvents (); UpdateOrientation (); UpdatePresetSelection (); preview.Update (NewImageSize, NewImageBackground); }
public ScreenshotTask(IntPtr window, bool clipboard, string file, bool resize, int resizeX, int resizeY, BackgroundType backType, Color backColor, int checkerSize, bool customGlass, Color aeroColor, bool mouse, bool clearType, bool shadow) { WindowHandle = window; ClipboardNotDisk = clipboard; DiskSaveDirectory = file; DoResize = resize; ResizeX = resizeX; ResizeY = resizeY; Background = backType; BackgroundColor = backColor; CheckerboardSize = checkerSize; CustomGlass = customGlass; AeroColor = aeroColor; CaptureMouse = mouse; DisableClearType = clearType; DisableShadow = shadow; }
public static Color GetColor(BackgroundType bgType) { switch (bgType) { case BackgroundType.Button: return GetColorBackground(dntheme.ColorType.CommonControlsButtonIconBackground); case BackgroundType.TextEditor: return GetColorBackground(dntheme.ColorType.DefaultText); case BackgroundType.DialogWindow: return GetColorBackground(dntheme.ColorType.DialogWindow); case BackgroundType.TextBox: return GetColorBackground(dntheme.ColorType.CommonControlsTextBox); case BackgroundType.TreeNode: return GetColorBackground(dntheme.ColorType.TreeView); case BackgroundType.Search: return GetColorBackground(dntheme.ColorType.ListBoxBackground); case BackgroundType.ComboBox: return GetColorBackground(dntheme.ColorType.CommonControlsComboBoxBackground); case BackgroundType.Toolbar: return GetColorBackground(dntheme.ColorType.ToolBarIconBackground); case BackgroundType.ToolBarButtonChecked: return GetColorBackground(dntheme.ColorType.ToolBarButtonChecked); case BackgroundType.MainMenuMenuItem: return GetColorBackground(dntheme.ColorType.ToolBarIconVerticalBackground); case BackgroundType.ContextMenuItem: return GetColorBackground(dntheme.ColorType.ContextMenuRectangleFill); case BackgroundType.GridViewItem: return GetColorBackground(dntheme.ColorType.GridViewBackground); case BackgroundType.CodeToolTip: return GetColorBackground(dntheme.ColorType.CodeToolTip); case BackgroundType.TitleAreaActive: return GetColorBackground(dntheme.ColorType.EnvironmentMainWindowActiveCaption); case BackgroundType.TitleAreaInactive: return GetColorBackground(dntheme.ColorType.EnvironmentMainWindowInactiveCaption); default: Debug.Fail("Invalid bg type"); return GetColorBackground(dntheme.ColorType.SystemColorsWindow); } }
protected static string GetBackgroundAndType(IDictionary<string, string> attributes, out BackgroundType type) { type = BackgroundType.None; string result = null; foreach (KeyValuePair<string, string> attribute in attributes) { if (type != BackgroundType.None) throw new ArgumentException("Background builder: Only one of the attributes 'StaticScreen', 'RemoveBackground' and 'BackgroundManagerClassName' must be set"); if (attribute.Key == "StaticScreen") { type = BackgroundType.Static; result = attribute.Value; } else if (attribute.Key == "BackgroundManagerClassName") { type = BackgroundType.Manager; result = attribute.Value; } } if (type == BackgroundType.None) throw new ArgumentException("Background builder needs one of the attributes 'StaticScreen', 'RemoveBackground' or 'BackgroundManagerClassName'"); return result; }
internal static ImageInfo GetImageInfo(TypeIcon typeIcon, BackgroundType bgType) { switch (typeIcon) { case TypeIcon.StaticClass: return new ImageInfo("StaticClass", bgType); case TypeIcon.Class: return new ImageInfo("Class", bgType); case TypeIcon.ClassPrivate: return new ImageInfo("ClassPrivate", bgType); case TypeIcon.ClassProtected: return new ImageInfo("ClassProtected", bgType); case TypeIcon.ClassInternal: return new ImageInfo("ClassInternal", bgType); case TypeIcon.ClassProtectedInternal: return new ImageInfo("ClassProtectedInternal", bgType); case TypeIcon.Enum: return new ImageInfo("Enum", bgType); case TypeIcon.EnumPrivate: return new ImageInfo("EnumPrivate", bgType); case TypeIcon.EnumProtected: return new ImageInfo("EnumProtected", bgType); case TypeIcon.EnumInternal: return new ImageInfo("EnumInternal", bgType); case TypeIcon.EnumProtectedInternal: return new ImageInfo("EnumProtectedInternal", bgType); case TypeIcon.Struct: return new ImageInfo("Struct", bgType); case TypeIcon.StructPrivate: return new ImageInfo("StructPrivate", bgType); case TypeIcon.StructProtected: return new ImageInfo("StructProtected", bgType); case TypeIcon.StructInternal: return new ImageInfo("StructInternal", bgType); case TypeIcon.StructProtectedInternal: return new ImageInfo("StructProtectedInternal", bgType); case TypeIcon.Interface: return new ImageInfo("Interface", bgType); case TypeIcon.InterfacePrivate: return new ImageInfo("InterfacePrivate", bgType); case TypeIcon.InterfaceProtected: return new ImageInfo("InterfaceProtected", bgType); case TypeIcon.InterfaceInternal: return new ImageInfo("InterfaceInternal", bgType); case TypeIcon.InterfaceProtectedInternal:return new ImageInfo("InterfaceProtectedInternal", bgType); case TypeIcon.Delegate: return new ImageInfo("Delegate", bgType); case TypeIcon.DelegatePrivate: return new ImageInfo("DelegatePrivate", bgType); case TypeIcon.DelegateProtected: return new ImageInfo("DelegateProtected", bgType); case TypeIcon.DelegateInternal: return new ImageInfo("DelegateInternal", bgType); case TypeIcon.DelegateProtectedInternal:return new ImageInfo("DelegateProtectedInternal", bgType); case TypeIcon.Exception: return new ImageInfo("Exception", bgType); case TypeIcon.ExceptionPrivate: return new ImageInfo("ExceptionPrivate", bgType); case TypeIcon.ExceptionProtected: return new ImageInfo("ExceptionProtected", bgType); case TypeIcon.ExceptionInternal: return new ImageInfo("ExceptionInternal", bgType); case TypeIcon.ExceptionProtectedInternal:return new ImageInfo("ExceptionProtectedInternal", bgType); case TypeIcon.Generic: return new ImageInfo("Generic", bgType); case TypeIcon.GenericPrivate: return new ImageInfo("GenericPrivate", bgType); case TypeIcon.GenericProtected: return new ImageInfo("GenericProtected", bgType); case TypeIcon.GenericInternal: return new ImageInfo("GenericInternal", bgType); case TypeIcon.GenericProtectedInternal: return new ImageInfo("GenericProtectedInternal", bgType); default: Debug.Fail("Unknown type"); goto case TypeIcon.Class; } }
internal static ImageSource GetIcon(TypeIcon typeIcon, BackgroundType bgType) { return ImageCache.Instance.GetImage(GetImageInfo(typeIcon, bgType)); }
internal static ImageInfo GetImageInfo(TypeDef type, BackgroundType bgType) { return GetImageInfo(GetTypeIcon(type), bgType); }
public AdBackground(Dictionary<string, object> data) { topColor = ColorFromHex(data["color"] as string); bottomColor = ColorFromHex(data["color2"] as string); type = TypeFromString(data["type"] as string); }
public static ImageSource GetIcon(TypeDef type, BackgroundType bgType) { return GetIcon(GetTypeIcon(type), bgType); }
public Container Parse(string filename, SxzColor backgroundColor, bool useMostCommonColor, bool parseBackground, BackgroundType backgroundType, double bitsPerPixel, double maximumDistance) { int width = 0; int height = 0; //now we can act on our pixel byte array to get pixels out //and also histogram because it is informative if nothing else LocationPool locationPool = null; Dictionary<SxzColor, int> histogram = new Dictionary<SxzColor, int>(); TransparentRegion transparentRegion = new TransparentRegion(); //Parse all the pixels into the locationpool, histogram and remove the fully transparent pixels into the transparentregion using (System.Drawing.Bitmap bitMap = new System.Drawing.Bitmap(filename)) { width = bitMap.Width; height = bitMap.Height; locationPool = new LocationPool(width, height); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { System.Drawing.Color pixel = bitMap.GetPixel(x, y); Location location = new Location(); location.Color = new SxzColor(pixel.R, pixel.G, pixel.B); location.Point.X = x; location.Point.Y = y; //Don't put transparent colors into the histogram if (pixel.A == 0) { transparentRegion.Add(location); locationPool.SetLocation(location, x, y); locationPool.SetMarked(location); continue; } if (histogram.ContainsKey(location.Color)) { int count = histogram[location.Color]; histogram[location.Color] = count + 1; } else { histogram.Add(location.Color, 1); } locationPool.SetLocation(location, x, y); } } } Console.WriteLine("Total pixel count " + (width * height)); Console.WriteLine("Total transparent pixel count " + transparentRegion.Locations.Count); //Remove all the transparent locations //foreach (Location location in transparentRegion.Locations) //{ // locationPool.SetMarked(location); //} //set the neighbors after removing transparent pixels to save time since those aren't needed anymore locationPool.SetNeighbors(); Console.WriteLine("Done removing transparent pixels"); //Sort the colors by frequency List<KeyValuePair<SxzColor, int>> colorList = histogram.ToList(); colorList.Sort((first, second) => { return first.Value == second.Value ? (int)(SxzColor.GetColorDistance(second.Key, new SxzColor(0, 0, 0)) - SxzColor.GetColorDistance(first.Key, new SxzColor(0, 0, 0))) : second.Value.CompareTo(first.Value); }); //Find the most commonly used color SxzColor mostCommonColor = colorList[0].Key; if (useMostCommonColor) { backgroundColor = mostCommonColor; } //always start with a palette, register empty palette and fill as we go Console.WriteLine("Processing the most common color"); DefaultPaletteChunk defaultPaletteChunk = new DefaultPaletteChunk(); Palette defaultPalette = new Palette(defaultPaletteChunk); //Initialization overhead List<PaletteContainer> paletteContainers = new List<PaletteContainer>(); PaletteContainer initialPaletteContainer = new PaletteContainer(); initialPaletteContainer.Initial = true; initialPaletteContainer.Palette = defaultPalette; paletteContainers.Add(initialPaletteContainer); HashSet<Location> locations = locationPool.GetByColor(backgroundColor); if (parseBackground && locations.Count > 0) { if (backgroundType == BackgroundType.Background) { Console.WriteLine("Creating background chunk"); BackgroundChunk backgroundChunk = new BackgroundChunk(); BackgroundChunkContainer backgroundChunkContainer = new BackgroundChunkContainer(); backgroundChunkContainer.Chunk = backgroundChunk; backgroundChunkContainer.Color = backgroundColor; //pull out all the pixels with the most common color and throw them into a backgroundchunk if (!initialPaletteContainer.Contains(backgroundColor)) { Console.WriteLine("Background chunk in it's own palette"); //not in default palette so create a new palette Palette palette = new Palette(); palette.Add(backgroundColor); PaletteContainer paletteContainer = new PaletteContainer(); paletteContainer.Palette = palette; paletteContainers.Add(paletteContainer); paletteContainer.Add(backgroundChunkContainer); backgroundChunk.Palette = palette.GetPaletteChunk(); } else { backgroundChunk.Palette = defaultPaletteChunk; initialPaletteContainer.Add(backgroundChunkContainer); } //AddChunk(paletteContainers, backgroundContainer, mostCommonColor); backgroundChunkContainer.Locations = locations; } else if (backgroundType == BackgroundType.Rectangle) { MonoRectangleChunk rectangleChunk = new MonoRectangleChunk(); rectangleChunk.Origin = new SxzPoint(0, 0); rectangleChunk.Width = width; rectangleChunk.Height = height; MonoRectangleChunkContainer rectangleContainer = new MonoRectangleChunkContainer(); rectangleContainer.Color = backgroundColor; rectangleContainer.Chunk = rectangleChunk; if (!initialPaletteContainer.Contains(backgroundColor)) { Console.WriteLine("Background chunk in it's own palette"); //not in default palette so create a new palette Palette palette = new Palette(); palette.Add(backgroundColor); PaletteContainer paletteContainer = new PaletteContainer(); paletteContainer.Palette = palette; paletteContainers.Add(paletteContainer); paletteContainer.Add(rectangleContainer); rectangleChunk.Palette = palette.GetPaletteChunk(); } else { rectangleChunk.Palette = defaultPaletteChunk; initialPaletteContainer.Add(rectangleContainer); } //AddChunk(paletteContainers, backgroundContainer, mostCommonColor); rectangleContainer.Locations = locations; } //Remove the pixels with the background color from the location pool foreach (Location location in locations) { locationPool.SetMarked(location); } } Console.WriteLine("Done processing the most common color"); Console.WriteLine("Parsing monocolor regions"); //Pull out all regions with the same color in mono regions that were not pulled by the most common color if any HashSet<Region> monoRegions = Process(locationPool, maximumDistance, RegionType.MonoRegion); Console.WriteLine("Have mono region count " + monoRegions.Count); foreach (Region region in monoRegions) { HashSet<ChunkContainer> potentialContainers = region.GetChunks(locationPool); PaletteContainer paletteContainer = GetPaletteContainer(paletteContainers, region.GetColors()); foreach (ChunkContainer chunkContainer in potentialContainers) { //filter out chunks that are not storage sufficient, putting the unused locations //back into the location pool //... if (!chunkContainer.IsValid(bitsPerPixel)) { PrintTossedChunk(chunkContainer); foreach (Location location in chunkContainer.Locations) { locationPool.Unmark(location); } continue; } if (paletteContainer == null) { paletteContainer = new PaletteContainer(); paletteContainer.Palette = new Palette(); paletteContainers.Add(paletteContainer); } paletteContainer.Add(chunkContainer); paletteContainer.AddColors(region.GetColors()); } } Console.WriteLine("Done processing monocolor regions"); Console.WriteLine("Parsing multicolor regions"); HashSet<Region> colorRegions = Process(locationPool, maximumDistance, RegionType.MultiColorRegion); Console.WriteLine("Have multi color region count " + colorRegions.Count); foreach (Region region in colorRegions) { HashSet<ChunkContainer> potentialContainers = region.GetChunks(locationPool); PaletteContainer paletteContainer = GetPaletteContainer(paletteContainers, region.GetColors()); if (paletteContainer == null) { paletteContainer = new PaletteContainer(); paletteContainer.Palette = new Palette(); paletteContainers.Add(paletteContainer); } foreach (ChunkContainer chunkContainer in potentialContainers) { paletteContainer.Add(chunkContainer); paletteContainer.AddColors(region.GetColors()); } } Console.WriteLine("Done processing multicolor regions"); Console.WriteLine("Histogram count " + colorList.Count); Console.WriteLine("Majority color " + mostCommonColor + " with count " + colorList[0].Value); //alrighty, let's get some output going Container container = new Container(); Frame frame = new Frame(); container.Frames.Add(frame); foreach (PaletteContainer paletteContainer in paletteContainers) { PaletteChunk paletteChunk = paletteContainer.Palette.GetPaletteChunk(); if (paletteChunk == null) { paletteChunk = defaultPaletteChunk; } if (!paletteContainer.Initial) { paletteChunk.Colors.Sort(new PaletteChunk.ColorSorter()); frame.Chunks.Add(paletteChunk); } foreach (ChunkContainer chunkContainer in paletteContainer.ChunkContainers) { int count = chunkContainer.Chunk.GetData().Count; PrintKeptChunk(chunkContainer); chunkContainer.SetIndex(paletteChunk); chunkContainer.Chunk.Palette = paletteChunk; frame.Chunks.Add(chunkContainer.Chunk); } } return container; }
public static void DisplayBackground( Gump gump, BackgroundType color, int x, int y, int width, int height ) { switch ( color ) { case BackgroundType.Alpha:{ gump.AddAlphaRegion( x, y, width, height ); break; } case BackgroundType.BlackAlpha:{ gump.AddImageTiled( x, y, width, height, 2624 ); gump.AddAlphaRegion( x, y, width, height ); break; } case BackgroundType.Black:{ gump.AddImageTiled( x, y, width, height, 2624 ); break; } case BackgroundType.Gray:{ gump.AddImageTiled( x, y, width, height, 5058 ); break; } case BackgroundType.Marble:{ gump.AddImageTiled( x, y, width, height, 5104 ); break; } case BackgroundType.Offwhite:{ gump.AddImageTiled( x, y, width, height, 3004 ); break; } case BackgroundType.DarkGray:{ gump.AddImageTiled( x, y, width, height, 5124 ); break; } case BackgroundType.Scroll:{ gump.AddImageTiled( x, y, width, height, 5174 ); break; } case BackgroundType.ActiveTextEntry:{ gump.AddImageTiled( x, y, width, height, 2604 ); break; } case BackgroundType.InactiveTextEntry:{ gump.AddImageTiled( x, y, width, height, 1416 ); break; } } }
internal static ImageInfo GetImageInfo(MethodDef method, BackgroundType bgType) { return FieldTreeNode.GetImageInfo(GetMemberIcon(method), bgType); }
public BoardItem CreateInstance(Board board, int x, int y, int z, int rx, int ry, int cx, int cy, BackgroundType type, int a, bool front, bool flip, bool beforeAdding) { return new BackgroundInstance(this, board, x, y, z, rx, ry, cx, cy, type, a, front, flip, beforeAdding); }
public MonitorPage(int idNum, ConfigNode node, RasterPropMonitor thatMonitor) { ourMonitor = thatMonitor; screenWidth = ourMonitor.screenWidth; screenHeight = ourMonitor.screenHeight; cameraAspect = ourMonitor.cameraAspect; cameraObject = thatMonitor.cameraStructure; defaultColor = ourMonitor.defaultFontTintValue; screenXMin = 0; screenYMin = 0; pageNumber = idNum; isMutable = false; if (!node.HasData) { throw new ArgumentException("Empty page?"); } if (node.HasValue("name")) { string value = node.GetValue("name").Trim(); if (!IsValidPageName(value)) { JUtil.LogMessage(ourMonitor, "Warning, name given for page #{0} is invalid, ignoring.", pageNumber); } else { name = value; } } else { JUtil.LogMessage(ourMonitor, "Warning, page #{0} has no name. It's much better if it does.", pageNumber); } isDefault |= node.HasValue("default"); if (node.HasValue("button")) { SmarterButton.CreateButton(thatMonitor.internalProp, node.GetValue("button"), this, thatMonitor.PageButtonClick); } // Page locking system -- simple locking: simpleLockingPage |= node.HasValue("lockingPage"); // and name-based locking. if (node.HasValue("disableSwitchingTo")) { string[] tokens = node.GetValue("disableSwitchingTo").Split(','); foreach (string token in tokens) { disableSwitchingTo.Add(token.Trim()); } } unlocker |= node.HasValue("unlockerPage"); if (node.HasValue("localMargins")) { Vector4 margindata = ConfigNode.ParseVector4(node.GetValue("localMargins")); screenXMin = (int)margindata.x; screenYMin = (int)margindata.y; screenWidth = screenWidth - (int)margindata.z - screenXMin; screenHeight = screenHeight - (int)margindata.w - screenYMin; } pageFont = node.GetInt("defaultFontNumber") ?? 0; if (node.HasValue("defaultFontTint")) { defaultColor = ConfigNode.ParseColor32(node.GetValue("defaultFontTint")); } if (node.HasValue("techsRequired")) { techsRequired = node.GetValue("techsRequired").Split(new[] { ' ', ',', ';', '\t', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (node.HasValue("fallbackOnNoTech")) { fallbackPageName = node.GetValue("fallbackOnNoTech").Trim(); } if (node.HasNode("CONTEXTREDIRECT")) { foreach (string content in node.GetNode("CONTEXTREDIRECT").GetValues("redirect")) { string[] tokens = content.Split(','); if (tokens.Length > 2 || !IsValidPageName(tokens[0].Trim()) || !IsValidPageName(tokens[1].Trim())) { JUtil.LogMessage(ourMonitor, "Warning, invalid page redirect statement on page #{0}.", pageNumber); continue; } redirectPages[tokens[0].Trim()] = tokens[1].Trim(); } const string valueError = "Warning, invalid global button redirect statement on page #{0}: {1}"; foreach (string content in node.GetNode("CONTEXTREDIRECT").GetValues("renumber")) { string[] tokens = content.Split(','); if (tokens.Length > 2) { JUtil.LogMessage(ourMonitor, valueError, pageNumber, "requires two arguments."); continue; } int from, to; if (!int.TryParse(tokens[0], out from) || !int.TryParse(tokens[1], out to)) { JUtil.LogMessage(ourMonitor, valueError, pageNumber, "something isn't a number."); continue; } redirectGlobals[from] = to; } JUtil.LogMessage(this, "Page '{2}' (#{0}) registers {1} page redirects and {3} global button redirects.", idNum, redirectPages.Count, name, redirectGlobals.Count); } foreach (ConfigNode handlerNode in node.GetNodes("PAGEHANDLER")) { MonoBehaviour handlerModule; HandlerSupportMethods supportMethods; MethodInfo handlerMethod = InstantiateHandler(handlerNode, ourMonitor, out handlerModule, out supportMethods); if (handlerMethod != null && handlerModule != null) { try { pageHandlerMethod = (Func<int, int, string>)Delegate.CreateDelegate(typeof(Func<int, int, string>), handlerModule, handlerMethod); } catch { JUtil.LogErrorMessage(ourMonitor, "Incorrect signature for the page handler method {0}", handlerModule.name); break; } pageHandlerS = supportMethods; isMutable = true; pageHandlerModule = handlerModule; break; } } if (pageHandlerMethod == null) { if (node.HasValue("text")) { text = JUtil.LoadPageDefinition(node.GetValue("text")); isMutable |= text.IndexOf("$&$", StringComparison.Ordinal) != -1; } } if (node.HasValue("textOverlay")) { textOverlayBuffer = JUtil.LoadPageDefinition(node.GetValue("textOverlay")).Split(JUtil.LineSeparator, StringSplitOptions.None); } foreach (ConfigNode handlerNode in node.GetNodes("BACKGROUNDHANDLER")) { MonoBehaviour handlerModule; HandlerSupportMethods supportMethods; MethodInfo handlerMethod = InstantiateHandler(handlerNode, ourMonitor, out handlerModule, out supportMethods); if (handlerMethod != null && handlerModule != null) { try { backgroundHandlerMethod = (Func<RenderTexture, float, bool>)Delegate.CreateDelegate(typeof(Func<RenderTexture, float, bool>), handlerModule, handlerMethod); } catch { JUtil.LogErrorMessage(ourMonitor, "Incorrect signature for the background handler method {0}", handlerModule.name); break; } backgroundHandlerS = supportMethods; isMutable = true; showNoSignal = node.HasValue("showNoSignal"); background = BackgroundType.Handler; backgroundHandlerModule = handlerModule; break; } } if (background == BackgroundType.None) { if (node.HasValue("cameraTransform")) { isMutable = true; background = BackgroundType.Camera; camera = node.GetValue("cameraTransform"); cameraFOV = defaultFOV; cameraFlickerChance = node.GetFloat("flickerChance") ?? 0; cameraFlickerRange = node.GetInt("flickerRange") ?? 0; if (node.HasValue("fov")) { float fov; cameraFOV = float.TryParse(node.GetValue("fov"), out fov) ? fov : defaultFOV; } else if (node.HasValue("zoomFov") && node.HasValue("zoomButtons")) { Vector3 zoomFov = ConfigNode.ParseVector3(node.GetValue("zoomFov")); Vector2 zoomButtons = ConfigNode.ParseVector2(node.GetValue("zoomButtons")); if ((int)zoomFov.z != 0 && ((int)zoomButtons.x != (int)zoomButtons.y)) { maxFOV = Math.Max(zoomFov.x, zoomFov.y); minFOV = Math.Min(zoomFov.x, zoomFov.y); zoomSteps = (int)zoomFov.z; zoomUpButton = (int)zoomButtons.x; zoomDownButton = (int)zoomButtons.y; zoomSkip = (maxFOV - minFOV) / zoomSteps; currentZoom = 0; cameraFOV = maxFOV; } else { JUtil.LogMessage(ourMonitor, "Ignored invalid camera zoom settings on page {0}.", pageNumber); } } } } if (background == BackgroundType.None) { if (node.HasValue("textureURL")) { string textureURL = node.GetValue("textureURL").EnforceSlashes(); if (GameDatabase.Instance.ExistsTexture(textureURL)) { backgroundTexture = GameDatabase.Instance.GetTexture(textureURL, false); background = BackgroundType.Texture; } } } if (node.HasValue("textureInterlayURL")) { string textureURL = node.GetValue("textureInterlayURL").EnforceSlashes(); if (GameDatabase.Instance.ExistsTexture(textureURL)) { interlayTexture = GameDatabase.Instance.GetTexture(textureURL, false); } else { JUtil.LogErrorMessage(ourMonitor, "Interlay texture could not be loaded."); } } if (node.HasValue("textureOverlayURL")) { string textureURL = node.GetValue("textureOverlayURL").EnforceSlashes(); if (GameDatabase.Instance.ExistsTexture(textureURL)) { overlayTexture = GameDatabase.Instance.GetTexture(textureURL, false); } else { JUtil.LogErrorMessage(ourMonitor, "Overlay texture {0} could not be loaded.", textureURL); } } }
private void GetArgsList() { MessagesTitle = (string) ArgsList[2]; Messages = (string) ArgsList[4]; HideSpawnerList = (ArrayList) ArgsList[6]; MSGCheckBoxesList = (ArrayList) ArgsList[13]; megaSpawner = (MegaSpawner) ArgsList[19]; fromSpawnerList = (bool) ArgsList[20]; PersonalConfigList = (ArrayList) ArgsList[28]; StyleTypeConfig = (StyleType) PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType) PersonalConfigList[1]; DefaultTextColor = (TextColor) PersonalConfigList[4]; TitleTextColor = (TextColor) PersonalConfigList[5]; }
public static BitmapSource GetIcon(string name, BackgroundType bgType) { return ImageCache.Instance.GetImage(name, bgType); }
private void GetArgsList() { Help = (bool) ArgsList[0]; DisplayMessages = (bool) ArgsList[1]; MessagesTitle = (string) ArgsList[2]; OldMessagesTitle = (string) ArgsList[3]; Messages = (string) ArgsList[4]; OldMessages = (string) ArgsList[5]; PageInfoList = (ArrayList) ArgsList[12]; SCGArgsList = (ArrayList) ArgsList[24]; SCGSetList = (ArrayList) ArgsList[25]; PersonalConfigList = (ArrayList) ArgsList[28]; cpg = (int) PageInfoList[24]; pg = (int) PageInfoList[25]; StyleTypeConfig = (StyleType) PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType) PersonalConfigList[1]; DefaultTextColor = (TextColor) PersonalConfigList[4]; TitleTextColor = (TextColor) PersonalConfigList[5]; MessagesTextColor = (TextColor) PersonalConfigList[6]; CommandButtonsTextColor = (TextColor) PersonalConfigList[7]; PageNumberTextColor = (int) PersonalConfigList[8]; }
private void GetArgsList() { MessagesTitle = (string) ArgsList[2]; Messages = (string) ArgsList[4]; MSGCheckBoxesList = (ArrayList) ArgsList[13]; PersonalConfigList = (ArrayList) ArgsList[28]; StyleTypeConfig = (StyleType) PersonalConfigList[0]; BackgroundTypeConfig = (BackgroundType) PersonalConfigList[1]; DefaultTextColor = (TextColor) PersonalConfigList[4]; TitleTextColor = (TextColor) PersonalConfigList[5]; }
public static ImageSource GetIcon(MethodDef method, BackgroundType bgType) { return FieldTreeNode.GetIcon(GetMemberIcon(method), bgType); }
public static ImageSource GetIcon(FieldDef field, BackgroundType bgType) { return GetIcon(GetMemberIcon(field), bgType); }