public void SetBossParams(bool Visible, string name, string subtitle, float curenerg, float maxenerg, hudColors colors, hudColors.EnergyBarColors barColors) { //calculateMode = calculate; hudColors = colors; EnergyBarColors = barColors; visible = Visible; if (Visible) { bossBar.SetFilledColor(EnergyBarColors.filled); bossBar.SetShadowColor(EnergyBarColors.shadow); bossBar.SetEmptyColor(EnergyBarColors.empty); bossBar.SetColor2(Color.white); bossBar.SetFilledDrainSpeed(maxenerg); bossBar.SetCurrEnergy(curenerg, hudEnergyBar.ESetMode.Normal); bossBar.SetMaxEnergy(maxenerg); textBoss.text = name; textBossSub.text = subtitle; //if (bossBar.GetComponent<Image>().color.a != 1 ) //{ // Color a = new Color(bossBar.GetComponent<Image>().color.r, bossBar.GetComponent<Image>().color.g, bossBar.GetComponent<Image>().color.b, 1); // bossBar.GetComponent<Image>().color = a; // SamusPlugin.logger.Log(BepInEx.Logging.LogLevel.Message, "set bossBar image alpha to 1 manually"); //} } curEnergy = curenerg; maxEnergy = maxenerg; bossIni = true; }
// Start is called before the first frame update void Awake() { hudColors = new hudColors(false); string hudN = "ballHUD"; baseObject = gameObject.transform.Find(hudN).gameObject; bombDeco = gameObject.transform.Find(hudN + "/bombdeco").gameObject; bombIcon = gameObject.transform.Find(hudN + "/Bombs/Powerbomb/PBfill").gameObject.GetComponent <Image>(); bombDigits = gameObject.transform.Find(hudN + "/Text/PowerBombText").gameObject.GetComponent <Text>(); //Debug.Log(bombDigits); bombFilled = new List <Image>(); bombEmpty = new List <Image>(); for (int i = 0; i < 3; i++) { string path = hudN + "/Bombs/bomb" + (i + 1) + "/Bfill" + (i + 1); bombFilled.Add(gameObject.transform.Find(path).gameObject.GetComponent <Image>()); bombFilled[i].color = hudColors.ballBombFilled; path = hudN + "/Bombs/bomb" + (i + 1) + "/Bempty" + (i + 1); bombEmpty.Add(gameObject.transform.Find(path).gameObject.GetComponent <Image>()); bombEmpty[i].color = hudColors.ballBombEmpty; } bombDeco.GetComponent <Image>().color = hudColors.ballBombDeco; energyDeco = gameObject.transform.Find(hudN + "/energydeco").gameObject; energyDeco.GetComponent <Image>().color = hudColors.ballBombEnergyDeco; //SetBombParams(PbAmount, PbCapacity, AvailableBombs, true); ballini = false; }
public void SetBombParams(int PbAmount, int PbCapacity, int AvailableBombs, bool init, hudColors colors) { if (PbAmount != pbAmount || init) { //Debug.Log("PbAmount test: " + PbAmount); //Debug.Log("bombDigits test: " + bombDigits); bombDigits.text = PbAmount.ToString("D2"); pbAmount = PbAmount; UpdatePowerBombReadoutColors(); } if (pbCapacity != PbCapacity || init) { pbCapacity = PbCapacity; UpdatePowerBombReadoutColors(); } for (int i = 0; i < 3; i++) { bool lit = i < AvailableBombs; bombFilled[i].gameObject.SetActive(lit); } availableBombs = AvailableBombs; hudColors = colors; bombDeco.SetActive(pbCapacity > 0); if (init) { ballini = true; } }
void updateHudState() { if (character.skillLocator.utility.skillNameToken == "DG_SAMUS_UTILITY_DASH_NAME") { curState = EHudState.Combat; return; } inMorphBall = SkillStates.BaseStates.BaseSamus.morphBall; if (inMorphBall) { curState = EHudState.Ball; } else { curState = EHudState.Combat; } switch (curState) { case EHudState.Combat: hudcolors = combatHudColors; energyBar = combatEnergyBar; break; case EHudState.Ball: hudcolors = ballHudColors; energyBar = ballEnergyBar; break; case EHudState.None: break; } }
// Start is called before the first frame update void Awake() { ini = false; string path = "combatHud/Envirorment"; damagePulse = 0f; damagePulseTimer = 0f; arrowTimer = 0f; warningColorLerp = 0f; warningLerpAlpha = 0f; threatStatus = ThreatStatus.Normal; visible = true; iconTranslateRange = 342.5f; hudColors = new hudColors(true); //lhudTimer = new hudTimer(); threatStuff = gameObject.transform.Find(path).gameObject; threatIcon = new List <GameObject>(); foreach (Transform transform in threatStuff.transform.Find("EnIcon").GetComponentsInChildren <Transform>()) { threatIcon.Add(transform.gameObject); //Debug.Log(transform.gameObject + "[" + threatIcon.Count + "]"); } arrowDown = threatStuff.transform.Find("EnIcon/EnarrowDown").gameObject.GetComponent <Image>(); arrowUp = threatStuff.transform.Find("EnIcon/EnarrowUp").gameObject.GetComponent <Image>(); threatWarning = threatStuff.transform.Find("EnIcon/warningText").gameObject.GetComponent <Text>(); threatBar = threatStuff.transform.Find("EnBarBack/EnBar").gameObject.GetComponent <hudEnergyBar>(); //threatBar.initBars(threatBar.gameObject.GetComponent<Image>(), threatBar.gameObject.transform.parent.Find("EnBarShadow").gameObject.GetComponent<Image>()); //Debug.Log(threatBar); hasArrows = arrowUp != null && arrowDown != null; threatIcon[0].GetComponent <Image>().color = hudColors.threatIconColor; threatIconTrans = threatIcon[0].transform; threatBar.SetFilledColor(hudColors.threatBarFilled); //Debug.Log(threatBar.GetFilledColor()); threatBar.SetShadowColor(hudColors.threatBarShadow); //Debug.Log(threatBar.GetShadowColor()); threatBar.SetEmptyColor(hudColors.threatBarEmpty); //Debug.Log(threatBar.GetEmptyColor()); threatBar.SetTesselation(1f); threatBar.SetMaxEnergy(100f); threatBar.SetFilledDrainSpeed(9999f); threatBar.SetShadowDrainSpeed(9999f); threatBar.SetShadowDrainDelay(0f); threatBar.SetIsAlwaysResetTimer(false); if (threatWarning) { threatWarning.color = hudColors.threatWarningFont; threatWarning.gameObject.GetComponent <Outline>().effectColor = hudColors.threatWarningOutline; } //localMat = new Material(threatWarning.material); //threatWarning.material = localMat; debugIniMaxEnergy = threatBar.GetMaxEnergy(); ini = true; }
//float healthP; //hudEnergyBar.CalculateMode calculateMode; private void Awake() { combatHudColors = new hudColors(true); combatBarColors = combatHudColors.GetEnergyBarColors(); combatInitColors = combatHudColors.GetEnergyInitColors(); ballHudColors = new hudColors(false); ballBarColors = ballHudColors.GetEnergyBarColors(); ballInitColors = ballHudColors.GetEnergyInitColors(); }
// Start is called before the first frame update void Awake() { hudColors = new hudColors(true); changedColor = false; string combatVisorName = "combatVisor"; string combatHudName = "combatHud"; //for (int i = 0; i < gameObject.transform.childCount; i++) //{ // if (gameObject.transform.GetChild(i).name.StartsWith("combatVisor")) // combatVisorName = gameObject.transform.GetChild(i).name; // else if (gameObject.transform.GetChild(i).name.StartsWith("combatHud")) // combatHudName = gameObject.transform.GetChild(i).name; //} pivot = new List <GameObject>(); decos = new List <GameObject>(); combatHud = gameObject.transform.Find(combatHudName).gameObject; frame = gameObject.transform.Find(combatVisorName + "/BaseWidget_Pivot/basewidget_nonfunctional/basewidget_deco/basewidget_frame/model_frame/CMDL_E64E5DBA").gameObject; for (int i = 0; i < frame.GetComponent <MeshRenderer>().materials.Length; i++) { frame.GetComponent <MeshRenderer>().materials[i].color *= hudColors.hudFrameColor; } decos.Add(frame); foreach (Transform item in combatHud.GetComponentsInChildren <Transform>()) { if (item.name.StartsWith("energyLetter")) { decos.Add(item.gameObject); } } //decos.Add(gameObject.transform.Find(combatHudName + "/energy").gameObject); pivot.AddRange(decos); tickdec0s = new List <GameObject> { gameObject.transform.Find(combatHudName + "/Missiles/Mtick").gameObject, gameObject.transform.Find(combatHudName + "/Envirorment/Entick").gameObject }; pivot.AddRange(tickdec0s); for (int i = 0; i < tickdec0s.Count; i++) { tickdec0s[i].GetComponent <Image>().color = hudColors.tickDecoColor; } basePosition = frame.transform.localPosition; SetIsVisible(true); init = true; }
//Material localMat; // Start is called before the first frame update void Awake() { rendertimings = 0; arrowTimer = 0f; missileWarningAlpha = 0f; latestStatus = invStatus.Normal; missileWarningPulse = 0f; missileIconAltDeplete = 0f; missileIconIncrement = 0f; visible = true; IconTranslateRange = 342.5f; hudColors = new hudColors(true); string path = "combatHud/Missiles"; //hudType = HudType; //missileCapacity = MissileCapacity; //numMissiles = NumMissiles; //missilesActive = MissilesActive; missileIcon = gameObject.transform.Find(path + "/MIcon").gameObject.GetComponent <Image>(); missileDigits = gameObject.transform.Find(path + "/MIcon/count").gameObject.GetComponent <Text>(); missileBar = gameObject.transform.Find(path + "/MBarBack/MBar").gameObject.GetComponent <hudEnergyBar>(); missileWarning = gameObject.transform.Find(path + "/MIcon/depleted").gameObject.GetComponent <Text>(); arrowUp = gameObject.transform.Find(path + "/MIcon/arrowUp").gameObject.GetComponent <Image>(); arrowDown = gameObject.transform.Find(path + "/MIcon/arrowDown").gameObject.GetComponent <Image>(); hasArrows = arrowUp && arrowDown; iconTransform = missileIcon.transform; missileDigits.color = hudColors.missileDigitsFont; missileDigits.gameObject.GetComponent <Outline>().effectColor = hudColors.missileDigitsOutline; missileIcon.color = hudColors.missileIconColorInactive; missileBar.SetEmptyColor(hudColors.missileBarEmpty); missileBar.SetFilledColor(hudColors.missileBarFilled); missileBar.SetShadowColor(hudColors.missileBarShadow); missileBar.SetTesselation(1f); missileBar.SetMaxEnergy(5f); missileBar.SetFilledDrainSpeed(99f); missileBar.SetShadowDrainSpeed(20f); missileBar.SetShadowDrainDelay(0.7f); missileBar.SetIsAlwaysResetTimer(true); rIconLerp = 1f; missIni = false; if (missileWarning) { missileWarning.color = hudColors.missileWarningFont; missileWarning.gameObject.GetComponent <Outline>().effectColor = hudColors.missileWarningOutline; } //localMat = new Material(missileDigits.material); //missileDigits.material = localMat; latestStatus = GetInvStatus(); }
void Start() { baseHUD = gameObject; //energyIntf = gameObject.GetComponent<hudHealthInterface>(); //threatIntf = gameObject.GetComponent<hudThreat>(); //missileIntf = gameObject.GetComponent<hudMissiles>(); //decoIntf = gameObject.GetComponent<hudDeco>(); decoIntf.SetSize(); //helmetIntf = gameObject.GetComponent<hudHelmet>(); helmetIntf.SetSize(); //ballIntf = gameObject.GetComponent<hudBall>(); //bossEnergyIntf = gameObject.GetComponent<hudBossEnergy>(); combatHudColors = new hudColors(true); combatEnergyBar = combatHudColors.GetEnergyBarColors(true); ballHudColors = new hudColors(false); ballEnergyBar = ballHudColors.GetEnergyBarColors(false); timer = new hudTimer(); texts = new List <Text>(); foreach (Transform item in gameObject.transform.GetComponentsInChildren <Transform>(true)) { if (item.gameObject.GetComponent <Text>() != null) { texts.Add(item.gameObject.GetComponent <Text>()); //Debug.Log("added text: " + item.gameObject); } } foreach (Text item in texts) { localMat = new Material(item.material); item.material = localMat; } baseFrame = new List <Color>() { new Color(0.156863f, 0.156863f, 0.156863f), new Color(0.4f, 0.4f, 0.4f), new Color(0.8f, 0.8f, 0.8f) }; Color temp = new Color(0.294118f, 0.494118f, 0.639216f, 0.627451f); frameColorTest = new List <Color>() { baseFrame[0] * temp, baseFrame[1] * temp, baseFrame[2] * temp }; }
// Start is called before the first frame update void Awake() { hudColors = new hudColors(true); baseObject = gameObject.transform.GetChild(0).gameObject; path = baseObject.name; //baseObject = gameObject.transform.Find(path).gameObject; Pivot = gameObject.transform.Find(path + "/BaseWidget_Pivot").gameObject; helmet = new List <GameObject>(); helmet.Add(Pivot.transform.Find("BaseWidget_Helmet/model_bottomhel").gameObject); helmet.Add(Pivot.transform.Find("BaseWidget_Helmet/model_tophel3").gameObject); glow = Pivot.transform.Find("BaseWidget_Glow").gameObject; helmetLight = new List <GameObject>(); GameObject parent = Pivot.transform.Find("BaseWidget_Helmet/BaseWidget_HelmetLight").gameObject; List <GameObject> children = new List <GameObject>(); foreach (Transform child in parent.transform.GetComponentsInChildren <Transform>()) { if (child != parent.transform) { children.Add(child.gameObject); } } foreach (GameObject mesh in children) { if (mesh.GetComponent <MeshRenderer>() != null) { helmetLight.Add(mesh); } } //pivotPosition = foreach (GameObject item in helmetLight) { if (item.GetComponent <MeshRenderer>().materials.Length > 1) { foreach (Material mat in item.GetComponent <MeshRenderer>().materials) { mat.color = hudColors.helmetLightColor; } } else if (item.GetComponent <MeshRenderer>().materials.Length == 1) { item.GetComponent <MeshRenderer>().material.color = hudColors.helmetLightColor; } } }
void updateItems(hudTypes hud) { if (hud == hudTypes.combat) { //string path = "combatHud"; //cEnergyDigits = gameObject.transform.Find(path + "/EnergyBar/healthDigits").gameObject.GetComponent<Text>(); //List<Transform> tempList = new List<Transform>(); //tempList.AddRange(gameObject.transform.Find(path).GetComponentsInChildren<Transform>()); //foreach (Transform item in tempList) //{ // if (item.name.StartsWith("EnergyTankBack")) // { // cEmptyTanks.Add(item.gameObject.GetComponent<Image>()); // } // else if (item.name.StartsWith("EnergyTank") && !item.name.Contains("Back")) // { // cFilledTanks.Add(item.gameObject.GetComponent<Image>()); // } //} //cEnergyWarning = gameObject.transform.Find(path + "/EnergyBar/EnergyWarning").gameObject.GetComponent<Text>(); //cEnergyBar = gameObject.transform.Find("combatVisor/basewidget_energystuff/energybart01_energybar/HealthBack/HealthBar").gameObject.GetComponent<hudEnergyBar>(); cEnergyDigits = combatEnergyDigits; cEmptyTanks = combatEmptyTanks; cFilledTanks = combatFilledTanks; cEnergyWarning = combatEnergyWarning; cEnergyBar = combatEnergyBar; } else { //string path = "ballHUD"; //cEnergyDigits = gameObject.transform.Find(path + "/Text/healthText").gameObject.GetComponent<Text>(); //List<Transform> tempList = new List<Transform>(); //tempList.AddRange(gameObject.transform.Find(path + "/EnergyTanks").GetComponentsInChildren<Transform>()); //foreach (Transform item in tempList) //{ // if (item.name.StartsWith("empty")) // { // cEmptyTanks.Add(item.gameObject.GetComponent<Image>()); // } // else if (item.name.StartsWith("fill") && !item.name.Contains("empty")) // { // cFilledTanks.Add(item.gameObject.GetComponent<Image>()); // } //} //cEnergyWarning = gameObject.transform.Find(path + "/Text/EnergyWarning").gameObject.GetComponent<Text>(); //cEnergyBar = gameObject.transform.Find(path + "/healthBar/background/healthBar").gameObject.GetComponent<hudEnergyBar>(); cEnergyDigits = ballEnergyDigits; cEnergyBar = ballEnergyBar; cEmptyTanks = ballEmptyTanks; cFilledTanks = ballFilledTanks; cEnergyWarning = ballEnergyWarning; } if (hud == hudTypes.combat) { cHudColors = combatHudColors; cInitColors = combatInitColors; cBarColors = combatBarColors; } else { cHudColors = ballHudColors; cInitColors = ballInitColors; cBarColors = ballBarColors; } }