Inheritance: MonoBehaviour
    void Awake()
    {
        if (Instance)
        {
            DestroyImmediate(gameObject);
        }
        else
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;

            GameOverMenu = transform.FindChild("GameOverMenu").gameObject;
            MainMenu = transform.FindChild("MainMenu").gameObject;
            AboutMenu = transform.FindChild("AboutMenu").gameObject;
            HudMenu = transform.FindChild("HUD Canvas").gameObject;
            HighscoreMenu = transform.FindChild("HighScoreMenu").gameObject;
            DifficultyMenu = transform.FindChild("DifficultyMenu").gameObject;
            NicknameMenu = transform.FindChild("NicknameEdit").gameObject;
            MoreMenu = transform.FindChild("MoreMenu").gameObject;

            var tutorial = transform.FindChild("Tutorial");
            Tutorial1 = tutorial.FindChild("Tutorial 1").gameObject;
            Tutorial2 = tutorial.FindChild("Tutorial 2").gameObject;
            Tutorial3 = tutorial.FindChild("Tutorial 3").gameObject;
            Tutorial4 = tutorial.FindChild("Tutorial 4").gameObject;
            Tutorial5 = tutorial.FindChild("Tutorial 5").gameObject;
        }
    }
Exemple #2
0
 // private int angle = 0;
 void Awake()
 {
     gm = gameObject;
     tr = transform;
     _camera = GameObject.Find("Main Camera").GetComponent<Camera>();
     uimanager = GameObject.Find("UIManager").GetComponent<UIManager>();
 }
    void OnEnable()
    {
        if(initalized == false)
        {
            UI = GameObject.FindGameObjectWithTag("GameManager").GetComponent<UIManager>();
            inventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
            itemsPanel = gameObject.transform.FindChild("ItemsPanel");
            initalized = true;
        }

        if (UI.ActiveMenu != "InventoryUI")
        {
            this.enabled = false;
            return;
        }

        for (int i = 0; i < itemsPanel.childCount - 2; i++)
        {
            if (i <= inventory.items.Count - 1)
            {
                GameObject inventorySlot = itemsPanel.GetChild(i).gameObject;
                Sprite icon = inventory.items[i].uiTexture;
                inventorySlot.GetComponent<Image>().overrideSprite = icon;
            }
        }
    }
Exemple #4
0
 /// <summary>
 /// Constructs a demo object with the appropriate gui.
 /// </summary>
 public Demo()
     : base("Moonfire Games' Gtk Demo")
 {
     // Build the GUI
     uiManager = new UIManager();
     CreateGui();
 }
Exemple #5
0
	void Awake()
	{
		itemIcon = gameObject.transform.GetChild (0).GetComponent<Image> ();
		inventory = GameObject.FindGameObjectWithTag ("UI").transform.GetChild (1).GetComponent<PlayerInventory> ();
		manager = GameObject.FindGameObjectWithTag ("UI").GetComponent<UIManager> ();
		itemInformation = GameObject.FindGameObjectWithTag ("UI").transform.GetChild (1).GetChild (0).GetComponent<ItemInformation> ();
	}
Exemple #6
0
 /// <summary>
 /// Constructs a demo object with the appropriate gui.
 /// </summary>
 public ViewerEntry()
     : base("Moonfire Games' Gtk ViewerEntry")
 {
     // Build the GUI
     uiManager = new UIManager();
     CreateGui();
 }
Exemple #7
0
 public override void HandleInput(UIManager manager) {
     if (manager.Right.Pressed) {
         MenuGrid.X += 1;
     }
     if (manager.Left.Pressed) {
         MenuGrid.X -= 1;
     }
     if (manager.Down.Pressed) {
         MenuGrid.Y += 1;
     }
     if (manager.Up.Pressed) {
         MenuGrid.Y -= 1;
     }
     for (var i = 0; i < MenuItems.Count; i++) {
         if (MenuGrid == i) {
             MenuItems[i].Highlight();
         }
         else {
             MenuItems[i].Dim();
         }
     }
     if (manager.A.Pressed) {
         if (CurrentMenuItem is UIMenu) {
             manager.Activate(CurrentMenuItem);
         }
         else {
             Trigger();
         }
     }
     else if (manager.B.Pressed) {
         CancelAndDeactivate(manager);
     }
 }
 // Use this for initialization
 void Start()
 {
     try
     {
         MusicLevel = GameObject.Find("Music Slider").GetComponent<Slider>();
         if (MusicLevel == null)
            throw new NullReferenceException("Missing Music Slider");
         EffectLevel = GameObject.Find("Effect Slider").GetComponent<Slider>();
         if (EffectLevel == null)
             throw new NullReferenceException("Missing Effect Slider");
         MusicLevel.value = OptionManager.getInstance().getMusicLevel();
         EffectLevel.value = OptionManager.getInstance().getEffectLevel();
         UM = UIManager.getInstance();
         if (UM == null)
             throw new NullReferenceException("Missing the UIManager");
         sm = SoundManager.getInstance();
         if (sm == null)
             throw new NullReferenceException("Missing SoundManager");
     }
     catch (Exception e)
     {
         ErrorUI.error = e.Message;
         LevelManager.getInstance().LoadLevel("Error");
         Destroy(gameObject.transform.parent.gameObject);
     }
 }
Exemple #9
0
    void Awake()
    {
        if (UI_Manager == null)
        {
            UI_Manager = this;
            
            DontDestroyOnLoad(gameObject);            
        }
        else if (UI_Manager != null)
        {
            Destroy(gameObject);
        }        

        _titleScreenAnim = titleScreen.GetComponent<Animator>();
        _soundScreenAnim = soundScreen.GetComponent<Animator>();
        _pauseScreenAnim = pauseScreen.GetComponent<Animator>();
        _loseScreenAnim = loseScreen.GetComponent<Animator>();
        _fadeScreenAnim = fadeScreen.GetComponent<Animator>();
        _oFScreenAnim = overlayFadeScreen.GetComponent<Animator>();

        _titleCanvas = titleScreen.GetComponent<CanvasGroup>();
        _pauseCanvas = pauseScreen.GetComponent<CanvasGroup>();
        _loseCanvas = loseScreen.GetComponent<CanvasGroup>();

        _source = GetComponent<AudioSource>();        

        Setup();
    }
 void Start()
 {
     uim = uiMObj.GetComponent<UIManager> ();
     bc = bmObj.GetComponent<BuildControls> ();
     dc = dmObj.GetComponent<DestroyControls> ();
     changeMode (mode);
 }
