/// <summary>
 /// Constructs an RCObjectPlacementDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCObjectPlacementDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.objectPlacementMaskGreen = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ObjectPlacementMaskGreen");
     this.objectPlacementMaskRed   = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ObjectPlacementMaskRed");
     this.lastKnownMousePosition   = RCIntVector.Undefined;
 }
Example #2
0
        /// <summary>
        /// Called if loading the resources has been finished.
        /// </summary>
        private void LoadingFinished(IUIBackgroundTask sender, object args)
        {
            this.loadingTask.Finished -= this.LoadingFinished;
            this.loadingTask.Failed   -= this.LoadingFailed;

            if (this.LoadFinished != null)
            {
                this.LoadFinished();
            }

            this.loadingTask  = null;
            this.currentPhase = ShowPhase.Normal;
            UIWorkspace.Instance.SetDefaultMousePointer(UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.NormalPointer"));

            UIFont menuFont = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B");

            string[] menuPoints = new string[3] {
                START_GAME_MENUPOINT, CREDITS_MENUPOINT, EXIT_MENUPOINT
            };
            this.menuPanel = new RCMainMenuPanel(new RCIntRectangle((UIWorkspace.Instance.WorkspaceSize.X - MENU_PANEL_WIDTH) / 2,
                                                                    100,
                                                                    MENU_PANEL_WIDTH,
                                                                    (menuFont.CharTopMaximum + menuFont.CharBottomMaximum + 1) * menuPoints.Length),
                                                 menuPoints);
            this.RegisterPanel(this.menuPanel);

            this.menuPanel[START_GAME_MENUPOINT].Pressed += this.OnMenupointPressed;
            this.menuPanel[CREDITS_MENUPOINT].Pressed    += this.OnMenupointPressed;
            this.menuPanel[EXIT_MENUPOINT].Pressed       += this.OnMenupointPressed;

            this.menuPanel.Show();
        }
Example #3
0
        /// <summary>
        /// Constructs a details panel.
        /// </summary>
        /// <param name="productIconSprites">The product icon sprite group.</param>
        /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
        /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
        /// <param name="backgroundSprite">Name of the sprite resource that will be the background of this panel or null if there is no background.</param>
        public RCDetailsPanel(ISpriteGroup productIconSprites, RCIntRectangle backgroundRect, RCIntRectangle contentRect, string backgroundSprite)
            : base(backgroundRect, contentRect, ShowMode.Appear, HideMode.Disappear, 0, 0, backgroundSprite)
        {
            if (productIconSprites == null)
            {
                throw new ArgumentNullException("productIconSprites");
            }

            this.textFont        = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5");
            this.objectTypeTexts = new Dictionary <int, UIString>();

            this.isConnected                 = false;
            this.backgroundTask              = null;
            this.hpIndicatorSprites          = new Dictionary <MapObjectConditionEnum, SpriteGroup>();
            this.productIconSprites          = productIconSprites;
            this.currentCustomContent        = null;
            this.buttonArray                 = new RCSelectionButton[MAX_SELECTION_SIZE];
            this.productionLineDisplay       = null;
            this.constructionProgressDisplay = null;
            this.supplyDetailsDisplay        = null;
            this.resourceAmountDisplay       = null;
            this.weaponDetailsDisplay        = null;
            this.multiplayerService          = null;
            this.selectionDetailsView        = null;
            this.mapObjectDetailsView        = null;
            this.productionDetailsView       = null;
            this.selectionButtonsAdded       = false;
            this.hpTexts    = new Dictionary <MapObjectConditionEnum, UIString>();
            this.energyText = null;
        }
Example #4
0
        public MySensitiveObject(RCIntVector position,
                                 RCIntRectangle range,
                                 string name,
                                 RCColor basicColor,
                                 RCColor highColor)
            : base(position, range)
        {
            this.nameStrBasic    = new UIString(name, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6"), new RCIntVector(2, 2), RCColor.WhiteHigh);
            this.nameStrHigh     = new UIString(name, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6"), new RCIntVector(2, 2), RCColor.LightRed);
            this.backgroundBasic = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(basicColor, this.Range.Size, new RCIntVector(2, 2));
            this.backgroundHigh  = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(highColor, this.Range.Size, new RCIntVector(2, 2));

            this.backgroundBasic.Upload();
            this.backgroundHigh.Upload();

            this.name          = name;
            this.isHighlighted = false;
            this.activatorBtn  = UIMouseButton.Undefined;

            this.MouseSensor.Enter      += this.OnEnter;
            this.MouseSensor.Leave      += this.OnLeave;
            this.MouseSensor.ButtonDown += this.OnButtonDown;
            this.MouseSensor.ButtonUp   += this.OnButtonUp;
            this.MouseSensor.Wheel      += this.OnWheel;
            this.MouseSensor.Move       += this.OnMove;
        }
Example #5
0
 /// <summary>
 /// Called by the framework on updates.
 /// </summary>
 private void UpdateHdl()
 {
     if (this.currentPhase == ShowPhase.OnlyBackground)
     {
         if (UIRoot.Instance.GraphicsPlatform.RenderLoop.TimeSinceStart - this.firstActivationTime >
             START_TITLE_ANIMATION)
         {
             this.currentPhase = ShowPhase.AnimatingTitle;
             this.titleAnimation.Reset(false);
             this.titleAnimation.Start();
         }
     }
     else if (this.currentPhase == ShowPhase.AnimatingTitle)
     {
         if (this.titleAnimation.CurrentTimepoint > this.titleAnimation.Duration)
         {
             this.currentPhase = ShowPhase.Loading;
             this.titleAnimation.Stop();
             UIRoot.Instance.GraphicsPlatform.RenderLoop.FrameUpdate -= this.UpdateHdl;
             this.loadingTask           = UIResourceManager.LoadResourceGroupAsync("RC.App.CommonResources");
             this.loadingTask.Finished += this.LoadingFinished;
             this.loadingTask.Failed   += this.LoadingFailed;
         }
     }
 }
Example #6
0
        /// <summary>
        /// Constructs an RCSelectGamePage instance.
        /// </summary>
        public RCSelectGamePage()
            : base()
        {
            this.background    = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.PlanetBackground");
            this.okButtonPanel = new RCNavButtonPanel(new RCIntRectangle(220, 139, 100, 32), new RCIntRectangle(0, 17, 81, 15),
                                                      UIPanel.ShowMode.DriftFromRight, UIPanel.HideMode.DriftToRight,
                                                      300, 300,
                                                      "RC.App.Sprites.OkBtnPanel",
                                                      "Ok");

            this.cancelButtonPanel = new RCNavButtonPanel(new RCIntRectangle(229, 155, 91, 35), new RCIntRectangle(0, 17, 82, 15),
                                                          UIPanel.ShowMode.DriftFromBottom, UIPanel.HideMode.DriftToBottom,
                                                          300, 300,
                                                          "RC.App.Sprites.CancelBtnPanel",
                                                          "Cancel");

            this.selectGamePanel = new RCSelectGamePanel(new RCIntRectangle(0, 0, 180, 159), new RCIntRectangle(23, 45, 157, 114),
                                                         UIPanel.ShowMode.DriftFromLeft, UIPanel.HideMode.DriftToLeft,
                                                         300, 300,
                                                         "RC.App.Sprites.LeftMediumPanel1");

            this.gameInfoPanel = new RCGameInfoPanel(new RCIntRectangle(193, 0, 127, 139), new RCIntRectangle(0, 20, 117, 119),
                                                     UIPanel.ShowMode.DriftFromRight, UIPanel.HideMode.DriftToRight,
                                                     300, 300,
                                                     "RC.App.Sprites.RightMediumPanel");

            this.RegisterPanel(this.okButtonPanel);
            this.RegisterPanel(this.cancelButtonPanel);
            this.RegisterPanel(this.selectGamePanel);
            this.RegisterPanel(this.gameInfoPanel);

            this.okButtonPanel.NavigationButton.Pressed     += this.OnButtonPressed;
            this.cancelButtonPanel.NavigationButton.Pressed += this.OnButtonPressed;
            this.selectGamePanel.CreateGameButton.Pressed   += this.OnButtonPressed;
        }
Example #7
0
        /// <summary>
        /// Sets a new list of items to be displayed in this listbox.
        /// </summary>
        /// <param name="itemStrings">The list of the items to be displayed.</param>
        public void SetItems(string[] itemStrings)
        {
            if (itemStrings == null)
            {
                throw new ArgumentNullException("itemStrings");
            }

            for (int i = 0; i < this.items.Length; i++)
            {
                this.items[i].Dispose();
                this.highlightedItems[i].Dispose();
                this.disabledItems[i].Dispose();
            }

            this.items            = new UIString[itemStrings.Length];
            this.highlightedItems = new UIString[itemStrings.Length];
            this.disabledItems    = new UIString[itemStrings.Length];
            this.itemStrings      = new string[itemStrings.Length];

            for (int i = 0; i < itemStrings.Length; i++)
            {
                this.items[i]            = new UIString(itemStrings[i], UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5"), UIWorkspace.Instance.PixelScaling, RCColor.Green);
                this.highlightedItems[i] = new UIString(itemStrings[i], UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5"), UIWorkspace.Instance.PixelScaling, RCColor.LightGreen);
                this.disabledItems[i]    = new UIString(itemStrings[i], UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5"), UIWorkspace.Instance.PixelScaling, RCColor.White);
                this.itemStrings[i]      = itemStrings[i];
            }

            this.ItemCount = itemStrings.Length;
        }
        /// <summary>
        /// Constructs a minimap display control at the given position with the given size.
        /// </summary>
        /// <param name="isoTileSpriteGroup">Reference to the sprites of the isometric tile types.</param>
        /// <param name="terrainObjectSpriteGroup">Reference to the sprites of the terrain object types.</param>
        /// <param name="position">The position of the minimap display control.</param>
        /// <param name="size">The size of the minimap display control.</param>
        public RCMinimapDisplay(ISpriteGroup isoTileSpriteGroup, ISpriteGroup terrainObjectSpriteGroup, RCIntVector position, RCIntVector size)
            : base(position, size)
        {
            if (isoTileSpriteGroup == null)
            {
                throw new ArgumentNullException("isoTileSpriteGroup");
            }
            if (terrainObjectSpriteGroup == null)
            {
                throw new ArgumentNullException("terrainObjectSpriteGroup");
            }

            this.minimapView                      = null;
            this.minimapScanner                   = null;
            this.scannerStatus                    = ScannerStatusEnum.Inactive;
            this.mouseHandler                     = null;
            this.showAttackSignalsFlag            = false;
            this.timeSinceAttackSignalFlagChanged = 0;
            this.spriteBuffer                     = null;
            this.isoTileSpriteGroup               = isoTileSpriteGroup;
            this.terrainObjectSpriteGroup         = terrainObjectSpriteGroup;

            this.connectionStatus        = ConnectionStatusEnum.Offline;
            this.backgroundTask          = null;
            this.stopBackgroundTaskEvent = null;
            this.newJobEvent             = null;
            this.jobQueue = new Fifo <IMinimapBackgroundJob>();

            this.crosshairsPointer   = UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.CrosshairsPointer");
            this.windowLocationBrush = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.WhiteHigh, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.windowLocationBrush.Upload();
        }
Example #9
0
 /// <summary>
 /// Constructs an RCSelectionBoxDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCSelectionBoxDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.selectionBoxPointer = UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.SelectionBoxPointer");
     this.crosshairsPointer   = UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.CrosshairsPointer");
     this.selectionBoxBrush   = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightGreen, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
     this.selectionBoxBrush.Upload();
 }
 /// <summary>
 /// Constructs an RCIsoTileHighlightDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCIsoTileHighlightDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.mapTerrainView           = null;
     this.highlightIsoTile         = false;
     this.isotileHighlightedSprite = UIResourceManager.GetResource <UISprite>("RC.MapEditor.Sprites.IsotileHighlighted");
     this.isotileNormalSprite      = UIResourceManager.GetResource <UISprite>("RC.MapEditor.Sprites.IsotileNormal");
     this.lastKnownMousePosition   = RCIntVector.Undefined;
 }
Example #11
0
 /// <summary>
 /// Creates an RCAppPanel instance.
 /// </summary>
 /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
 /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
 /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param>
 /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param>
 /// <param name="appearDuration">
 /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case
 /// of ShowMode.Appear.
 /// </param>
 /// <param name="disappearDuration">
 /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case
 /// of HideMode.Disappear.
 /// </param>
 /// <param name="backgroundSprite">
 /// Name of the sprite resource that will be the background of this panel or null if there is no background.
 /// </param>
 /// <remarks>
 /// The backgroundRect shall entirely contain the contentRect.
 /// The origin of the panel's coordinate system will be the top-left corner of contentRect.
 /// The range rectangle of the panel will be backgroundRect relative to contentRect.
 /// The clip rectangle of the panel will be contentRect in the panel's coordinate system.
 /// </remarks>
 public RCAppPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect,
                   ShowMode showMode, HideMode hideMode,
                   int appearDuration, int disappearDuration,
                   string backgroundSprite)
     : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration)
 {
     this.StatusChanged += this.OnPanelStatusChanged;
     this.background     = backgroundSprite != null?UIResourceManager.GetResource <UISprite>(backgroundSprite) : null;
 }
Example #12
0
 /// <summary>
 /// Creates an RCSelectMapPanel instance.
 /// </summary>
 /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
 /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
 /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param>
 /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param>
 /// <param name="appearDuration">
 /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case
 /// of ShowMode.Appear.
 /// </param>
 /// <param name="disappearDuration">
 /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case
 /// of HideMode.Disappear.
 /// </param>
 /// <param name="backgroundSprite">
 /// Name of the sprite resource that will be the background of this panel or null if there is no background.
 /// </param>
 public RCSelectMapPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect,
                         ShowMode showMode, HideMode hideMode,
                         int appearDuration, int disappearDuration,
                         string backgroundSprite)
     : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite)
 {
     this.selectMapTitle = new UIString(SELECT_MAP_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"),
                                        UIWorkspace.Instance.PixelScaling, RCColor.LightBlue);
 }
