Пример #1
0
 public void UsageAndFunction(int windowId)
 {
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF1"), this.nameStyle);
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF2"), this.nameStyle);
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF3"), this.nameStyle);
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF4"), this.nameStyle);
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF5"), this.nameStyle);
     GUILayout.Label("・" + LocalisationFile.GetTranslatedString("UF6"), this.nameStyle);
     GUI.DragWindow();
 }
Пример #2
0
 public void MainWindow(int windowId)
 {
     this.hasCompliance = true;
     this.InspectBlocks();
     GUILayout.FlexibleSpace();
     GUILayout.Space(5f);
     GUILayout.BeginHorizontal();
     this.openURL = GUILayout.Button(LocalisationFile.GetTranslatedString("Link"));
     GUILayout.FlexibleSpace();
     this.playerStats = GUILayout.Toggle(this.playerStats, LocalisationFile.GetTranslatedString("PlayerStats"));
     GUILayout.Space(15f);
     this.uf = GUILayout.Toggle(this.uf, LocalisationFile.GetTranslatedString("UF"));
     GUILayout.Space(15f);
     this.minimise = GUILayout.Toggle(this.minimise, LocalisationFile.GetTranslatedString("Minimise"));
     GUILayout.EndHorizontal();
     GUI.DragWindow(new Rect(0, 0, 10000f, 20f));
 }
Пример #3
0
        void SetLanguage()
        {
            this.language = OptionsMaster.BesiegeConfig.Language;
            switch (this.language)
            {
            case "English":
            default:
                LocalisationFile.languageInt = 1;
                break;

            case "Japanese":
                LocalisationFile.languageInt = 2;
                break;
            }
            for (int i = 0; i < 6; i++)
            {
                this.translatedNames[i] = LocalisationFile.GetTranslatedString(typeNames[i]);
            }
        }
Пример #4
0
 public void StatusWindow(int windowId)
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(LocalisationFile.GetTranslatedString("Player"), this.defaultStyle, GUILayout.Width(this.labelWidth3));
     GUILayout.Label(LocalisationFile.GetTranslatedString("Machine"), this.defaultStyle, GUILayout.Width(this.labelWidth3));
     GUILayout.Label(LocalisationFile.GetTranslatedString("TankType"), this.defaultStyle, GUILayout.Width(this.labelWidth3));
     GUILayout.Label(LocalisationFile.GetTranslatedString("Compliance"), this.defaultStyle, GUILayout.Width(this.labelWidth3));
     GUILayout.EndHorizontal();
     GUILayout.Space(5f);
     foreach (var kvp in LJTMachine.MachineDic)
     {
         GUILayout.BeginHorizontal();
         GUILayout.Label(kvp.Key.Player.Name, this.defaultStyle, GUILayout.Width(this.labelWidth3));
         GUILayout.Label(kvp.Key.Name, this.defaultStyle, GUILayout.Width(this.labelWidth3));
         GUILayout.Label(LocalisationFile.GetTranslatedString(((TankType)kvp.Value.TankTypeInt).ToString()), this.defaultStyle, GUILayout.Width(this.labelWidth3));
         GUILayout.Label(kvp.Value.HasCompliance ? "OK" : "NO", kvp.Value.HasCompliance ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth3));
         GUILayout.EndHorizontal();
     }
     GUI.DragWindow();
 }
