Inheritance: MonoBehaviour
 public ActionResult Add(UI.Models.PortalContact contact)
 {
     Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
     string jsoncontact = Newtonsoft.Json.JsonConvert.SerializeObject(contact);
     appclient.CreateContact(Session["companyid"].ToString(), Session["companyid"].ToString(), Guid.NewGuid().ToString().Replace("-",""), contact.designation, contact.title, contact.firstname, contact.lastname, contact.emailaddress, contact.officephone, contact.secondaryemail, contact.mobilephone, jsoncontact, contact.objecttype,"", Session["companyid"].ToString());
     return RedirectToAction("index");
 }
	void DisplayMenu ()
	{
		if (Social.localUser == null || !Social.localUser.authenticated) {
			if (GUILayout.Button("Login/Register")) {
				LumosSocialGUI.ShowWindow(LumosGUIWindow.Login);
			}
		} else {
			if (GUILayout.Button("Achievements")) {
				LumosSocialGUI.ShowWindow(LumosGUIWindow.Achievements);
			}
			
			if (GUILayout.Button("Leaderboards")) {
				LumosSocialGUI.ShowWindow(LumosGUIWindow.Leaderboards);
			}
			
			if (GUILayout.Button("Profile")) {
				LumosSocialGUI.ShowWindow(LumosGUIWindow.Profile);
			}
			
			if (GUILayout.Button("Settings")) {
				LumosSocialGUI.ShowWindow(LumosGUIWindow.Settings);
			}
			
			if (GUILayout.Button("Close")) {
				currentUI = UI.None;
			}
		}
	}
        protected override HtmlNode CreateInput(UI.UIControlState state)
        {
            HtmlComposite ul = new HtmlComposite("ul", new HtmlAttribute("class", "unstyled"));

            foreach (KeyValuePair<object, object> item in state.Options)
            {
                HtmlComposite li = new HtmlComposite("li");
                ul.Children.AddLast(li);
                
                
                string id = state.Name + "_" + item.Key;
                HtmlComposite label = new HtmlComposite("label", new HtmlAttribute("class", "checkbox"));
                li.Children.AddLast(label);

                HtmlStandalone checkbox = new HtmlStandalone("input",
                    new HtmlAttribute("type", "radio"),
                    new HtmlAttribute("id", id),
                    new HtmlAttribute("name", state.Name),
                    new HtmlAttribute("value", item.Key));

                if (state.Value.Equals(item.Key))
                    checkbox.Attributes.AddLast("checked", "checked");


                label.Children.AddLast(checkbox);
                label.Children.AddLast(new HtmlText(" " + item.Value));

            }

            return ul;
        }
Exemplo n.º 4
0
        public virtual void Render(System.IO.TextWriter writer, UI.UIControlState state, params HtmlAttribute[] attributes)
        {
            if (_Label == null)
                _Label = new HtmlSimple("label", state.Label, new HtmlAttribute("for", state.Name));

            _Label.Write(writer);

            if (_Input == null)
                _Input = CreateInput(state);

            for (int i = 0; i < attributes.Length; i++)
                _Input.Attributes[attributes[i].Name] = attributes[i].Value;

            this._Input.Write(writer);

            if (!string.IsNullOrEmpty(state.ErrorMessage))
                new HtmlSimple("span", state.ErrorMessage, new HtmlAttribute("class", "error")).Write(writer);
            else
            {
                if (!string.IsNullOrEmpty(state.Hint))
                {
                    if (_Hint == null)
                        _Hint = new HtmlSimple("span", state.Hint, new HtmlAttribute("class", "hint"));

                    _Hint.Write(writer);
                }
            }
        }
        public ReviewClientOrderPage(YellowstonePathology.Business.Rules.Surgical.PatientRecentAccessions patientRecentAccessions,
			YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder,
			UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_PatientRecentAccessions = patientRecentAccessions;
            this.m_ClientOrder = clientOrder;
            this.m_PageNavigator = pageNavigator;

            InitializeComponent();

            this.DataContext = this;

            if (this.m_ClientOrder.Accessioned == true)
            {
                this.m_CloseButtonVisibility = System.Windows.Visibility.Collapsed;
                this.m_NextButtonVisibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.m_CloseButtonVisibility = System.Windows.Visibility.Visible;
                this.m_NextButtonVisibility = System.Windows.Visibility.Collapsed;
            }

            this.Loaded += new RoutedEventHandler(ReviewClientOrderPage_Loaded);
        }
Exemplo n.º 6
0
 public Dama()
 {
     InitializeComponent();
     ui = new UI();
     this.Width = 650;
     this.Height = 540;
     igra = false;
     polje = new int[10, 10];
     poteze1 = new List<Poteza>();
     poteze2 = new List<Poteza>();
     poteze = new List<Poteza>();
     narejene_poteze = new List<Poteza>();
     poteza = true;
     stran = true;
     prvi_klik = false;
     stevilka_poteze = -1;
     slika = new Bitmap(530, 530);
     pictureBox1.Width = 510;
     pictureBox1.Height = 510;
     besedilo.Top = 5;
     besedilo.Left = 510;
     besedilo.Width = 180;
     besedilo.Height = 500;
     besedilo.ScrollBars = ScrollBars.Vertical;
     besedilo.Text += "Pozdravljeni! \r\n";
     pictureBox1.Image = slika;
     potrebno = true;
     ctrl = z = false;
     menu();
 }
Exemplo n.º 7
0
 static void Main()
 {
     var ui = new UI(new RealConsoleAdapter());
     while (ui.Process())
     {
     }
 }
Exemplo n.º 8
0
        public Settings(UI ui)
            : base(ui)
        {
            this.name = "Settings";

            CreatePage();
        }
 public ActionResult Add(UI.Models.Job jobdata)
 {
     UI.Models.Job job = new Models.Job();
     jobdata.PayRate = jobdata.PayRate + "-" + jobdata.payratemax;
     job.InsertJobDetials(jobdata);
     return RedirectToAction("index", "jobs", null);
 }
Exemplo n.º 10
0
        public virtual void Render(System.IO.TextWriter writer, UI.UIControlState state, params HtmlAttribute[] attributes)
        {


            writer.Write("<div class=\"");
            if (state.Validated)
            {
                if (string.IsNullOrEmpty(state.ErrorMessage))
                {
                    writer.Write("form-group has-success");
                }
                else
                {
                    writer.Write("form-group has-error");
                }
            }
            else
            {
                writer.Write("form-group");
            }

            writer.WriteLine("\">");

            RenderLabel(writer, state);
            RenderInput(writer, state, attributes);
            RenderHintOrError(writer, state);


            writer.WriteLine("</div>");

        }
Exemplo n.º 11
0
 public TiawpsReader(UI.DelegateManager delegatemanager, string filename)
 {
     this.delegatemanager = delegatemanager;
     readrguid = Guid.NewGuid();
     this.fileName = filename;
     name = System.IO.Path.GetFileNameWithoutExtension(fileName);
 }
        public ActionResult consultant(UI.Models.portaluser recruiterdata)
        {
            Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
            appclient.Addconsultant(recruiterdata.usermail, recruiterdata.userpassword, recruiterdata.usertitle, Session["usertoken"].ToString());

            return RedirectToAction("index");
        }
    void Start()
    {
        UITextInfo backTextInfo = new UITextInfo();
        backTextInfo.SetFont(fontBack).SetFontSize(24).SetColor(new Color(1f, 1f, 1f)).SetTextAlignment(UIAnchorLocation.LEFT_TOP);

        UITextInfo backTextLargerInfo = new UITextInfo();
        backTextLargerInfo.SetFont(fontBack).SetFontSize(28).SetColor(new Color(1f, 1f, 1f)).SetTextAlignment(UIAnchorLocation.LEFT_TOP);

        UIRelativeLayout rootLayout = new UIRelativeLayout("rootLayout", 0f, 0f, 1f, 1f, null, UIAnchorLocation.LEFT_BOT);

        UIStringLabel backLabelSmall = new UIStringLabel(0.01f, 0.99f, 0.2f, 0.1f, null, UILayoutType.RELATIVE_LAYOUT, UIAnchorLocation.LEFT_TOP, backTextInfo, "Back");
        UIStringLabel backLabelLarge = new UIStringLabel(0.01f, 0.99f, 0.2f, 0.1f, null, UILayoutType.RELATIVE_LAYOUT, UIAnchorLocation.LEFT_TOP, backTextLargerInfo, "Back");
        UIStaticButton backButton = new UIStaticButton(0.01f, 0.99f, 0.1f, 0.08f, null, UILayoutType.RELATIVE_LAYOUT, UIAnchorLocation.LEFT_TOP, new MenuButtonListener(hover, dehover, "MainMenu"));

        backButton.SetUIComponentIdle(backLabelSmall).SetUIComponentHighlighted(backLabelLarge);

        UITextInfo mainTextInfo = new UITextInfo();
        mainTextInfo.SetFont(fontMain).SetFontSize(48).SetColor(new Color(1f, 1f, 1f)).SetTextAlignment(UIAnchorLocation.LEFT_TOP);

        UIStringLabel mainTextLabel = new UIStringLabel(0.15f, 0.8f, 0.9f, 0.5f, null, UILayoutType.RELATIVE_LAYOUT, UIAnchorLocation.LEFT_TOP, mainTextInfo, mainText);

        rootLayout.AddUIComponent(backButton)
            .AddUIComponent(mainTextLabel);

        m_panel = new UI(rootLayout);
        m_panel.SetStartMenu(1);

        screenWidth = Screen.width;
        screenHeight = Screen.height;
    }