Example #13
0
 /// <summary>
 /// Constructs an RCMenuButton with the given text.
 /// </summary>
 public RCMenuButton(string text, RCIntRectangle buttonRect) : base(buttonRect.Location, buttonRect.Size)
 {
     this.menuButtonFont  = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B");
     this.normalText      = new UIString(text, this.menuButtonFont, UIWorkspace.Instance.PixelScaling, new RCColor(220, 220, 220));
     this.highlightedText = new UIString(text, this.menuButtonFont, UIWorkspace.Instance.PixelScaling, RCColor.White);
     this.textPosition    = new RCIntVector((this.Range.Width - this.normalText.Width) / 2,
                                            (this.Range.Height - (this.menuButtonFont.CharBottomMaximum + this.menuButtonFont.CharTopMaximum + 1)) / 2 +
                                            this.menuButtonFont.CharTopMaximum);
 }
 /// <summary>
 /// Constructs an RCResourceAmountTooltip extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCResourceAmountTooltip(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.mapObjectDetailsView = null;
     this.objectID             = -1;
     this.drawPosition         = RCIntVector.Undefined;
     this.stringToRender       = new UIString("R:{0}", UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5"), UIWorkspace.Instance.PixelScaling, RCColor.White);
     this.backgroundBrush      = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Black, new RCIntVector(1, this.stringToRender.Font.MinimumLineHeight), UIWorkspace.Instance.PixelScaling);
     this.backgroundBrush.Upload();
 }