Пример #5
0
        public void InspectBlocks()
        {
            if (!this.machine)
            {
                GUILayout.Label(LocalisationFile.GetTranslatedString("Caution"), this.defaultStyle);
                return;
            }
            if (!this.minimise)
            {
                GUILayout.Space(5f);
                GUILayout.BeginHorizontal();
                this._tankTypeInt = GUILayout.SelectionGrid(_tankTypeInt, translatedNames, 3);
                if (this._tankTypeInt != (int)this._tankType)
                {
                    this.OnTypeChangeFromGUI(this._tankTypeInt);
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(5f);
                GUILayout.BeginHorizontal();
                GUILayout.Label(LocalisationFile.GetTranslatedString("Block"), this.nameStyle, GUILayout.Width(this.labelWidth1));
                GUILayout.Label(LocalisationFile.GetTranslatedString("Minimum"), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(LocalisationFile.GetTranslatedString("Maximum"), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(LocalisationFile.GetTranslatedString("Current"), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(LocalisationFile.GetTranslatedString("Power"), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(LocalisationFile.GetTranslatedString("Judge"), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.EndHorizontal();
                GUILayout.Space(5f);
            }
            foreach (BlockBehaviour BB in this.machine.BuildingBlocks)
            {
                if (!this.restrictedBlocksDic.ContainsKey((int)BB.Prefab.Type))
                {
                    continue;
                }
                this.restrictedBlocksDic[(int)BB.Prefab.Type].currentCount++;
                switch (BB.Prefab.Type)
                {
                case BlockType.Cannon:
                case BlockType.ShrapnelCannon:
                    if (this.restrictedBlocksDic[(int)BB.Prefab.Type].highestPowerValue < (BB as CanonBlock).StrengthSlider.Value)
                    {
                        this.restrictedBlocksDic[(int)BB.Prefab.Type].highestPowerValue = (BB as CanonBlock).StrengthSlider.Value;
                    }
                    continue;

                case BlockType.CogMediumPowered:
                case BlockType.Wheel:
                case BlockType.LargeWheel:
                    if (this.restrictedBlocksDic[(int)BB.Prefab.Type].highestPowerValue < (BB as CogMotorControllerHinge).SpeedSlider.Value)
                    {
                        this.restrictedBlocksDic[(int)BB.Prefab.Type].highestPowerValue = (BB as CogMotorControllerHinge).SpeedSlider.Value;
                    }
                    continue;

                case BlockType.Rocket:
                    if ((BB as TimedRocket).PowerSlider.Value <= 0.5f)
                    {
                        this.restrictedBlocksDic[(int)BB.Prefab.Type].currentCount--;
                    }
                    continue;

                case BlockType.Bomb:
                    if (BB.gameObject.GetComponent <WeakPointBomb>().isWeakPoint)
                    {
                        this.weakPointCount++;
                    }
                    continue;
                }
            }
            foreach (var kvp in this.restrictedBlocksDic)
            {
                int  min;
                int  max;
                int  current;
                bool powerFlag;
                bool judge;
                switch (kvp.Key)
                {
                case (int)BlockType.Propeller:
                    min                 = this.regulation.ChildBlockRestriction[kvp.Key].minNum;
                    max                 = this.regulation.ChildBlockRestriction[kvp.Key].maxNum;
                    current             = kvp.Value.currentCount + this.restrictedBlocksDic[(int)BlockType.SmallPropeller].currentCount;
                    judge               = powerFlag = kvp.Value.highestPowerValue <= this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[0];
                    judge              &= current >= min && current <= max;
                    this.hasCompliance &= judge;
                    if (this.minimise)
                    {
                        continue;
                    }
                    GUILayout.BeginHorizontal();
                    GUILayout.Label(ReferenceMaster.TranslateBlockName((BlockType)kvp.Key).ToUpper(), this.nameStyle, GUILayout.Width(this.labelWidth1));
                    GUILayout.Label(min.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(max.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(current.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Space(this.labelWidth2);
                    GUILayout.Label(judge ? "OK" : "NO", judge ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.EndHorizontal();
                    continue;

                case (int)BlockType.SmallPropeller:
                case (int)BlockType.BuildEdge:
                case (int)BlockType.BuildNode:
                    continue;

                case (int)BlockType.Cannon:
                    min     = this.regulation.ChildBlockRestriction[kvp.Key].minNum;
                    max     = this.regulation.ChildBlockRestriction[kvp.Key].maxNum;
                    current = kvp.Value.currentCount;
                    if (current == 0)
                    {
                        judge = powerFlag = kvp.Value.highestPowerValue <= this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[0];
                    }
                    else if (current <= max)
                    {
                        judge = powerFlag = kvp.Value.highestPowerValue <= this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[current - 1];
                    }
                    else
                    {
                        judge = powerFlag = false;
                    }
                    judge &= current >= min;
                    this.hasCompliance &= judge;
                    if (this.minimise)
                    {
                        continue;
                    }
                    GUILayout.BeginHorizontal();
                    GUILayout.Label((ReferenceMaster.TranslateBlockName((BlockType)kvp.Key).ToUpper()), this.nameStyle, GUILayout.Width(this.labelWidth1));
                    GUILayout.Label(min.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(max.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(current.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(powerFlag ? "OK" : "NO", powerFlag ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(judge ? "OK" : "NO", judge ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.EndHorizontal();
                    continue;

                case (int)BlockType.ShrapnelCannon:
                    min                 = this.regulation.ChildBlockRestriction[kvp.Key].minNum;
                    max                 = this.regulation.ChildBlockRestriction[kvp.Key].maxNum;
                    current             = kvp.Value.currentCount;
                    judge               = powerFlag = kvp.Value.highestPowerValue <= this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[0];
                    judge              &= current >= min && current <= max;
                    this.hasCompliance &= judge;
                    if (this.minimise)
                    {
                        continue;
                    }
                    GUILayout.BeginHorizontal();
                    GUILayout.Label(ReferenceMaster.TranslateBlockName((BlockType)kvp.Key).ToUpper(), this.nameStyle, GUILayout.Width(this.labelWidth1));
                    GUILayout.Label(min.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(max.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(current.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(powerFlag ? "OK" : "NO", powerFlag ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(judge ? "OK" : "NO", judge ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.EndHorizontal();
                    continue;

                default:
                    min                 = this.regulation.ChildBlockRestriction[kvp.Key].minNum;
                    max                 = this.regulation.ChildBlockRestriction[kvp.Key].maxNum;
                    current             = kvp.Value.currentCount;
                    judge               = powerFlag = kvp.Value.highestPowerValue <= this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[0];
                    judge              &= current >= min && current <= max;
                    this.hasCompliance &= judge;
                    if (this.minimise)
                    {
                        continue;
                    }
                    GUILayout.BeginHorizontal();
                    GUILayout.Label(ReferenceMaster.TranslateBlockName((BlockType)kvp.Key).ToUpper(), this.nameStyle, GUILayout.Width(this.labelWidth1));
                    GUILayout.Label(min.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(max.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.Label(current.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                    if (this.regulation.ChildBlockRestriction[kvp.Key].maxPowers[0] == 0)
                    {
                        GUILayout.Space(this.labelWidth2);
                    }
                    else
                    {
                        GUILayout.Label(powerFlag ? "OK" : "NO", powerFlag ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    }
                    GUILayout.Label(judge ? "OK" : "NO", judge ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                    GUILayout.EndHorizontal();
                    continue;
                }
            }
            if (!this.minimise)
            {
                GUILayout.Space(5f);
                GUILayout.BeginHorizontal();
                GUILayout.Label(LocalisationFile.GetTranslatedString("WeakPointBomb"), this.nameStyle, GUILayout.Width(this.labelWidth1));
                GUILayout.Label(1.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(1.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(this.weakPointCount.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Space(this.labelWidth2);
            }
            bool flag4 = this.weakPointCount == 1;

            this.hasCompliance &= flag4;
            if (!this.minimise)
            {
                GUILayout.Label(flag4 ? "OK" : "NO", flag4 ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.EndHorizontal();
                GUILayout.Space(5f);
                GUILayout.BeginHorizontal();
                GUILayout.Label(LocalisationFile.GetTranslatedString("Machine(All)"), this.nameStyle, GUILayout.Width(this.labelWidth1));
                GUILayout.Label(0.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(this.regulation.MaxBlockCount.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Label(this.machine.DisplayBlockCount.ToString(), this.defaultStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.Space(this.labelWidth2);
            }
            bool flag2 = this.regulation.MaxBlockCount >= this.machine.DisplayBlockCount;

            this.hasCompliance &= flag2;
            if (!this.minimise)
            {
                GUILayout.Label(this.hasCompliance ? "OK" : "NO", this.hasCompliance ? this.defaultStyle : this.noStyle, GUILayout.Width(this.labelWidth2));
                GUILayout.EndHorizontal();
            }
        }
Пример #6
0
 public void OnGUI()
 {
     if (StatMaster.SimulationState >= SimulationState.GlobalSimulation || StatMaster.inMenu || StatMaster.isMainMenu || (StatMaster.SimulationState == SimulationState.SpectatorMode && StatMaster.isMP))
     {
         return;
     }
     if (hudToggle)
     {
         foreach (var kvp in this.restrictedBlocksDic)
         {
             kvp.Value.currentCount      = 0;
             kvp.Value.highestPowerValue = 0;
         }
         this.weakPointCount = 0;
         if (StatMaster.isMP)
         {
             LJTMachine.MachineDic[PlayerMachine.GetLocal()].HasCompliance = this.hasCompliance;
         }
         this.windowRect = GUILayout.Window(32575339, this.windowRect, new GUI.WindowFunction(this.MainWindow), LocalisationFile.GetTranslatedString("Title"));
         if (this.uf)
         {
             this.windowRect2 = GUILayout.Window(32575340, this.windowRect2, new GUI.WindowFunction(this.UsageAndFunction), LocalisationFile.GetTranslatedString("UF"));
         }
         if (this.playerStats)
         {
             this.windowRect3 = GUILayout.Window(32575341, this.windowRect3, new GUI.WindowFunction(this.StatusWindow), LocalisationFile.GetTranslatedString("PlayerStats"));
         }
     }
 }