Exemplo n.º 14
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // build
            var es = new EventStore("eventstore.db");
            var ui = new UI();

            var sb = new Spielbrett(es.History);

            var sp = new Spiel(es);
            var schiri = new Schiedsrichter(es);
            var map = new Mapper(sb);
            var app = new App(sp, schiri, map);

            // bind
            es.OnAppended += sb.Update;

            app.Spielstand_aktualisiert += ui.Spielstand_anzeigen;

            ui.Neues_Spiel_gewünscht += app.Neues_Spiel;
            ui.Spielstein_gesetzt += app.Zug_ausführen;

            // run
            app.Starten();

            Application.Run(ui);
        }
Exemplo n.º 15
0
        public void Run()
        {
            var app = new MockApplication();
            var sut = new UI(app);

            Application.Run(sut);
        }
        protected override HtmlNode CreateInput(UI.UIControlState state)
        {
            HtmlComposite ul = new HtmlComposite("ul");

            System.Collections.IEnumerable items =
                state.Value is string ?
                ((string)state.Value).Split(',') :
                (System.Collections.IEnumerable)state.Value;

            foreach (KeyValuePair<object, object> item in state.Options)
            {
                HtmlComposite li = new HtmlComposite("li");
                ul.Children.AddLast(li);

                string id = state.Name + "_" + item.Key;

                li.Children.AddLast(new HtmlSimple("label", item.Value, new HtmlAttribute("for", id)));

                HtmlStandalone checkbox = new HtmlStandalone("input",
                    new HtmlAttribute("type", "checkbox"),
                    new HtmlAttribute("id", id),
                    new HtmlAttribute("name", state.Name),
                    new HtmlAttribute("value", item.Key));

                if (IsChecked(items, item.Key))
                    checkbox.Attributes.AddLast("checked", "checked");

                li.Children.AddLast(checkbox);
            }

            return ul;
        }
Exemplo n.º 17
0
	void Default(int active) {
		currentUI = Default;
		curActive = active;
		GUI.depth = 0;
		CreatePanel ();
		CreateNavButton ("Research",Research);
		CreateNavButton ("Components",Components);

        //Debug stuff

		/*if (CreateButton ("Spawn Ship")) {
			shipbuilder.SpawnShip();
		}

		if (CreateButton ("Destroy Ship")) {
			shipbuilder.DespawnShip();
		}
        */
		if (CreateButton ("Save")) 
			shipbuilder.Save ();
        /*

		if (CreateButton ("Load"))
			shipbuilder.Load (0);*/
	}
Exemplo n.º 18
0
        public About(UI ui)
            : base(ui)
        {
            this.name = "About";

            CreatePage();
        }
Exemplo n.º 19
0
    void Start()
    {
        instance = this;

        skullIcon.gameObject.SetActive(false);
        femur1.gameObject.SetActive(false);
        femur2.gameObject.SetActive(false);
    }
Exemplo n.º 20
0
        public bool ChangePassword(UI.Models.ProfileModelObject.ChangePassword changepassworddata,string accesstoken)
        {
            bool passwordchangestatus = false;
            Business.DataLayer datalayer = new DataLayer();
            datalayer.ChangePassword(changepassworddata.newpassword, changepassworddata.AuthToken, accesstoken);

            return passwordchangestatus;
        }
Exemplo n.º 21
0
	void Start ()
	{
		this._ui = new UI (new RulesBuilderBase ());
		this._ui.Load (this.XML.text, this._data);
		this._ui.Canvas.renderMode = RenderMode.ScreenSpaceOverlay;
		this._ui.Canvas.worldCamera = Camera.main;

	}
Exemplo n.º 22
0
 protected override HtmlNode CreateInput(UI.UIControlState state)
 {
     return new HtmlStandalone("input",
         new HtmlAttribute("type", "hidden"),
         new HtmlAttribute("name", state.Name),
         new HtmlAttribute("id", state.Name),
         new HtmlAttribute("value", state.Value));
 }
Exemplo n.º 23
0
 void Awake()
 {
     if (instance == null) {
         GameObject.DontDestroyOnLoad (this.gameObject);
         instance = this;
     } else
         GameObject.Destroy (this.gameObject);
 }
Exemplo n.º 24
0
 public static void Init( string _logFile, UI _form ) {
     form = _form;
     logFile = _logFile;
     if( !File.Exists( logFile ) ) {
         FileStream fs = File.Create( logFile );
         fs.Close();
     }
 }
Exemplo n.º 25
0
        public Core(UI.EventManager pEventManager)
        {
            EventManager = pEventManager;
            NameQueryResponseInfoList = new Dictionary<WoWGuid, NameQueryResponseInfo>();
            ChatList = new System.Collections.Specialized.StringCollection();
            ObjList = new Dictionary<WoWGuid, ObjectBase>();
 
        }
Exemplo n.º 26
0
    void Start()
    {
        breakingPoints = 0;

        breakingLimit = 2 + (ShelfGameManager.manager.currentLevel + 1) * 2;

        uiScript = FindObjectOfType<UI> ();
    }