Example #15
0
 /// <summary>
 /// Creates an RCSelectGamePanel instance.
 /// </summary>
 /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
 /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
 /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param>
 /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param>
 /// <param name="appearDuration">
 /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case
 /// of ShowMode.Appear.
 /// </param>
 /// <param name="disappearDuration">
 /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case
 /// of HideMode.Disappear.
 /// </param>
 /// <param name="backgroundSprite">
 /// Name of the sprite resource that will be the background of this panel or null if there is no background.
 /// </param>
 public RCSelectGamePanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect,
                          ShowMode showMode, HideMode hideMode,
                          int appearDuration, int disappearDuration,
                          string backgroundSprite)
     : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite)
 {
     this.selectGameTitle = new UIString(SELECT_GAME_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"),
                                         UIWorkspace.Instance.PixelScaling, RCColor.LightBlue);
     this.createGameButton = new RCMenuButton(CREATE_GAME_BUTTON, new RCIntRectangle(0, 99, 85, 15));
     this.AddControl(this.createGameButton);
 }
Example #16
0
 public MySensitiveAnimObject(RCIntVector position,
                              RCIntRectangle range,
                              string name,
                              RCColor basicColor,
                              RCColor highColor)
     : base(position, range, name, basicColor, highColor)
 {
     this.anim = UIResourceManager.GetResource <UIAnimation>("RC.App.Animations.MainMenuTitleAnim");
     this.anim.Reset(true);
     this.anim.Start();
 }