Exemple #11
0
 public void RegisterEvents(UIManager pManagerInstance)
 {
     btn_Create.Click += new EventHandler(pManagerInstance.ProjectButtonClicked);
     btn_Update.Click += new EventHandler(pManagerInstance.ProjectButtonClicked);
     btn_InviteUser.Click += new EventHandler(pManagerInstance.ProjectButtonClicked);
     btn_ChangeOwner.Click += new EventHandler(pManagerInstance.ProjectButtonClicked);
 }
 void Awake()
 {
     if (!mInstance)
     {
         mInstance = this;
     }
 }
    // Use this for initialization
    void Start()
    {
        progress = 0;
        uiManager = GameObject.FindObjectOfType<UIManager>();

        if (initialPuzzleIndex >= 0)
        {
            List<Puzzle> puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
            for (int i = 0; i < puzzleCount + remainingFailures; i++)
            {
                puzzlesToComplete.Add(puzzleSet[initialPuzzleIndex]);
            }
            currentPuzzle = SpawnPuzzle(puzzlesPrefabs[initialPuzzleIndex]);
        }
        else
        {
            List<Puzzle> puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
            for (int i = 0; i < puzzleCount + remainingFailures; i++)
            {
                int puzzleIndex = Random.Range(0, puzzleSet.Count);
                puzzlesToComplete.Add(puzzleSet[puzzleIndex]);
                puzzleSet.RemoveAt(puzzleIndex);
                if (puzzleSet.Count == 0)
                    puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
            }
            currentPuzzle = SpawnPuzzle(puzzlesToComplete[progress]);
        }
        SetupCurrentPuzzle();

        Run();
    }
 private EZGUIPointerDisablePatcher()
 {
     mManager = UIManager.instance;
     mUsedPointers = (bool[])typeof(UIManager).GetField("usedPointers",
         BindingFlags.NonPublic | BindingFlags.Instance).GetValue(UIManager.instance);
     mManager.AddMouseTouchPtrListener(EZGUIMouseTouchPtrListener);
 }
Exemple #15
0
	IEnumerator Start(){
		soundManager=SoundManager._instance;
		uiManager=UIManager._instance;
		saveDataManager=SaveDataManager.instance_;
		volcanoEyeManager=VolcanoEyeManager._instance;

		endText.SetActive(false);

		yield return new WaitForSeconds (0.5f);

		while( true ){
			if (Input.GetMouseButtonDown (0)) {
				print("preiosno");
				break;
			}
			yield return 0;
		}

		instance = this;
		for( int i = 0; i < spawnPointsParent.transform.childCount; i++){
			spawnPoints.Add( spawnPointsParent.transform.GetChild(i));
		}
		currentLives = lives;
		personPrefab = Resources.Load ("PersonPrefab") as GameObject;
		loadGame();

	}
Exemple #16
0
 public void UnRegisterEvents(UIManager pEventHandler)
 {
     btn_CreateOptions.Click -= pEventHandler.SurveyButtonClicked;
     btn_Edit.Click -= pEventHandler.SurveyButtonClicked;
     btn_New.Click -= pEventHandler.SurveyButtonClicked;
     btn_Vote.Click -= pEventHandler.SurveyButtonClicked;
 }
        public override void LoadContent()
        {
            base.LoadContent();

            cam = new Camera(GraphicsDevice);
            uiManager = new UIManager();
            //uiManager.EnableProfilling = true;

            var menuPanel = new UIPanel();
            menuPanel.AddConstraint(Edge.CenterXY, null, Edge.CenterXY);
            menuPanel.Alpha = 0f;

            var testScenesButton = GetMenuEntry(menuPanel, "UI Test Scenes");
            testScenesButton.InputReleased += testScenes;
            menuPanel.AddChild(testScenesButton);

            var transitionScenesButton = GetMenuEntry(menuPanel, "Transition Test Scenes");
            transitionScenesButton.InputReleased += TransitionScenesButton_InputReleased;
            menuPanel.AddChild(transitionScenesButton);

            var exitButton = GetMenuEntry(menuPanel, "Exit");
            exitButton.InputReleased += ExitButton_InputReleased;
            menuPanel.AddChild(exitButton);

            uiManager.Add(menuPanel);
        }
 /// <summary>
 /// Unity START
 /// </summary>
 /// <remarks>
 /// <para>
 /// Set up references to MainMenuController (MMC) and UIController (UIC), and get
 /// the NewGameManager (MMC) and UIManager (UIC) components.
 /// </para>
 /// </remarks>
 void Start()
 {
     GameObject mmc = GameObject.Find("MainMenuController");
     GameObject uic = GameObject.Find("UIController");
     ngm = mmc.GetComponent<NewGameManager>();
     uim = uic.GetComponent<UIManager>();
 }
    void Start () {
        gs = GameObject.Find("GameState").GetComponent<GameState>();
		gc = GameObject.Find("HandOfGod").GetComponent<GrabController>();
        tc = GameObject.Find("Tutorials").GetComponent<TutorialController>();
        ui = GameObject.Find("UI").GetComponent<UIManager>();
        sh = GameObject.Find("SoundHelper").GetComponent<SoundHelper>();
        planet = GameObject.Find("Planet");

        musicsource = gameObject.GetComponent<AudioSource>();
        StartCoroutine(startMusic());

        source = gameObject.AddComponent<AudioSource>();
        source.clip = crashSpaceship;
        source.loop = false;
        attackSource = gameObject.AddComponent<AudioSource>();
        attackSource.clip = attackSound;
        attackSource.loop = false;
        jetStartSource = gameObject.AddComponent<AudioSource>();
        jetStartSource.clip = jetstartSound;
        jetStartSource.loop = false;

        gs.ActiveSkill = 0;
        gs.CollectedResources = 0;
        bakeTimer = Time.time;
      
        // Create planet landscape
        planet.layer = 10;
        planet.GetComponent<RandomObjectScattering> ().Setup ();
        

        readyToBakePathfinding = true;
	}
	// Use this for initialization
	void Awake ()
	{
		if (instance == null)
			instance = this;
		else if (instance != this)
			Destroy (gameObject);
	}
Exemple #21
0
 /// <summary>
 /// Initializes a new MenuButton class.
 /// </summary>
 /// <param name="assignedUIManager">The AssignedUIManager.</param>
 public MenuButton(UIManager assignedUIManager)
     : base(assignedUIManager)
 {
     Size = new UISize(300, 30);
     _font = new Font("Segoe UI", 16, TypefaceStyle.Bold);
     Text = "MenuButton1";
 }
Exemple #22
0
    public Shell()
        : base("Mono Heap Profiler")
    {
        entries = new ActionEntry[] {
            new ActionEntry ("FileMenu", null, "_File", null, null, null),
            new ActionEntry ("OpenAction", Stock.Open, null, "<control>O", "Open a profile...", new EventHandler (OnOpen)),
            new ActionEntry ("QuitAction", Stock.Quit, null, "<control>Q", "Quit the application", delegate { Application.Quit (); }),
        };

        DefaultSize = new Gdk.Size (700, 700);
        DeleteEvent += delegate { Application.Quit (); };

        main_box = new VBox (false, 0);
        Add (main_box);

        shell_commands = new ActionGroup ("TestActions");
        shell_commands.Add (entries);

        uim = new UIManager ();
        uim.AddWidget += delegate (object obj, AddWidgetArgs args) {
            args.Widget.Show ();
            main_box.PackStart (args.Widget, false, true, 0);
        };

        uim.ConnectProxy += OnProxyConnect;
        uim.InsertActionGroup (shell_commands, 0);
        uim.AddUiFromResource ("shell-ui.xml");
        AddAccelGroup (uim.AccelGroup);

        sb = new Statusbar ();
        main_box.PackEnd (sb, false, true, 0);

        pager = new ShellPager (this);
        main_box.PackEnd (pager, true, true, 0);
    }
 void StartUp()
 {
     DontDestroyOnLoad(this);
     UIM = GameObject.Find("UIManager").GetComponent<UIManager>();
     TrapM = GameObject.Find("TrapManager").GetComponent<TrapManager>();
     money = startingMoney;
     UIM.UpdateMoneyText();
 }
