void LoadAssets() { string stealFilename; string grabFilename; string infoFilename; string talkFilename; switch (DaggerfallUnity.Settings.InteractionModeIcon.ToLower()) { case "classic": stealFilename = classicStealFilename; grabFilename = classicGrabFilename; infoFilename = classicInfoFilename; talkFilename = classicTalkFilename; displayScale = classicScale; break; case "monochrome": stealFilename = monoStealFilename; grabFilename = monoGrabFilename; infoFilename = monoInfoFilename; talkFilename = monoTalkFilename; displayScale = monoScale; break; case "colour": stealFilename = colourStealFilename; grabFilename = colourGrabFilename; infoFilename = colourInfoFilename; talkFilename = colourTalkFilename; displayScale = colourScale; break; default: stealFilename = iconStealFilename; grabFilename = iconGrabFilename; infoFilename = iconInfoFilename; talkFilename = iconTalkFilename; if (DaggerfallUnity.Settings.InteractionModeIcon.ToLower() == "minimal") { displayScale = minimalScale; } else { displayScale = iconScale; } break; } StealTexture = DaggerfallUI.GetTextureFromResources(IconsFolder + stealFilename, out stealSize); GrabTexture = DaggerfallUI.GetTextureFromResources(IconsFolder + grabFilename, out grabSize); InfoTexture = DaggerfallUI.GetTextureFromResources(IconsFolder + infoFilename, out infoSize); TalkTexture = DaggerfallUI.GetTextureFromResources(IconsFolder + talkFilename, out talkSize); }
private void LoadPage() { ResetButtonTextures(); LoadButtons(); if (BestiaryMain.SettingEntries == 2) { currentEntryIndex = 0; LoadEntry(); } else { LoadSummary(); UpdatePageNameLabel(); } void ResetButtonTextures() { for (int i = 0; i < contentButtons.Count; i++) { contentButtons[i].BackgroundTexture = blankTexture; } } void LoadButtons() { for (int i = 0; i < BestiaryMain.AllText.Pages[currentPageIndex].Entries.Count && i < contentButtonTextures.Count; i++) { contentButtonTextures[i] = DaggerfallUI.GetTextureFromResources(BestiaryMain.AllText.Pages[currentPageIndex].Entries[i].ButtonTextureName); if (!contentButtonTextures[i]) { throw new Exception("BestiaryUI: Could not load contentButtonTextures" + (i) + "."); } contentButtons[i].BackgroundTexture = contentButtonTextures[i]; } } void UpdatePageNameLabel() { pageNameLabel.Text = BestiaryMain.AllText.Pages[currentPageIndex].Title; pageNameLabel.Position = new Vector2(pageNamePos[0] + ((pageNameSize[0] - pageNameLabel.TextWidth) / 2), pageNamePos[1]); summaryButton.Position = pageNameLabel.Position; summaryButton.Size = new Vector2(pageNameLabel.TextWidth, pageNameSize[1]); } }
private void LoadTextures() { backgroundTexture = DaggerfallUI.GetTextureFromResources(backgroundTextureName); if (!backgroundTexture) { throw new Exception("BestiaryUI: Could not load backgroundTexture."); } blankTexture = DaggerfallUI.GetTextureFromResources(blankTextureName); if (!blankTexture) { throw new Exception("BestiaryUI: Could not load blankTexture."); } attackFalseTexture = DaggerfallUI.GetTextureFromResources(attackFalseTextureName); if (!attackFalseTexture) { throw new Exception("BestiaryUI: Could not load attackFalseTexture."); } attackTrueTexture = DaggerfallUI.GetTextureFromResources(attackTrueTextureName); if (!attackTrueTexture) { throw new Exception("BestiaryUI: Could not load attackTrueTexture."); } leftArrowTexture = DaggerfallUI.GetTextureFromResources(leftArrowTextureName); if (!leftArrowTexture) { throw new Exception("BestiaryUI: Could not load leftArrowTexture."); } rightArrowTexture = DaggerfallUI.GetTextureFromResources(rightArrowTextureName); if (!rightArrowTexture) { throw new Exception("BestiaryUI: Could not load rightArrowTexture."); } for (int i = 0; i < 9; i++) { contentButtonTextures.Add(DaggerfallUI.GetTextureFromResources(blankTextureName)); } }
protected override void Setup() { base.Setup(); nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName); if (!nativeTexture) { throw new System.Exception("DaggerfallTravelMap: Could not load native texture."); } greenCheckboxTexture = DaggerfallUI.GetTextureFromResources(greenCheckboxTextureFilename); ParentPanel.BackgroundColor = Color.clear; travelPanel = DaggerfallUI.AddPanel(nativePanelRect, NativePanel); travelPanel.BackgroundTexture = nativeTexture; availableGoldLabel = DaggerfallUI.AddTextLabel(DaggerfallUI.DefaultFont, new Vector2(148, 97), "0", NativePanel); availableGoldLabel.MaxCharacters = 12; tripCostLabel = DaggerfallUI.AddTextLabel(DaggerfallUI.DefaultFont, new Vector2(117, 107), "0", NativePanel); tripCostLabel.MaxCharacters = 18; travelTimeLabel = DaggerfallUI.AddTextLabel(DaggerfallUI.DefaultFont, new Vector2(129, 117), "0", NativePanel); travelTimeLabel.MaxCharacters = 16; speedToggleColorPanel = DaggerfallUI.AddPanel(new Rect(cautiousPanelPos, colorPanelSize), NativePanel); SetToggleLook(speedToggleColorPanel); sleepToggleColorPanel = DaggerfallUI.AddPanel(new Rect(innPanelPos, colorPanelSize), NativePanel); SetToggleLook(sleepToggleColorPanel); transportToggleColorPanel = DaggerfallUI.AddPanel(new Rect(footPos, colorPanelSize), NativePanel); SetToggleLook(transportToggleColorPanel); SetupButtons(); Refresh(); }
void LoadAssets() { string stealFilename; string grabFilename; string infoFilename; string talkFilename; if (DaggerfallUnity.Settings.InteractionModeIcon.ToLower() == "classic") { stealFilename = classicStealFilename; grabFilename = classicGrabFilename; infoFilename = classicInfoFilename; talkFilename = classicTalkFilename; displayScale = classicScale; } else { stealFilename = iconStealFilename; grabFilename = iconGrabFilename; infoFilename = iconInfoFilename; talkFilename = iconTalkFilename; if (DaggerfallUnity.Settings.InteractionModeIcon.ToLower() == "minimal") { displayScale = minimalScale; } else { displayScale = iconScale; } } StealTexture = DaggerfallUI.GetTextureFromResources(stealFilename, out stealSize); GrabTexture = DaggerfallUI.GetTextureFromResources(grabFilename, out grabSize); InfoTexture = DaggerfallUI.GetTextureFromResources(infoFilename, out infoSize); TalkTexture = DaggerfallUI.GetTextureFromResources(talkFilename, out talkSize); }
void LoadAssets() { CrosshairTexture = DaggerfallUI.GetTextureFromResources(defaultCrosshairFilename, out crosshairSize); }