Exemplo n.º 27
0
 /// <summary>
 /// Adds the properties to the solidworks page
 /// </summary>
 /// <param name="page">The page to be added to</param>
 /// <param name="id">The starting Id for the controls. Will be updated to the next avalible id</param>
 /// <param name="mark">The starting mark for the selection boxes.Will be updated to the next avalible mark</param>
 public override void AddPropertiesToSWPage(UI.JointPMPage page, ref int id, ref int mark)
 {
     modelDoc.ClearSelection2(true);
     Axes[0].AddAxisToPage(ref id, ref mark, page, ref AxisSelBoxIDs[0]);
     Axes[1].AddAxisToPage(ref id, ref mark, page, ref AxisSelBoxIDs[1]);
     if (!Axes[0].UseCustomMovementLimits && !((RotationalJointAxis)Axes[0]).IsContinuous)
         Axes[0].AddLimitsToPage(ref id, ref mark, page);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Set position and size of a GUI element using resolution-independant coordinates. Size of the screen in these coordinates is always 1280x720.
 /// There are a lot of overloads of this method that allow you to use <see cref="Vector2i"/>/<see cref="Vector2u"/> for position and/or size.
 /// </summary>
 /// <param name="ctrl">Gui element to resize</param>
 /// <param name="x">Distance from left of the window to left of ctrl</param>
 /// <param name="y">Distance from top of the window to top of ctrl</param>
 /// <param name="w">Width of ctrl</param>
 /// <param name="h">Height of ctrl</param>
 /// <param name="screenrect">Actual screen resolusion</param>
 /// <seealso cref="LayoutSprite"/>
 public static void LayoutControl(UI.Control ctrl, int x, int y, int w, int h, IntRect screenrect)
 {
     // x,y,w,h are relative to 1280x720
     ctrl.X = (int)((x / 1280.0f) * screenrect.Width);
     ctrl.Y = (int)((y / 720.0f) * screenrect.Height);
     ctrl.Width = (int)((w / 1280.0f) * screenrect.Width);
     ctrl.Height = (int)((h / 720.0f) * screenrect.Height);
 }
Exemplo n.º 29
0
 public Processor(ReaderBase reader, UI.DelegateManager delegateManager, List<uint> filterOpcodeList)
 {
     Reader = reader;
     FilterOpcodeList = filterOpcodeList;
     DelegateManager = delegateManager;
     Core = new WoW.Core(delegateManager, reader.ClientBuildAmount);
     UniqueOpcodeList = new List<uint>();
     DefinedOpcodeList = new List<uint>();
 }
Exemplo n.º 30
0
 protected override HtmlNode CreateInput(UI.UIControlState state)
 {
     return new HtmlStandalone("input",
         new HtmlAttribute("type", "password"),
         new HtmlAttribute("name", state.Name),
         new HtmlAttribute("id", state.Name),
         new HtmlAttribute("value", state.Value),
         new HtmlAttribute("class", "form-control"));
 }
Exemplo n.º 31
0
        void ParseSettings()
        {
            try
            {
                settings = ScriptSettings.Load(@".\scripts\Metric_Speedometer.ini");

                // Parse Core settings
                this.useMph       = settings.GetValue("Core", "UseMph", false);
                this.speedoMode   = (SpeedoMode)settings.GetValue <int>("Core", "DisplayMode", 1);
                this.enableSaving = settings.GetValue("Core", "EnableSaving", true);
                this.rainbowMode  = settings.GetValue("Core", "RainbowMode", 0);
                this.onfootSpeedo = settings.GetValue("Core", "OnfootSpeedo", false);

                // Parse UI settings
                this.vAlign    = (VerticalAlignment)Enum.Parse(typeof(VerticalAlignment), settings.GetValue("UI", "VertAlign"), true);
                this.hAlign    = (HorizontalAlign)Enum.Parse(typeof(HorizontalAlign), settings.GetValue("UI", "HorzAlign"), true);
                this.posOffset = new Point(settings.GetValue <int>("UI", "OffsetX", 0), settings.GetValue <int>("UI", "OffsetY", 0));
                this.pWidth    = settings.GetValue("UI", "PanelWidth", 66);
                this.pHeight   = settings.GetValue("UI", "PanelHeight", 24);
                this.fontSize  = float.Parse(settings.GetValue("UI", "FontSize"), CultureInfo.InvariantCulture.NumberFormat);
                this.fontStyle = settings.GetValue("UI", "FontStyle", 4);
                this.backcolor = Color.FromArgb(settings.GetValue <int>("UI", "BackcolorA", 200), settings.GetValue <int>("UI", "BackcolorR", 237),
                                                settings.GetValue <int>("UI", "BackcolorG", 239), settings.GetValue <int>("UI", "BackcolorB", 241));
                this.forecolor = Color.FromArgb(settings.GetValue <int>("UI", "ForecolorA", 255), settings.GetValue <int>("UI", "ForecolorR", 0),
                                                settings.GetValue <int>("UI", "ForecolorG", 0), settings.GetValue <int>("UI", "ForecolorB", 0));
                this.kphText = settings.GetValue("Text", "KphText", "km/h");
                this.mphText = settings.GetValue("Text", "MphText", "mph");

                // Load stats
                if (enableSaving)
                {
                    LoadStats();
                }
            }
            catch { UI.Notify("~r~failed to load speedometer config"); }
        }
Exemplo n.º 32
0
    public void RerollSelected(DelegateDiceroll callBack)
    {
        this.callBack = callBack;

        if (!Network.IsNetworkGame)
        {
            foreach (Die die in DiceList)
            {
                if (die.IsSelected)
                {
                    die.RandomizeRotation();
                }
            }
            RerollPreparedDice();
        }
        else
        {
            if (DebugManager.DebugNetwork)
            {
                UI.AddTestLogEntry("DiceRoll.SyncSelectedDice");
            }
            Network.SyncSelectedDiceAndReroll();
        }
    }
Exemplo n.º 33
0
        public static void Main(string[] args)
        {
            /*Bird birdie = new Bird();
             * Console.WriteLine(birdie.ComeHere());
             *
             * Wolf wolfie = new Wolf();
             * Console.WriteLine(wolfie.Hunt());
             *
             * Bear teddy = new Bear();
             * Console.WriteLine(teddy.Hunt());
             *
             * Console.WriteLine(birdie.weight);
             *
             * birdie.Eat();
             *
             * Console.WriteLine(birdie.Name); */

            /*Bear teddyBear = new Bear();
             * Console.WriteLine(teddyBear.Hunt());*/

            UI userInterface = new UI();

            userInterface.Start();
        }
Exemplo n.º 34
0
 protected override void MouseDownHandler(Point p)
 {
     if (this.flowsheet.Activity == FlowsheetActivity.AddingConnStepOne)
     {
         if (this.ProcessStreamBase.CanConnect())
         {
             // ok for the second step
             this.flowsheet.firstStepCtrl = this;
             this.flowsheet.SetFlowsheetActivity(FlowsheetActivity.AddingConnStepTwo);
         }
         else
         {
             this.flowsheet.ResetActivity();
         }
     }
     else if (this.flowsheet.Activity == FlowsheetActivity.AddingConnStepTwo)
     {
         if (this.flowsheet.firstStepCtrl.Solvable is UnitOperation)
         {
             UnitOpControl ctrl = (UnitOpControl)this.flowsheet.firstStepCtrl;
             if (ctrl.UnitOperation.CanAttachStream(this.ProcessStreamBase, this.flowsheet.attachIndex))
             {
                 // update the model, the UI will be updated in the listener
                 ErrorMessage error = ctrl.UnitOperation.AttachStream(this.ProcessStreamBase, this.flowsheet.attachIndex);
                 UI.ShowError(error);
             }
         }
         this.flowsheet.ResetActivity();
     }
     else
     {
         this.flowsheet.ResetActivity();
         this.PerformSelection();
         this.PrepareForTheMove(p.X, p.Y);
     }
 }
    private void RpcSyncSelectedDiceAndReroll(int[] selectedDiceIds)
    {
        if (DebugManager.DebugNetwork)
        {
            UI.AddTestLogEntry("C: RpcSyncSelectedDice");
        }

        foreach (var die in DiceRoll.CurrentDiceRoll.DiceList)
        {
            int  diceId  = int.Parse(die.Model.name.Replace("DiceN", ""));
            bool isFound = false;
            for (int i = 0; i < selectedDiceIds.Length; i++)
            {
                if (selectedDiceIds[i] == diceId)
                {
                    isFound = true;
                    break;
                }
            }
            die.ToggleSelected(isFound);
        }

        DiceRoll.CurrentDiceRoll.RandomizeAndRerollSelected();
    }
Exemplo n.º 36
0
    //
    // Information Panel
    //

    /// <summary>
    /// Updates the information panel from the message queue.
    /// </summary>
    /// <returns></returns>
    private IEnumerator UpdateInfoPanel()
    {
        WaitForSeconds showInfoWait = new WaitForSeconds(5.0f);

        while (true)
        {
            string text = UI.PopMessage();

            // reset the label so it will catch the user's eye
            informationLabel.text = "";
            yield return(null);

            informationLabel.text = text;

            if (text.Length == 0)
            {
                yield return(null); // just wait until the next frame, so the next info will immediately be displayed
            }
            else
            {
                yield return(showInfoWait); // wait for a little bit to show the information
            }
        }
    }
Exemplo n.º 37
0
        /// <summary>
        /// 取得ListView选中的行
        /// </summary>
        /// <returns></returns>
        private int GetLvSelectedIndex()
        {
            int index = -1;
            lvSelecteds.Clear();
            try
            {
                if (lvServers.SelectedIndices.Count <= 0)
                {
                    UI.Show(UIRes.I18N("PleaseSelectServer"));
                    return index;
                }

                index = lvServers.SelectedIndices[0];
                foreach (int i in lvServers.SelectedIndices)
                {
                    lvSelecteds.Add(i);
                }
                return index;
            }
            catch
            {
                return index;
            }
        }
Exemplo n.º 38
0
 void endWave()
 {
     if (waveIndex < wavesInfo.EnemyWaves.Count - 1)
     {
         waveIndex++;
     }
     timer = 0;
     stopDrums();
     audioSource.clip = waveEndSound;
     audioSource.Play();
     if (currentWave >= wavesInfo.EnemyWaves.Count)
     {
         winScreenUI.SetActive(true);
         stopSounds();
         Time.timeScale = 0;
     }
     else
     {
         fastForwardButton.interactable = true;
         OnPlanningPhase = true;
         setSignalsVisuals(true);
         UI.OpenUpgrades(3);
     }
 }
Exemplo n.º 39
0
    //private bool uiiOSFlag=true;

    void Awake()
    {
        if (gameMessage == null)
        {
            gameMessage = this;
            //~ messageObj=gameObject;
            gameMessage.init = true;
            Init();
        }

        UI ui = (UI)FindObjectOfType(typeof(UI));

        if (ui != null && ui.enabled)
        {
            uiFlag = true;
        }

        UInGUI uiNGUI = (UInGUI)FindObjectOfType(typeof(UInGUI));

        if (uiNGUI != null && uiNGUI.enabled)
        {
            nGUIFlag = true;
        }
    }
Exemplo n.º 40
0
    //Assignment and launch of execution of meneuver

    public void AssignManeuver()
    {
        string parameters = EventSystem.current.currentSelectedGameObject.name;

        Selection.ThisShip.SetAssignedManeuver(MovementFromString(parameters));

        UI.HideDirectionMenu();

        if (Phases.CurrentSubPhase.GetType() == typeof(SubPhases.PlanningSubPhase))
        {
            //Selection.ThisShip.InfoPanel.transform.Find("DialAssigned" + Selection.ThisShip.Owner.Id).gameObject.SetActive(true);
            Roster.HighlightShipOff(Selection.ThisShip);

            if (Roster.AllManuersAreAssigned(Phases.CurrentPhasePlayer))
            {
                UI.ShowNextButton();
                UI.HighlightNextButton();
            }
        }
        else
        {
            Triggers.FinishTrigger();
        }
    }
Exemplo n.º 41
0
    public void Start()
    {
        RegisterPlayer();
        RegisterGear();

        if (isLocalPlayer)
        {
            UI.Reset();
            Local         = this;
            Local._Player = this;
            Camera.main.GetComponent <CameraFollow>().Target = transform;
            Health.UponDeath += UponDeath;
        }
        else
        {
            Debug.Log("Player '" + Name + "' of team '" + Team + "'");
        }

        foreach (SpriteRenderer r in GetComponentsInChildren <SpriteRenderer>())
        {
            if (r.gameObject.layer != 9)
            {
                r.sortingLayerName = "Player";
            }
        }

        if (isLocalPlayer)
        {
            // Apply no gear, TODO load from file if necessary.
        }
        else if (!isServer)
        {
            // Request updated gear
            RequestGear = true;
        }
    }
Exemplo n.º 42
0
        public void Update()
        {
            Hierarchy.Push(Matrix.T(0, 0, -0.5f));
            /// :CodeSample: Lines.Add
            Lines.Add(new Vec3(0.1f, 0, 0), new Vec3(-0.1f, 0, 0), Color.White, 0.01f);
            /// :End:
            Hierarchy.Pop();

            Hierarchy.Push(Matrix.T(0, 0.05f, -0.5f));
            /// :CodeSample: Lines.Add
            Lines.Add(new Vec3(0.1f, 0, 0), new Vec3(-0.1f, 0, 0), Color.White, Color.Black, 0.01f);
            /// :End:
            Hierarchy.Pop();

            Hierarchy.Push(Matrix.T(0, 0.1f, -0.5f));
            /// :CodeSample: Lines.Add
            Lines.Add(new LinePoint[] {
                new LinePoint(new Vec3(0.1f, 0, 0), Color.White, 0.01f),
                new LinePoint(new Vec3(0, 0.02f, 0), Color.Black, 0.005f),
                new LinePoint(new Vec3(-0.1f, 0, 0), Color.White, 0.01f),
            });
            /// :End:
            Hierarchy.Pop();


            UI.WindowBegin("Settings", ref windowPose, new Vec2(20, 0) * U.cm);
            if (UI.Button("Clear"))
            {
                drawList.Clear();
                drawPoints.Clear();
            }
            UI.WindowEnd();

            DrawMenu();
            Draw(Handed.Right);
        }
Exemplo n.º 43
0
    public static void Show(Action<string> doWithSelectedManeuver, Action callback, Func<string, bool> filter = null, bool isRegularPlanning = false)
    {
        UI.HideNextButton();

        PrepareSubphase(doWithSelectedManeuver, callback);

        GameObject prefab = (GameObject)Resources.Load("Prefabs/UI/DirectionsWindow", typeof(GameObject));
        DirectionsWindow = MonoBehaviour.Instantiate(prefab, GameObject.Find("UI/DirectionsPanel").transform);

        if (Selection.ThisShip.Owner is Players.HumanPlayer)
        {
            GameObject.Find("UI").transform.Find("ContextMenuPanel").gameObject.SetActive(false);
            CustomizeDirectionsMenu(filter);
            CustomizeForStressed();
            DirectionsWindow.transform.localPosition = FixMenuPosition(
                DirectionsWindow.transform.gameObject,
                Input.mousePosition
            );
        }
        else
        {
            DirectionsMenu.Hide();
        }

        Phases.CurrentSubPhase.IsReadyForCommands = true;

        if (isRegularPlanning) Selection.ThisShip.Owner.AskAssignManeuver();

        if (!HasAnyAvailableManeuver)
        {
            Messages.ShowError("No available maneuvers!");

            DirectionsMenu.Hide();
            DirectionsMenu.FinishManeuverSelections();
        }
    }
Exemplo n.º 44
0
        public override void Load()
        {
            SelectableImage newGame = new SelectableImage(Assets.GetTexture("HUDNewGameBase"), Assets.GetTexture("HUDNewGameSelected"), new Vector2(150, 150), scale: 0.25f);

            newGame.OnClick = () =>
            {
                SceneManager.LoadScene("Level_1");
            };

            SelectableImage settings = new SelectableImage(Assets.GetTexture("HUDSettingsBase"), Assets.GetTexture("HUDSettingsSelected"), new Vector2(150, 200), scale: 0.25f);

            settings.OnClick = () =>
            {
                SceneManager.StartScene("Settings");
            };

            SelectableImage quit = new SelectableImage(Assets.GetTexture("HUDQuitBase"), Assets.GetTexture("HUDQuitSelected"), new Vector2(150, 250), scale: 0.25f);

            quit.OnClick = Config.ExitAction;

            UI.AddUIElement(quit);
            UI.AddUIElement(settings);
            UI.AddUIElement(newGame);
        }
Exemplo n.º 45
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (SaveBase() != 0)
            {
                return;
            }

            if (SaveRouting() != 0)
            {
                return;
            }

            if (SaveKCP() != 0)
            {
                return;
            }

            if (SaveGUI() != 0)
            {
                return;
            }

            if (SaveUserPAC() != 0)
            {
                return;
            }

            if (ConfigHandler.SaveConfigToFile(ref config) == 0)
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                UI.ShowWarning(UIRes.I18N("OperationFailed"));
            }
        }