Exemple #24
0
 void Start()
 {
     gm = gameObject;
     uimanager = GameObject.Find("UIManager").GetComponent<UIManager>();
     uimanager.OnPress_WButton += Appeare;
     uimanager.OnCloseGUI += Disappeare;
     gm.SetActive(false);
 }
Exemple #25
0
    private void Awake()
    {
        LevelManagerInstance = levelManager;
        UIManagerInstance = uiManager;
        GameObject.DontDestroyOnLoad (this.gameObject);

        UIManagerInstance.OpenMenu("main");
    }
    void Start()
    {
        colorAllTiles();
        uiManager = GameObject.FindObjectOfType<UIManager>();
        mainCamera = GameObject.FindObjectOfType<Camera>();
        validPoints = new List<Point2>();

    }
Exemple #27
0
	public PopMenuState( GameController context ) : base( context ) 
	{
		this.uiManager = new UIManager();
		sub_state = new SubMenuState(context, this, uiManager);
		main_state = new MainMenuState(context, this, uiManager);

		this.openSFX = Resources.Load("SFX/OpenMenu") as AudioClip;
	}
 public static UIManager GetInstance()
 {
     if (instance == null)
     {
         instance = new UIManager();
     }
     return instance;
 }
Exemple #29
0
	void Start(){
		instance = this;
		updateCoin ();
		int temp = PlayerPrefs.GetInt ("Level") % LevelManager.levelChange;
		levelText.text = "Level " + ((temp == 0 && PlayerPrefs.GetInt ("Level") > 0) ? 7 : temp);
		Texture2D skin = list.Find (item => item.GetInstanceID() == PlayerPrefs.GetInt("SkinID")-2);
		PlayerMovement.player.GetComponent<SpriteRenderer> ().sprite = Sprite.Create(skin, new Rect(0,0,skin.width, skin.height), new Vector2(0.5f,0.5f));
	}
Exemple #30
0
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogException(new Exception("There are two UIManagers. This is extremely dangerous."));
     }
     instance = this;
 }
Exemple #31
0
        public override bool Draw(UltimaBatcher2D batcher, int posX, int posY)
        {
            _equipConvData = null;
            _transform     = false;
            AnimationsLoader.Instance.SittingValue = 0;
            FrameInfo.X      = 0;
            FrameInfo.Y      = 0;
            FrameInfo.Width  = 0;
            FrameInfo.Height = 0;

            posY -= 3;
            int drawX = posX + (int)Offset.X;
            int drawY = posY + (int)(Offset.Y - Offset.Z);

            drawX += 22;
            drawY += 22;

            bool hasShadow = !IsDead && !IsHidden && ProfileManager.Current.ShadowsEnabled;

            if (AuraManager.IsEnabled)
            {
                AuraManager.Draw(batcher, drawX, drawY, ProfileManager.Current.PartyAura && World.Party.Contains(this) ? ProfileManager.Current.PartyAuraHue : Notoriety.GetHue(NotorietyFlag));
            }

            bool isHuman = IsHuman;


            if (ProfileManager.Current.HighlightGameObjects && SelectedObject.LastObject == this)
            {
                _viewHue    = 0x0023;
                HueVector.Y = 1;
            }
            else if (ProfileManager.Current.NoColorObjectsOutOfRange && Distance > World.ClientViewRange)
            {
                _viewHue    = Constants.OUT_RANGE_COLOR;
                HueVector.Y = 1;
            }
            else if (World.Player.IsDead && ProfileManager.Current.EnableBlackWhiteEffect)
            {
                _viewHue    = Constants.DEAD_RANGE_COLOR;
                HueVector.Y = 1;
            }
            else if (IsHidden)
            {
                _viewHue = 0x038E;
            }
            else if (SelectedObject.HealthbarObject == this)
            {
                _viewHue = Notoriety.GetHue(NotorietyFlag);
            }
            else
            {
                _viewHue = 0;

                if (IsDead)
                {
                    if (!isHuman)
                    {
                        _viewHue = 0x0386;
                    }
                }
                else if (ProfileManager.Current.HighlightMobilesByFlags)
                {
                    if (IsPoisoned)
                    {
                        _viewHue = ProfileManager.Current.PoisonHue;
                    }

                    if (IsParalyzed)
                    {
                        _viewHue = ProfileManager.Current.ParalyzedHue;
                    }

                    if (NotorietyFlag != NotorietyFlag.Invulnerable && IsYellowHits)
                    {
                        _viewHue = ProfileManager.Current.InvulnerableHue;
                    }
                }
            }


            bool isAttack     = Serial == TargetManager.LastAttack;
            bool isUnderMouse = SelectedObject.LastObject == this && TargetManager.IsTargeting;

            //bool needHpLine = false;

            if (this != World.Player)
            {
                if (isAttack || isUnderMouse)
                {
                    _viewHue = Notoriety.GetHue(NotorietyFlag);
                }

                if (this == TargetManager.LastTarget)
                {
                    UIManager.SetTargetLineGump(this);
                    //needHpLine = true;
                }
            }


            bool mirror = false;

            ProcessSteps(out byte dir);

            AnimationsLoader.Instance.GetAnimDirection(ref dir, ref mirror);
            IsFlipped = mirror;

            ushort graphic   = GetGraphicForAnimation();
            byte   animGroup = GetGroupForAnimation(this, graphic, true);
            sbyte  animIndex = AnimIndex;

            AnimationsLoader.Instance.Direction = dir;
            AnimationsLoader.Instance.AnimGroup = animGroup;

            Item mount = HasEquipment ? Equipment[(int)Layer.Mount] : null;

            if (isHuman && mount != null)
            {
                AnimationsLoader.Instance.SittingValue = 0;

                ushort mountGraphic = mount.GetGraphicForAnimation();

                if (mountGraphic != 0xFFFF)
                {
                    if (hasShadow)
                    {
                        DrawInternal(batcher, this, null, drawX, drawY + 10, mirror, ref animIndex, true, graphic, isHuman);
                        AnimationsLoader.Instance.AnimGroup = GetGroupForAnimation(this, mountGraphic);
                        DrawInternal(batcher, this, mount, drawX, drawY, mirror, ref animIndex, true, mountGraphic, isHuman);
                    }
                    else
                    {
                        AnimationsLoader.Instance.AnimGroup = GetGroupForAnimation(this, mountGraphic);
                    }

                    drawY += DrawInternal(batcher, this, mount, drawX, drawY, mirror, ref animIndex, false, mountGraphic, isHuman, isMount: true);
                }
            }
            else
            {
                if ((AnimationsLoader.Instance.SittingValue = IsSitting()) != 0)
                {
                    animGroup = (byte)PEOPLE_ANIMATION_GROUP.PAG_STAND;
                    animIndex = 0;

                    ProcessSteps(out dir);
                    AnimationsLoader.Instance.Direction = dir;
                    AnimationsLoader.Instance.FixSittingDirection(ref dir, ref mirror, ref drawX, ref drawY);

                    if (AnimationsLoader.Instance.Direction == 3)
                    {
                        animGroup = 25;
                    }
                    else
                    {
                        _transform = true;
                    }
                }
                else if (hasShadow)
                {
                    DrawInternal(batcher, this, null, drawX, drawY, mirror, ref animIndex, true, graphic, isHuman);
                }
            }

            AnimationsLoader.Instance.AnimGroup = animGroup;

            DrawInternal(batcher, this, null, drawX, drawY, mirror, ref animIndex, false, graphic, isHuman);

            if (HasEquipment)
            {
                var equip = Equipment;
                for (int i = 0; i < Constants.USED_LAYER_COUNT; i++)
                {
                    Layer layer = LayerOrder.UsedLayers[dir, i];

                    Item item = equip[(int)layer];

                    if (item == null)
                    {
                        continue;
                    }

                    if (IsDead && (layer == Layer.Hair || layer == Layer.Beard))
                    {
                        continue;
                    }

                    if (isHuman)
                    {
                        if (IsCovered(this, layer))
                        {
                            continue;
                        }

                        if (item.ItemData.AnimID != 0)
                        {
                            graphic = item.ItemData.AnimID;

                            if (AnimationsLoader.Instance.EquipConversions.TryGetValue(Graphic, out Dictionary <ushort, EquipConvData> map))
                            {
                                if (map.TryGetValue(item.ItemData.AnimID, out EquipConvData data))
                                {
                                    _equipConvData = data;
                                    graphic        = data.Graphic;
                                }
                            }

                            DrawInternal(batcher, this, item, drawX, drawY, mirror, ref animIndex, false, graphic, isHuman, false);
                        }
                        else
                        {
                            if (item.ItemData.IsLight)
                            {
                                Client.Game.GetScene <GameScene>().AddLight(this, this, drawX, drawY);
                            }
                        }

                        _equipConvData = null;
                    }
                    else
                    {
                        if (item.ItemData.IsLight)
                        {
                            Client.Game.GetScene <GameScene>().AddLight(this, this, drawX, drawY);
                            break;
                        }
                    }
                }
            }
            //if (FileManager.Animations.SittingValue != 0)
            //{
            //    ref var sittingData = ref FileManager.Animations.SittingInfos[FileManager.Animations.SittingValue - 1];

            //    if (FileManager.Animations.Direction == 3 && sittingData.DrawBack &&
            //        HasEquipment && Equipment[(int) Layer.Cloak] == null)
            //    {

            //    }
            //}
            //

            FrameInfo.X      = Math.Abs(FrameInfo.X);
            FrameInfo.Y      = Math.Abs(FrameInfo.Y);
            FrameInfo.Width  = FrameInfo.X + FrameInfo.Width;
            FrameInfo.Height = FrameInfo.Y + FrameInfo.Height;

            return(true);
        }
