public override void Run(DeckHandler dh) { if (!String.IsNullOrEmpty(ProgramPath)) { System.Diagnostics.Process.Start(ProgramPath); } }
public override void OnInspectorGUI() { DeckHandler myTarget = (DeckHandler)target; EditorUtility.SetDirty(myTarget); myTarget.emptyCardPrefab = EditorGUILayout.ObjectField("EmptyCard:", myTarget.emptyCardPrefab, typeof(GameObject), false) as GameObject; myTarget.deckList = EditorGUILayout.ObjectField("Deck List:", myTarget.deckList, typeof(DeckList), false) as DeckList; if (!EditorApplication.isPlaying) { return; } Queue <InSceneCard> cards = myTarget.getCards(); int x = 0; foreach (var item in cards) { EditorGUILayout.LabelField("Slot#" + x++, item.cardInfo.name); } if (GUILayout.Button("ValidateCards")) { myTarget.validate(); } if (GUILayout.Button("Shuffle")) { myTarget.shuffleDeck(); } }
private void Start() { PhotonNetwork.ConnectUsingSettings("1.0"); DeckHandler.LoadFromSaveToDeck(); _audioControl = GameObject.FindGameObjectWithTag(Tag.Audio).GetComponent <AudioControl>(); ButtonCheck(); }
// Start is called before the first frame update void Start() { //defaults the hand to be untoggled showingHand = false; pos = transform.position; handSpriteRender = gameObject.GetComponent <SpriteRenderer>(); //resize the sprite[] to 40, to hold all card sprites Array.Resize(ref cardSprites, 50); Resources.LoadAll <Sprite>("Assets/Cards").CopyTo(cardSprites, 0); //initializes array and used scripts spriteArray = this.GetComponent <SpriteArray>(); deckHandler = playerDeck.GetComponent <DeckHandler>(); cardData = cards.GetComponent <CardData>(); //initializes and tells the button "place" what to do Button placeCard = place.GetComponent <Button>(); placeCard.onClick.AddListener(PlaceCards); //initializes the card places and attack text card1Sprite = card1.GetComponent <SpriteRenderer>(); card2Sprite = card2.GetComponent <SpriteRenderer>(); card3Sprite = card3.GetComponent <SpriteRenderer>(); atkTxtMsh1 = atkTxt1.GetComponent <TextMesh>(); atkTxtMsh2 = atkTxt2.GetComponent <TextMesh>(); atkTxtMsh3 = atkTxt3.GetComponent <TextMesh>(); hlthTxtMsh1 = hlthTxt1.GetComponent <TextMesh>(); hlthTxtMsh2 = hlthTxt2.GetComponent <TextMesh>(); hlthTxtMsh3 = hlthTxt3.GetComponent <TextMesh>(); }
public FolderNavigate(DeckHandler dh) : base(dh) { base.isNavigationKey = true; PageReference = new Page("New Page"); PageReference.Keys[4].setImage("Resources\\back.png"); PageReference.Keys[4].KeyPressedFunction = new GoBack(dh); PageReference.Keys[4].KeyHeldFunction = new GoHome(dh); }
void Awake() { states = GetComponent <StateManager>() ?? gameObject.AddComponent <StateManager>(); deckHandler = GetComponent <DeckHandler>() ?? gameObject.AddComponent <DeckHandler>(); animationManager = GetComponent <AnimationManager>() ?? gameObject.AddComponent <AnimationManager>(); instance = this; }
void Setup() { GameObject[] playerObject = GameObject.FindGameObjectsWithTag("Player"); allPlayer = new GameObject[playerObject.Length]; for (int i = 0; i < playerObject.Length; i++) { allPlayer[i] = playerObject[i]; } deckHandler = GameManager.Instance.deckHandler; }
public override void Run(DeckHandler dh) { if (!String.IsNullOrEmpty(WebUrl) && IsValidUri(WebUrl)) { System.Diagnostics.Process.Start(WebUrl); } else { MessageBox.Show(String.Format("Couldn't load that link. It may not be valid. ({0})", WebUrl)); } }
public override void Run(DeckHandler dh) { if (dh.PageStack.Count > 0) { dh.CurrentPage = dh.PageStack.Pop(); dh.renderPage(); } else { MessageBox.Show("No page to go back to"); } }
static void Main() { DeckHandler deckHandler = new DeckHandler(); //TODO: Manage streamdeck not being connected and manage searching for the connection periodically when one isn't detected if (deckHandler.Deck == null) { } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainPage(deckHandler)); }
public TwitchSubscriptions(DeckHandler dh = null) : base(dh) { base.isNavigationKey = true; updateLive = new Thread(() => { CacheTimer = new System.Windows.Forms.Timer(); CacheTimer.Interval = 60000; CacheTimer.Tick += updateLiveChannels; CacheTimer.Start(); updateLiveChannels(null, null); }); updateLive.Start(); }
private void Start() { deckHandler = GameManager.Instance.deckHandler; uiHandler = GameManager.Instance.uiHandler; cardSetHandler = GameManager.Instance.cardSetHandler; firstLineSet = new List <Card>(); secondLineSet = new List <Card>(); thirdLineSet = new List <Card>(); screenForSetup.SetActive(false); uiHandler.canvasSetup.gameObject.SetActive(false); uiHandler.completeBtn().onClick.AddListener(SetupComplete); }
public override void Run(DeckHandler dh) { Page PageReference = new Page("Twitch Live Subs"); PageReference.Keys[4].setImage("Resources\\back.png"); PageReference.Keys[4].KeyPressedFunction = new GoBack(dh); PageReference.Keys[4].KeyHeldFunction = new GoHome(dh); //Wait for liveChannels to be populated while (liveChannels == null) { Thread.Sleep(1); } var i = 0; foreach (var stream in liveChannels.Streams) { string saveLocation = "image_cache\\" + stream.Channel.DisplayName + ".jpeg"; if (!File.Exists(saveLocation)) { var logoUrl = stream.Channel.Logo.Replace("300x300", "70x70"); Console.WriteLine(logoUrl); WebClient wc = new WebClient(); byte[] bytes = wc.DownloadData(logoUrl); MemoryStream ms = new MemoryStream(bytes); Image img = Image.FromStream(ms); img = ResizeImage(img, 72, 72); if (!Directory.Exists("image_cache\\")) { Directory.CreateDirectory("image_cache\\"); } img.Save(saveLocation, System.Drawing.Imaging.ImageFormat.Jpeg); } PageReference.Keys[i].setImage(saveLocation); PageReference.Keys[i].KeyPressedFunction = new OpenWebLink(stream.Channel.Url); i++; if (i == 4) { i++; } } dh.PageStack.Push(dh.CurrentPage); dh.CurrentPage = PageReference; dh.renderPage(); }
public void OnClick() { StartGameView(); GameObject faceDownPile = GameObject.Find("faceDownPile"); DeckHandler deckHandler = faceDownPile.GetComponent <DeckHandler>(); if (isServer) { deckHandler.PrepareDeck(); } NetworkIdentity networkIdentity = NetworkClient.connection.identity; playerManager = networkIdentity.GetComponent <PlayerManager>(); //playerManager.CmdDealHand(); }
public void Awake() { //turnHandler.playerCount += 1; //playerNumber = turnHandler.playerCount; //gameObject.name = $"Player {playerNumber}"; playerHandArea = GameObject.Find("playerHandArea"); faceDownPile = GameObject.Find("faceDownPile"); discardPile = GameObject.Find("discardPile"); goDownArea = GameObject.Find("goDownArea"); mainCanvas = GameObject.Find("Game Panel"); deckHandler = faceDownPile.GetComponent <DeckHandler>(); cardDeck = deckHandler.cardDeck; //deckHandler.AssignAuthority(connectionToClient, cardList); }
//deck starts with 3 copies of each card private void Start() { if (instance != null) { Destroy(gameObject); } else { instance = this; } for (int i = 0; i < 6; i++) { deck.Add(3); } player1 = GameSystem.instance.player1; player2 = GameSystem.instance.player2; }
public override void Run(DeckHandler dh) { dh.PageStack.Push(dh.CurrentPage); dh.CurrentPage = PageReference; dh.renderPage(); }
private void Awake() { Instance = this; }
// start is called once at the start of the script private void Start() { cardData = cards.GetComponent <CardData>(); handHandler = cardInHand.GetComponent <HandHandler>(); deckHandler = playerDeck.GetComponent <DeckHandler>(); }
public override void Run(DeckHandler dh) { return; }
public OpenWebLink(DeckHandler dh) { WebUrl = ""; }
public OpenProgram(DeckHandler dh) : base(dh) { }
public void Delete() { DeckHandler.DeleteCard(this); }
public GoHome(DeckHandler dh) : base(dh) { base.isNavigationKey = true; }
public NoFunction(DeckHandler dh = null) : base(dh) { }
public KeyFunction(DeckHandler dh) { }
public virtual void Run(DeckHandler dh) { //override this to implement your function return; }
public override void Run(DeckHandler dh) { dh.CurrentPage = dh.CurrentProfile.MainPage; dh.renderPage(); }
public MainPage(DeckHandler dh) { InitializeComponent(); deckHandler = dh; currentPage = new Page(deckHandler.CurrentPage); functionTypes = Assembly .GetAssembly(typeof(KeyFunction)) .GetTypes() .Where(t => t.IsSubclassOf(typeof(KeyFunction))).ToList <Type>(); functionNames = new List <string>(); foreach (var functionType in functionTypes) { var function = (KeyFunction)Activator.CreateInstance(functionType); functionNames.Add(function.getFunctionName()); } //Generate tray icon systrayIcon = new NotifyIcon(); systrayIcon.BalloonTipTitle = "OpenStreamDeck"; systrayIcon.BalloonTipText = "Double click to open OpenStreamDeck profile manager"; systrayIcon.ShowBalloonTip(500); systrayIcon.DoubleClick += systrayIcon_DoubleClicked; var menu = new ContextMenu(); var menuItem = new MenuItem(); menuItem.Index = 0; menuItem.Text = "Exit"; menuItem.Click += exitButton_Clicked; menu.MenuItems.Add(menuItem); systrayIcon.ContextMenu = menu; systrayIcon.Icon = new Icon("Resources/appicon.ico"); systrayIcon.Visible = true; //Build array of picture boxes. Indexes matching indexes for their respective keys. keyPictureBoxes = new List <PictureBox>(); keyPictureBoxes.Add(keyZeroPicBox); keyPictureBoxes.Add(keyOnePicBox); keyPictureBoxes.Add(keyTwoPicBox); keyPictureBoxes.Add(keyThreePicBox); keyPictureBoxes.Add(keyFourPicBox); keyPictureBoxes.Add(keyFivePicBox); keyPictureBoxes.Add(keySixPicBox); keyPictureBoxes.Add(keySevenPicBox); keyPictureBoxes.Add(keyEightPicBox); keyPictureBoxes.Add(keyNinePicBox); keyPictureBoxes.Add(keyTenPicBox); keyPictureBoxes.Add(keyElevenPicBox); keyPictureBoxes.Add(keyTwelvePicBox); keyPictureBoxes.Add(keyThirteenPicBox); keyPictureBoxes.Add(keyFourteenPicBox); populateFields(); //Initialize timer to check when UI needs refreshed for page changes UIRefreshCheck = new Timer(); UIRefreshCheck.Tick += checkUpdate; UIRefreshCheck.Interval = 10; UIRefreshCheck.Start(); }