Exemplo n.º 46
0
        static void Main(string[] args)
        {
            UI Ui = new UI();

            Ui.RunUI();
        }
Exemplo n.º 47
0
        protected void gvBusiness_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //鼠标移动到每项时颜色交替效果
                e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c1ebff'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e");

                //设置悬浮鼠标指针形状为"小手"
                e.Row.Attributes["style"] = "Cursor:hand";

                //申请人、申请时间
                Label  lblState     = e.Row.FindControl("lblState") as Label;
                Button btnSubmit    = e.Row.FindControl("btnSubmit") as Button;
                Label  lblApplyName = e.Row.FindControl("lblApplyName") as Label;
                Label  lblApplyTime = e.Row.FindControl("lblApplyTime") as Label;

                if (!Convert.IsDBNull(gvBusiness.DataKeys[e.Row.RowIndex].Value))
                {
                    int             SaleId = Convert.ToInt32(gvBusiness.DataKeys[e.Row.RowIndex].Value);
                    BusinessExpInfo pc     = new BusinessExpInfo(SaleId);

                    if (pc.SendEmployeeName == "")
                    {
                        lblApplyName.Text = pc.PreEmployeeName.ToString();//市场部员工
                        lblApplyTime.Text = pc.PreApplyTime.ToString();
                    }
                    else if (pc.PreEmployeeName == "")
                    {
                        lblApplyName.Text = pc.SendEmployeeName.ToString();//市场部经理
                        lblApplyTime.Text = pc.ApplyTime.ToString();
                    }

                    //绑定子GridView
                    GridView gv = e.Row.FindControl("GridView2") as GridView;

                    int       emid   = Convert.ToInt32(Session["EmployeeId"]);
                    int       mainid = Convert.ToInt32(pc.MainBusinessExpId);
                    DataTable dt     = BusinessExpInfo.getBusinessExpListOfApproves1(emid, mainid);

                    if (dt.Rows.Count == 0)
                    {
                        dt.Rows.Add(dt.NewRow());
                        UI.BindCtrl(dt.DefaultView, gv, AspNetPager2);
                        gv.Rows[0].Visible = false;
                    }
                    else
                    {
                        UI.BindCtrl(dt.DefaultView, gv, AspNetPager2);
                    }

                    //button控制
                    if (pc.IsApply1 == 1)
                    {
                        btnSubmit.Enabled = false;
                    }

                    //审批状态
                    if (pc.IsApply1 == 0)
                    {
                        lblState.Text = "待审";
                    }
                    else if (pc.IsApply1 == 1 && pc.IsApply2 == 0)
                    {
                        if (pc.IsOver1 == 0)
                        {
                            lblState.Text = "修正";
                        }
                        else
                        {
                            lblState.Text = "通过";
                        }
                    }
                }
            }
        }