Example #17
0
        static void Test6()
        {
            Assembly xnaPlugin = Assembly.Load("RC.UI.XnaPlugin, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");

            new UIRoot();
            UIRoot.Instance.LoadPlugins(xnaPlugin);
            UIRoot.Instance.InstallPlugins();
            UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6").GetFontSprite(new RCIntVector(6, 3), new RCColor(255, 0, 0)).Save("c255_0_0_ps6_3.png");
            UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6").GetFontSprite(new RCIntVector(2, 3), new RCColor(0, 255, 0)).Save("c0_255_0_ps2_3.png");
            UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6").GetFontSprite(new RCIntVector(4, 4), new RCColor(0, 0, 255)).Save("c0_0_255_ps4_4.png");
        }
Example #18
0
 /// <summary>
 /// Creates an RCRegistryPanel instance.
 /// </summary>
 /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
 /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
 /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param>
 /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param>
 /// <param name="appearDuration">
 /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case
 /// of ShowMode.Appear.
 /// </param>
 /// <param name="disappearDuration">
 /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case
 /// of HideMode.Disappear.
 /// </param>
 /// <param name="backgroundSprite">
 /// Name of the sprite resource that will be the background of this panel or null if there is no background.
 /// </param>
 public RCRegistryPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect,
                        ShowMode showMode, HideMode hideMode,
                        int appearDuration, int disappearDuration,
                        string backgroundSprite)
     : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite)
 {
     this.registryTitle = new UIString(REGISTRY_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"),
                                       UIWorkspace.Instance.PixelScaling, RCColor.LightBlue);
     this.newIdButton  = new RCMenuButton(NEW_ID_BUTTON, new RCIntRectangle(0, 99, 85, 15));
     this.deleteButton = new RCMenuButton(DELETE_BUTTON, new RCIntRectangle(88, 99, 66, 15));
     this.AddControl(this.newIdButton);
     this.AddControl(this.deleteButton);
 }