Exemple #32
0
 private void Start()
 {
     // Retrieves the UI manager
     _uiManager = GameObject.Find("Canvas").GetComponent <UIManager>();
 }
Exemple #33
0
 void Start()
 {
     UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClose, 0, 0);
 }
 void Start()
 {
     controller = new InputController();
     rigidbody  = GetComponent <Rigidbody>();
     uiManager  = FindObjectOfType <UIManager>();
 }
 private void Awake()
 {
     Debug.Log("UIManager Awake");
     Instance = this;
 }
Exemple #36
0
 void Awake()
 {
     instance = this;
 }
        public static void RequestPartyAccept(uint serial)
        {
            Socket.Send(new PPartyAccept(serial));

            UIManager.GetGump<PartyInviteGump>()?.Dispose();
        }
 private void Start()
 {
     uiManager = FindObjectOfType <UIManager>();
 }
        private void Build()
        {
            Gui.Initialize(this);

            // Widget Launchpad.Launcher.Interface.MainWindow
            this.UIManager = new UIManager();
            ActionGroup mainActionGroup = new ActionGroup("Default");

            this.menuAction = new Action("menuAction", LocalizationCatalog.GetString("Menu"), null, null)
            {
                ShortLabel = LocalizationCatalog.GetString("Menu")
            };
            mainActionGroup.Add(this.menuAction, null);

            this.repairGameAction = new Action(
                "repairGameAction",
                LocalizationCatalog.GetString("Repair Game"),
                LocalizationCatalog.GetString("Starts a repair process for the installed game."),
                "gtk-refresh")
            {
                ShortLabel = LocalizationCatalog.GetString("Repair Game")
            };
            mainActionGroup.Add(this.repairGameAction, null);

            this.reinstallGameAction = new Action(
                "reinstallGameAction",
                LocalizationCatalog.GetString("Reinstall Game"),
                LocalizationCatalog.GetString("Reinstalls the installed game."),
                "gtk-refresh")
            {
                ShortLabel = LocalizationCatalog.GetString("Reinstall Game")
            };
            mainActionGroup.Add(this.reinstallGameAction, null);

            this.UIManager.InsertActionGroup(mainActionGroup, 0);
            AddAccelGroup(this.UIManager.AccelGroup);
            this.Name  = "Launchpad.Launcher.Interface.MainWindow";
            this.Title = LocalizationCatalog.GetString("Launchpad - {0}");

            if (SystemInformation.IsRunningOnUnix())
            {
                this.Icon = Pixbuf.LoadFromResource("Launchpad.Launcher.Resources.RocketIcon.ico");
            }
            else
            {
                this.Icon = Pixbuf.LoadFromResource("Launchpad.Launcher.Resources.RocketIcon_Grey.ico");
            }

            this.WindowPosition = (WindowPosition)4;
            this.DefaultWidth   = 745;
            this.DefaultHeight  = 415;
            this.Resizable      = false;

            // Container child Launchpad.Launcher.Interface.MainWindow.Gtk.Container+ContainerChild
            this.vbox1 = new VBox
            {
                Name    = "vbox1",
                Spacing = 6
            };

            // Container child vbox1.Gtk.Box+BoxChild
            this.UIManager.AddUiFromString
            (
                "<ui>" +
                "<menubar name='menuBar'>" +
                "<menu name='menuAction' action='menuAction'>" +
                "<menuitem name='repairGameAction' action='repairGameAction'/>" +
                "<separator/>" +
                "<menuitem name='reinstallGameAction' action='reinstallGameAction'/>" +
                "</menu>" +
                "</menubar>" +
                "</ui>"
            );
            this.menuBar      = (MenuBar)this.UIManager.GetWidget("/menuBar");
            this.menuBar.Name = "menuBar";
            this.vbox1.Add(this.menuBar);

            Box.BoxChild w2 = (Box.BoxChild) this.vbox1 [this.menuBar];
            w2.Position = 0;
            w2.Expand   = false;
            w2.Fill     = false;

            // Container child vbox1.Gtk.Box+BoxChild
            this.hbox2 = new HBox
            {
                Name        = "hbox2",
                Spacing     = 6,
                BorderWidth = 4
            };

            // Container child hbox2.Gtk.Box+BoxChild
            this.browserContainer = new VBox
            {
                Name    = "browserContainer",
                Spacing = 6
            };

            // Container child browserContainer.Gtk.Box+BoxChild
            this.alignment2 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                WidthRequest = 310,
                Name         = "alignment2"
            };

            // Container child alignment2.Gtk.Container+ContainerChild
            this.browserWindow = new ScrolledWindow
            {
                CanFocus   = true,
                Name       = "browserWindow",
                ShadowType = ShadowType.In
            };
            this.alignment2.Add(this.browserWindow);
            this.browserContainer.Add(this.alignment2);

            Box.BoxChild w4 = (Box.BoxChild) this.browserContainer [this.alignment2];
            w4.Position = 0;
            this.hbox2.Add(this.browserContainer);

            Box.BoxChild w5 = (Box.BoxChild) this.hbox2 [this.browserContainer];
            w5.Position = 0;
            w5.Expand   = false;

            // Container child hbox2.Gtk.Box+BoxChild
            this.alignment5 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name = "alignment5"
            };

            // Container child alignment5.Gtk.Container+ContainerChild
            this.gameBanner = new Image
            {
                WidthRequest  = 450,
                HeightRequest = 300,
                Name          = "gameBanner",
                Pixbuf        = Pixbuf.LoadFromResource("Launchpad.Launcher.Resources.RocketIcon.ico")
            };
            this.alignment5.Add(this.gameBanner);
            this.hbox2.Add(this.alignment5);

            Box.BoxChild w7 = (Box.BoxChild) this.hbox2 [this.alignment5];
            w7.Position = 1;
            this.vbox1.Add(this.hbox2);

            Box.BoxChild w8 = (Box.BoxChild) this.vbox1 [this.hbox2];
            w8.Position = 1;
            w8.Expand   = false;
            w8.Fill     = false;

            // Container child vbox1.Gtk.Box+BoxChild
            this.alignment1 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name        = "alignment1",
                LeftPadding = 6
            };

            // Container child alignment1.Gtk.Container+ContainerChild
            this.indicatorLabel = new Label
            {
                Name      = "indicatorLabel",
                Xalign    = 0F,
                LabelProp = LocalizationCatalog.GetString("Idle")
            };
            this.alignment1.Add(this.indicatorLabel);
            this.vbox1.Add(this.alignment1);

            Box.BoxChild w10 = (Box.BoxChild) this.vbox1 [this.alignment1];
            w10.Position = 2;
            w10.Expand   = false;
            w10.Fill     = false;

            // Container child vbox1.Gtk.Box+BoxChild
            this.hbox3 = new HBox
            {
                Name        = "hbox3",
                Spacing     = 6,
                BorderWidth = 4
            };

            // Container child hbox3.Gtk.Box+BoxChild
            this.alignment4 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name = "alignment4"
            };

            // Container child alignment4.Gtk.Container+ContainerChild
            this.mainProgressBar = new ProgressBar
            {
                Name = "mainProgressBar"
            };
            this.alignment4.Add(this.mainProgressBar);
            this.hbox3.Add(this.alignment4);

            Box.BoxChild w12 = (Box.BoxChild) this.hbox3 [this.alignment4];
            w12.Position = 0;

            // Container child hbox3.Gtk.Box+BoxChild
            this.hbox4 = new HBox
            {
                Name    = "hbox4",
                Spacing = 6
            };

            // Container child hbox4.Gtk.Box+BoxChild
            this.alignment3 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                WidthRequest = 100,
                Name         = "alignment3"
            };

            // Container child alignment3.Gtk.Container+ContainerChild
            this.primaryButton = new Button
            {
                Sensitive    = false,
                CanDefault   = true,
                CanFocus     = true,
                Name         = "primaryButton",
                UseUnderline = true,
                Label        = LocalizationCatalog.GetString("Inactive")
            };
            this.alignment3.Add(this.primaryButton);
            this.hbox4.Add(this.alignment3);

            Box.BoxChild w14 = (Box.BoxChild) this.hbox4 [this.alignment3];
            w14.Position = 0;
            this.hbox3.Add(this.hbox4);

            Box.BoxChild w15 = (Box.BoxChild) this.hbox3 [this.hbox4];
            w15.Position = 1;
            w15.Expand   = false;
            w15.Fill     = false;
            this.vbox1.Add(this.hbox3);

            Box.BoxChild w16 = (Box.BoxChild) this.vbox1 [this.hbox3];
            w16.Position = 3;
            w16.Expand   = true;
            w16.Fill     = false;

            Add(this.vbox1);
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }

            this.primaryButton.HasDefault = true;
            Show();
            DeleteEvent += OnDeleteEvent;
            this.repairGameAction.Activated    += OnRepairGameActionActivated;
            this.reinstallGameAction.Activated += OnReinstallGameActionActivated;
            this.primaryButton.Clicked         += OnPrimaryButtonClicked;
        }
