public override void Start() { base.Start(); GRLoader grInv = new GRLoader(GRLoader.INV_GR); BackpackBg.GetComponent <RawImage>().texture = grInv.LoadImageAt(6); }
//public static int setControl=0; public override void Start() { base.Start(); GRLoader Chains = new GRLoader(GRLoader.CHAINS_GR); this.GetComponent <RawImage>().texture = Chains.LoadImageAt(0); }
void SetUpUW2OptBtns() { GRLoader grOptBtns = new GRLoader(GRLoader.OPTBTNS_GR); Texture2D buttonBG = ArtLoader.CreateBlankImage(25, 14); UWHUD.instance.InteractionControlUW2BG.texture = grOptBtns.LoadImageAt(2); UW2Buttons = new Texture2D[12]; //In off and on pairs UW2Buttons[0] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, -52, 0); //options UW2Buttons[1] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, -52, 0); //options UW2Buttons[2] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, 0, 0); //talk UW2Buttons[3] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, 0, 0); //talk UW2Buttons[4] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, -52, -15); //pickup UW2Buttons[5] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, -52, -15); //pickup UW2Buttons[6] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, -26, 0); //look UW2Buttons[7] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, -26, 0); //look UW2Buttons[8] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, 0, -15); //attack UW2Buttons[9] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, 0, -15); //attack UW2Buttons[10] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(0), buttonBG, -26, -15); //use UW2Buttons[11] = ArtLoader.InsertImage(grOptBtns.LoadImageAt(1), buttonBG, -26, -15); //use }
public void Begin() { if (_RES == GAME_SHOCK) { return; } GRLoader bodies = new GRLoader(GRLoader.BODIES_GR); Blank = Resources.Load <Texture2D>(_RES + "/Sprites/Texture_Blank"); //atTopLevel=true; playerUW = this.GetComponent <UWCharacter>(); playerContainer = this.GetComponent <Container>(); for (int i = 0; i < 8; i++) { //bBackPack[i] = true; setBackPack(i, null); } UWHUD.instance.Encumberance.text = getEncumberance().ToString(); if (playerUW.isFemale) { //UWHUD.instance.playerBody.texture =(Texture2D)Resources.Load(_RES +"/Hud/Bodies/bodies_" + (5+playerUW.Body).ToString("0000")); UWHUD.instance.playerBody.texture = bodies.LoadImageAt(5 + playerUW.Body); } else { //UWHUD.instance.playerBody.texture =(Texture2D)Resources.Load(_RES +"/Hud/Bodies/bodies_" + (playerUW.Body).ToString("0000")); UWHUD.instance.playerBody.texture = bodies.LoadImageAt(playerUW.Body); } Ready = true; Refresh(); }
public static void InitMapButtons(MapWorldSelect[] Buttons) { GRLoader gempt = new GRLoader(GRLoader.GEMPT_GR, 3); for (int i = 0; i <= Buttons.GetUpperBound(0); i++) { if (Buttons[i] != null) { switch (Buttons[i].world) { case GameWorldController.Worlds.Britannia: Buttons[i].ButtonOff = GRLoader.CreateBlankImage(29, 29); Buttons[i].ButtonOn = gempt.LoadImageAt(16); break; case GameWorldController.Worlds.PrisonTower: Buttons[i].ButtonOff = gempt.LoadImageAt(0); Buttons[i].ButtonOn = gempt.LoadImageAt(8); break; case GameWorldController.Worlds.Killorn: Buttons[i].ButtonOff = gempt.LoadImageAt(1); Buttons[i].ButtonOn = gempt.LoadImageAt(9); break; case GameWorldController.Worlds.Ice: Buttons[i].ButtonOff = gempt.LoadImageAt(2); Buttons[i].ButtonOn = gempt.LoadImageAt(10); break; case GameWorldController.Worlds.Talorus: Buttons[i].ButtonOff = gempt.LoadImageAt(3); Buttons[i].ButtonOn = gempt.LoadImageAt(11); break; case GameWorldController.Worlds.Academy: Buttons[i].ButtonOff = gempt.LoadImageAt(4); Buttons[i].ButtonOn = gempt.LoadImageAt(12); break; case GameWorldController.Worlds.Pits: Buttons[i].ButtonOff = gempt.LoadImageAt(6); Buttons[i].ButtonOn = gempt.LoadImageAt(14); break; case GameWorldController.Worlds.Tomb: Buttons[i].ButtonOff = gempt.LoadImageAt(5); Buttons[i].ButtonOn = gempt.LoadImageAt(13); break; case GameWorldController.Worlds.Ethereal: Buttons[i].ButtonOff = gempt.LoadImageAt(7); Buttons[i].ButtonOn = gempt.LoadImageAt(15); break; } } } }
public override void Start() { base.Start(); grlfti = new GRLoader(GRLoader.LFTI_GR); if (_RES == GAME_UW2) { SetUpUW2OptBtns(); } SetImage(ref Controls[0], 0); //Init the options button }
public void ButtonClickMainMenu(int option) { //Button clicks on front menu. if (MenuMode == 0) { switch (option) { case 0: //PLay introduction //UWHUD.instance.CutScenesFull.SetAnimation="cs013_n01"; Cutscene_Intro ci = UWHUD.instance.gameObject.AddComponent <Cutscene_Intro>(); UWHUD.instance.CutScenesFull.cs = ci; UWHUD.instance.CutScenesFull.Begin(); break; case 1: // Create Character MenuMode = 1; CharGen.SetActive(true); OpScr.SetActive(false); CharGenQuestion.text = getQuestion(0); InitChargenScreen(); chrBtns = new GRLoader(GRLoader.CHRBTNS_GR); chrBtns.PaletteNo = 9; PlaceButtons(Chargen.GetChoices(Chargen.STAGE_GENDER, -1), false); break; case 2: // Acknowledgements Cutscene_Credits cc = UWHUD.instance.gameObject.AddComponent <Cutscene_Credits>(); UWHUD.instance.CutScenesFull.cs = cc; UWHUD.instance.CutScenesFull.Begin(); break; case 3: // Journey onwards. In the future will be a link to load menu MenuMode = 2; DisplaySaveGames(); break; case 4: //Reset MainMenu IntroductionButton.SetActive(true); CreateCharacterButton.SetActive(true); CreditsButton.SetActive(true); JourneyOnButton.SetActive(true); for (int i = 0; i <= SaveGameButtons.GetUpperBound(0); i++) { SaveGameButtons[i].SetActive(false); } OpScr.SetActive(true); CharGen.SetActive(false); break; } } else { //Chargen ChargenClick(option); } }
public override void Start() { base.Start(); comp = this.GetComponent <RawImage>(); GRLoader grCompass = new GRLoader(GRLoader.COMPASS_GR); for (int i = 0; i < 4; i++) { //CompassPoles[i]=Resources.Load <Texture2D> (_RES +"/HUD/Compass/Compass_000"+i.ToString()); CompassPoles[i] = grCompass.LoadImageAt(i); } }
public override void Start() { base.Start(); GRLoader powerArt = new GRLoader(GRLoader.POWER_GR); if (uiPowerGem == null) { uiPowerGem = this.gameObject.GetComponent <RawImage>(); } PowerGemArt = new Texture2D[powerArt.NoOfImages]; for (int i = 0; i <= PowerGemArt.GetUpperBound(0); i++) { PowerGemArt[i] = powerArt.LoadImageAt(i); } }
public override void Start() { switch (_RES) { case GAME_UWDEMO: return; default: if (ButtonLoader == null) { ButtonLoader = new GRLoader(GRLoader.OPBTN_GR); ButtonLoader.PaletteNo = 6; } ButtonBG.texture = ButtonLoader.LoadImageAt(ButtonOffIndex, false); break; } }
public override void Start() { base.Start(); GRLoader powerArt = new GRLoader(GRLoader.POWER_GR); if (uiPowerGem == null) { uiPowerGem = this.gameObject.GetComponent <RawImage>(); } PowerGemArt = new Texture2D[powerArt.NoOfFileImages()]; for (int i = 0; i <= PowerGemArt.GetUpperBound(0); i++) { PowerGemArt[i] = powerArt.LoadImageAt(i); } if (_RES == GAME_UW2) { uiPowerGem.GetComponent <GuiBase_Draggable>().rectT = new RectTransform[2]; uiPowerGem.GetComponent <GuiBase_Draggable>().rectT[0] = this.GetComponent <RectTransform>(); uiPowerGem.GetComponent <GuiBase_Draggable>().rectT[1] = UWHUD.instance.HudCompass.GetComponent <RectTransform>(); } }
//void Start() //{ //RefreshPanels(-1); //} /// <summary> /// Refreshs the panels depending on the active mode /// </summary> /// <param name="ActivePanelMode">Active panel mode.</param> public void RefreshPanels(int ActivePanelMode) { switch (ActivePanelMode) { case -1: UpdatePanelStates(); break; case HUD_MODE_INVENTORY: //Inventory InventoryEnabled = true; RuneBagEnabled = false; StatsEnabled = false; ConversationEnabled = false; CutSceneSmallEnabled = true; CutSceneFullEnabled = false; MapEnabled = false; if (chains.ActiveControl > 2) { chains.ActiveControl = ActivePanelMode; UpdatePanelStates(); } else { StartCoroutine(RotatePanels(currentPanel, InventoryPanel)); chains.ActiveControl = ActivePanelMode; } break; case HUD_MODE_STATS: //Stats display StatsDisplay.UpdateNow = true; InventoryEnabled = false; RuneBagEnabled = false; StatsEnabled = true; ConversationEnabled = false; CutSceneSmallEnabled = true; CutSceneFullEnabled = false; MapEnabled = false; if (chains.ActiveControl > 2) { chains.ActiveControl = ActivePanelMode; UpdatePanelStates(); } else { StartCoroutine(RotatePanels(currentPanel, StatsDisplayPanel)); chains.ActiveControl = ActivePanelMode; } break; case HUD_MODE_RUNES: //Runebag InventoryEnabled = false; RuneBagEnabled = true; StatsEnabled = false; ConversationEnabled = false; CutSceneSmallEnabled = true; CutSceneFullEnabled = false; MapEnabled = false; if (chains.ActiveControl > 2) { chains.ActiveControl = ActivePanelMode; UpdatePanelStates(); } else { StartCoroutine(RotatePanels(currentPanel, RuneBagPanel)); chains.ActiveControl = ActivePanelMode; } break; case HUD_MODE_CONV: //Conversation GRLoader grConv = new GRLoader(GRLoader.CONVERSE_GR); InventoryPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); PaperDollFemalePanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); PaperDollMalePanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); StatsDisplayPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, -1.0f, 0.0f, 0.0f); RuneBagPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, -1.0f, 0.0f, 0.0f); InventoryEnabled = true; RuneBagEnabled = false; StatsEnabled = false; ConversationEnabled = true; CutSceneSmallEnabled = false; CutSceneFullEnabled = false; MapEnabled = false; npcTradeArea.texture = grConv.LoadImageAt(1); pcTradeArea.texture = grConv.LoadImageAt(1); ConvNPCPortraitBG.texture = grConv.LoadImageAt(2); ConvPCPortraitBG.texture = grConv.LoadImageAt(2); ConvTextScrollTop.texture = grConv.LoadImageAt(3); ConvTextScrollBottom.texture = grConv.LoadImageAt(4); ConvPCTitleBG.texture = grConv.LoadImageAt(0); ConvNPCTitleBG.texture = grConv.LoadImageAt(0); UpdatePanelStates(); break; case HUD_MODE_MAP: //Map InventoryPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); PaperDollFemalePanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); PaperDollMalePanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f); StatsDisplayPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, -1.0f, 0.0f, 0.0f); RuneBagPanel.GetComponent <RectTransform>().rotation = new Quaternion(0.0f, -1.0f, 0.0f, 0.0f); InventoryEnabled = false; RuneBagEnabled = false; StatsEnabled = false; ConversationEnabled = false; CutSceneSmallEnabled = false; CutSceneFullEnabled = false; MapEnabled = true; UpdatePanelStates(); break; } if (ActivePanelMode != -1) { chains.ActiveControl = ActivePanelMode; } }
public void ChargenClick(int option) { //0 = Gender //1 = Handeness //2 = Class //3,4,5,6,7 = Skills. Some are skipped over. //8 is portrait/race //9 is difficulty. //10 is name //11 is confirm. switch (chargenStage) { case Chargen.STAGE_GENDER: //Gender UWCharacter.Instance.PlayerSkills.InitSkills(); //Set all skills to zero if (option == 0) { UWCharacter.Instance.isFemale = false; } else { UWCharacter.Instance.isFemale = true; } CharGender.text = StringController.instance.GetString(2, Chargen.GetChoices(chargenStage, -1)[option]); chargenStage++; PlaceButtons(Chargen.GetChoices(chargenStage, -1), false); break; case Chargen.STAGE_HANDENESS: //Handedness if (option == 0) { UWCharacter.Instance.isLefty = true; } else { UWCharacter.Instance.isLefty = false; } chargenStage++; PlaceButtons(Chargen.GetChoices(chargenStage, -1), false); break; case Chargen.STAGE_CLASS: UWCharacter.Instance.CharClass = option; CharClassAns = option; SkillSeed = Chargen.getSeed(option); //Set str, int and dex here. //Max attribute is 30. Min is 12. UWCharacter.Instance.PlayerSkills.STR = Mathf.Min(Mathf.Max(Chargen.getBaseSTR(option) + Random.Range(1, SkillSeed), 12), 30); UWCharacter.Instance.PlayerSkills.INT = Mathf.Min(Mathf.Max(Chargen.getBaseINT(option) + Random.Range(1, SkillSeed), 12), 30); UWCharacter.Instance.PlayerSkills.DEX = Mathf.Min(Mathf.Max(Chargen.getBaseDEX(option) + Random.Range(1, SkillSeed), 12), 30); CharStr.text = "Str: " + UWCharacter.Instance.PlayerSkills.STR.ToString(); CharInt.text = "Int: " + UWCharacter.Instance.PlayerSkills.INT.ToString(); CharDex.text = "Dex: " + UWCharacter.Instance.PlayerSkills.DEX.ToString(); CharClass.text = getClass(UWCharacter.Instance.CharClass); UWCharacter.Instance.MaxVIT = (UWCharacter.Instance.PlayerSkills.STR * 2); UWCharacter.Instance.CurVIT = (UWCharacter.Instance.PlayerSkills.STR * 2); CharVit.text = "Vit: " + UWCharacter.Instance.MaxVIT.ToString(); //todo chargenStage++; if (Chargen.GetChoices(chargenStage, CharClassAns).GetUpperBound(0) == 0) { //Only one choice. Accept it by default. // chargenStage++; CharGenQuestion.text = getQuestion(chargenStage); ChargenClick(0); return; } else { PlaceButtons(Chargen.GetChoices(chargenStage, CharClassAns), false); } break; case Chargen.STAGE_SKILLS_1: case Chargen.STAGE_SKILLS_2: case Chargen.STAGE_SKILLS_3: case Chargen.STAGE_SKILLS_4: //Set skills here if possible. AdvanceSkill(option, chargenStage); chargenStage++; if (Chargen.GetChoices(chargenStage, CharClassAns).GetUpperBound(0) == 0) { //Only one choice. Accept it by default. //chargenStage++; CharGenQuestion.text = getQuestion(chargenStage); ChargenClick(0); return; } else { PlaceButtons(Chargen.GetChoices(chargenStage, CharClassAns), false); } break; case Chargen.STAGE_SKILLS_5: //Assume I will always have a choice here. //Set skills here if possible. AdvanceSkill(option, chargenStage); chargenStage++; PlaceButtons(Chargen.GetChoices(chargenStage, CharClassAns), true); //Moving to protrait. break; case Chargen.STAGE_PORTRAIT: chargenStage++; PlaceButtons(Chargen.GetChoices(chargenStage, -1), false); UWCharacter.Instance.Body = option; GRLoader chrBdy = new GRLoader(GRLoader.BODIES_GR); //Show the matching body. //Update the paperdoll. if (UWCharacter.Instance.isFemale) { //CharGenBody.texture = (Texture2D)Resources.Load(_RES +"/Hud/Chargen/chrbtns_" + (22+option).ToString("0000")); CharGenBody.texture = chrBtns.LoadImageAt(22 + option); //UWHUD.instance.playerBody.texture =(Texture2D)Resources.Load(_RES +"/Hud/Bodies/bodies_" + (5+option).ToString("0000")); UWHUD.instance.playerBody.texture = chrBdy.LoadImageAt(5 + option); } else { //CharGenBody.texture = (Texture2D)Resources.Load(_RES +"/Hud/Chargen/chrbtns_" + (17+option).ToString("0000")); CharGenBody.texture = chrBtns.LoadImageAt(17 + option); //UWHUD.instance.playerBody.texture =(Texture2D)Resources.Load(_RES +"/Hud/Bodies/bodies_" + (option).ToString("0000")); UWHUD.instance.playerBody.texture = chrBdy.LoadImageAt(option); } break; case Chargen.STAGE_DIFFICULTY: //Not implemented. //Show the name input box. //Remove buttons. chargenStage++; GameWorldController.instance.difficulty = option; RemoveButtons(); EnterCharName.gameObject.SetActive(true); EnterCharName.GetComponent <RawImage>().texture = chrBtns.LoadImageAt(2); EnterCharName.Select(); break; case Chargen.STAGE_NAME: //Set the player name. //UWCharacter.Instance.CharName=CharNameAns; chargenStage++; EnterCharName.gameObject.SetActive(false); PlaceButtons(Chargen.GetChoices(chargenStage, CharClassAns), false); break; case Chargen.STAGE_CONFIRM: if (option == 0) { //Start a new game UWCharacter.Instance.EXP = 50; UWCharacter.Instance.TrainingPoints = 1; UWCharacter.Instance.PlayerMagic.MaxMana = UWCharacter.Instance.PlayerSkills.ManaSkill * 3; UWCharacter.Instance.PlayerMagic.CurMana = UWCharacter.Instance.PlayerMagic.MaxMana; UWCharacter.Instance.PlayerMagic.TrueMaxMana = UWCharacter.Instance.PlayerMagic.MaxMana; GameWorldController.instance.InitBGlobals(0); //Reset quest variables for (int i = 0; i <= Quest.instance.QuestVariables.GetUpperBound(0); i++) { Quest.instance.QuestVariables[i] = 0; } for (int i = 0; i <= UWCharacter.Instance.PlayerMagic.PlayerRunes.GetUpperBound(0); i++) { UWCharacter.Instance.PlayerMagic.PlayerRunes[i] = false; } switch (_RES) { case GAME_UW1: case GAME_UWDEMO: Quest.instance.TalismansRemaining = 8; Quest.instance.DayGaramonDream = 0; Quest.instance.GaramonDream = 0; Quest.instance.IncenseDream = 0; Quest.instance.isGaramonBuried = false; Quest.instance.isOrbDestroyed = false; Quest.instance.isCupFound = false; break; case GAME_UW2: Quest.instance.variables[101] = 255; Quest.instance.variables[102] = 255; Quest.instance.variables[103] = 255; Quest.instance.variables[104] = 255; Quest.instance.variables[105] = 255; Quest.instance.variables[106] = 255; break; } GameClock.instance._day = 0; GameClock.instance._minute = 51; GameClock.instance._second = 15; UWCharacter.Instance.Fatigue = 20; UWCharacter.Instance.FoodLevel = 192; JourneyOnwards(); } else { //restart chargen chargenStage = Chargen.STAGE_GENDER; InitChargenScreen(); PlaceButtons(Chargen.GetChoices(chargenStage, -1), false); } break; } //Set next question. CharGenQuestion.text = getQuestion(chargenStage); }
public void Begin() { gameUi.SetActive(true); gameSelectUi.SetActive(false); //Init the art work for the hud //Init hud elements mapBackground.texture = GameWorldController.instance.bytloader.LoadImageAt(BytLoader.BLNKMAP_BYT); //mainwindow_art.texture=GameWorldController.instance.bytloader.LoadImageAt(BytLoader.MAIN_BYT); CursorIcon = GameWorldController.instance.grCursors.LoadImageAt(0); CursorIconDefault = GameWorldController.instance.grCursors.LoadImageAt(0); CursorIconTarget = GameWorldController.instance.grCursors.LoadImageAt(9); MapQuill = GameWorldController.instance.grCursors.LoadImageAt(14); MapQuillWriting = GameWorldController.instance.grCursors.LoadImageAt(12); MapEraser = GameWorldController.instance.grCursors.LoadImageAt(13); //inventoryDownArrow.texture=GameWorldController.instance.grCursors.LoadImageAt(2); //inventoryUpArrow.texture=GameWorldController.instance.grCursors.LoadImageAt(1); GRLoader grPanels = new GRLoader(GRLoader.PANELS_GR); InventoryPanel.GetComponent <RawImage>().texture = grPanels.LoadImageAt(0); RuneBagPanel.GetComponent <RawImage>().texture = grPanels.LoadImageAt(1); StatsDisplayPanel.GetComponent <RawImage>().texture = grPanels.LoadImageAt(2); UWHUD.instance.EnableDisableControl(UWHUD.instance.main_windowUW1, _RES != GAME_UW2); UWHUD.instance.EnableDisableControl(UWHUD.instance.main_windowUW2, _RES == GAME_UW2); UWHUD.instance.EnableDisableControl(UWHUD.instance.InteractionControlUW1.gameObject, _RES != GAME_UW2); UWHUD.instance.EnableDisableControl(UWHUD.instance.InteractionControlUW2.gameObject, _RES == GAME_UW2); MapPanel.transform.SetAsLastSibling(); ConversationPanel.transform.SetAsLastSibling(); GRLoader grButtons = new GRLoader(GRLoader.BUTTONS_GR); if (grButtons != null) { InvUp.GetComponent <RawImage>().texture = grButtons.LoadImageAt(27); InvDown.GetComponent <RawImage>().texture = grButtons.LoadImageAt(28); } if (_RES == GAME_UW2) {//Set line width of message scroll for UW2. MessageScroll.LineWidth = 54; Conversation_tl.LineWidth = 48; } switch (_RES) { case GAME_UW2: //Set UW2 specific UI positions SetUIElementPosition(window, 128f, 210f, new Vector2(-40.8f, 20f)); SetUIElementPosition(HudCompass, 16f, 52f, new Vector2(-40f, -56f)); SetUIElementPosition(HudCompass.NorthIndicators[0], 4f, 10f, new Vector2(26.02f - 26f, 13.98f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[1], 4f, 10f, new Vector2(33.01f - 26f, 13.99f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[2], 5f, 5f, new Vector2(40.46f - 26f, 12.51f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[3], 4f, 10f, new Vector2(44.00f - 26f, 12.01f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[4], 5f, 7f, new Vector2(48.52f - 26f, 8.5f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[5], 6f, 9f, new Vector2(46.51f - 26f, 7.02f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[6], 5f, 8f, new Vector2(42.00f - 26f, 4.5f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[7], 5f, 11f, new Vector2(33.49f - 26f, 3.5f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[8], 5f, 12f, new Vector2(26f - 26f, 2.49f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[9], 5f, 11f, new Vector2(18.5f - 26f, 3.49f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[10], 5f, 8f, new Vector2(9.99f - 26f, 4.49f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[11], 6f, 10f, new Vector2(5.04f - 26f, 7.01f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[12], 5f, 7f, new Vector2(3.49f - 26f, 8.49f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[13], 5f, 8f, new Vector2(5.98f - 26f, 10.51f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[14], 6f, 8f, new Vector2(11.99f - 26f, 11.97f - 8f)); SetUIElementPosition(HudCompass.NorthIndicators[15], 5f, 10f, new Vector2(19.03f - 26f, 13.5f - 8f)); SetUIElementPosition(powergem, 5f, 14f, new Vector2(-40f, -53.79f)); powergem.transform.parent.GetComponent <RectTransform>().SetSiblingIndex(HudCompass.GetComponent <RectTransform>().GetSiblingIndex() + 1); SetUIElementPosition(ChainsControl, 32f, 15f, new Vector2(119.7f, -35f)); FlaskMana.GetComponent <RectTransform>().anchoredPosition = new Vector2(139.5f, -48.4f); FlaskHealth.GetComponent <RectTransform>().anchoredPosition = new Vector2(100.14f, -48.5f); activeRunes[0].transform.parent.GetComponent <RectTransform>().anchoredPosition = new Vector2(1.9f, -11.6f); spelleffectdisplay[0].transform.parent.GetComponent <RectTransform>().anchoredPosition = new Vector2(-35f, -11.6f); //InventoryPanel.GetComponent<RectTransform>().anchoredPosition = new Vector2(114.7f,36f); SetUIElementPosition(InventoryPanel, 112f, 79f, new Vector2(114.6f, 36.7f)); SetUIElementPosition(RuneBagPanel, 112f, 79f, new Vector2(114.6f, 36.7f)); SetUIElementPosition(StatsDisplayPanel, 112f, 79f, new Vector2(114.6f, 36.7f)); //RuneBagPanel.GetComponent<RectTransform>().anchoredPosition = new Vector2(114.7f,36f); //StatsDisplayPanel.GetComponent<RectTransform>().anchoredPosition = new Vector2(114.7f,36f); SetUIElementPosition(playerBody, 69f, 36f, new Vector2(1.78f, 20.51f)); SetUIElementPosition(RightShoulder_Slot, 16f, 16f, new Vector2(16.8f - 39f, 99.4f - 56.3f)); SetUIElementPosition(LeftShoulder_Slot, 16f, 16f, new Vector2(65.3f - 39f, 99.4f - 56.3f)); SetUIElementPosition(RightHand_Slot, 16f, 16f, new Vector2(12.8f - 39f, 77f - 56.3f)); SetUIElementPosition(LeftHand_Slot, 16f, 16f, new Vector2(68.3f - 39f, 76.9f - 56.3f)); SetUIElementPosition(BackPack_Slot[0], 16f, 16f, new Vector2(11.9f - 39f, 30f - 55.9f)); SetUIElementPosition(BackPack_Slot[1], 16f, 16f, new Vector2(30.9f - 39f, 30f - 55.9f)); SetUIElementPosition(BackPack_Slot[2], 16f, 16f, new Vector2(49.9f - 39f, 30f - 55.9f)); SetUIElementPosition(BackPack_Slot[3], 16f, 16f, new Vector2(68.9f - 39f, 30f - 55.9f)); SetUIElementPosition(BackPack_Slot[4], 16f, 16f, new Vector2(11.9f - 39f, 12f - 55.9f)); SetUIElementPosition(BackPack_Slot[5], 16f, 16f, new Vector2(30.9f - 39f, 12f - 55.9f)); SetUIElementPosition(BackPack_Slot[6], 16f, 16f, new Vector2(49.9f - 39f, 12f - 55.9f)); SetUIElementPosition(BackPack_Slot[7], 16f, 16f, new Vector2(68.9f - 39f, 12f - 55.9f)); SetUIElementPosition(ContainerOpened, 16f, 16f, new Vector2(-26f, -4.8f)); SetUIElementPosition(RightRing_Slot, 8f, 8f, new Vector2(-13.71f, 5.01f)); SetUIElementPosition(LeftRing_Slot, 8f, 8f, new Vector2(17.69f, 5.01f)); SetUIElementPosition(MonsterEyes, 3f, 20f, new Vector2(-40.06f, 94.48f)); SetUIElementPosition(Legs_f_Slot, 51f, 19f, new Vector2(276.83f - 157.83f, 132.71f - 80.71f)); SetUIElementPosition(Chest_f_Slot, 44f, 33f, new Vector2(277.83f - 157.83f, 137.71f - 80.71f)); SetUIElementPosition(Helm_f_Slot, 20f, 20f, new Vector2(276.38f - 157.83f, 162.74f - 80.71f)); SetUIElementPosition(Gloves_f_Slot, 15f, 33f, new Vector2(276.9f - 157.83f, 131.11f - 80.71f)); SetUIElementPosition(Boots_f_Slot, 14f, 21f, new Vector2(275.83f - 157.83f, 109.01f - 80.71f)); SetUIElementPosition(Legs_m_Slot, 51f, 19f, new Vector2(276.83f - 157.83f, 132.71f - 80.71f)); SetUIElementPosition(Chest_m_Slot, 44f, 33f, new Vector2(277.83f - 157.83f, 137.71f - 80.71f)); SetUIElementPosition(Helm_m_Slot, 20f, 20f, new Vector2(276.38f - 157.83f, 162.74f - 80.71f)); SetUIElementPosition(Gloves_m_Slot, 15f, 33f, new Vector2(276.9f - 157.83f, 131.11f - 80.71f)); SetUIElementPosition(Boots_m_Slot, 14f, 21f, new Vector2(275.83f - 157.83f, 109.01f - 80.71f)); SetUIElementPosition(ContainerOpened.GetComponent <ContainerOpened>().BackpackBg, 0.9f, -34.4f, new Vector2(40.9f, 21.7f)); MessageLogScrollEdgeRight.GetComponent <RectTransform>().anchoredPosition = new Vector2(65.87f, -64.4f); MessageScrollBackground.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 208.68f); MessageScrollBackground.GetComponent <RectTransform>().anchoredPosition = new Vector2(-40.8f, -64.8f); MessageScrollDrag.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 216f); MessageScrollDrag.GetComponent <RectTransform>().anchoredPosition = new Vector2(-41.2f, -64.5f); //MessageScroll.GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 172f); //MessageScroll.GetComponent<RectTransform>().anchoredPosition= new Vector2(-39.5f, -62.4f); SetUIElementPosition(MessageScroll, 33f, 174f, new Vector2(-40.93f, -62.4f)); //Conversation element positions SetUIElementPosition(Conversation_tl, 80f, 198f, new Vector2(-38.54f, -19.9f)); SetUIElementPosition(ConversationPortraits[0], 70f, 64f, new Vector2(39.9f, 62f)); SetUIElementPosition(ConversationPortraits[1], 70f, 64f, new Vector2(-125.9f, 62f)); PCName.GetComponent <RectTransform>().anchoredPosition = new Vector2(-37.6f, 97.871f); PCName.alignment = TextAnchor.MiddleRight; NPCName.GetComponent <RectTransform>().anchoredPosition = new Vector2(-46.7f, 29.9f); NPCName.alignment = TextAnchor.MiddleLeft; //Player Trade SetUIElementPosition(playerTrade[0], 16f, 16f, new Vector2(130.7f - 158.6f, 180.8f - 100.69f)); SetUIElementPosition(playerTrade[1], 16f, 16f, new Vector2(151.2f - 158.6f, 180.8f - 100.69f)); SetUIElementPosition(playerTrade[2], 16f, 16f, new Vector2(130.7f - 158.6f, 163.2f - 100.69f)); SetUIElementPosition(playerTrade[3], 16f, 16f, new Vector2(151.2f - 158.6f, 163.2f - 100.69f)); SetUIElementPosition(playerTrade[4], 16f, 16f, new Vector2(130.7f - 158.6f, 145.62f - 100.69f)); SetUIElementPosition(playerTrade[5], 16f, 16f, new Vector2(151.2f - 158.6f, 145.6f - 100.69f)); SetUIElementPosition(npcTrade[0], 16f, 16f, new Vector2(81.5f - 158.6f, 180.8f - 100.69f)); SetUIElementPosition(npcTrade[1], 16f, 16f, new Vector2(102f - 158.6f, 180.8f - 100.69f)); SetUIElementPosition(npcTrade[2], 16f, 16f, new Vector2(81.5f - 158.6f, 163.2f - 100.69f)); SetUIElementPosition(npcTrade[3], 16f, 16f, new Vector2(102f - 158.6f, 163.2f - 100.69f)); SetUIElementPosition(npcTrade[4], 16f, 16f, new Vector2(81.5f - 158.6f, 145.6f - 100.69f)); SetUIElementPosition(npcTrade[5], 16f, 16f, new Vector2(102.2f - 158.6f, 145.6f - 100.69f)); //Automap SetUIElementPosition(MapDown, 30f, 30f, new Vector2(145f, 85f)); SetUIElementPosition(MapUp, 30f, 30f, new Vector2(145f, -85f)); SetUIElementPosition(MapEraserButton, 30f, 30f, new Vector2(120f, -25f)); SetUIElementPosition(MapClose, 30f, 60f, new Vector2(120f, -55f)); MapInteraction.InitMapButtons(InWorldGemSelect); break; } }
int[,] ImgSequences = { { 0, 0, 0, 0, 0 }, { 1, 2, 3, 2, 1 }, { 4, 5, 6, 5, 4 }, { 7, 8, 9, 8, 7 } };//blue 0,green 1, orange 2, red 3 public override void Start() { base.Start(); EyesGr = new GRLoader(GRLoader.EYES_GR); }
void PrepareDragonImages() { GRLoader dragonsGr = new GRLoader(GRLoader.DRAGONS_GR); Output = new Texture2D[dragonsGr.NoOfFileImages()]; for (int i = 0; i <= Output.GetUpperBound(0); i++) { switch (i) { case 2: case 3: case 4: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(1), 4, 0); break; case 5: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(1), 4, -1); break; case 6: case 7: case 8: case 9: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(1), 12, 10); break; case 11: case 12: case 13: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), ArtLoader.CreateBlankImage(37, 23), 0, 5); break; case 20: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(19), -1, -3); break; case 21: case 22: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(19), 0, 0); break; case 23: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(19), 0, -1); break; case 24: case 25: case 26: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(28), 3, 10); break; case 27: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), dragonsGr.LoadImageAt(28), 4, 10); break; case 29: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), ArtLoader.CreateBlankImage(34, 23), -4, 5); break; case 30: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), ArtLoader.CreateBlankImage(34, 23), -6, 9); break; case 31: Output [i] = ArtLoader.InsertImage(dragonsGr.LoadImageAt(i), ArtLoader.CreateBlankImage(34, 23), -4, 9); break; default: Output [i] = dragonsGr.LoadImageAt(i); break; } } }