Example #19
0
 /// <summary>
 /// Constructs an RCMainMenuPage.
 /// </summary>
 public RCMainMenuPage()
 {
     this.currentPhase         = ShowPhase.OnlyBackground;
     this.firstActivationTime  = 0;
     this.hasBeenActivatedOnce = false;
     this.loadingTask          = null;
     this.background           = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.MainMenuBackground");
     this.titleAnimation       = UIResourceManager.GetResource <UIAnimation>("RC.App.Animations.MainMenuTitleAnim");
     this.headerFooterFont     = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6");
     this.loadingFont          = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font7");
     this.headerString         = new UIString("DAVID MOLDVAI ENTERTAINMENT PRESENTS:", this.headerFooterFont, UIWorkspace.Instance.PixelScaling, new RCColor(220, 220, 220));
     this.footerString         = new UIString("COPYRIGHT 1986", this.headerFooterFont, UIWorkspace.Instance.PixelScaling, new RCColor(220, 220, 220));
     this.loadingString        = new UIString("Loading...", this.loadingFont, UIWorkspace.Instance.PixelScaling, new RCColor(220, 220, 220));
 }
Example #20
0
    private void TickResources()
    {
        UpdateROC();

        resPool.AddResource(ResourceStockpile.ResourceType.Food, FoodRateOfChange);
        resPool.AddResource(ResourceStockpile.ResourceType.Gasses, GasesRateOfChange);
        resPool.AddResource(ResourceStockpile.ResourceType.Metals, MetalsRateOfChange);

        UIResourceManager.GetInstance().SetAllROCs(GasesRateOfChange, MetalsRateOfChange, FoodRateOfChange);
        UIResourceManager.GetInstance().SetAll(resPool.gasses, resPool.metals, resPool.food);

        currentTime = Time.time;
        StartCoroutine(ResourceTick());
    }