Exemple #40
0
        public void ExecuteBuySingleInsuranceCommand()
        {
            if (BuySingleInsuranceModel == null)
            {
                return;
            }
            if (!BuySingleInsuranceModel.Check())
            {
                return;
            }
            if (BuySingleInsuranceModel.BirthDay == null)
            {
                return;
            }
            var rbim = new RequestBuyInsuranceManually
            {
                CardNo =
                    string.IsNullOrWhiteSpace(BuySingleInsuranceModel.IdNo) &&
                    (BuySingleInsuranceModel.IsBabyType || BuySingleInsuranceModel.IsChildType)
                        ? BuySingleInsuranceModel.BirthDay.Value.ToString("yyyy-MM-dd")
                        : BuySingleInsuranceModel.IdNo,
                Count        = BuySingleInsuranceModel.InsuranceCount,
                FlightNumber = BuySingleInsuranceModel.FlightNumber
            };

            if (BuySingleInsuranceModel.IsIdType)
            {
                rbim.IdType = EnumIDType.NormalId;
            }
            else if (BuySingleInsuranceModel.IsMilitaryIdType)
            {
                rbim.IdType = EnumIDType.MilitaryId;
            }
            else if (BuySingleInsuranceModel.IsPassportIdType)
            {
                rbim.IdType = EnumIDType.Passport;
            }
            else if (BuySingleInsuranceModel.IsOtherType)
            {
                rbim.IdType = EnumIDType.Other;
            }
            if (BuySingleInsuranceModel.IsAdultType)
            {
                rbim.PassengerType = EnumPassengerType.Adult;
            }
            else if (BuySingleInsuranceModel.IsChildType)
            {
                rbim.PassengerType = EnumPassengerType.Child;
            }
            else if (BuySingleInsuranceModel.IsBabyType)
            {
                rbim.PassengerType = EnumPassengerType.Baby;
            }
            rbim.InsuranceLimitEndTime   = BuySingleInsuranceModel.FlightStartDate.Date.AddDays(1).AddSeconds(-1);
            rbim.InsuranceLimitStartTime = BuySingleInsuranceModel.FlightStartDate.Date;
            rbim.StartDateTime           = BuySingleInsuranceModel.FlightStartDate;
            rbim.InsuredName             = BuySingleInsuranceModel.Name;
            rbim.Mobile     = BuySingleInsuranceModel.Mobile;
            rbim.PNR        = BuySingleInsuranceModel.PNR;
            rbim.SexType    = BuySingleInsuranceModel.Gender ? EnumSexType.Male : EnumSexType.Female;
            rbim.Birth      = BuySingleInsuranceModel.BirthDay;
            rbim.ToCityName = BuySingleInsuranceModel.ToCityName;
            IsBusy          = true;
            Action action = () => CommunicateManager.Invoke <IInsuranceService>(service =>
            {
                service.BuyInsuranceManually(rbim);
                UIManager.ShowMessage("投保成功!");
                IsDone = true;
            }, UIManager.ShowErr);

            Task.Factory.StartNew(action).ContinueWith(task =>
            {
                Action setBusyAction = () => { IsBusy = false; };
                DispatcherHelper.UIDispatcher.Invoke(setBusyAction);
            });
        }
