예제 #1
0
        private void OnTimedEvent_ReadLogAndMessage(object sender, EventArgs e)
        {
            if (PoEWindowState.WINDOW_ACTIVE == processWatcher.GetPoEWindowState())
            {
                var latestLines = logReader.GetLinesSinceLastKnownLine();
                foreach (string line in latestLines)
                {
                    var request = logParser.ParseLine(line);

                    if (request != null)
                    {
                        if (request.RequestMessage.ToLower().StartsWith("!inv") && request.RequestSource == PoE_PartyTool.Model.RequestSource.GUILD)
                        {
                            if (cb_XezzMode.Checked == true)
                            {
                                request.Execute();
                            }
                            else
                            {
                                foreach (var inList in requestList)
                                {
                                    if (inList.CharacterName == request.CharacterName)
                                    {
                                        // there is already a request from this character present, in this case we could switch to that characters request
                                        return;
                                    }
                                }

                                requestList.Add(request);
                                lbl_requestCount.Text = requestList.Count.ToString();

                                // quick fix for if the list is empty. this way no extra timer is needed for the moment
                                if (requestList.Count == 1)
                                {
                                    btn_inv.Enabled    = true;
                                    btn_remove.Enabled = true;
                                    btn_left.Enabled   = true;
                                    btn_right.Enabled  = true;

                                    selectedListItem     = 0;
                                    lbl_currentNr.Text   = (selectedListItem + 1).ToString();
                                    lbl_currentName.Text = requestList[selectedListItem].CharacterName;
                                }
                            }
                        }
                    }
                }
            }
        }