Exemplo n.º 48
0
    private static int Main(string[] args)
    {
        // Enabling Windows XP visual effects before any controls are created
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        // Sort out the command line arguments
        CommandLineArgs clargs = new CommandLineArgs(args);

        // see if we're already running
        bool createdNew = false;

        System.Threading.Mutex mutex = new System.Threading.Mutex(true, "TVRenameMutex", out createdNew);

        if (!createdNew)
        {
            // we're already running

            // tell the already running copy to come to the foreground
            IpcClientChannel clientChannel = new IpcClientChannel();
            ChannelServices.RegisterChannel(clientChannel, true);

            RemotingConfiguration.RegisterWellKnownClientType(typeof(IPCMethods), "ipc://TVRenameChannel/IPCMethods");

            IPCMethods ipc = new IPCMethods();

            // if we were already running, and no command line arguments, then bring application to the foreground
            // and we're done.
            if (args.Length == 0)
            {
                ipc.BringToForeground();
                return(0);
            }

            // Send command-line arguments to already running TVRename via IPC

            CommandLineArgs.MissingFolderBehaviour before = ipc.MissingBehaviour;
            bool renameBefore = ipc.RenameBehaviour;

            if (clargs.RenameCheck == false)
            {
                // Temporarily override behaviour for missing folders
                ipc.RenameBehaviour = false;
            }

            if (clargs.MissingFolder != CommandLineArgs.MissingFolderBehaviour.Ask)
            {
                // Temporarily override behaviour for missing folders
                ipc.MissingBehaviour = clargs.MissingFolder;
            }

            // TODO: Unify command line handling between here and in UI.cs (ProcessArgs).  Just send in clargs via IPC?

            if (clargs.Scan || clargs.DoAll) // doall implies scan
            {
                ipc.Scan();
            }

            if (clargs.DoAll)
            {
                ipc.DoAll();
            }

            if (clargs.Quit)
            {
                ipc.Quit();
                return(0);
            }

            ipc.RenameBehaviour  = renameBefore;
            ipc.MissingBehaviour = before;

            return(0);
        }

#if !DEBUG
        try
        {
#endif

        // Starting TVRename...

        // Check arguments for forced recover
        bool ok            = true;
        string recoverText = "";

        if (clargs.ForceRecover)
        {
            ok          = false; // force recover dialog
            recoverText = "Recover manually requested.";
        }

        // Load settings files
        TVDoc doc = null;
        try
        {
            if (!string.IsNullOrEmpty(clargs.UserFilePath))
            {
                PathManager.SetUserDefinedBasePath(clargs.UserFilePath);
            }
        }
        catch (System.Exception ex)
        {
            MessageBox.Show("Error while setting the User-Defined File Path:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            Environment.Exit(1);
        }

        FileInfo tvdbFile     = PathManager.TVDBFile;
        FileInfo settingsFile = PathManager.TVDocSettingsFile;

        do           // loop until no problems loading settings & tvdb cache files
        {
            if (!ok) // something went wrong last time around, ask the user what to do
            {
                RecoverXML rec = new RecoverXML(recoverText);
                if (rec.ShowDialog() == DialogResult.OK)
                {
                    tvdbFile     = rec.DBFile;
                    settingsFile = rec.SettingsFile;
                }
                else
                {
                    return(1);
                }
            }

            // try loading using current settings files, and set up the main
            // classes
            TheTVDB.Instance.setup(tvdbFile, PathManager.TVDBFile, clargs);

            doc = new TVDoc(settingsFile, clargs);

            if (!ok)
            {
                doc.SetDirty();
            }

            ok = doc.LoadOK;

            if (!ok)
            {
                recoverText = "";
                if (!doc.LoadOK && !String.IsNullOrEmpty(doc.LoadErr))
                {
                    recoverText += doc.LoadErr;
                }
                if (!TheTVDB.Instance.LoadOK && !String.IsNullOrEmpty(TheTVDB.Instance.LoadErr))
                {
                    recoverText += "\r\n" + TheTVDB.Instance.LoadErr;
                }
            }
        } while (!ok);

        // Show user interface
        UI theUI = new UI(doc);
        Application.Run(theUI);
        GC.KeepAlive(mutex);

#if !DEBUG
    }

    catch (Exception e)
    {
        ShowException se = new ShowException(e);
        se.ShowDialog();
    }
#endif

        return(0);
    }
Exemplo n.º 49
0
 protected override void DrawBackground()
 {
     UI.FillScreen("UI/SaveBg");
     UI.Darken();
 }
Exemplo n.º 50
0
        static void Main(string[] args)
        {
            UI ui = new UI();

            ui.Start();
        }
Exemplo n.º 51
0
 public PCB_Options() : base()
 {
     InitializeComponent();
     UI.ApplyADUITheme(this);
 }
Exemplo n.º 52
0
        /// <summary>
        /// 保存基础设置
        /// </summary>
        /// <returns></returns>
        private int SaveBase()
        {
            //日志
            bool   logEnabled = chklogEnabled.Checked;
            string loglevel   = cmbloglevel.Text.TrimEx();

            //Mux
            bool muxEnabled = chkmuxEnabled.Checked;

            //本地监听
            string localPort       = txtlocalPort.Text.TrimEx();
            string protocol        = cmbprotocol.Text.TrimEx();
            bool   udpEnabled      = chkudpEnabled.Checked;
            bool   sniffingEnabled = chksniffingEnabled.Checked;

            if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort))
            {
                UI.Show(UIRes.I18N("FillLocalListeningPort"));
                return(-1);
            }
            if (Utils.IsNullOrEmpty(protocol))
            {
                UI.Show(UIRes.I18N("PleaseSelectProtocol"));
                return(-1);
            }
            config.inbound[0].localPort       = Utils.ToInt(localPort);
            config.inbound[0].protocol        = protocol;
            config.inbound[0].udpEnabled      = udpEnabled;
            config.inbound[0].sniffingEnabled = sniffingEnabled;

            //本地监听2
            string localPort2       = txtlocalPort2.Text.TrimEx();
            string protocol2        = cmbprotocol2.Text.TrimEx();
            bool   udpEnabled2      = chkudpEnabled2.Checked;
            bool   sniffingEnabled2 = chksniffingEnabled2.Checked;

            if (chkAllowIn2.Checked)
            {
                if (Utils.IsNullOrEmpty(localPort2) || !Utils.IsNumberic(localPort2))
                {
                    UI.Show(UIRes.I18N("FillLocalListeningPort"));
                    return(-1);
                }
                if (Utils.IsNullOrEmpty(protocol2))
                {
                    UI.Show(UIRes.I18N("PleaseSelectProtocol"));
                    return(-1);
                }
                if (config.inbound.Count < 2)
                {
                    config.inbound.Add(new Mode.InItem());
                }
                config.inbound[1].localPort       = Utils.ToInt(localPort2);
                config.inbound[1].protocol        = protocol2;
                config.inbound[1].udpEnabled      = udpEnabled2;
                config.inbound[1].sniffingEnabled = sniffingEnabled2;
            }
            else
            {
                if (config.inbound.Count > 1)
                {
                    config.inbound.RemoveAt(1);
                }
            }

            //日志
            config.logEnabled = logEnabled;
            config.loglevel   = loglevel;

            //Mux
            config.muxEnabled = muxEnabled;

            //remoteDNS
            config.remoteDNS = txtremoteDNS.Text.TrimEx();

            config.listenerType = (ListenerType)Enum.ToObject(typeof(ListenerType), cmblistenerType.SelectedIndex);

            config.defAllowInsecure = chkdefAllowInsecure.Checked;

            return(0);
        }