Exemple #41
0
 void CloseWindow()
 {
     UIManager.CloseUI(UIInfo.MoneyTreeRoot);
 }
Exemple #42
0
 void Start()
 {
     inv       = GameObject.Find("Inventory").GetComponent <Inventory>();
     uiManager = GameObject.Find("UIManager").GetComponent <UIManager>();
     tooltip   = inv.GetComponent <Tooltip>();
 }
Exemple #43
0
 private void Awake()
 {
     main = this;
 }
Exemple #44
0
        Gtk.Menu CreateMenu()
        {
            if (menu != null)
            {
                return(menu);
            }

            var group = new ActionGroup("Popup");

            var help = new Gtk.Action("help", GettextCatalog.GetString("Show Error Reference"),
                                      GettextCatalog.GetString("Show Error Reference"), Gtk.Stock.Help);

            help.Activated += OnShowReference;
            group.Add(help, "F1");

            var copy = new Gtk.Action("copy", GettextCatalog.GetString("_Copy"),
                                      GettextCatalog.GetString("Copy task"), Gtk.Stock.Copy);

            copy.Activated += OnTaskCopied;
            group.Add(copy, "<Control><Mod2>c");

            var jump = new Gtk.Action("jump", GettextCatalog.GetString("_Go to"),
                                      GettextCatalog.GetString("Go to task"), Gtk.Stock.JumpTo);

            jump.Activated += OnTaskJumpto;
            group.Add(jump);

            var columns = new Gtk.Action("columns", GettextCatalog.GetString("Columns"));

            group.Add(columns, null);

            var columnType = new ToggleAction("columnType", GettextCatalog.GetString("Type"),
                                              GettextCatalog.GetString("Toggle visibility of Type column"), null);

            columnType.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnType] = VisibleColumns.Type;
            group.Add(columnType);

            var columnValidity = new ToggleAction("columnValidity", GettextCatalog.GetString("Validity"),
                                                  GettextCatalog.GetString("Toggle visibility of Validity column"), null);

            columnValidity.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnValidity] = VisibleColumns.Marked;
            group.Add(columnValidity);

            var columnLine = new ToggleAction("columnLine", GettextCatalog.GetString("Line"),
                                              GettextCatalog.GetString("Toggle visibility of Line column"), null);

            columnLine.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnLine] = VisibleColumns.Line;
            group.Add(columnLine);

            var columnDescription = new ToggleAction("columnDescription", GettextCatalog.GetString("Description"),
                                                     GettextCatalog.GetString("Toggle visibility of Description column"), null);

            columnDescription.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnDescription] = VisibleColumns.Description;
            group.Add(columnDescription);

            var columnFile = new ToggleAction("columnFile", GettextCatalog.GetString("File"),
                                              GettextCatalog.GetString("Toggle visibility of File column"), null);

            columnFile.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnFile] = VisibleColumns.File;
            group.Add(columnFile);

            var columnProject = new ToggleAction("columnProject", GettextCatalog.GetString("Project"),
                                                 GettextCatalog.GetString("Toggle visibility of Project column"), null);

            columnProject.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnProject] = VisibleColumns.Project;
            group.Add(columnProject);

            var columnPath = new ToggleAction("columnPath", GettextCatalog.GetString("Path"),
                                              GettextCatalog.GetString("Toggle visibility of Path column"), null);

            columnPath.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnPath] = VisibleColumns.Path;
            group.Add(columnPath);

            var columnCategory = new ToggleAction("columnCategory", GettextCatalog.GetString("Category"),
                                                  GettextCatalog.GetString("Toggle visibility of Category column"), null);

            columnCategory.Toggled        += OnColumnVisibilityChanged;
            columnsActions[columnCategory] = VisibleColumns.Category;
            group.Add(columnCategory);



            var uiManager = new UIManager();

            uiManager.InsertActionGroup(group, 0);

            string uiStr = "<ui><popup name='popup'>"
                           + "<menuitem action='help'/>"
                           + "<menuitem action='copy'/>"
                           + "<menuitem action='jump'/>"
                           + "<separator/>"
                           + "<menu action='columns'>"
                           + "<menuitem action='columnType' />"
                           + "<menuitem action='columnValidity' />"
                           + "<menuitem action='columnLine' />"
                           + "<menuitem action='columnDescription' />"
                           + "<menuitem action='columnFile' />"
                           + "<menuitem action='columnProject' />"
                           + "<menuitem action='columnPath' />"
                           + "<menuitem action='columnCategory' />"
                           + "</menu>"
                           + "</popup></ui>";

            uiManager.AddUiFromString(uiStr);
            menu = (Menu)uiManager.GetWidget("/popup");
            menu.ShowAll();

            menu.Shown += delegate {
                columnType.Active        = view.Columns[VisibleColumns.Type].Visible;
                columnValidity.Active    = view.Columns[VisibleColumns.Marked].Visible;
                columnLine.Active        = view.Columns[VisibleColumns.Line].Visible;
                columnDescription.Active = view.Columns[VisibleColumns.Description].Visible;
                columnFile.Active        = view.Columns[VisibleColumns.File].Visible;
                columnProject.Active     = view.Columns[VisibleColumns.Project].Visible;
                columnPath.Active        = view.Columns[VisibleColumns.Path].Visible;
                columnCategory.Active    = view.Columns[VisibleColumns.Category].Visible;
                help.Sensitive           = copy.Sensitive = jump.Sensitive =
                    view.Selection != null &&
                    view.Selection.CountSelectedRows() > 0 &&
                    (columnType.Active ||
                     columnValidity.Active ||
                     columnLine.Active ||
                     columnDescription.Active ||
                     columnFile.Active ||
                     columnPath.Active);
                string dummyString;
                help.Sensitive &= GetSelectedErrorReference(out dummyString);
            };

            return(menu);
        }
Exemple #45
0
 private void Awake()
 {
     _uiManager = GameObject.Find("Canvas").GetComponent <UIManager>();
     Assert.IsNotNull(_uiManager, "Failed to access to UIManager script.");
 }
Exemple #46
0
 private void Awake()
 {
     instance = this;
 }
Exemple #47
0
 void Awake()
 {
     singleton = this;
 }
