/// <summary> /// Advanced Menu constructor that allows custom title banner. /// </summary> /// <param name="title">Title that appears on the big banner. Set to "" if you are using a custom banner.</param> /// <param name="subtitle">Subtitle that appears in capital letters in a small black bar.</param> /// <param name="offset">Point object with X and Y data for offsets. Applied to all menu elements.</param> /// <param name="spriteLibrary">Sprite library name for the banner.</param> /// <param name="spriteName">Sprite name for the banner.</param> public UIMenu(string title, string subtitle, Point offset, string spriteLibrary, string spriteName) { _offset = offset; Children = new Dictionary<UIMenuItem, UIMenu>(); WidthOffset = 0; _instructionalButtonsScaleform = new Scaleform(0); _instructionalButtonsScaleform.Load("instructional_buttons"); UpdateScaleform(); _mainMenu = new UIContainer(new Point(0, 0), new Size(700, 500), Color.FromArgb(0, 0, 0, 0)); _logo = new Sprite(spriteLibrary, spriteName, new Point(0 + _offset.X, 0 + _offset.Y), new Size(431, 107)); _mainMenu.Items.Add(Title = new UIResText(title, new Point(215 + _offset.X, 20 + _offset.Y), 1.15f, Color.White, Font.HouseScript, UIResText.Alignment.Centered)); if (!String.IsNullOrWhiteSpace(subtitle)) { _mainMenu.Items.Add(new UIResRectangle(new Point(0 + offset.X, 107 + _offset.Y), new Size(431, 37), Color.Black)); _mainMenu.Items.Add(Subtitle = new UIResText(subtitle, new Point(8 + _offset.X, 110 + _offset.Y), 0.35f, Color.WhiteSmoke, 0, UIResText.Alignment.Left)); if (subtitle.StartsWith("~")) { CounterPretext = subtitle.Substring(0, 3); } _counterText = new UIResText("", new Point(425 + _offset.X, 110 + _offset.Y), 0.35f, Color.WhiteSmoke, 0, UIResText.Alignment.Right); _extraYOffset = 37; } _upAndDownSprite = new Sprite("commonmenu", "shop_arrows_upanddown", new Point(190 + _offset.X, 147 + 37 * (MaxItemsOnScreen + 1) + _offset.Y - 37 + _extraYOffset), new Size(50, 50)); _extraRectangleUp = new UIResRectangle(new Point(0 + _offset.X, 144 + 38 * (MaxItemsOnScreen + 1) + _offset.Y - 37 + _extraYOffset), new Size(431, 18), Color.FromArgb(200, 0, 0, 0)); _extraRectangleDown = new UIResRectangle(new Point(0 + _offset.X, 144 + 18 + 38 * (MaxItemsOnScreen + 1) + _offset.Y - 37 + _extraYOffset), new Size(431, 18), Color.FromArgb(200, 0, 0, 0)); _descriptionBar = new UIResRectangle(new Point(_offset.X, 123), new Size(431, 4), Color.Black); _descriptionRectangle = new Sprite("commonmenu", "gradient_bgd", new Point(_offset.X, 127), new Size(431, 30)); _descriptionText = new UIResText("Description", new Point(_offset.X + 5, 125), 0.35f, Color.FromArgb(255, 255, 255, 255), Font.ChaletLondon, UIResText.Alignment.Left); _background = new Sprite("commonmenu", "gradient_bgd", new Point(_offset.X, 144 + _offset.Y - 37 + _extraYOffset), new Size(290, 25)); SetKey(MenuControls.Up, Control.PhoneUp); SetKey(MenuControls.Down, Control.PhoneDown); SetKey(MenuControls.Left, Control.PhoneLeft); SetKey(MenuControls.Right, Control.PhoneRight); SetKey(MenuControls.Select, Control.FrontendAccept); SetKey(MenuControls.Back, Control.PhoneCancel); SetKey(MenuControls.Back, Control.FrontendPause); }
private void Update() { if (GameLobby.isClosedGameLooby) { sendInvitationConatiner.SetActive(false); playerVsPlayerContainer.SetActive(false); playerVsComputerContainer.SetActive(false); startGameContainer.SetActive(false); gameLobbyContainer.SetActive(false); signInContainer.SetActive(false); MenuUserContainer.SetActive(false); receiveInvitationContainer.SetActive(false); userUIContainer.SetActive(true); MainMenuContainer.SetActive(true); UIContainer.SetActive(true); GameLobby.isClosedGameLooby = false; } if (isUpdateAvatar && isClosedEditAvatar) { Image avatar = ProfileContainer.transform.Find("[ProfileUser]").Find("AvatarNameContainer").Find("Avatar").Find("Image").GetComponent <Image>(); string nameAvatar = NetworkClient.users[NetworkClient.clientID].avatar; Avatar.DisplayAvatar(avatar, nameAvatar); isUpdateAvatar = false; isClosedEditAvatar = false; } }
public SandboxGameScreen() : base() { StateChanges = new Queue <SimConnectStateChange>(); ucp = new UIUCP(this); ucp.Y = ScreenHeight - 210; ucp.SetInLot(false); ucp.UpdateZoomButton(); ucp.MoneyText.Caption = "0";// PlayerAccount.Money.ToString(); this.Add(ucp); Title = new UIGameTitle(); Title.SetTitle(""); this.Add(Title); WindowContainer = new UIContainer(); Add(WindowContainer); if (Content.Content.Get().TS1) { TS1NeighPanel = new UINeighborhoodSelectionPanel(4); TS1NeighPanel.OnHouseSelect += (house) => { ActiveFamily = Content.Content.Get().Neighborhood.GetFamilyForHouse((short)house); InitializeLot(Path.Combine(Content.Content.Get().TS1BasePath, "UserData/Houses/House" + house.ToString().PadLeft(2, '0') + ".iff"), false);// "UserData/Houses/House21.iff" Remove(TS1NeighPanel); }; Add(TS1NeighPanel); } }
public void SetupQuery() { UIContainer parent = null; QueryPanel = new UIQueryPanel(World); if (QueryPanel.Parent != null && QueryPanel.Parent.Parent != null) { parent = QueryPanel.Parent; } QueryPanel.OnSellBackClicked += ObjectHolder.SellBack; //QueryPanel.OnInventoryClicked += ObjectHolder.MoveToInventory; //QueryPanel.OnAsyncBuyClicked += ObjectHolder.AsyncBuy; //QueryPanel.OnAsyncSaleClicked += ObjectHolder.AsyncSale; //QueryPanel.OnAsyncPriceClicked += ObjectHolder.AsyncSale; //QueryPanel.OnAsyncSaleCancelClicked += ObjectHolder.AsyncCancelSale; QueryPanel.X = 0; QueryPanel.Y = -114; if (parent != null) { parent.Add(QueryPanel); } }
public UIManager() { var bounds = Game.ScreenResolution; notifyTimer = new Timer(5000); killInfoTimer = new Timer(4500); scaleformDisplayTimer = new Timer(4000); scaleformFadeTimer = new Timer(2000); scaleform = new Scaleform(Function.Call <int>(Hash.REQUEST_SCALEFORM_MOVIE, "MP_BIG_MESSAGE_FREEMODE")); killInfoUI = new UIBox(new Point(bounds.Width / 2 - (bounds.Width / 2) / 2 + 200, (Game.ScreenResolution.Height - 40) - (Game.ScreenResolution.Height / 10)), new Size(200, 60)); centerText = new UIText(null, new Point(bounds.Width / 2 - (bounds.Width / 2) / 2, UI.HEIGHT - 38), 0.70f, Color.White, Font.ChaletComprimeCologne, true); teamInfoHUD = new UIContainer(new Point((int)0.00115f * Game.ScreenResolution.Width + 960, UI.HEIGHT / 6 - 20), new Size(180, Config.MaxTeams * 31), Color.FromArgb(180, Color.Black)); SetupTeamInfoHUD(Config.MaxTeams); _hudAssets[0] = new HUDAsset() { ActiveAsset = @"scripts\AirSuperiority\hud\fireext\1.png", InactiveAsset = @"scripts\AirSuperiority\hud\fireext\2.png" }; _hudAssets[1] = new HUDAsset() { ActiveAsset = @"scripts\AirSuperiority\hud\irflares\1.png", InactiveAsset = @"scripts\AirSuperiority\hud\irflares\2.png" }; _hudAssets[2] = new HUDAsset() { ActiveAsset = @"scripts\AirSuperiority\hud\rdrjam\1.png", InactiveAsset = @"scripts\AirSuperiority\hud\rdrjam\2.png" }; _activeHudAssets = _hudAssets.Select(x => x.ActiveAsset).ToArray(); SetHUDIcon(2, false); rankBar.RankedUp += RankBar_RankedUp; Tick += OnTick; }
protected override void Setup() { Instance = this; //描画エリア _mContainer = new UIContainer(new Point(0, 0), new Size(500, 20)); //バー表示が設定されていたら描画 this.OnDrawingTickAsObservable .Where(_ => !Game.IsPaused && Game.Player.IsAlive && progressBarDataList.Any()) //Readだし排他ロックいらないかなという判断 .Subscribe(_ => { _mContainer.Items.Clear(); var datas = new ProgressBarData[0]; //ここは排他ロック必要 lock (lockObject) { //完了しているものは除外する progressBarDataList.RemoveAll(x => x.ProgressBarStatus.IsCompleted); datas = progressBarDataList.ToArray(); } foreach (var progressBarData in datas) { AddProgressBarToContainer(progressBarData); } _mContainer.Draw(); }); }
private void SetupScoreboard(int numSlots) { if (numSlots > numAvailableSlots) { infoContainer = new UIContainer(new Point((int)0.00115f * Game.ScreenResolution.Width + 960, UI.HEIGHT / 6 - 20), new Size(180, numSlots * 31), Color.FromArgb(180, Color.Black)); UIRectangle[] containerItems = new UIRectangle[numSlots << 1]; for (int i = 0; i < numSlots; i++) { var color = (TeamColor)i; containerItems[i] = new UIRectangle(new Point(), new Size(0, 11), Color.FromArgb(180, Color.Orange)); containerItems[i + numSlots] = new UIRectangle(new Point(22, (30 * i) + 12), new Size(21, 13), Color.FromArgb(180, color.ToSystemColor())); } infoContainer.Items.AddRange(containerItems); Array.Resize(ref entries, numSlots); numAvailableSlots = numSlots; } }
public UIButton(UIContainer container, string buttonText = "", string buttonColor = "0 0 0 0.85", string textColor = "1 1 1 1", int fontSize = 15) : base(container) { _fontSize = fontSize; var button = new CuiButton(); buttonComponent = button.Button; textComponent = button.Text; buttonComponent.Command = CuiHelper.GetGuid(); buttonComponent.Color = buttonColor; textComponent.Text = buttonText; textComponent.FontSize = _fontSize; textComponent.Align = TextAnchor.MiddleCenter; Element.Components.Insert(0, buttonComponent); _plugin.cmd.AddConsoleCommand(buttonComponent.Command, _plugin, "OnButtonClick"); _plugin.UIButtonCallBacks[buttonComponent.Command] = this; label = new UILabel(container, buttonText, parent: Element.Name, fontSize: _fontSize); label.SetPosition(0, 0); label.SetSize(1f, 1f); label.text.Align = TextAnchor.MiddleCenter; label.text.Color = textColor; textComponent = label.text; }
public override UIContainer FindActivityUIRectsOnMask() { UIContainer container = new UIContainer(); var uirects = FindActivityUIRectsWithCanvas(); //按层级关系排序 uirects.Sort((a, b) => { int sort = a.SortOrder.CompareTo(b.SortOrder); return(sort != 0 ? sort : a.DeepOrder.CompareTo(b.DeepOrder)); }); for (var i = 0; i < uirects.Count; i++) { if (!IsShowWithMaskFather(uirects[i].Parent, uirects[i])) { continue; } if (IsCanShow(uirects, i) && uirects[i] is ClickUIRect) { container.Insert(uirects[i]); } } container.Sort(); return(container); }
private void InitUI() { // Initialize Root Object _gameUI = new UIContainer(new Vector2f(GlobalConstants.BoardLength * GlobalConstants.SquareSize, 0), new Vector2f(GlobalConstants.WindowWidth - GlobalConstants.BoardLength * GlobalConstants.SquareSize, GlobalConstants.SquareSize * GlobalConstants.BoardLength), new Color(215, 215, 215)); // Move History moveHistory = new MoveHistory(new Vector2f(_gameUI.Position.X, _gameUI.Position.Y + GlobalConstants.SquareSize), new Vector2f(_gameUI.Shape.Size.X, _gameUI.Shape.Size.Y - (GlobalConstants.SquareSize * 2))); // Quit Button GraphicButton quitButton = new GraphicButton( new Vector2f(_gameUI.Position.X + _gameUI.Shape.Size.X - ButtonWidth, _gameUI.Position.Y + _gameUI.Shape.Size.Y - ButtonHeight), new Vector2f(ButtonWidth, ButtonHeight), new Color(100, 100, 100), new Color(150, 150, 150)); quitButton.SetGraphics(Application.Instance().AssetManager.Textures[TextureID.ReturnIdle], Application.Instance().AssetManager.Textures[TextureID.ReturnHover]); quitButton.SetCommand(new GoToStateCommand(new MenuState())); quitButton.SetBorder(1, Color.Black); // New Game Button GraphicButton newGameButton = new GraphicButton( new Vector2f(_gameUI.Position.X + _gameUI.Shape.Size.X - (ButtonWidth * 2), _gameUI.Position.Y + _gameUI.Shape.Size.Y - ButtonHeight), new Vector2f(ButtonWidth, ButtonHeight), new Color(100, 100, 100), new Color(150, 150, 150)); newGameButton.SetGraphics(Application.Instance().AssetManager.Textures[TextureID.NewGameIdle], Application.Instance().AssetManager.Textures[TextureID.NewGameHover]); newGameButton.SetCommand(new ResetGameCommand(this)); newGameButton.SetBorder(1, Color.Black); // Add Elements _gameUI.AddElement(moveHistory); _gameUI.AddElement(quitButton); _gameUI.AddElement(newGameButton); }
public FighterDisplay() { var location = new Point((int)(UI.WIDTH / 2) - 150, 80); warningBackground = new UIContainer(location, new Size(400, 70), Color.FromArgb(130, 55, 55, 55)); CreateText(); }
public void PropertyElement_Target_CanBeSetAndGet() { var element = new PropertyElement(); Assert.That(element.TryGetTarget(out UIContainer _), Is.False); Assert.Throws <InvalidOperationException>(() => element.GetTarget <UIContainer>()); var container = new UIContainer(); Assert.DoesNotThrow(() => element.SetTarget(container)); Assert.That(element.TryGetTarget(out UIContainer _), Is.True); Assert.DoesNotThrow(() => element.GetTarget <UIContainer>()); Assert.DoesNotThrow(() => element.SetTarget((object)container)); Assert.That(element.TryGetTarget(out UIContainer _), Is.True); Assert.DoesNotThrow(() => element.GetTarget <UIContainer>()); Assert.DoesNotThrow(() => element.SetTarget(container)); Assert.That(element.TryGetTarget(out object _), Is.True); Assert.DoesNotThrow(() => element.GetTarget <object>()); var container2 = new ComplexUIContainer(); Assert.That(element.TryGetTarget(out ComplexUIContainer _), Is.False); Assert.Throws <InvalidCastException>(() => element.GetTarget <ComplexUIContainer>()); Assert.DoesNotThrow(() => element.SetTarget(container2)); Assert.That(element.TryGetTarget(out ComplexUIContainer _), Is.True); Assert.DoesNotThrow(() => element.GetTarget <ComplexUIContainer>()); var container3 = new ComplexUIChildContainer(); Assert.DoesNotThrow(() => element.SetTarget(container3)); Assert.That(element.TryGetTarget(out ComplexUIContainer _), Is.True); Assert.DoesNotThrow(() => element.GetTarget <ComplexUIContainer>()); }
private void inspectEntity() { RaycastResult rayResult = World.Raycast(GameplayCamera.Position, GameplayCamera.Direction, maxRayDist, IntersectOptions.Everything); Entity[] nearEntities = World.GetNearbyEntities(rayResult.HitCoords, .3f); if (nearEntities.Length > 0) { Model m = nearEntities[0].Model; Vector3 dim = m.GetDimensions(); UI.ShowSubtitle(m.Hash.ToString() + " h: " + dim.Z.ToString() + " w: " + dim.X.ToString() + " z: " + dim.Y.ToString()); float offset = 1.9f; FUL = -(dim.X / 2f) * nearEntities[0].RightVector + dim.Z * nearEntities[0].UpVector; BLR = (dim.X / 2f) * nearEntities[0].RightVector + offset * nearEntities[0].UpVector; System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\Users\\Artur\\Desktop\\test.txt"); file.WriteLine(m.Hash.ToString() + " " + (-dim.X / 2f).ToString() + " " + 0 + " " + dim.Z.ToString() + " " + (dim.X / 2f).ToString() + " " + 0 + " " + offset.ToString()); file.Close(); FUL = FUL + nearEntities[0].Position; BLR = BLR + nearEntities[0].Position; int width = UI.WorldToScreen(FUL).X - UI.WorldToScreen(BLR).X; int height = UI.WorldToScreen(BLR).Y - UI.WorldToScreen(FUL).Y; this.mContainer = new UIContainer(new Point(UI.WorldToScreen(FUL).X - width, UI.WorldToScreen(FUL).Y), new Size(width, height), Color.FromArgb(200, 237, 239, 241)); this.mContainer.Draw(); } }
protected override void OnPopup(UIContainer popup, object[] args) { RPG.GetPopup <QuestStarted>().Hide(); var quest = (Quest)args[0]; popup.Size = new Size(UI.WIDTH, 115); var extra = quest.AdditionalRewards.Count; if (extra > 0) { popup.Size = new Size(popup.Size.Width, popup.Size.Height + extra * 20); } popup.Position = new Point(0, UI.HEIGHT / 2 - 50); var completedText = quest.IsContract ? "Contract complete" : "Quest complete"; var color = quest.IsContract ? Color.FromArgb(150, 180, 180, 180) : Color.FromArgb(150, 255, 180, 0); popup.Color = color; popup.Items.Add(new UIText(completedText, new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- " + quest.Name + " -", new Point(UI.WIDTH / 2, 15), 1.4f, Color.White, 0, true)); popup.Items.Add(new UIText("- " + quest.GetBasicRewardString() + " -", new Point(UI.WIDTH / 2, 80), 0.25f, Color.White, 0, true)); var point = 110; for (int index = 0; index < quest.AdditionalRewards.Count; index++) { var reward = quest.AdditionalRewards[index]; popup.Items.Add(new UIText("- " + reward.GetRewardString() + " -", new Point(UI.WIDTH / 2, point + (index * 15)), 0.24f, Color.White, 0, true)); } }
void InitialChat() { option = new OptionGroup(); option.AddEvent(view.left.userEvent); option.AddEvent(view.right.userEvent); option.AddEvent(view.center.userEvent); option.SelectChanged = SelectChanged; option.Selecet = view.right.userEvent; //input = view.input.userEvent as TextInput; view.input.OnSubmit = OnSubmit; container = view.chatbox.composite as UIContainer; //other = new UILinker<ChatItem, ChatData>(container,view.other); other = new UILinker <ChatItem, ChatData>(container, view.other); other.LayoutCallback = GetContentSize; other.ItemUpdate = ItemUpdate; self = new UILinker <ChatItem, ChatData>(container, view.self); self.LayoutCallback = GetContentSize; self.ItemUpdate = ItemUpdate; tip = new UILinker <TipItem, TipData>(container, view.tip); //tip.ItemUpdate = TipItemUpdate; view.send.userEvent.Click = (o, e) => { OnSubmit(view.input); }; view.ItemText.activeSelf = false; var size = view.ItemText.SizeDelta; view.ItemText.GetGenerationSettings(ref size, ref settings); }
private void CreateUiContainer() { _uiContainer = new UIContainer(new Point(0, 0), new Size(40, 40), Color.FromArgb(0, 0, 0, 0)); var color = Color.FromArgb(220, 255, 50, 50); var crosshair1 = new UIRectangle(new Point(0, 0), new Size(5, 2), color); _uiContainer.Items.Add(crosshair1); var crosshair2 = new UIRectangle(new Point(0, 38), new Size(5, 2), color); _uiContainer.Items.Add(crosshair2); var crosshair3 = new UIRectangle(new Point(0, 2), new Size(2, 3), color); _uiContainer.Items.Add(crosshair3); var crosshair4 = new UIRectangle(new Point(38, 2), new Size(2, 3), color); _uiContainer.Items.Add(crosshair4); var crosshair5 = new UIRectangle(new Point(35, 0), new Size(5, 2), color); _uiContainer.Items.Add(crosshair5); var crosshair6 = new UIRectangle(new Point(35, 38), new Size(5, 2), color); _uiContainer.Items.Add(crosshair6); var crosshair7 = new UIRectangle(new Point(0, 35), new Size(2, 3), color); _uiContainer.Items.Add(crosshair7); var crosshair8 = new UIRectangle(new Point(38, 35), new Size(2, 3), color); _uiContainer.Items.Add(crosshair8); }
private void AddItems(){ container = GetContainer (); if (container != null) { if (clearContainer) { container.Clear (); } if (execute != null) { if(behaviour == null){ behaviour = gameObject.AddBehaviour(execute); behaviour.stateMachine.SetVariable ("Items", items); behaviour.stateMachine.SetVariable ("Container", container.gameObject); } return; } for (int i=0; i< items.Length; i++) { if (items [i] != null) { container.Add (items[i]); } } if(openContainer){ OpenContainer(); } } }
public SampleState(GameController owner, GameModel gameModelCore, UIContainer uiContainer) { _owner = owner; _gameModelCore = gameModelCore; _uiContainer = uiContainer; CloseUI(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load <SpriteFont>("Arial"); whiteTexture = Content.Load <Texture2D>("white"); pointerTexture = Content.Load <Texture2D>("pointer"); runningTexture = Content.Load <Texture2D>("running"); breakpointTexture = Content.Load <Texture2D>("breakpoint"); runTexture = Content.Load <Texture2D>("run"); stepInTexture = Content.Load <Texture2D>("stepin"); stepOverTexture = Content.Load <Texture2D>("stepover"); stepOutTexture = Content.Load <Texture2D>("stepout"); restartTexture = Content.Load <Texture2D>("restart"); pinheadTexture = Content.Load <Texture2D>("pinhead"); ui = new UIContainer(); UIButtonStyle defaultButtonStyle = UIButton.GetDefaultStyle(Content); ui.Add(new UIButton("Run (F5)", runTexture, new Rectangle(100, 650, 120, 40), defaultButtonStyle, DoRun)); ui.Add(new UIButton("Step In (F11)", stepInTexture, new Rectangle(240, 650, 120, 40), defaultButtonStyle, DoStepIn)); ui.Add(new UIButton("Step Over (F10)", stepOverTexture, new Rectangle(380, 650, 120, 40), defaultButtonStyle, DoStepOver)); ui.Add(new UIButton("Step Out (^F11)", stepOutTexture, new Rectangle(520, 650, 120, 40), defaultButtonStyle, DoStepOut)); ui.Add(new UIButton("Restart", restartTexture, new Rectangle(660, 650, 120, 40), defaultButtonStyle, DoRestart)); DoRestart(); }
void Start() { FingerGestures.OnDragMove += OnDragMove; FingerGestures.OnFingerDown += OnFingerDown; tiles = new StageType[height, width]; gos = new GameObject[height, width]; var save_btn_go = gameObject.transform.Find("Controls/save_btn").gameObject; save_btn_button = save_btn_go.GetComponent <UnityEngine.UI.Button>(); save_btn_button.onClick.AddListener(OnSaveBtnClick); TileBtns_go = gameObject.transform.Find("Controls/ScollView/TileBtns").gameObject; TileBtns_verticallayoutgroup = TileBtns_go.GetComponent <UnityEngine.UI.VerticalLayoutGroup>(); Container = new UIContainer <TileBtn>(TileBtns_verticallayoutgroup.gameObject); Template_go = gameObject.transform.Find("Controls/ScollView/TileBtns/Template").gameObject; tileGo = gameObject.transform.Find("ScrollView/Content/tile").gameObject; tileGo.GetComponent <Image>(); tileContent = gameObject.transform.Find("ScrollView/Content").gameObject.GetComponent <RectTransform>(); tileContent.sizeDelta = new Vector2(width * tileSize, height * tileSize); var brushs = Enum.GetValues(typeof(StageType)); Container.Resize(brushs.Length); for (int i = 0; i < Container.ChildCount; i++) { var t = Container.GetChild(i); t.UpdateInfo((StageType)i); t.OnClickCallback = OnClick; } }
public void Inject(object reference) { if (reference is UIContainer) { _container = reference as UIContainer; } }
private void EnsureUIView(Dictionary <Transform, string> goPathDic) { EnsureUIContainer(mUIView); foreach (var item in goPathDic) { Transform child = item.Key; UIView uIView = child.GetComponent <UIView>(); if (uIView) { DestroyImmediate(uIView); } UIContainer uiConTainer = child.GetComponent <UIContainer>(); if (child.name.Contains("(Item)")) { if (!uiConTainer) { uiConTainer = child.AddComponent <UIContainer>(); } } else if (uiConTainer) { DestroyImmediate(uiConTainer); } EnsureUIContainer(uiConTainer); } }
public LoginScreen() { /** * Scale the whole screen to 1024 */ BackgroundCtnr = new UIContainer(); BackgroundCtnr.ScaleX = BackgroundCtnr.ScaleY = ScreenWidth / 800.0f; /** Background image **/ Background = new UIImage(GetTexture((ulong)FileIDs.UIFileIDs.setup)); Background.ID = "Background"; BackgroundCtnr.Add(Background); var lbl = new UILabel(); lbl.Caption = "Version 1.1097.1.0"; lbl.X = 20; lbl.Y = 558; BackgroundCtnr.Add(lbl); this.Add(BackgroundCtnr); LoginProgress = new UILoginProgress(); LoginProgress.X = (ScreenWidth - (LoginProgress.Width + 20)); LoginProgress.Y = (ScreenHeight - (LoginProgress.Height + 20)); LoginProgress.Opacity = 0.9f; this.Add(LoginProgress); LoginDialog = new UILoginDialog(this); LoginDialog.Opacity = 0.9f; //Center LoginDialog.X = (ScreenWidth - LoginDialog.Width) / 2; LoginDialog.Y = (ScreenHeight - LoginDialog.Height) / 2; this.Add(LoginDialog); }
public virtual void Show(params object[] args) { _popup = new UIContainer(); _timeWaited = 0; OnPopup(_popup, args); _show = true; }
public void SetPanel(int newPanel) { OptionsModeButton.Selected = false; if (CurrentPanel != -1) { this.Remove(Panel); } if (newPanel != CurrentPanel) { switch (newPanel) { case 5: Panel = new UIOptions(); Panel.X = 177; Panel.Y = 96; this.Add(Panel); OptionsModeButton.Selected = true; break; default: break; } CurrentPanel = newPanel; } else { CurrentPanel = -1; } }
public UIContainer GetSkillBar(int skillOffset) { var skillBarUI = new UIContainer(new Point(UI.WIDTH / 2 - 178, UI.HEIGHT - 45 + skillOffset), new Size(356, 35)); skillBarUI.Items.Add(new UIRectangle(new Point(5, 5), new Size(64, 18), Slots[0].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[0].IsEmpty && !Slots[0].Usable && Slots[0].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(5, 5), new Size((int)(65 * Slots[0].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[0].GetText(), new Point(35, 8), 0.18f, Slots[0].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + (RPG.UsingController ? "(Up)" : Slots[0].Key.ToString()) + "]", new Point(32, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(75, 5), new Size(64, 18), Slots[1].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[1].IsEmpty && !Slots[1].Usable && Slots[1].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(75, 5), new Size((int)(65 * Slots[1].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[1].GetText(), new Point(107, 8), 0.18f, Slots[1].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + (RPG.UsingController ? "(Right)" : Slots[1].Key.ToString()) + "]", new Point(105, 23), 0.16f, Color.White, 0, true)); if(RPG.GameMode == GameMode.FullRPG) { skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size(64, 18), Slots[2].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[2].IsEmpty && !Slots[2].Usable && Slots[2].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size((int)(65 * Slots[2].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[2].GetText(), new Point(177, 8), 0.18f, Slots[2].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText((RPG.UsingController ? "(Special)" : "[CapsLock]"), new Point(175, 23), 0.16f, Color.White, 0, true)); } else { skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size(64, 18), Slots[2].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[2].IsEmpty && !Slots[2].Usable && Slots[2].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size(65, 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText("Class Skill", new Point(177, 8), 0.18f, Slots[2].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText((RPG.UsingController ? "(Special)" : "[CapsLock]"), new Point(175, 23), 0.16f, Color.White, 0, true)); } skillBarUI.Items.Add(new UIRectangle(new Point(215, 5), new Size(64, 18), Slots[3].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[3].IsEmpty && !Slots[3].Usable && Slots[3].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(215, 5), new Size((int)(65 * Slots[3].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[3].GetText(), new Point(247, 8), 0.18f, Slots[3].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + (RPG.UsingController ? "(Down)" : Slots[3].Key.ToString()) + "]", new Point(245, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(285, 5), new Size(64, 18), Slots[4].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[4].IsEmpty && !Slots[4].Usable && Slots[4].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(285, 5), new Size((int)(65 * Slots[4].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[4].GetText(), new Point(317, 8), 0.18f, Slots[4].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + (RPG.UsingController ? "(Left)" : Slots[3].Key.ToString()) + "]", new Point(315, 23), 0.16f, Color.White, 0, true)); return skillBarUI; }
private void MarkCellHandler(string evt, byte[] coords) { UIContainer container = ColoredCellsContainer; evt = evt.Remove(0, 8); // remove "TSOMaze_" if (coords.Length > 0 && coords.Length % 2 == 0) { string index = "15"; // "Yellow" switch (evt[0]) { // blue is always the first color marked, so make a new container for it and make sure it's visible case 'B': { index = "12"; // "Blue" if (ColoredCellsContainer != null) { Remove(ColoredCellsContainer); } ColoredCellsContainer = new UIContainer() { Visible = true }; Add(ColoredCellsContainer); container = ColoredCellsContainer; break; } case 'E': { index = "12"; if (SolutionPathContainer != null) { Remove(SolutionPathContainer); } SolutionPathContainer = new UIContainer() { Visible = true }; container = SolutionPathContainer; Add(SolutionPathContainer); break; // "Blue" for "ExitIcon" } case 'G': index = "13"; break; // "Green" case 'R': index = "14"; break; // "Red" } for (int x = 0; x < coords.Length - 1; x++) { var color = Script.Create <UIImage>(evt); color.UseTooltip(); color.Position = NWCellOriginOffset; color.Y += coords[x++] * CellOffsetY; color.X += coords[x] * CellOffsetX; color.Tooltip = GameFacade.Strings.GetString("f112", index); container.Add(color); } } }
private void InitializeMouse() { /** City Scene **/ UIContainer mouseHitArea = new UIContainer(); MouseHitAreaEventRef = mouseHitArea.ListenForMouse(new Rectangle(0, 0, ScreenWidth, ScreenHeight), new UIMouseEvent(MouseHandler)); AddAt(0, mouseHitArea); }
void Start() { DontDestroyOnLoad(base.gameObject); if (instance == null) { instance = this; } }
void Init() { ui = new UIContainer(); SetPipeSocket(new Vector2(16, 28), 1); AddOutputPipe(new Vector2(16, 54)); unlimitedPipes = true; }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); popup.Position = new Point(0, UI.HEIGHT / 2 + 45); popup.Items.Add(new UIRectangle(new Point(0, 0), popup.Size, Color.FromArgb(150, 2, 70, 200))); popup.Items.Add(new UIText("grand theft auto", new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- RPG - ", new Point(UI.WIDTH / 2, 15), 2.02f, Color.White, 0, true)); }
protected override void Custom(UIContainer popup, int timeWaited, int showTime, int fadeTime) { if (timeWaited > showTime - fadeTime) { var timeOfFrame = timeWaited - (showTime - fadeTime); popup.Position = new Point(popup.Position.X, (int)((UI.HEIGHT / 2 + 45) + (UI.HEIGHT * ((float)timeOfFrame / fadeTime)))); } }
protected override void Custom(UIContainer popup, int timeWaited, int showTime, int fadeTime) { if (timeWaited > showTime - fadeTime) { var timeOfFrame = timeWaited - (showTime - fadeTime); popup.Position = new Point(popup.Position.X, (int)((UI.HEIGHT / 2 + 45) + (UI.HEIGHT * ((float)timeOfFrame / fadeTime)))); } }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); popup.Position = new Point(0, UI.HEIGHT / 2 + 45); popup.Items.Add(new UIRectangle(new Point(0, 0), popup.Size, Color.FromArgb(150, 2, 70, 200))); popup.Items.Add(new UIText("grand theft auto", new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- RPG - ", new Point(UI.WIDTH / 2, 15), 2.02f, Color.White, 0, true)); }
public void ResetPointerAttackUI() { container = UIRectManager.Instance.FindActivityUIRectsOnMask(); if (PointerAttachUI == null || !PointerAttachUI.IsActivite || PointerAttachUI.Position != Pointer.transform.position || !IsContainUIRect(container, PointerAttachUI)) { PointerAttachUI = null; } }
public GazeVisualization() { _uiContainerGaze = new UIContainer(new Point(0, 0), new Size(4, 4), Color.FromArgb(0, 0, 0, 0)); var crosshair1 = new UIRectangle(new Point(0, 0), new Size(4, 4), Color.FromArgb(220, 255, 0, 0)); _uiContainerGaze.Items.Add(crosshair1); var crosshair2 = new UIRectangle(new Point(1, 1), new Size(2, 2), Color.FromArgb(220, 0, 255, 255)); _uiContainerGaze.Items.Add(crosshair2); }
//! 构造 public UIControl() { m_Parent = null; m_Id = 0; m_Rect = new Rect(0, 0, 0, 0); m_Visible = true; m_Enable = true; }
public DrawMenu() { Tick += OnTick; this.mContainer = new UIContainer(new Point(10, 240), new Size(200, 300), Color.FromArgb(200, 237, 239, 241)); this.mContainer.Items.Add(new UIRectangle(new Point(0, 0), new Size(200, 30), Color.FromArgb(255, 26, 188, 156))); this.mContainer.Items.Add(new UIText("Example Title", new Point(100, 4), 0.5f, Color.WhiteSmoke, GTA.Font.ChaletComprimeCologne, true)); this.mContainer.Items.Add(new UIRectangle(new Point(0, 30), new Size(200, 30), Color.FromArgb(135, 26, 187, 155))); this.mContainer.Items.Add(new UIText("Example", new Point(100, 34), 0.4f, Color.Black, 0, true)); }
protected override void OnPopup(UIContainer popup, object[] args) { var text1 = (string)args[0]; var text2 = (string)args[1]; popup.Size = new Size(500,60); popup.Position = new Point(UI.WIDTH/2 - 250, 25); popup.Color = Color.FromArgb(150, 2, 70, 200); popup.Items.Add(new UIText("Tutorial", new Point(15, 0), 0.5f, Color.White, 0,false)); popup.Items.Add(new UIText(text1, new Point(35, 25), 0.25f, Color.White, 0, false)); popup.Items.Add(new UIText(text2, new Point(35, 40), 0.25f, Color.Orange,0, false)); }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); popup.Position = new Point(0, UI.HEIGHT / 2 - 200); popup.Items.Add(new UIText("congratualtions", new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 0), new Size(UI.WIDTH, 25), Color.FromArgb(150, 2, 70, 200))); popup.Items.Add(new UIText("- you are now level " + RPG.PlayerData.Level + " -", new Point(UI.WIDTH / 2, 15), 1.5f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 25), new Size(UI.WIDTH, 80), Color.FromArgb(150, 2, 70, 200))); }
private void CreateUiContainer(Color outerColor, Color innerColor) { UiContainer = new UIContainer(new Point(0, 0), new Size(16, 16), Color.FromArgb(0, 0, 0, 0)); UiContainer.Items.Add(new UIRectangle(new Point(6, 0), new Size(4, 6), outerColor)); UiContainer.Items.Add(new UIRectangle(new Point(7, 1), new Size(2, 4), innerColor)); UiContainer.Items.Add(new UIRectangle(new Point(6, 10), new Size(4, 6), outerColor)); UiContainer.Items.Add(new UIRectangle(new Point(7, 11), new Size(2, 4), innerColor)); UiContainer.Items.Add(new UIRectangle(new Point(0, 6), new Size(6, 4), outerColor)); UiContainer.Items.Add(new UIRectangle(new Point(1, 7), new Size(4, 2), innerColor)); UiContainer.Items.Add(new UIRectangle(new Point(10, 6), new Size(6, 4), outerColor)); UiContainer.Items.Add(new UIRectangle(new Point(11, 7), new Size(4, 2), innerColor)); }
protected override void Custom(UIContainer popup, int timeWaited, int showTime, int fadeTime) { if (timeWaited < fadeTime) { popup.Position = new Point(UI.WIDTH - (int)(((float)timeWaited /fadeTime) * 400),popup.Position.Y); } if (timeWaited > showTime - fadeTime) { var timeOfFrame = timeWaited - (showTime - fadeTime); popup.Position = new Point((int)(300 - (UI.WIDTH * ((float)timeOfFrame / fadeTime))), popup.Position.Y); } }
protected override void OnPopup(UIContainer popup, object[] args) { if (!args.Any()) return; var text = TextToShow(args[0]); if (string.IsNullOrEmpty(text)) return; if (!RPGSettings.ShowKillstreaks) return; popup.Size = new Size(UI.WIDTH, 105); popup.Position = new Point(0, 100); popup.Items.Add(new UIText(text, new Point(UI.WIDTH / 2, 0), 1.2f, Color.White, Font.Monospace, true)); }
protected override void OnPopup(UIContainer popup, object[] args) { if (!args.Any()) return; var text = (string)args[0]; var size = (float)args[1]; if (string.IsNullOrEmpty(text)) return; popup.Size = new Size(UI.WIDTH, 200); popup.Position = new Point(UI.WIDTH, UI.HEIGHT - 80); popup.Items.Add(new UIText(text, new Point(2, 2), size, Color.FromArgb(60, 2, 2, 2), Font.Monospace, true)); popup.Items.Add(new UIText(text, new Point(0, 0), size, Color.White, Font.Monospace, true)); }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); string[] lines = new string[] { "Sorry for such a delay in the update!", "", "Patch Notes:", "- Added in weapon unlock system. You can now unlock weapons", " using SP once you reach the required level.", " You will also be notified which weapons are available upon level up", " Go to Menu > Character Menu > Weapons to unlock weapons.", " Weapon mods are planned for the future.", "- Weapon icons will be fixed in a future patch", " ", "Coming Soon: ", "- New Quests", "- Survival Mode", "- Unique Class Skills", "", "Please remember this a free mod and I work on it in my spare time, if you", "would like to support the project feel free to donate, but it is never required.", "Thanks for playing, hope you have a great time.", "LogicSpawn", "", "Press E to Close" }; var extra = lines.Length; popup.Size = new Size(popup.Size.Width, popup.Size.Height + extra*20); popup.Position = new Point(0, UI.HEIGHT / 2 - popup.Size.Height/2); var headerText = "GTA:RPG"; var color = Color.FromArgb(70, 145, 145, 145); popup.Color = color; popup.Items.Add(new UIText(headerText, new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- PATCH NOTES and UPDATES -", new Point(UI.WIDTH / 2, 15), 1.5f, Color.White, 0, true)); var point = 100; for (int index = 0; index < extra; index++) { var text = lines[index]; popup.Items.Add(new UIText(text, new Point(UI.WIDTH / 2, point + (index * 15)), 0.24f, Color.White, 0, true)); } }
protected UIContainer CreateSwitchAppButton(string appname, PhoneApp app) { if (app.phone != this.phone) { throw new Exception("Can't create a switch app button between two different phones!"); } UIContainer btncontainer = new UIContainer(CursorType: CursorType.Cursor, Width: SmartPhone.SCREEN_RECT.Width, CentreHorizontal: true); Button button = new Button(Color.LightBlue, Color.LightBlue, Color.LightCyan, Color.Turquoise, Textures.SmartPhoneButton, CursorType: CursorType.Cursor, Text: appname); btncontainer.AddElement(button); button.OnPressed += obj => { phone.SwitchTo(app); }; return btncontainer; }
public UIContainer GetSkillBar(int skillOffset) { var skillBarUI = new UIContainer(new Point(UI.WIDTH / 2 - 178, UI.HEIGHT - 45 + skillOffset), new Size(356, 35)); skillBarUI.Items.Add(new UIRectangle(new Point(5, 5), new Size(64, 18), Slots[0].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[0].IsEmpty && !Slots[0].Usable && Slots[0].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(5, 5), new Size((int)(65 * Slots[0].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[0].GetText(), new Point(35, 8), 0.18f, Slots[0].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + Slots[0].Key + "]", new Point(32, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(75, 5), new Size(64, 18), Slots[1].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[1].IsEmpty && !Slots[1].Usable && Slots[1].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(75, 5), new Size((int)(65 * Slots[1].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[1].GetText(), new Point(107, 8), 0.18f, Slots[1].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + Slots[1].Key + "]", new Point(105, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size(64, 18), Slots[2].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[2].IsEmpty && !Slots[2].Usable && Slots[2].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(145, 5), new Size((int)(65 * Slots[2].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[2].GetText(), new Point(177, 8), 0.18f, Slots[2].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[CapsLock]", new Point(175, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(215, 5), new Size(64, 18), Slots[3].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[3].IsEmpty && !Slots[3].Usable && Slots[3].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(215, 5), new Size((int)(65 * Slots[3].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[3].GetText(), new Point(247, 8), 0.18f, Slots[3].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + Slots[3].Key + "]", new Point(245, 23), 0.16f, Color.White, 0, true)); skillBarUI.Items.Add(new UIRectangle(new Point(285, 5), new Size(64, 18), Slots[4].Usable ? Color.FromArgb(120, 85, 85, 85) : Color.FromArgb(50, 8, 8, 8))); if (!Slots[4].IsEmpty && !Slots[4].Usable && Slots[4].CooldownRatio < 1) { skillBarUI.Items.Add(new UIRectangle(new Point(285, 5), new Size((int)(65 * Slots[4].CooldownRatio), 18), Color.FromArgb(120, 85, 85, 85))); } skillBarUI.Items.Add(new UIText(Slots[4].GetText(), new Point(317, 8), 0.18f, Slots[4].Usable ? Color.White : Color.DarkGray, 0, true)); skillBarUI.Items.Add(new UIText("[" + Slots[4].Key + "]", new Point(315, 23), 0.16f, Color.White, 0, true)); return skillBarUI; }
protected override void OnPopup(UIContainer popup, object[] args) { var wep = (WeaponDefinition)args[0]; popup.Size = new Size(UI.WIDTH, 115); popup.Position = new Point(0, 0); var startedText = "Weapon Unlocked"; var color = Color.FromArgb(150, 100, 180, 0); popup.Items.Add(new UIText(startedText, new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 0), new Size(UI.WIDTH, 25), color)); popup.Items.Add(new UIText("- " + wep.WeaponName + " -", new Point(UI.WIDTH / 2, 15), 1.3f, Color.White, 0, true)); popup.Items.Add(new UIText(wep.Description, new Point(UI.WIDTH / 2, 80), 0.4f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 25), new Size(UI.WIDTH, 80), color)); }
public override void Draw(Size offset) { HeaderColor = Color.White; var container = new UIContainer(new Point(), new Size(UI.WIDTH, UI.HEIGHT), Color.FromArgb(180, 45, 45, 45)); container.Items.Add(new UIRectangle(new Point(0, UI.HEIGHT / 2 - 40), new Size(UI.WIDTH, 45), TopColor)); container.Items.Add(new UIText(_headerCaption.ToUpper(), new Point(UI.WIDTH / 2, UI.HEIGHT / 2 - 40 + 5), HeaderScale, HeaderColor, 0, true)); container.Items.Add(new UIRectangle(new Point(0, UI.HEIGHT / 2 - 40 + 45), new Size(UI.WIDTH, 20), SelectedIndex == 0 ? SelectedItemColor : UnselectedItemColor)); container.Items.Add(new UIText("- " + _yesText + " -", new Point(UI.WIDTH / 2, UI.HEIGHT / 2 - 40 + 45), 0.3f, SelectedIndex == 0 ? SelectedTextColor : UnselectedTextColor, 0, true)); container.Items.Add(new UIRectangle(new Point(0, UI.HEIGHT / 2 - 40 + 65), new Size(UI.WIDTH, 20), SelectedIndex == 1 ? SelectedItemColor : UnselectedItemColor)); container.Items.Add(new UIText("- " + _noText + " -", new Point(UI.WIDTH / 2, UI.HEIGHT / 2 - 40 + 65), 0.3f, SelectedIndex == 1 ? SelectedTextColor : UnselectedTextColor, 0, true)); container.Draw(); }
protected override void OnPopup(UIContainer popup, object[] args) { if (args.Length > 0) { AddNotification((Notification) args[0]); } popup.Size = new Size(UI.WIDTH / 7, UI.HEIGHT - 150); popup.Position = new Point((UI.WIDTH/2) - (UI.WIDTH/7/2), 25); for (int i = 0; i < _notifications.Count; i++) { popup.Items.Add(new UIText("- " + _notifications[i].Text + " -", new Point(popup.Size.Width / 2, popup.Position.Y + popup.Size.Height - 50 - 25 - (i * 25)), 0.23f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, popup.Position.Y + popup.Size.Height - 50 - 25 - (i * 25)), new Size(popup.Size.Width, 14), _notifications[i].GetColor())); } ResetTimeWaited(); }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); popup.Position = new Point(0, UI.HEIGHT / 2 - 200); popup.Items.Add(new UIText("congratulations", new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 0), new Size(UI.WIDTH, 25), Color.FromArgb(150, 2, 70, 200))); popup.Items.Add(new UIText("- you are now level " + RPG.PlayerData.Level + " -", new Point(UI.WIDTH / 2, 15), 1.5f, Color.White, 0, true)); var unlockedWeapons = RPG.PlayerData.Weapons.Where(w => w.LevelToUnlock == RPG.PlayerData.Level).Select(w => w.WeaponName).ToArray(); var unlocks = string.Join(", ", unlockedWeapons); if(unlockedWeapons.Any()) popup.Items.Add(new UIText("- weapons unlocked: "+ unlocks + " -", new Point(UI.WIDTH / 2, 80), 0.32f, Color.White, 0, true)); popup.Items.Add(new UIRectangle(new Point(0, 25), new Size(UI.WIDTH, 80), Color.FromArgb(150, 2, 70, 200))); }
private void CreateDebugWindow() { _uiContainerDebug = new UIContainer(new Point(0, 0), new Size(1280, 720), Color.FromArgb(25, 237, 239, 241)); _uiContainerDebug.Items.Add(new UIRectangle(new Point(0, 0), new Size(400, 30), Color.FromArgb(255, 26, 188, 156))); _uiContainerDebug.Items.Add(new UIText("Tobii Eye tracking", new Point(200, 4), 0.5f, Color.WhiteSmoke, 0, true)); _uiContainerDebug.Items.Add(new UIRectangle(new Point(0, 30), new Size(400, 150), Color.FromArgb(135, 26, 187, 155))); DebugText1 = new UIText("Debug", new Point(200, 34), 0.4f, Color.Black, 0, true); _uiContainerDebug.Items.Add(DebugText1); DebugText2 = new UIText("Debug", new Point(200, 64), 0.4f, Color.Black, 0, true); _uiContainerDebug.Items.Add(DebugText2); DebugText3 = new UIText("Debug", new Point(200, 94), 0.4f, Color.Black, 0, true); _uiContainerDebug.Items.Add(DebugText3); DebugText4 = new UIText("Debug", new Point(200, 124), 0.4f, Color.Black, 0, true); _uiContainerDebug.Items.Add(DebugText4); DebugText5 = new UIText("Debug", new Point(200, 154), 0.4f, Color.Black, 0, true); _uiContainerDebug.Items.Add(DebugText5); }
public PhoneApp(int type, SmartPhone phone, int consumeRate, Entity owner = null, string Title = "") : base(type, -1, owner) { this.ConsumeRate = consumeRate; this.phone = phone; this.ActiveEffects = new ItemEffect[0]; this.PassiveEffects = new ItemEffect[0]; //This container allows the TextSprite to be centred UIContainer PageTitleContainer = new UIContainer(Color.White, Color.White, Width: SmartPhone.SCREEN_RECT.Width, CursorType: CursorType.Cursor, MarginTop: 10, MarginBottom: 10, CentreHorizontal: true); TextSprite PageTitle = new TextSprite(Title, 2, Color.White, SmartPhone.SCREEN_RECT.Width, CursorType: CursorType.Cursor); PageTitleContainer.AddElement(PageTitle); HUD = new UIGrid(Width: SmartPhone.SCREEN_RECT.Width, Height: SmartPhone.SCREEN_RECT.Height, CursorType: CursorType.Cursor, GridColumns: 1, ColWidth: SmartPhone.SCREEN_RECT.Width); HUD.AddElement(PageTitleContainer); PageContent = new UIGrid(Width: SmartPhone.SCREEN_RECT.Width, Height: SmartPhone.SCREEN_RECT.Height - PageTitleContainer.Height, CursorType: CursorType.Cursor, GridColumns: 1, ColWidth: SmartPhone.SCREEN_RECT.Width); HUD.AddElement(PageContent); }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); string[] lines = new string[] { "Thank you for playing the GTA:RPG experience. It's a work in progress and ", "hopefully this preview has been fun to play. More missions soon!", "", "Your feedback and support is important in making this a great mod.", "Feel free to continue playing, completing contracts and earning exp.", "", "Planned Features in the future:", "Vehicle: Mod tree, cruise control and weapon systems", "Quests: Animated cutscenes and more quest condition types ", "Player Customisation: More customisation for player stats and progression", "", "Once again thanks for playing, hope you had a great time.", "LogicSpawn", "Press E to Close", }; var extra = lines.Length; popup.Size = new Size(popup.Size.Width, popup.Size.Height + extra*20); popup.Position = new Point(0, UI.HEIGHT / 2 - 50); var headerText = "GTA:RPG"; var color = Color.FromArgb(150, 2, 70, 200); popup.Color = color; popup.Items.Add(new UIText(headerText, new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- Thanks for Playing -", new Point(UI.WIDTH / 2, 15), 1.5f, Color.White, 0, true)); var point = 100; for (int index = 0; index < extra; index++) { var text = lines[index]; popup.Items.Add(new UIText(text, new Point(UI.WIDTH / 2, point + (index * 15)), 0.24f, Color.White, 0, true)); } }
protected override void OnPopup(UIContainer popup, object[] args) { popup.Size = new Size(UI.WIDTH, 105); string[] lines = new string[] { "Press j to open the main menu to browse the inventory, buy goods, receive contracts", "Earn XP by getting kills, completing missions and destroying vehicles", "In the Character Menu section, you can unlock new skills for SP ( Gained alongside normal XP) ", "Remember, you can press K at any time to respawn your personal vehicle.", "This mod is a work in progress, expect things to improve", "Hotkeys:", "[J] Main Menu -- [I] Inventory -- [O] Character Menu -- [K] Spawn Your Vehicle -- [L] Quest Log ", "[F8] Save Game -- [F9] Load Game -- [F10] New Game -- [F11] Debug -- ", "[T] Skill 1 -- [Y] Skill 2 -- [CapsLock] Skill 3 -- [U] Skill 4 -- [B] Skill 5", "Close", "Press E to close this popup", }; var extra = lines.Length; popup.Size = new Size(popup.Size.Width, popup.Size.Height + extra*20); popup.Position = new Point(0, UI.HEIGHT / 2 - 50); var headerText = "Welcome to GTA:RPG"; var color = Color.FromArgb(150, 2, 70, 200); popup.Color = color; popup.Items.Add(new UIText(headerText, new Point(UI.WIDTH / 2, 0), 0.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- Game Guide -", new Point(UI.WIDTH / 2, 15), 1.5f, Color.White, 0, true)); popup.Items.Add(new UIText("- Basic info to get you started -", new Point(UI.WIDTH / 2, 80), 0.25f, Color.White, 0, true)); var point = 100; for (int index = 0; index < extra; index++) { var text = lines[index]; popup.Items.Add(new UIText("- " + text + " -", new Point(UI.WIDTH / 2, point + (index * 15)), 0.24f, Color.White, 0, true)); } }
private UIContainer GetQuestTracker() { var quests = PlayerData.Quests.Where(q => q.InProgress).ToList(); if(!quests.Any()) return new UIContainer(); //350 IS MAP height Point questTrackerPoint; switch (PlayerData.Setup.SafeArea) { case 0: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 63 : 63), 10); break; case 1: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 57 : 57), 15); break; case 2: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 51 : 50), 20); break; case 3: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 45 : 45), 25); break; case 4: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 39 : 39), 30); break; case 5: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 32 : 32), 35); break; case 6: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 26 : 26), 40); break; case 7: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 19 : 19), 45); break; case 8: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 13 : 13), 50); break; case 9: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 6 : 6), 55); break; case 10: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), 60); break; default: questTrackerPoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), 65); break; } var questTracker = new UIContainer(questTrackerPoint, new Size(180, UI.HEIGHT - 190)); //note: -180 for non-RPG-UI var bottomPoint = (questTracker.Size.Height); for (int i = quests.Count -1; i >= 0; i--) { var quest = quests[i]; var text = quest.GetProgressString(); var formattedText = RPGUI.FormatText(text, 80); var lines = formattedText.Length; var height = 15 + (lines * 10) + 2; bottomPoint = bottomPoint - height; var point = new Point(5,bottomPoint); questTracker.Items.Add(new UIRectangle(point, new Size(170, 15), Color.FromArgb(120, 255, 255, 255))); questTracker.Items.Add(new UIText(quest.Name, new Point(point.X + 1, point.Y),0.25f,Color.FromArgb(230,8,8,8),0,false)); questTracker.Items.Add(new UIText((i+1).ToString("00"), new Point(point.X + 170 - 14, point.Y + 1),0.25f,Color.FromArgb(230,78,78,78),Font.Monospace, false)); for (int j = 0; j < lines; j++) { questTracker.Items.Add(new UIText(formattedText[j], new Point(5 + point.X, point.Y + 15 + (j * 10)), 0.2f, Color.White, 0, false)); } //questTracker.Items.Add(new UIText("- " + quest.GetProgressString(), new Point(point.X, point.Y + 15),0.2f,Color.White,0,false)); //questTracker.Items.Add(new UIText("- Malvoro is upset with your last mission.\n- Kill Antonio\n- Speak to bob\n- Eat cakes\n- Dist: 5m", new Point(5 + point.X, point.Y + 15),0.2f,Color.White,0,false)); } questTracker.Items.Add(new UIText("Missions", new Point(1, bottomPoint - 17), 0.28f, Color.White, 0, false)); //questTracker.Items.Add(new UIRectangle(new Point(1, bottomPoint - 17), new Size(180 - 6, 15), Color.FromArgb(120, 150, 150, 150))); return questTracker; }
public override void Draw(Size offset) { if (!RPGSettings.ShowUI) return; if (ExtendWindowHeight) { new UIRectangle(new Point(offset.Width, offset.Height - UI.HEIGHT), new Size(300, UI.HEIGHT), UnselectedItemColor).Draw(); } var container = new UIContainer(new Point(UI.WIDTH/2 - 300, UI.HEIGHT - 150), new Size(600, 140)); new UIRectangle(new Point(0, UI.HEIGHT - 150),new Size(UI.WIDTH,140), Color.FromArgb(70, 8, 8, 8)).Draw(); var lines = RPGUI.FormatText(Caption, 90); container.Items.Add(new UIText(lines[0], new Point(301, 5 + 1), 0.42f, Color.Black, Font.ChaletComprimeCologne, true)); container.Items.Add(new UIText(lines[0], new Point(300, 5), 0.42f, Color.White, Font.ChaletComprimeCologne, true)); if(lines.Length >1) { container.Items.Add(new UIText(lines[1], new Point(301, 25 + 1), 0.42f, Color.Black, Font.ChaletComprimeCologne, true)); container.Items.Add(new UIText(lines[1], new Point(300, 25), 0.42f, Color.White, Font.ChaletComprimeCologne, true)); } for (int i = 0; i < 4; i++) { if (i > Items.Count - 1) break; var item = Items[i]; var color = SelectedIndex == i ? Color.Orange : Color.White; var guessedWidth = (int)(6f * item.Caption.Length); guessedWidth -= item.Caption.Count(x => x == 'i' || x == 'l' || x == '!' || x == '\'' || x == ',' || x == '.' || x == 'I') * 4; guessedWidth -= item.Caption.Count(x => x == ' ') * 2; var pos = 268 - 10 - guessedWidth; switch(i) { case 3: container.Items.Add(new UIText(item.Caption, new Point(pos + 1, 56), 0.4f, Color.FromArgb(180, 0, 0, 0), Font.ChaletComprimeCologne, false)); container.Items.Add(new UIText(item.Caption, new Point(pos, 55), 0.4f, color, Font.ChaletComprimeCologne, false)); break; case 0: container.Items.Add(new UIText(item.Caption, new Point(341, 56), 0.4f, Color.FromArgb(180,0,0,0), Font.ChaletComprimeCologne, false)); container.Items.Add(new UIText(item.Caption, new Point(340, 55), 0.4f, color, Font.ChaletComprimeCologne, false)); break; case 2: container.Items.Add(new UIText(item.Caption, new Point(pos + 1, 86), 0.4f, Color.FromArgb(180, 0, 0, 0), Font.ChaletComprimeCologne, false)); container.Items.Add(new UIText(item.Caption, new Point(pos, 85), 0.4f, color, Font.ChaletComprimeCologne, false)); break; case 1: container.Items.Add(new UIText(item.Caption, new Point(341, 86), 0.4f, Color.FromArgb(180, 0, 0, 0), Font.ChaletComprimeCologne, false)); container.Items.Add(new UIText(item.Caption, new Point(340, 85), 0.4f, color, Font.ChaletComprimeCologne, false)); break; } } container.Draw(); var colorA = SelectedIndex == 3 ? Color.Orange : Color.SteelBlue; var colorB = SelectedIndex == 0 ? Color.Orange : Color.SteelBlue; var colorC = SelectedIndex == 2 ? Color.Orange : Color.SteelBlue; var colorD = SelectedIndex == 1 ? Color.Orange : Color.SteelBlue; new GTASprite("helicopterhud", "hud_corner").Draw(new Point(UI.WIDTH / 2 - 33, UI.HEIGHT - 100), 32, 32, colorA); //1 new GTASprite("helicopterhud", "hud_corner").Draw(new Point(UI.WIDTH / 2 + 1, UI.HEIGHT - 100), 32, 32, colorB,90); //2 new GTASprite("helicopterhud", "hud_corner").Draw(new Point(UI.WIDTH / 2 - 33, UI.HEIGHT - 100 + 32), 32, 32, colorC,270); //3 new GTASprite("helicopterhud", "hud_corner").Draw(new Point(UI.WIDTH / 2 + 1, UI.HEIGHT - 100 + 32), 32, 32, colorD, 180); //4 if(Items.Count > 3) { new GTASprite("helicopterhud", "hud_line").Draw(new Point(UI.WIDTH / 2 - 33 - 10, UI.HEIGHT - 84), 20, 3, colorA); //1 } if(Items.Count > 2) { new GTASprite("helicopterhud", "hud_line").Draw(new Point(UI.WIDTH / 2 - 33 - 10, UI.HEIGHT - 84 + 30), 20, 3, colorC); //3 } if(Items.Count > 0) { new GTASprite("helicopterhud", "hud_line").Draw(new Point(UI.WIDTH / 2 + 1 + 20, UI.HEIGHT - 84), 20, 3, colorB); //2 } if(Items.Count > 1) { new GTASprite("helicopterhud", "hud_line").Draw(new Point(UI.WIDTH / 2 + 1 + 20, UI.HEIGHT - 84 + 30), 20, 3, colorD); //4 } var bottomY = offset.Height + 70 + Items.Count * ItemHeight; if (HasFooter) bottomY += FooterHeight; bottomY += HeaderHeight; if(ExtendWindowHeight) { new UIRectangle(new Point(offset.Width, bottomY), new Size(300, UI.HEIGHT), UnselectedItemColor).Draw(); new UIRectangle(new Point(offset.Width + 300, offset.Height - UI.HEIGHT), new Size(2, UI.HEIGHT * 2), Color.FromArgb(200, 8, 8, 8)).Draw(); } }
public static void SetAlpha(UIContainer popup, int alpha) { for (int index = 0; index < popup.Items.Count; index++) { var i = popup.Items[index]; var r = i.Color.R; var g = i.Color.G; var b = i.Color.B; i.Color = Color.FromArgb(alpha, r, g, b); } }
public void UpdateX() { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; //Loot Interact var nearbyLoot = RPGInfo.NearbyLoot; var showingLoot = false; if (nearbyLoot != null) { if (nearbyLoot.Item.Type == ItemType.Money || nearbyLoot.Item.Type == ItemType.QuestItem) { RPGMethods.Loot(nearbyLoot); } else if (ShowUI) { var interactUI = new UIContainer(new Point(UI.WIDTH / 2 - 120, UI.HEIGHT - 100), new Size(240, 17), Color.FromArgb(70, 70, 200, 70)); interactUI.Items.Add(new UIText("Press E To Loot " + nearbyLoot.Name, new Point(240 / 2, 1), 0.25f, Color.White, 0, true)); interactUI.Draw(); showingLoot = true; } } if (CurrentDialog != null && !IsOpen(DialogMenu)) { World.RenderingCamera = NpcCamera; OpenDialog(); } if (!ShowUI || CurrentDialog != null) return; //NPC Interact if(!showingLoot && CurrentDialog == null && !Game.Player.Character.IsInCombat) { var nearestPed = RPGInfo.NearestPed; if (nearestPed != null) { var npcObject = RPG.WorldData.Npcs.FirstOrDefault(n => n.IsQuestNpc && n.EntityHandle == nearestPed.Handle); if (npcObject != null) { var interactUI = new UIContainer(new Point(UI.WIDTH / 2 - 120, UI.HEIGHT - 122), new Size(240, 17), Color.FromArgb(70, 190, 190, 190)); interactUI.Items.Add(new UIText("Press E to Interact with " + npcObject.Name, new Point(240 / 2, 1), 0.25f, Color.White, 0, true)); interactUI.Draw(); } } } if (vehicle != null) { var speed = ((int)(vehicle.Speed * 2.45)).ToString("000"); new UIText(" MPH", new Point(RPGInfo.IsWideScreen ? 207 : 248, UI.HEIGHT - 41), 0.22f, Color.White, 0, false).Draw(); //55 new UIText(speed, new Point(RPGInfo.IsWideScreen ? 192 : 233, UI.HEIGHT - 41), 0.22f, Color.White, 0, false).Draw(); //55 } //Player text //new UIText(PlayerData.Name.ToLower() + " level " + PlayerData.Level + " criminal", new Point(51, UI.HEIGHT - 55), 0.25f, Color.White, 0, false).Draw(); //Expbar var expBarUI = new UIContainer(new Point(0, UI.HEIGHT - 2), new Size(UI.WIDTH, 2), Color.FromArgb(180, 20, 20, 20)); var percentExp = (float)PlayerData.Exp / PlayerData.ExpToLevel; expBarUI.Items.Add(new UIRectangle(new Point(0, 0), new Size((int)(percentExp * UI.WIDTH), 2), Color.FromArgb(220, 255, 255, 0))); expBarUI.Draw(); #region "RPG Style UI" var borderColor = Color.FromArgb(255, 75, 75, 75); Point rectanglePoint; Point textPoint; switch(PlayerData.Setup.SafeArea) { case 0: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 63 : 63), UI.HEIGHT - 47); textPoint = new Point((RPGInfo.IsWideScreen ? 63 : 63), UI.HEIGHT - 48); break; case 1: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 57 : 57), UI.HEIGHT - 43); textPoint = new Point((RPGInfo.IsWideScreen ? 57 : 57), UI.HEIGHT - 44); break; case 2: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 51 : 50), UI.HEIGHT - 40); // textPoint = new Point((RPGInfo.IsWideScreen ? 51 : 51), UI.HEIGHT - 41); // break; case 3: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 45 : 45), UI.HEIGHT - 36); textPoint = new Point((RPGInfo.IsWideScreen ? 45 : 45), UI.HEIGHT - 37); break; case 4: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 39 : 39), UI.HEIGHT - 33); textPoint = new Point((RPGInfo.IsWideScreen ? 39 : 39), UI.HEIGHT - 34); break; case 5: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 32 : 32), UI.HEIGHT - 29); textPoint = new Point((RPGInfo.IsWideScreen ? 32 : 32), UI.HEIGHT - 30); break; case 6: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 26 : 26), UI.HEIGHT - 26); textPoint = new Point((RPGInfo.IsWideScreen ? 26 : 26), UI.HEIGHT - 27); break; case 7: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 19 : 19), UI.HEIGHT - 22); textPoint = new Point((RPGInfo.IsWideScreen ? 19 : 19), UI.HEIGHT - 23); break; case 8: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 13 : 13), UI.HEIGHT - 18); textPoint = new Point((RPGInfo.IsWideScreen ? 13 : 13), UI.HEIGHT - 19); break; case 9: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 6 : 6), UI.HEIGHT - 15); textPoint = new Point((RPGInfo.IsWideScreen ? 6 : 6), UI.HEIGHT - 16); break; case 10: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), UI.HEIGHT - 10); textPoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), (RPGInfo.IsWideScreen ? UI.HEIGHT - 11 : UI.HEIGHT - 12)); break; default: rectanglePoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), UI.HEIGHT - 10); textPoint = new Point((RPGInfo.IsWideScreen ? 0 : 0), (RPGInfo.IsWideScreen ? UI.HEIGHT - 11 : UI.HEIGHT - 12)); break; } new UIRectangle(rectanglePoint, new Size(181, 10), borderColor).Draw(); //playerinfo new UIText(PlayerData.Name + " Level " + PlayerData.Level + " " + PlayerData.Class.ToString().Replace("_", " "), textPoint, 0.22f, Color.White, 0, false).Draw(); var offset = ShowingSubtitle ? - 85 : 0; new UIRectangle(new Point(UI.WIDTH / 2 - 173, UI.HEIGHT - 45 - 28 + offset), new Size(345, 10), Color.FromArgb(60, 0, 0, 0)).Draw(); new UIRectangle(new Point(UI.WIDTH / 2 - 173, UI.HEIGHT - 45 - 13 + offset), new Size(345, 10), Color.FromArgb(60, 0, 0, 0)).Draw(); var hpText = string.Format("HP: {0}/{1}",Game.Player.Character.Health,Game.Player.Character.MaxHealth); var armorText = string.Format("Armor: {0}/{1}", Game.Player.Character.Armor, 100); var hp = ((float) Game.Player.Character.Health/Game.Player.Character.MaxHealth); var ap = ((float) Game.Player.Character.Armor/100); var hpColor = Color.FromArgb(120,33,149,34); if(hp < 0.2f) { hpColor = Color.FromArgb(120, 139, 0, 0); } else if(hp < 0.4f) { hpColor = Color.FromArgb(120, 255, 69, 0); } new UIRectangle(new Point(UI.WIDTH / 2 - 173, UI.HEIGHT - 45 - 28 + offset), new Size((int)(hp * 345), 10), hpColor).Draw(); new UIRectangle(new Point(UI.WIDTH / 2 - 173, UI.HEIGHT - 45 - 13 + offset), new Size((int)(ap * 345), 10), Color.FromArgb(180, 30, 144, 255)).Draw(); new UIText(hpText, new Point(UI.WIDTH / 2, UI.HEIGHT - 45 - 28 - 2 + offset), 0.22f, Color.White, 0, true).Draw(); new UIText(armorText, new Point(UI.WIDTH / 2, UI.HEIGHT - 45 - 13 - 2 + offset), 0.22f, Color.White, 0, true).Draw(); #endregion //Character window #2 if (View.ActiveMenus > 0) { var charPanel = new UIContainer(new Point(UI.WIDTH - 300, View.MenuPosition.Y - 215), new Size(300, 200), Color.Gray); //todo: what should we draw here? //charPanel.Draw(); } //Quest Tracker if(ShowQuestTracker) { GetQuestTracker().Draw(); } //Skill bar if(ShowSkillBar) { var skillOffset = ShowingSubtitle ? -80 : 0; var skillBarUI = RPG.SkillHandler.GetSkillBar(skillOffset); skillBarUI.Draw(); } }
//private void ChangeVariation(int obj) //{ // var index = Mennu.SelectedIndex; // var kvp = variations.ElementAt(index); // var component = kvp.Key; // Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, component, obj, 0,0); //} //private Menu Mennu; //Dictionary<int, int> variations = new Dictionary<int, int>(); // // //private void SelectTile(int obj) //{ // throw new NotImplementedException(); //} public override void Update() { if(Game.IsKeyPressed(Keys.F5)) { //try //{ //RPG.PlayerData.AddMoney(20120324); //var mmmmmenu = new TiledMenu("Select Your Gender", // new TiledPanel("Male", new GTASprite("mptattoos1", "tattoo_drugdeal", Color.Red), Color.DodgerBlue, SelectTile, "Play as an XY chromosome."), // new TiledPanel("Female", new GTASprite("mptattoos", "killplayerbountyhead", Color.Purple),Color.Pink, SelectTile, "Play as an XX chromosome.")); //View.AddMenu(mmmmmenu); //variations = new Dictionary<int, int>(); //for (int i = 0; i < 10 ; i++) //{ // var a = Function.Call<int>(Hash._0x5FAF9754E789FB47, Game.Player.Character, i); // //if(a > 1) // //{ // // variations.Add(i,a); // RPGLog.Log("Tried " + i + " got variations: " + a); // //} //} //Function.Call(Hash.SET_PED_RANDOM_PROPS, Game.Player.Character); //Function.Call(Hash.SET_PED_PROP_INDEX, Game.Player.Character, 0, adasdasdasdij); //adasdasdasdij++; // // View.MenuPosition = new Point(UI.WIDTH/2 - 150, UI.HEIGHT - 300); // Mennu.Width = 300; // RPGUI.FormatMenu(Mennu); // View.AddMenu(Mennu); //} //catch (Exception ex) //{ // RPGLog.Log(ex); //} //Wait(500); //try //{ // var outArg = new OutputArgument(); // var a = Function.Call<Vector3>(Hash.GET_HUD_COMPONENT_POSITION, 15, outArg); // RPG.Notify("a: " + a); // RPG.Notify("a: " + outArg.GetResult<Vector3>()); // //} //catch //{ // //} //string s = Game.GetUserInput(100); //try //{ // var propName = s; // Model m = propName; // var p = World.CreateProp(m, Game.Player.Character.Position + Game.Player.Character.ForwardVector * 2, true, true); // Wait(5000); // if (p.Exists()) // { // p.Delete(); // } //} //catch (Exception) //{ // RPG.Notify("err"); //} } if (!Debug) return; var c = new UIContainer(new Point(UI.WIDTH - 305, UI.HEIGHT - 305), new Size(300, 300), Color.FromArgb(180, 50, 50, 50)); var debug = ""; debug += "player co-ordinates: " + VecStr(Game.Player.Character.Position) + "\n"; debug += "- heading: " + Game.Player.Character.Heading + "\n"; debug += "- rotation: " + VecStr(Game.Player.Character.Rotation) + "\n"; debug += "- model hash: " + Game.Player.Character.Model.Hash + "\n"; var v = new UIText(debug,new Point(0, 0), 0.25f, Color.White); var cardebug = ""; if (Game.Player.Character.IsInVehicle()) { cardebug += "vehicle model: " + Game.Player.Character.CurrentVehicle.Model.Hash + "\n"; cardebug += "- heading: " + Game.Player.Character.CurrentVehicle.Heading + "\n"; cardebug += "- rotation: " + VecStr(Game.Player.Character.CurrentVehicle.Rotation) + "\n"; } var x = new UIText(cardebug, new Point(0, 200), 0.25f, Color.White); c.Items.Add(v); c.Items.Add(x); c.Draw(); }