Exemplo n.º 53
0
 public static void Enable()
 {
     control.disabled = false;
     UI.SetHelpText("Press A or D to move.");
 }
Exemplo n.º 54
0
        private void VerifyDirectories()
        {
            try
            {
                if (!Directory.Exists(modDirectory))
                {
                    Directory.CreateDirectory(modDirectory);
                }
                if (!Directory.Exists(bankDirectory))
                {
                    Directory.CreateDirectory(bankDirectory);
                }

                if (!File.Exists(modConfig))
                {
                    configuration = new Configuration()
                    {
                        banks    = new List <Bank>(),
                        settings = new Settings()
                        {
                            addBankKey           = Keys.N,
                            addBankRequiresShift = true
                        }
                    };

                    File.WriteAllText(modConfig, JsonConvert.SerializeObject(configuration, Formatting.Indented));
                }

                if (!File.Exists(franklinsBank))
                {
                    BankAccount account = new BankAccount()
                    {
                        balance      = 0,
                        owner        = AccountOwner.franklin,
                        transactions = new List <Transaction>(),
                        isOpened     = false,
                        bank         = null
                    };
                    File.WriteAllText(franklinsBank, JsonConvert.SerializeObject(account, Formatting.Indented));
                }
                else
                {
                    franklinsAccount = JsonConvert.DeserializeObject <BankAccount>(File.ReadAllText(franklinsBank));
                }
                if (!File.Exists(michaelsBank))
                {
                    BankAccount account = new BankAccount()
                    {
                        balance      = 0,
                        owner        = AccountOwner.michael,
                        transactions = new List <Transaction>(),
                        isOpened     = false,
                        bank         = null
                    };
                    File.WriteAllText(michaelsBank, JsonConvert.SerializeObject(account, Formatting.Indented));
                }
                else
                {
                    michaelsAccount = JsonConvert.DeserializeObject <BankAccount>(File.ReadAllText(michaelsBank));
                }

                if (!File.Exists(trevorsBank))
                {
                    BankAccount account = new BankAccount()
                    {
                        balance      = 0,
                        owner        = AccountOwner.trevor,
                        transactions = new List <Transaction>(),
                        isOpened     = false,
                        bank         = null
                    };
                    File.WriteAllText(trevorsBank, JsonConvert.SerializeObject(account, Formatting.Indented));
                }
                else
                {
                    trevorsAccount = JsonConvert.DeserializeObject <BankAccount>(File.ReadAllText(trevorsBank));
                }

                if (!File.Exists(globalBank))
                {
                    BankAccount account = new BankAccount()
                    {
                        balance      = 0,
                        owner        = AccountOwner.global,
                        transactions = new List <Transaction>(),
                        isOpened     = false,
                        bank         = null
                    };
                    File.WriteAllText(globalBank, JsonConvert.SerializeObject(account, Formatting.Indented));
                }
                else
                {
                    globalAccount = JsonConvert.DeserializeObject <BankAccount>(File.ReadAllText(globalBank));
                }
            }
            catch (Exception ex)
            {
                UI.Notify($"Ocorreu um erro: {ex.Message}");
            }
        }