Exemple #48
0
        private void NetClient_PacketReceived(object sender, Packet e)
        {
            e.MoveToData();

            switch (e.ID)
            {
            case 0xA8:     // ServerListReceived
                ParseServerList(e);

                CurrentLoginStep = LoginSteps.ServerSelection;

                if (Settings.GlobalSettings.AutoLogin || Reconnect)
                {
                    if (Servers.Length != 0)
                    {
                        int index = Settings.GlobalSettings.LastServerNum;

                        if (index <= 0 || index > Servers.Length)
                        {
                            Log.Warn($"Wrong server index: {index}");
                            index = 1;
                        }

                        SelectServer((byte)Servers[index - 1].Index);
                    }
                }

                break;

            case 0x8C:     // ReceiveServerRelay
                // On OSI, upon receiving this packet, the client would disconnect and
                // log in to the specified server. Since emulated servers use the same
                // server for both shard selection and world, we don't need to disconnect.
                HandleRelayServerPacket(e);

                break;

            case 0x86:     // UpdateCharacterList
                ParseCharacterList(e);

                UIManager.GetGump <CharacterSelectionGump>()?.Dispose();

                _currentGump?.Dispose();

                UIManager.Add(_currentGump = new CharacterSelectionGump());

                break;

            case 0xA9:     // ReceiveCharacterList
                ParseCharacterList(e);
                ParseCities(e);
                ParseFlags(e);
                CurrentLoginStep = LoginSteps.CharacterSelection;

                uint charToSelect = 0;

                bool haveAnyCharacter = false;
                bool tryAutologin     = Settings.GlobalSettings.AutoLogin || Reconnect;

                for (byte i = 0; i < Characters.Length; i++)
                {
                    if (Characters[i].Length > 0)
                    {
                        haveAnyCharacter = true;

                        if (Characters[i] == Settings.GlobalSettings.LastCharacterName)
                        {
                            charToSelect = i;

                            break;
                        }
                    }
                }

                if (tryAutologin && haveAnyCharacter)
                {
                    SelectCharacter(charToSelect);
                }
                else if (!haveAnyCharacter)
                {
                    StartCharCreation();
                }

                break;

            case 0xBD:     // ReceiveVersionRequest
                NetClient.Socket.Send(new PClientVersion(Settings.GlobalSettings.ClientVersion));

                break;

            case 0x82:     // ReceiveLoginRejection
            case 0x85:     // character list notification
            case 0x53:     // Error Code
                byte code = e.ReadByte();

                PopupMessage     = ServerErrorMessages.GetError(e.ID, code);
                CurrentLoginStep = LoginSteps.PopUpMessage;

                break;

            case 0xB9:
                uint flags = 0;

                if (Client.Version >= ClientVersion.CV_60142)
                {
                    flags = e.ReadUInt();
                }
                else
                {
                    flags = e.ReadUShort();
                }
                World.ClientLockedFeatures.SetFlags((LockedFeatureFlags)flags);
                break;

            default:
                break;
            }
        }
Exemple #49
0
 private void Awake()
 {
     uiManager = GetComponentInParent <UIManager>();
 }
Exemple #50
0
 public void OnCloseClick()
 {
     UIManager.CloseUI(UIInfo.SNSRoot);
 }
Exemple #51
0
 public virtual void StartUIManager()
 {
     Instance = this;
 }
Exemple #52
0
 private void Start()
 {
     uimanager = UIManager.GetInstance;
     btn_Server.GetComponent <Button>().onClick.AddListener(btn_Server_Click);
     btn_Client.GetComponent <Button>().onClick.AddListener(btn_Client_Click);
 }
 private void Start()
 {
     //get the script component of the UI MAnager
     uIManager = GameObject.FindGameObjectWithTag("UIManager").GetComponent <UIManager>();
 }
Exemple #54
0
 private void OnLoginBtnClick()
 {
     UIManager.Instance().OpenUI("Main", "Main");
     Close();
 }
 public void Awake()
 {
     Instance = this;
 }
Exemple #56
0
    void Start()
    {
        InitUIText();
        //item.SetActive (false);
        UIManager.SetButtonEventHandler(changeBtn.gameObject, EnumButtonEvent.OnClick, OnClickchange, 0, 0);
        UIManager.SetButtonEventHandler(transferBtn.gameObject, EnumButtonEvent.OnClick, OnClicktransfer, 0, 0);
        UIManager.SetButtonEventHandler(disbandBtn.gameObject, EnumButtonEvent.OnClick, OnClickdisband, 0, 0);
        UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClickclose, 0, 0);
        UIManager.SetButtonEventHandler(departureBtn.gameObject, EnumButtonEvent.OnClick, OnClickdeparture, 0, 0);
        UIManager.SetButtonEventHandler(OtherFamilyBtn.gameObject, EnumButtonEvent.OnClick, OnClickOtherFamily, 0, 0);
        UIManager.SetButtonEventHandler(leftBtn.gameObject, EnumButtonEvent.OnClick, OnClickright, 0, 0);
        UIManager.SetButtonEventHandler(rightBtn.gameObject, EnumButtonEvent.OnClick, OnClickLeft, 0, 0);
        UIManager.SetButtonEventHandler(juanzhuBtn.gameObject, EnumButtonEvent.OnClick, OnClickjuanzhuBtn, 0, 0);
        UIManager.SetButtonEventHandler(tanheBtn.gameObject, EnumButtonEvent.OnClick, OnClicktanheBtn, 0, 0);
        UIManager.SetButtonEventHandler(qiandaoBtn.gameObject, EnumButtonEvent.OnClick, OnClickqiandaoBtn, 0, 0);

        for (int i = 0; i < btns.Count; i++)
        {
            UIManager.SetButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick, OnClickbtnTabels, i, 0);
        }
        for (int i = 0; i < Guildbtns.Count; i++)
        {
            UIManager.SetButtonEventHandler(Guildbtns[i].gameObject, EnumButtonEvent.OnClick, OnClickGuildbtns, i, 0);
        }
        GuildSystem.InitGuildDataOk  += RefreshFamilyInfo;
        GuildSystem.InitmemberDataOk += RefreshFamilyMembers;
        GuildSystem.UpdateGuildInfo  += UpdateUI;
        RefreshFamilyMembers(GuildSystem.GuildMembers.ToArray());
        RefreshFamilyInfo(GuildSystem.Mguild);
        familyGongxianLabel.text = GuildSystem.GetGuildMemberSelf(GamePlayer.Instance.InstId).contribution_.ToString();

        GlobalValue.Get(Constant.C_FamilyOneDayFundzLose, out weihu);
        weihuLable.text = (GuildSystem.Mguild.buildings_[((int)GuildBuildingType.GBT_Main) - 1].level_ * weihu).ToString();
        SelectTabelBtn(0);
        SelectTabelView(0);
        SelectGuildTabelBtn(0);
        UpdateUI();
        UpdatePlayerMoneyOk();
        if (bIndex == 0)
        {
            if (CurPage == 0)
            {
                numLabel.text = "1" + "/" + MaxPage;
                CurPage       = 1;
            }
            else
            {
                numLabel.text = CurPage + "/" + MaxPage;
            }
        }
        else
        {
            if (CurResPage == 0)
            {
                numLabel.text = "1" + "/" + MaxResPage;
                CurResPage    = 1;
            }
            else
            {
                numLabel.text = CurResPage + "/" + MaxResPage;
            }
        }
        GlobalValue.Get(Constant.C_FamilySignDrop, out SignDrop);
        ItemData ida = ItemData.GetData(DropData.GetData(SignDrop).item_1_);

        UIManager.Instance.AddItemCellUI(spobj, (uint)ida.id_).showTips = true;
        //HeadIconLoader.Instance.LoadIcon (ida.icon_, qiandaoT);
        if (GuildSystem.GetGuildMemberSelf(GamePlayer.Instance.InstId).signflag_)
        {
            qiandaoBtn.isEnabled = false;
            yiobj.SetActive(true);
        }
        else
        {
            qiandaoBtn.isEnabled = true;
            yiobj.SetActive(false);
        }
        GameManager.Instance.UpdatePlayermake += UpdatePlayerMoneyOk;
        GuildSystem.UpdateGuildMemberOk       += updateGuildMember;
        GuildSystem.UpdateGuildLevelok        += updateguildLevel;
    }
