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 (RPGSettings.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); }
//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); if (Game.Player.Character.IsInVehicle()) { debug += "vehicle model: " + Game.Player.Character.CurrentVehicle.Model.Hash + "\n"; debug += "- heading: " + Game.Player.Character.CurrentVehicle.Heading + "\n"; debug += "- rotation: " + VecStr(Game.Player.Character.CurrentVehicle.Rotation) + "\n"; } foreach (var wep in RPG.PlayerData.Weapons) { debug += string.Format("Weapon: {0} [{1}] , Unlocked {2} \n", wep.WeaponName, wep.WeaponHash.ToString(), wep.Unlocked); } var lines = RPGUI.FormatText(debug, 99); for (int i = 0; i < lines.Length; i++) { var x = new UIText(lines[i], new Point(0, 0 + (30 * i)), 0.25f, Color.White); c.Items.Add(x); } c.Draw(); }