示例#1
0
 void SetCustomClassWindow()
 {
     createCharCustomClassWindow          = new CreateCharCustomClass(uiManager);
     createCharCustomClassWindow.OnClose += CreateCharCustomClassWindow_OnClose;
     wizardStage = WizardStages.CustomClassBuilder;
     uiManager.PushWindow(createCharCustomClassWindow);
 }
示例#2
0
        protected override void Setup()
        {
            if (IsSetup)
            {
                return;
            }

            base.Setup();

            prevWindow = (CreateCharCustomClass)this.PreviousWindow;

            // Load native texture
            nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName);
            if (!nativeTexture)
            {
                throw new Exception("CreateCharSpecialAdvantage: Could not load native texture.");
            }

            // Create panel for window
            repPanel.Size = TextureReplacement.GetSize(nativeTexture, nativeImgName);
            repPanel.HorizontalAlignment     = HorizontalAlignment.Center;
            repPanel.VerticalAlignment       = VerticalAlignment.Middle;
            repPanel.BackgroundTexture       = nativeTexture;
            repPanel.BackgroundTextureLayout = BackgroundLayout.StretchToFill;
            repPanel.OnMouseClick           += RepPanel_OnMouseClick;
            NativePanel.Components.Add(repPanel);

            // Setup UI components
            font       = DaggerfallUI.DefaultFont;
            exitButton = DaggerfallUI.AddButton(exitButtonRect, repPanel);
            exitButton.OnMouseClick += ExitButton_OnMouseClick;
            exitButton.ClickSound    = DaggerfallUI.Instance.GetAudioClip(SoundClips.ButtonClick);

            // Setup adjustable bars
            SetupRepBars(merchantsGreenPanel, merchantsRedPanel, new Vector2(3f, 75f), new Vector2(3f, 77f), prevWindow.MerchantsRep);
            SetupRepBars(peasantsGreenPanel, peasantsRedPanel, new Vector2(36f, 75f), new Vector2(36f, 77f), prevWindow.PeasantsRep);
            SetupRepBars(scholarsGreenPanel, scholarsRedPanel, new Vector2(69f, 75f), new Vector2(69f, 77f), prevWindow.ScholarsRep);
            SetupRepBars(nobilityGreenPanel, nobilityRedPanel, new Vector2(102f, 75f), new Vector2(102f, 77f), prevWindow.NobilityRep);
            SetupRepBars(underworldGreenPanel, underworldRedPanel, new Vector2(135f, 75f), new Vector2(135f, 77f), prevWindow.UnderworldRep);

            // Setup text labels
            merchantsPtsLabel  = DaggerfallUI.AddTextLabel(font, new Vector2(18f, 143f), prevWindow.MerchantsRep.ToString(), repPanel);
            peasantsPtsLabel   = DaggerfallUI.AddTextLabel(font, new Vector2(50f, 143f), prevWindow.PeasantsRep.ToString(), repPanel);
            scholarsPtsLabel   = DaggerfallUI.AddTextLabel(font, new Vector2(82f, 143f), prevWindow.ScholarsRep.ToString(), repPanel);
            nobilityPtsLabel   = DaggerfallUI.AddTextLabel(font, new Vector2(114f, 143f), prevWindow.NobilityRep.ToString(), repPanel);
            underworldPtsLabel = DaggerfallUI.AddTextLabel(font, new Vector2(146f, 143f), prevWindow.UnderworldRep.ToString(), repPanel);
            distributePtsLabel = DaggerfallUI.AddTextLabel(font, new Vector2(64f, 173f), pointsToDistribute.ToString(), repPanel);

            IsSetup = true;
        }
示例#3
0
        void UpdateDifficultyAdjustment()
        {
            int total = 0;

            foreach (SpecialAdvDis s in advDisList)
            {
                total += s.difficulty;
            }

            CreateCharCustomClass prevWindow = (CreateCharCustomClass)this.PreviousWindow;

            if (isDisadvantages)
            {
                prevWindow.DisadvantageAdjust = total;
            }
            else
            {
                prevWindow.AdvantageAdjust = total;
            }
        }