Exemple #57
0
        public static void Main(string[] args)
        {
            /* Initialize our catalog */
            //   Catalog.Init (Defines.Name, Defines.LocaleDir);

            /* Process our args */
            options = new GtkMeshworkOptions();
            options.ProcessArgs(args);

            Common.SetProcessName("meshwork-gtk");

            /* Initialize the GTK application */
            Gtk.Application.Init();

            if (!System.Diagnostics.Debugger.IsAttached)
            {
                /* If we crash, attempt to log the error */
                GLib.ExceptionManager.UnhandledException   += UnhandledGLibExceptionHandler;
                AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
            }

            //XXX: Implement Gunique code here!

            splashWindow = new SplashWindow();
            splashWindow.Show();

            /* Load settings */
            if (options.ConfigPath != null)
            {
                Core.LoggingService.LogDebug("Using config dir: " + options.ConfigPath);
                Settings.OverrideConfigPath(options.ConfigPath);
            }
            tmpSettings = Settings.ReadSettings();

            // First run, create initial settings.
            if (tmpSettings == null || !tmpSettings.HasKey)
            {
                tmpSettings          = new Settings();
                tmpSettings.NickName = Core.OS.UserName;
                tmpSettings.RealName = Core.OS.RealName;
                tmpSettings.IncompleteDownloadDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                tmpSettings.CompletedDownloadDir  = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                tmpSettings.SetFirstRun(true);
            }

            /* Load Icons */
            Gtk.Window.DefaultIconList = new Gdk.Pixbuf[] {
                new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.tray_icon.png")
            };

            // Windows specific. Override stock icons to use embeded files.
            var sizes     = new [] { 16, 22, 24, 34 };
            var iconNames = new[] {
                "application-exit", "application-x-executable", "audio-x-generic",
                "computer", "dialog-error", "dialog-information", "dialog-password",
                "gtk-preferences", "dialog-question", "dialog-warning", "folder",
                "go-down", "go-home", "go-next", "go-previous", "go-up", "image-x-generic",
                "internet-group-chat", "list-add", "list-remove", "mail-attachment",
                "mail_generic", "mail-message-new", "mail-signed-verified",
                "network-transmit-receive", "stock_channel", "stock_internet",
                "system-search", "text-x-generic", "user-home", "video-x-generic",
                "view-refresh", "x-office-document"
            };

            foreach (var size in sizes)
            {
                foreach (var iconName in iconNames)
                {
                    if (Environment.OSVersion.Platform != PlatformID.Unix ||
                        !IconTheme.Default.HasIcon(iconName) ||
                        !IconTheme.Default.GetIconSizes(iconName).Contains(size))
                    {
                        var pixbuf = Gui.LoadIconFromResource(iconName, size);
                        if (pixbuf != null)
                        {
                            Gtk.IconTheme.AddBuiltinIcon(iconName, size, pixbuf);
                        }
                        else
                        {
                            Core.LoggingService.LogWarning("Missing embeded icon: {0} ({1}x{1})", iconName, size);
                        }
                    }
                }
            }

            /* Set up UI actions */
            builtin_actions = new BuiltinActionGroup();
            ui_manager      = new UIManager();
            ui_manager.InsertActionGroup(builtin_actions, 0);
            ui_manager.AddUiFromResource("FileFind.Meshwork.GtkClient.MainWindow.xml");
            ui_manager.AddUiFromResource("FileFind.Meshwork.GtkClient.TrayPopupMenu.xml");
            ui_manager.AddUiFromResource("FileFind.Meshwork.GtkClient.SearchPopupMenu.xml");
            ui_manager.AddUiFromResource("FileFind.Meshwork.GtkClient.MapPopupMenu.xml");

            /* Create the Tray Icon */
            trayIcon = new TrayIcon();

            /* Start the event loop */
            GLib.Idle.Add(new GLib.IdleHandler(FinishLoading));
            Gtk.Application.Run();
        }
Exemple #58
0
 void Start()
 {
     uiManager           = UIManager.instance;
     inputManager        = InputManager.instance;
     charactersDisplayed = 0;
 }
        public static bool PickUp
        (
            uint serial,
            int x,
            int y,
            int amount = -1,
            Point? offset = null,
            bool is_gump = false
        )
        {
            if (World.Player.IsDead || ItemHold.Enabled)
            {
                return false;
            }

            Item item = World.Items.Get(serial);

            if (item == null || item.IsDestroyed || item.IsMulti || item.OnGround && (item.IsLocked || item.Distance > Constants.DRAG_ITEMS_DISTANCE))
            {
                return false;
            }

            if (amount <= -1 && item.Amount > 1 && item.ItemData.IsStackable)
            {
                if (ProfileManager.CurrentProfile.HoldShiftToSplitStack == Keyboard.Shift)
                {
                    SplitMenuGump gump = UIManager.GetGump<SplitMenuGump>(item);

                    if (gump != null)
                    {
                        return false;
                    }

                    gump = new SplitMenuGump(item, new Point(x, y))
                    {
                        X = Mouse.Position.X - 80,
                        Y = Mouse.Position.Y - 40
                    };

                    UIManager.Add(gump);
                    UIManager.AttemptDragControl(gump, true);

                    return true;
                }
            }

            if (amount <= 0)
            {
                amount = item.Amount;
            }

            ItemHold.Clear();
            ItemHold.Set(item, (ushort) amount, offset);
            ItemHold.IsGumpTexture = is_gump;
            Socket.Send(new PPickUpRequest(item, (ushort) amount));
            UIManager.GameCursor.SetDraggedItem(offset);

            if (item.OnGround)
            {
                item.RemoveFromTile();
            }

            item.TextContainer?.Clear();

            World.ObjectToRemove = item.Serial;

            return true;
        }
Exemple #60
0
 private void Start()
 {
     isActivated = false;
     uiManager   = GameObject.FindGameObjectWithTag("Canvas").GetComponent <UIManager>();
 }