Example #21
0
    // Start is called before the first frame update
    void Start()
    {
        UIResourceManager UIResMan = UIResourceManager.GetInstance();

        shipMan = GetComponent <ShipManager>();

        resPool.AddResource(0, 100); //TODO: Get these from setup

        UIResMan.SetGasText(100);
        UIResMan.SetFoodText(100);
        UIResMan.SetMetalText(100);

        currentTime = Time.time;
        StartCoroutine(ResourceTick());
    }
Example #22
0
    public GameApp()
    {
        msInstance = this;

        mEventSystem         = new EventSystem();
        mSceneManager        = new SceneManager();
        mWindowManager       = new WindowManager();
        mDataManager         = new DataManager();
        mResourceManager     = new ResourceManager();
        mToucheManager       = new TouchManager();
        mAIFactory           = new AIFactory();
        mItemManage          = new ItemManager();
        mGMHandler           = new GMHandler();
        mModuleManager       = new ModuleManager();
        mSoundManager        = new SoundManager();
        mDropManager         = new DropManager();
        mConditionManager    = new ConditionManager();
        mStageDataManager    = new StageDataManager();
        mPlayerController    = new PlayerController();
        mBloodUIManager      = new BloodUIManager();
        mBossBloodUIManager  = new BossBloodUIManager();
        mPlayerDataPool      = new PlayerDataPool();
        mYesOrNoMgr          = new YesOrNoBoxManager();
        mUIEffectMgr         = new UIEffectManager();
        mInputSystem         = new InputSystem();
        mStoryManager        = new StoryManager();
        mPromptManager       = new PromptUIManager();
        mPaoPaoManager       = new PaoPaoManager();
        mGuideManager        = new GuideManager();
        mAnimationManager    = new AnimationManager();
        mPlayerHeadUIManager = new PlayerHeadUIManager();
        mUIResourceManager   = new UIResourceManager();
        mAnnounceItemManager = new AnnounceItemManager();
        mPopTipManager       = new PopTipManager();
        mQuackUIManager      = new QuackUIManager();
        mEggManager          = new EggManager();
        mShopManager         = new ShopManager();
        mStrFilterManager    = new StrFilterManager();
        mFightGradeManager   = new FightGradeManager();
        mMailItemManager     = new MailItemManager();
        mSettingManager      = new SettingManager();
        mZhushouManager      = new ZhushouManager();
        mOtherDataPool       = new OtherDataPool();
        mActivityManager     = new ActivityManager();
        mLoadingManager      = new LoadingManager();
        mChargeItemManager   = new ChargeItemManager();
        mChargeMsgManager    = new ChargeMsgManager();
    }
Example #23
0
        /// <summary>
        /// Constructs an RCListBox instance.
        /// </summary>
        /// <param name="position">The position of the RCListBox.</param>
        /// <param name="width">The width of the RCListBox.</param>
        /// <param name="visibleItemCount">
        /// The maximum number of items that can be visible in the listbox at a given time. If the number of
        /// items in the listbox is greater a vertical scrollbar is displayed along the right side of the control.
        /// </param>
        /// <param name="timeBetweenScrolls">
        /// The minimum time should be elapsed between scrolling the listbox in milliseconds.
        /// </param>
        public RCListBox(RCIntVector position, int width, int visibleItemCount, int timeBetweenScrolls)
            : base(position, new RCIntVector(width, HEIGHT), visibleItemCount, timeBetweenScrolls)
        {
            if (width <= TEXT_PADDING_LEFT + TEXT_PADDING_RIGHT)
            {
                throw new ArgumentOutOfRangeException("width", string.Format("Width must be at least {0}!", TEXT_PADDING_LEFT + TEXT_PADDING_RIGHT + 1));
            }

            this.items            = new UIString[0];
            this.highlightedItems = new UIString[0];
            this.disabledItems    = new UIString[0];
            this.itemStrings      = new string[0];
            this.textPartWidth    = width - TEXT_PADDING_LEFT - TEXT_PADDING_RIGHT;

            this.controlSprite = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ListBox");
        }