Exemplo n.º 55
0
        private void OnTick(object sender, EventArgs e)
        {
            try
            {
                BankAccount currAccount;
                if (Game.Player.Character.Model == new Model("player_two"))
                {
                    currAccount = trevorsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_zero"))
                {
                    currAccount = michaelsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_one"))
                {
                    currAccount = franklinsAccount;
                }
                else
                {
                    currAccount = globalAccount;
                }

                if (currAccount.isOpened)
                {
                    if (configuration.settings.showDebugMessages)
                    {
                        UI.Notify("DEBUG: Ativar itens de menu de depósito, retirada, saldo e abertura de conta");
                    }

                    deposit.Enabled       = true;
                    withdraw.Enabled      = true;
                    transfer.Enabled      = true;
                    balance.Enabled       = true;
                    createAccount.Enabled = false;
                    closeAccount.Enabled  = true;
                }
                else
                {
                    if (configuration.settings.showDebugMessages)
                    {
                        UI.Notify("DEBUG: Desativando itens de menu de depósito, retirada, saldo e fechamento de conta");
                    }

                    deposit.Enabled       = false;
                    withdraw.Enabled      = false;
                    transfer.Enabled      = false;
                    balance.Enabled       = false;
                    createAccount.Enabled = true;
                    closeAccount.Enabled  = false;
                }



                balance.Text = $"Balance: ${currAccount.balance}";

                if (pool != null)
                {
                    pool.ProcessMenus();
                }
                foreach (Bank bank in configuration.banks)
                {
                    Vector3 bankPos   = new Vector3(bank.XPos, bank.YPos, bank.ZPos - 1);
                    Vector3 bankPosNM = new Vector3(bank.XPos, bank.YPos, bank.ZPos);
                    if (World.GetDistance(Game.Player.Character.Position, bankPosNM) <= .75f && !bankMenu.Visible && !manageAccount.Visible && !transferMenu.Visible)
                    {
                        UI.ShowSubtitle("Pressione ~y~E~w~ para usar o banco", 1);
                    }
                    if (bankMenu.Visible || manageAccount.Visible)
                    {
                        Game.Player.Character.FreezePosition = true;
                    }
                    else if (!bankMenu.Visible && !manageAccount.Visible)
                    {
                        Game.Player.Character.FreezePosition = false;
                    }
                    World.DrawMarker(MarkerType.VerticalCylinder, bankPos, Vector3.Zero, Vector3.Zero, new Vector3(1, 1, 1), Color.Yellow);
                }
            }
            catch (Exception ex)
            {
                UI.Notify($"Ocorreu um erro: {ex.Message}");
            }
        }
Exemplo n.º 56
0
        private void MenuItemPressed(UIMenu sender, UIMenuItem selectedItem)
        {
            try
            {
                BankAccount currAccount;
                if (Game.Player.Character.Model == new Model("player_two"))
                {
                    currAccount = trevorsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_zero"))
                {
                    currAccount = michaelsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_one"))
                {
                    currAccount = franklinsAccount;
                }
                else
                {
                    currAccount = globalAccount;
                }

                int currentAmount = 0;

                if (selectedItem.Text == createBank.Text)
                {
                    if (bankType.Items[bankType.Index].ToString() == "Fleeca")
                    {
                        CreateBankAtPlayerPosition(BankType.fleeca);
                    }
                    else if (bankType.Items[bankType.Index].ToString() == "Pacific Standard")
                    {
                        CreateBankAtPlayerPosition(BankType.pacificStandard);
                    }
                    else if (bankType.Items[bankType.Index].ToString() == "Blaine County")
                    {
                        CreateBankAtPlayerPosition(BankType.blaineCounty);
                    }
                }
                else if (selectedItem.Text == deposit.Text)
                {
                    currentAmount = GetNumberInput();

                    if (Game.Player.Money >= currentAmount)
                    {
                        if (currentAmount >= 1)
                        {
                            Transaction transaction = new Transaction()
                            {
                                transactionAmount = currentAmount,
                                transactionDate   = World.CurrentDate,
                                transactionText   = "DEPOSITO FEITO COM SUCESSO.",
                                type = TransactionType.deposit
                            };
                            Game.Player.Money   = Game.Player.Money - currentAmount;
                            currAccount.balance = currAccount.balance + currentAmount;
                            currAccount.transactions.Add(transaction);
                            UI.Notify($"Depositado com sucesso ~y~${currentAmount}~w~ para sua conta!");
                        }
                    }
                    else
                    {
                        UI.Notify("~r~Error: Você não possui os fundos necessários para fazer esta transação");
                    }
                }
                else if (selectedItem.Text == withdraw.Text)
                {
                    currentAmount = GetNumberInput();

                    if (currAccount.balance >= currentAmount)
                    {
                        if (currentAmount >= 1)
                        {
                            Transaction transaction = new Transaction()
                            {
                                transactionAmount = currentAmount,
                                transactionDate   = World.CurrentDate,
                                transactionText   = "RETIRADA EMITIDA PELO PROPRIETÁRIO DA CONTA",
                                type = TransactionType.withdrawal
                            };
                            Game.Player.Money   = Game.Player.Money + currentAmount;
                            currAccount.balance = currAccount.balance - currentAmount;
                            currAccount.transactions.Add(transaction);
                            UI.Notify($"Retirado com sucesso ~y~${currentAmount}~w~ da sua conta!");
                        }
                    }
                    else
                    {
                        UI.Notify("~r~Error: Você não possui os fundos necessários para fazer esta transação");
                    }
                }
                else if (selectedItem.Text == closeAccount.Text)
                {
                    if (currAccount.isOpened && currentBank.typeOfBank == currAccount.bank.typeOfBank)
                    {
                        Game.Player.Money    = Game.Player.Money + currAccount.balance - currAccount.bank.startingMoney / 2;
                        currAccount.balance  = 0;
                        currAccount.isOpened = false;
                        currAccount.bank     = null;
                        UI.Notify($"Você encerrou sua conta com sucesso!");
                    }
                    else
                    {
                        string bankname = null;
                        if (currAccount.bank.typeOfBank == BankType.fleeca)
                        {
                            bankname = "Fleeca";
                        }
                        else if (currAccount.bank.typeOfBank == BankType.blaineCounty)
                        {
                            bankname = "Blaine County Savings";
                        }
                        else if (currAccount.bank.typeOfBank == BankType.pacificStandard)
                        {
                            bankname = "Pacific Standard";
                        }
                        UI.Notify($"~r~Você não pode fechar sua conta aqui! vá para (a) {bankname} banco para fechar sua conta");
                    }
                }
                else if (selectedItem.Text == createAccount.Text)
                {
                    if (!currAccount.isOpened)
                    {
                        currAccount.bank     = currentBank;
                        currAccount.balance  = currentBank.startingMoney;
                        currAccount.isOpened = true;
                        Game.Player.Money    = Game.Player.Money - currentBank.startingMoney / 2;
                        string bankname = null;
                        if (currentBank.typeOfBank == BankType.fleeca)
                        {
                            bankname = "Fleeca";
                        }
                        else if (currentBank.typeOfBank == BankType.blaineCounty)
                        {
                            bankname = "Blaine County Savings";
                        }
                        else if (currentBank.typeOfBank == BankType.pacificStandard)
                        {
                            bankname = "Pacific Standard";
                        }
                        UI.Notify($"Você abriu uma conta com sucesso ~y~{bankname}~w~!");
                    }
                }
                else if (selectedItem.Text == transfer.Text)
                {
                    int amountToTransfer = GetNumberInput();

                    if (currAccount.balance >= amountToTransfer)
                    {
                        if (bankAccountList.Items[bankAccountList.Index].ToString() == "Franklin" && currAccount != franklinsAccount && franklinsAccount.isOpened)
                        {
                            franklinsAccount.balance = franklinsAccount.balance + amountToTransfer;
                        }
                        else if (bankAccountList.Items[bankAccountList.Index].ToString() == "Michael" && currAccount != michaelsAccount && michaelsAccount.isOpened)
                        {
                            michaelsAccount.balance = michaelsAccount.balance + amountToTransfer;
                        }
                        else if (bankAccountList.Items[bankAccountList.Index].ToString() == "Trevor" && currAccount != trevorsAccount && trevorsAccount.isOpened)
                        {
                            trevorsAccount.balance = trevorsAccount.balance + amountToTransfer;
                        }
                        else if (bankAccountList.Items[bankAccountList.Index].ToString() == "Global" && currAccount != globalAccount && globalAccount.isOpened)
                        {
                            globalAccount.balance = globalAccount.balance + amountToTransfer;
                        }
                        else
                        {
                            UI.Notify("A conta selecionada não está aberta!");
                            return;
                        }

                        currAccount.balance = currAccount.balance - amountToTransfer;

                        UI.Notify($"Transferido com sucesso ~y~${amountToTransfer}~w~ to ~y~{bankAccountList.Items[bankAccountList.Index].ToString()}~w~!");
                    }
                    else
                    {
                        UI.Notify("~r~Error: Você não possui os fundos necessários para fazer esta transação");
                    }
                }

                if (configuration.settings.showDebugMessages)
                {
                    UI.Notify("DEBUG: Salvando alterações");
                }
                if (Game.Player.Character.Model == new Model("player_two"))
                {
                    currAccount = trevorsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_zero"))
                {
                    currAccount = michaelsAccount;
                }
                else if (Game.Player.Character.Model == new Model("player_one"))
                {
                    currAccount = franklinsAccount;
                }
                else
                {
                    currAccount = globalAccount;
                }
                Save();
            }
            catch (Exception ex)
            {
                UI.Notify($"Ocorreu um erro: {ex.Message}");
            }
        }
    protected override void OnEnter()
    {
        GameObject _extazModeHolder = GameObject.Find("2D Extaz");

        Transform[] _extazHolderChildren = _extazModeHolder.transform.GetComponentsInChildren <Transform>();

        ////Trying to add/remove the speedlines
        //GameObject.Find("ReferenceBody/MainCamera/Speedlines_Foreground").GetComponent<SpeedLines_Opacity>().AddSpeedLines();
        //GameObject.Find("GameManager/Speedlines_Background").GetComponent<SpeedLines_Opacity>().AddSpeedLines();

        foreach (Transform childTransform in _extazHolderChildren)
        {
            if (childTransform != _extazModeHolder.transform)
            {
                childTransform.gameObject.SetActive(false);
            }
        }

        //################################################

        playerInfos = gameManager.GetAllPlayerInfos();
        fromX       = new float[3];
        toX         = new float[3];
        UI _uiScript = GameObject.Find("UI").GetComponent <UI>();

        for (int i = 0; i < 3; i++)
        {
            PlayerInfo _info = playerInfos[i];

            if (_info.isDead)
            {
                _info.character.gameObject.SetActive(true);
                _info.isDead = true;
                _uiScript.GoWhite(_info.index);
            }

            fromX[i] = _info.character.transform.localPosition.x;
            toX[i]   = _info.previous25dX;

            if (toX[i] == -10f)
            {
                toX[i] = 0;
            }

            Vector3 _charLocPos = _info.character.transform.localPosition;
            if (_info.currentLane == 0 && _charLocPos.z != -3f)
            {
                _charLocPos.z = -3f;
                _info.character.transform.localPosition = _charLocPos;
            }
            else if (_info.currentLane == 1 && _charLocPos.z != 0f)
            {
                _charLocPos.z = 0f;
                _info.character.transform.localPosition = _charLocPos;
            }
            else if (_info.currentLane == 2 && _charLocPos.z != 3f)
            {
                _charLocPos.z = 3f;
                _info.character.transform.localPosition = _charLocPos;
            }
        }

        //################################################

        stateTimer = 0f;
        gameManager.cameraManager.StartTransition(transitionTo25dPosition, transitionTo25dRotation, transitionTo25dSize, transitionTo25dTime);
    }
 public static bool Prefix(Pawn pawn)
 {
     return DSGUI.ContextMenuStorage.Create(UI.MouseMapPosition(), pawn);
 }
Exemplo n.º 59
0
    public override void UpdateUI()
    {
        UI[] array = new UI[3]
        {
            UI.OBJ_MISSION_INFO_1,
            UI.OBJ_MISSION_INFO_2,
            UI.OBJ_MISSION_INFO_3
        };
        UI[] array2 = new UI[3]
        {
            UI.OBJ_TOP_CROWN_1,
            UI.OBJ_TOP_CROWN_2,
            UI.OBJ_TOP_CROWN_3
        };
        UI[] array3 = new UI[3]
        {
            UI.LBL_MISSION_INFO_1,
            UI.LBL_MISSION_INFO_2,
            UI.LBL_MISSION_INFO_3
        };
        UI[] array4 = new UI[3]
        {
            UI.SPR_MISSION_INFO_CROWN_1,
            UI.SPR_MISSION_INFO_CROWN_2,
            UI.SPR_MISSION_INFO_CROWN_3
        };
        UI[] array5 = new UI[3]
        {
            UI.SPR_CROWN_1,
            UI.SPR_CROWN_2,
            UI.SPR_CROWN_3
        };
        QuestInfoData info      = questInfo;
        QUEST_TYPE    questType = info.questData.tableData.questType;
        int           num       = 0;

        SetFontStyle((Enum)UI.STR_MISSION, 2);
        SetFontStyle((Enum)UI.STR_TREASURE, 2);
        SetFontStyle((Enum)UI.STR_SELL, 2);
        string text = null;

        switch (questType)
        {
        default:
            text = "STR_QUEST_TYPE_NORMAL";
            break;

        case QUEST_TYPE.ORDER:
            text = "STR_QUEST_TYPE_ORDER";
            break;

        case QUEST_TYPE.EVENT:
            text = "STR_QUEST_TYPE_EVENT";
            break;

        case QUEST_TYPE.STORY:
            text = "STR_QUEST_TYPE_STORY";
            break;
        }
        SetText((Enum)UI.LBL_QUEST_TYPE, text);
        SetLabelText((Enum)UI.LBL_QUEST_NUM, string.Format(base.sectionData.GetText("QUEST_NUMBER"), info.questData.tableData.locationNumber, info.questData.tableData.questNumber));
        SetLabelText((Enum)UI.LBL_QUEST_NAME, info.questData.tableData.questText);
        int num2 = (int)info.questData.tableData.limitTime;

        SetLabelText((Enum)UI.LBL_LIMIT_TIME, $"{num2 / 60:D2}:{num2 % 60:D2}");
        SetActive((Enum)UI.LBL_GUILD_REQUEST_NEED_POINT, false);
        SetActive((Enum)UI.STR_MISSION_EMPTY, false);
        if (!info.isExistMission)
        {
            SetActive((Enum)UI.OBJ_MISSION_INFO_ROOT, false);
        }
        else
        {
            SetActive((Enum)UI.OBJ_MISSION_INFO_ROOT, true);
            int i = 0;
            for (int num3 = info.missionData.Length; i < num3; i++)
            {
                SetActive((Enum)array[i], info.missionData[i] != null);
                SetActive((Enum)array2[i], info.missionData[i] != null);
                if (info.missionData[i] != null)
                {
                    SetActive((Enum)array4[i], info.missionData[i].state >= CLEAR_STATUS.CLEAR);
                    SetActive((Enum)array5[i], info.missionData[i].state >= CLEAR_STATUS.CLEAR);
                    SetLabelText((Enum)array3[i], info.missionData[i].tableData.missionText);
                }
            }
        }
        if (questType == QUEST_TYPE.ORDER)
        {
            SetActive((Enum)UI.OBJ_SELL_ITEM, true);
            QuestItemInfo quest_item = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem(info.questData.tableData.questID);

            if (quest_item != null && quest_item.sellItems != null && quest_item.sellItems.Count > 0)
            {
                SetGrid(UI.GRD_REWARD_SELL, string.Empty, quest_item.sellItems.Count, false, delegate(int i_2, Transform t_2, bool is_recycle_2)
                {
                    QuestItem.SellItem sellItem = quest_item.sellItems[i_2];
                    REWARD_TYPE type2           = (REWARD_TYPE)sellItem.type;
                    uint itemId = (uint)sellItem.itemId;
                    if (sellItem.num <= 0)
                    {
                        Log.Error(LOG.OUTGAME, "QuestItem sold get item num is zero. type={0},itemId={1}", type2, itemId);
                    }
                    else
                    {
                        int num4           = -1;
                        ItemIcon itemIcon4 = ItemIcon.CreateRewardItemIcon(type2, itemId, t_2, num4, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                        SetMaterialInfo(itemIcon4.transform, type2, itemId, null);
                    }
                });
            }
            SetActive((Enum)UI.OBJ_TOP_CROWN_ROOT, false);
        }
        SetActive((Enum)UI.OBJ_TREASURE, true);
        SetGrid(UI.GRD_REWARD_QUEST, string.Empty, 5, false, delegate(int i_2, Transform t_2, bool is_recycle_2)
        {
            if (info.questData.reward != null && info.questData.reward.Length > i_2)
            {
                REWARD_TYPE type   = (REWARD_TYPE)info.questData.reward[i_2].type;
                uint id            = (uint)info.questData.reward[i_2].id;
                ItemIcon itemIcon3 = ItemIcon.CreateRewardItemIcon(type, id, t_2, -1, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                SetMaterialInfo(itemIcon3.transform, type, id, null);
            }
        });
        EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)info.questData.tableData.GetMainEnemyID());

        if (enemyData != null)
        {
            int         iconId   = enemyData.iconId;
            RARITY_TYPE?rarity   = (info.questData.tableData.questType != QUEST_TYPE.ORDER) ? null : new RARITY_TYPE?(info.questData.tableData.rarity);
            ItemIcon    itemIcon = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, GetCtrl(UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon.SetEnableCollider(false);
            ItemIcon itemIcon2 = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, GetCtrl(UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon2.SetEnableCollider(false);
        }
        SetActive((Enum)UI.SPR_ELEMENT_ROOT, false);
        if (enemyData != null)
        {
            SetActive((Enum)UI.SPR_ELEMENT_ROOT_2, true);
            SetElementSprite((Enum)UI.SPR_ELEMENT_2, (int)enemyData.element);
            SetActive((Enum)UI.STR_NON_ELEMENT_2, enemyData.element == ELEMENT_TYPE.MAX);
            SetElementSprite((Enum)UI.SPR_WEAK_ELEMENT_2, (int)enemyData.weakElement);
            SetActive((Enum)UI.STR_NON_WEAK_ELEMENT_2, enemyData.weakElement == ELEMENT_TYPE.MAX);
        }
        else
        {
            SetActive((Enum)UI.SPR_ELEMENT_ROOT_2, false);
            SetActive((Enum)UI.STR_NON_WEAK_ELEMENT_2, false);
        }
        ShowInfo(questType, isShowDropInfo);
        SetActive((Enum)UI.TWN_DIFFICULT_STAR, false);
        num = (MonoBehaviourSingleton <QuestManager> .I.GetClearStatusQuestEnemySpecies(info.questData.tableData.questID)?.questStatus ?? 1);
        SetClearStatus((CLEAR_STATUS)num);
        if (!MonoBehaviourSingleton <UserInfoManager> .I.isGuildRequestOpen)
        {
            SetActive((Enum)UI.BTN_GUILD_REQUEST, false);
        }
    }
Exemplo n.º 60
0
        public void SetStatus(TanjiState state)
        {
            if (UI.InvokeRequired)
            {
                UI.Invoke(_setStatus, state);
                return;
            }

            UI.CoTConnectBtn.Text =
                (state == TanjiState.StandingBy ?
                 "Connect" : "Cancel");

            #region Switch: state
            switch (State = state)
            {
            case TanjiState.StandingBy:
                UI.CoTStatusTxt.StopDotAnimation("Standing By...");
                break;

            case TanjiState.ExtractingGameData:
                UI.CoTStatusTxt.SetDotAnimation("Extracting Game Data");
                break;

            case TanjiState.InjectingClient:
                UI.CoTStatusTxt.SetDotAnimation("Injecting Client");
                break;

            case TanjiState.InterceptingClient:
                UI.CoTStatusTxt.SetDotAnimation("Intercepting Client");
                break;

            case TanjiState.DecompressingClient:
                UI.CoTStatusTxt.SetDotAnimation("Decompressing Client");
                break;

            case TanjiState.CompressingClient:
                UI.CoTStatusTxt.SetDotAnimation("Compressing Client");
                break;

            case TanjiState.DisassemblingClient:
                UI.CoTStatusTxt.SetDotAnimation("Disassembling Client");
                break;

            case TanjiState.ModifyingClient:
                UI.CoTStatusTxt.SetDotAnimation("Modifying Client");
                break;

            case TanjiState.ReconstructingClient:
                UI.CoTStatusTxt.SetDotAnimation("Reconstructing Client");
                break;

            case TanjiState.InterceptingConnection:
                UI.CoTStatusTxt.SetDotAnimation("Intercepting Connection");
                break;

            case TanjiState.ReplacingResources:
                UI.CoTStatusTxt.SetDotAnimation("Replacing Resources");
                break;
            }
            #endregion
        }