Example #24
0
        public static void ClassInitialize(TestContext context)
        {
            ConfigurationManager.Initialize("..\\..\\..\\..\\config\\RC.UI.Test\\RC.UI.Test.root");
            //ConstantsTable.Add("RC.App.Version", "1.0.0.0", "STRING");

            UIRoot   root      = new UIRoot();
            Assembly xnaPlugin = Assembly.Load("RC.UI.XnaPlugin, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");

            root.LoadPlugins(xnaPlugin);
            root.InstallPlugins();
            UIWorkspace workspace = new UIWorkspace(new RCIntVector(1024, 768), new RCIntVector(1024, 768));

            UIResourceManager.LoadResourceGroup("RC.App.SplashScreen");
            UIResourceManager.LoadResourceGroup("RC.App.CommonResources");
            Directory.CreateDirectory(OUTPUT_DIR);
        }
Example #25
0
        /// <summary>
        /// Constructs a resource bar.
        /// </summary>
        /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param>
        /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param>
        /// <param name="backgroundSprite">Name of the sprite resource that will be the background of this panel or null if there is no background.</param>
        public RCResourceBar(RCIntRectangle backgroundRect, RCIntRectangle contentRect, string backgroundSprite)
            : base(backgroundRect, contentRect, ShowMode.Appear, HideMode.Disappear, 0, 0, backgroundSprite)
        {
            this.multiplayerService = ComponentManager.GetInterface <IMultiplayerService>();

            this.textFont               = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5");
            this.mineralsText           = new UIString("{0}", this.textFont, UIWorkspace.Instance.PixelScaling, RCColor.White);
            this.vespeneGasText         = new UIString("{0}", this.textFont, UIWorkspace.Instance.PixelScaling, RCColor.White);
            this.normalUsedSupplyText   = new UIString("{0}", this.textFont, UIWorkspace.Instance.PixelScaling, RCColor.White);
            this.criticalUsedSupplyText = new UIString("{0}", this.textFont, UIWorkspace.Instance.PixelScaling, RCColor.LightRed);
            this.totalSupplyText        = new UIString("/{0}", this.textFont, UIWorkspace.Instance.PixelScaling, RCColor.White);

            this.playerView        = null;
            this.mineralsTracker   = null;
            this.vespeneGasTracker = null;
        }
Example #26
0
        public MyButton(RCIntVector position,
                        RCIntVector size,
                        RCColor basicColor,
                        RCColor highlightedColor,
                        RCColor disabledColor,
                        string text)
            : base(position, size)
        {
            this.textStr               = new UIString(text, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font6"), new RCIntVector(2, 2), RCColor.Black);
            this.basicBackground       = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(basicColor, this.Range.Size - new RCIntVector(2, 2), new RCIntVector(2, 2));
            this.highlightedBackground = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(highlightedColor, this.Range.Size - new RCIntVector(2, 2), new RCIntVector(2, 2));
            this.disabledBackground    = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(disabledColor, this.Range.Size - new RCIntVector(2, 2), new RCIntVector(2, 2));

            this.basicBackground.Upload();
            this.highlightedBackground.Upload();
            this.disabledBackground.Upload();
        }
Example #27
0
        /// <summary>
        /// Constructs a construction progress display control at the given position with the given size.
        /// </summary>
        /// <param name="position">The position of the construction progress display control.</param>
        /// <param name="size">The size of the construction progress display control.</param>
        public RCConstructionProgressDisplay(RCIntVector position, RCIntVector size)
            : base(position, size)
        {
            IViewService viewService = ComponentManager.GetInterface <IViewService>();

            this.productionDetailsView = viewService.CreateView <IProductionDetailsView>();

            this.progressBarSprite = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ProductionProgressBar");
            this.progressBarBrush  = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Green, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.progressBarBrush.Upload();

            UIFont textFont = UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5");

            this.underConstructionText = new UIString("Under Construction", textFont, UIWorkspace.Instance.PixelScaling, RCColor.White);
            this.textPosition          = new RCIntVector(
                (PROGRESSBAR_INNER_RECT.Left + PROGRESSBAR_INNER_RECT.Right - this.underConstructionText.Width) / 2,
                PROGRESSBAR_SPRITE_POS.Y - this.underConstructionText.Font.CharBottomMaximum - 1);
        }
Example #28
0
 /// <summary>
 /// Creates a vertical or horizontal scrollbar with custom settings.
 /// </summary>
 /// <param name="position">The position of the upper-left corner of the scrollbar.</param>
 /// <param name="length">The length of the scrollbar.</param>
 /// <param name="settings">The settings of the scrollbar.</param>
 public RCScrollBar(RCIntVector position, int length, Settings settings)
     : base(position,
            settings.Alignment == Alignment.Horizontal ? new RCIntVector(length, RCScrollBar.WIDTH) : new RCIntVector(RCScrollBar.WIDTH, length),
            new UIScrollBar.Settings()
 {
     Alignment            = settings.Alignment == Alignment.Horizontal ? UIScrollBar.Alignment.Horizontal : UIScrollBar.Alignment.Vertical,
     ButtonExtension      = RCScrollBar.BUTTON_SIZE,
     IntervalLength       = settings.IntervalLength,
     SliderButtonRadius   = RCScrollBar.WIDTH / 2,
     StepValueChange      = settings.StepValueChange,
     TimeBetweenSteps     = settings.TimeBetweenSteps,
     TrackingValueChange  = settings.TrackingValueChange,
     TimeBetweenTrackings = settings.TimeBetweenTrackings
 })
 {
     this.controlSprite     = UIResourceManager.GetResource <UISprite>(settings.Alignment == Alignment.Horizontal ? "RC.App.Sprites.ScrollbarHorz" : "RC.App.Sprites.ScrollbarVert");
     this.alignment         = settings.Alignment;
     this.sliderTrackLength = length - 2 * RCScrollBar.BUTTON_SIZE;
 }
Example #29
0
    public void ReplacePanel(Selectable selectable)
    {
        switch (selectable.PanelType)
        {
        case PanelType.BUILDER:

            Builder           builder         = selectable.GetComponent <Builder>();
            UIBuilderManager  builderManager  = BuilderPanel.GetComponent <UIBuilderManager>();
            UIResourceManager resourceManager = ResourcePanel.GetComponent <UIResourceManager>();

            builderManager.Builder  = builder;
            resourceManager.Builder = builder;
            if (NetworkHelper.IsOffline)
            {
                ReplacePanel(BuilderPanel);
            }
            else
            {
                ReplacePanelDefault();
            }
            break;

        case PanelType.BUILDING:
            Building          building        = selectable.GetComponent <Building>();
            UIBuildingManager buildingManager = BuildingPanel.GetComponent <UIBuildingManager>();

            buildingManager.Building = building;
            ReplacePanel(BuildingPanel);
            break;

        case PanelType.UNIT:
            Unit          unit        = selectable.GetComponent <Unit>();
            UIUnitManager unitManager = UnitPanel.GetComponent <UIUnitManager>();

            unitManager.Unit = unit;
            ReplacePanel(UnitPanel);
            break;

        case PanelType.CORPSE:
            break;
        }
    }
Example #30
0
    void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
            // DontDestroyOnLoad(this);
        }
        else if (this != _instance)
        {
            Destroy(gameObject);
        }

        UIResourceManager.MouseCursor = mouseCursor;
        inGameMenu   = GameObject.Find("In Game Menu UI").GetComponent <InGameMenu>();
        enemyThreats = GameObject.Find("Enemy threats");
        droneThreats = GameObject.Find("Drone threats");

        GetEnemyCountTexts();
        SetEnemyCountTexts();
    }