diff --git a/ACTWebSocket.Core/ACTWebSocket.Core.csproj b/ACTWebSocket.Core/ACTWebSocket.Core.csproj index 0726925..4d0e434 100644 --- a/ACTWebSocket.Core/ACTWebSocket.Core.csproj +++ b/ACTWebSocket.Core/ACTWebSocket.Core.csproj @@ -115,6 +115,12 @@ + + Form + + + IPC_COPYDATA.cs + @@ -142,6 +148,9 @@ + + IPC_COPYDATA.cs + diff --git a/ACTWebSocket.Core/ACTWebSocket.cs b/ACTWebSocket.Core/ACTWebSocket.cs index 7c8b595..0df2a10 100644 --- a/ACTWebSocket.Core/ACTWebSocket.cs +++ b/ACTWebSocket.Core/ACTWebSocket.cs @@ -32,6 +32,7 @@ public interface PluginDirectory public class ACTWebSocketMain : UserControl, IActPluginV1, PluginDirectory { + string overlayCaption = "OverlayProcWMCOPYDATA"; string overlaySkinDirectory { get; set; } string pluginDirectory = ""; private ComboBox hostnames; @@ -39,17 +40,21 @@ public class ACTWebSocketMain : UserControl, IActPluginV1, PluginDirectory private TextBox uPnPPort; private Button buttonAddURL; private Button buttonURL; - private ListView skinList; + private ListView WebSkinListView; private Button buttonOpen; - private Button buttonManage; - private Button buttonDownload; - private Button buttonExit; - private ProgressBar progressBar; private CheckBox skinOnAct; - private Button buttonStart; - private GroupBox groupBox1; private GroupBox groupBox2; private CheckBox autostartoverlay; + private GroupBox groupBox1; + private GroupBox groupBox3; + private ListView FileSkinListView; + private Button buttonOpenOverlayProcManager; + private ColumnHeader Title2; + private ColumnHeader Title; + private Button buttonStartStopOverlayProc; + private Button buttonOverlay; + private ProgressBar progressBar; + private Button buttonDownload; private CheckBox chatFilter; public void SetSkinDir(string path) @@ -142,22 +147,27 @@ private void InitializeComponent() this.copyURL = new System.Windows.Forms.Button(); this.buttonAddURL = new System.Windows.Forms.Button(); this.buttonURL = new System.Windows.Forms.Button(); - this.skinList = new System.Windows.Forms.ListView(); + this.WebSkinListView = new System.Windows.Forms.ListView(); + this.Title2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.buttonOpen = new System.Windows.Forms.Button(); - this.buttonManage = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.buttonOverlay = new System.Windows.Forms.Button(); + this.autostartoverlay = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); this.buttonDownload = new System.Windows.Forms.Button(); - this.buttonExit = new System.Windows.Forms.Button(); + this.buttonStartStopOverlayProc = new System.Windows.Forms.Button(); + this.buttonOpenOverlayProcManager = new System.Windows.Forms.Button(); this.progressBar = new System.Windows.Forms.ProgressBar(); - this.buttonStart = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.autostartoverlay = new System.Windows.Forms.CheckBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.FileSkinListView = new System.Windows.Forms.ListView(); + this.Title = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.startoption.SuspendLayout(); this.hostdata.SuspendLayout(); this.othersets.SuspendLayout(); this.serverStatus.SuspendLayout(); - this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox3.SuspendLayout(); this.SuspendLayout(); // // port @@ -268,6 +278,7 @@ private void InitializeComponent() resources.ApplyResources(this.hostnames, "hostnames"); this.hostnames.FormattingEnabled = true; this.hostnames.Name = "hostnames"; + this.hostnames.TextChanged += new System.EventHandler(this.hostnames_TextChanged); // // label2 // @@ -341,15 +352,24 @@ private void InitializeComponent() this.buttonURL.UseVisualStyleBackColor = true; this.buttonURL.Click += new System.EventHandler(this.buttonURL_Click); // - // skinList + // WebSkinListView // - resources.ApplyResources(this.skinList, "skinList"); - this.skinList.HideSelection = false; - this.skinList.MultiSelect = false; - this.skinList.Name = "skinList"; - this.skinList.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.skinList.UseCompatibleStateImageBehavior = false; - this.skinList.View = System.Windows.Forms.View.List; + resources.ApplyResources(this.WebSkinListView, "WebSkinListView"); + this.WebSkinListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Title2}); + this.WebSkinListView.FullRowSelect = true; + this.WebSkinListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.WebSkinListView.HideSelection = false; + this.WebSkinListView.MultiSelect = false; + this.WebSkinListView.Name = "WebSkinListView"; + this.WebSkinListView.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.WebSkinListView.UseCompatibleStateImageBehavior = false; + this.WebSkinListView.View = System.Windows.Forms.View.Details; + this.WebSkinListView.SelectedIndexChanged += new System.EventHandler(this.skinList_SelectedIndexChanged); + // + // Title2 + // + resources.ApplyResources(this.Title2, "Title2"); // // buttonOpen // @@ -358,12 +378,42 @@ private void InitializeComponent() this.buttonOpen.UseVisualStyleBackColor = true; this.buttonOpen.Click += new System.EventHandler(this.buttonOpen_Click); // - // buttonManage + // groupBox2 + // + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.Controls.Add(this.buttonOverlay); + this.groupBox2.Controls.Add(this.buttonOpen); + this.groupBox2.Controls.Add(this.buttonURL); + this.groupBox2.Controls.Add(this.WebSkinListView); + this.groupBox2.Controls.Add(this.copyURL); + this.groupBox2.Controls.Add(this.buttonAddURL); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; + // + // buttonOverlay + // + resources.ApplyResources(this.buttonOverlay, "buttonOverlay"); + this.buttonOverlay.Name = "buttonOverlay"; + this.buttonOverlay.UseVisualStyleBackColor = true; + this.buttonOverlay.Click += new System.EventHandler(this.buttonOverlay_Click); // - resources.ApplyResources(this.buttonManage, "buttonManage"); - this.buttonManage.Name = "buttonManage"; - this.buttonManage.UseVisualStyleBackColor = true; - this.buttonManage.Click += new System.EventHandler(this.buttonManage_Click); + // autostartoverlay + // + resources.ApplyResources(this.autostartoverlay, "autostartoverlay"); + this.autostartoverlay.BackColor = System.Drawing.Color.Transparent; + this.autostartoverlay.Name = "autostartoverlay"; + this.autostartoverlay.UseVisualStyleBackColor = false; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.buttonDownload); + this.groupBox1.Controls.Add(this.buttonStartStopOverlayProc); + this.groupBox1.Controls.Add(this.buttonOpenOverlayProcManager); + this.groupBox1.Controls.Add(this.autostartoverlay); + this.groupBox1.Controls.Add(this.progressBar); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; // // buttonDownload // @@ -372,59 +422,56 @@ private void InitializeComponent() this.buttonDownload.UseVisualStyleBackColor = true; this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click); // - // buttonExit + // buttonStartStopOverlayProc // - resources.ApplyResources(this.buttonExit, "buttonExit"); - this.buttonExit.Name = "buttonExit"; - this.buttonExit.UseVisualStyleBackColor = true; - this.buttonExit.Click += new System.EventHandler(this.buttonExit_Click); + resources.ApplyResources(this.buttonStartStopOverlayProc, "buttonStartStopOverlayProc"); + this.buttonStartStopOverlayProc.Name = "buttonStartStopOverlayProc"; + this.buttonStartStopOverlayProc.UseVisualStyleBackColor = true; + this.buttonStartStopOverlayProc.Click += new System.EventHandler(this.buttonStartStopOverlayProc_Click); + // + // buttonOpenOverlayProcManager + // + resources.ApplyResources(this.buttonOpenOverlayProcManager, "buttonOpenOverlayProcManager"); + this.buttonOpenOverlayProcManager.Name = "buttonOpenOverlayProcManager"; + this.buttonOpenOverlayProcManager.UseVisualStyleBackColor = true; + this.buttonOpenOverlayProcManager.Click += new System.EventHandler(this.buttonOpenOverlayProcManager_Click); // // progressBar // resources.ApplyResources(this.progressBar, "progressBar"); this.progressBar.Name = "progressBar"; // - // buttonStart + // groupBox3 // - resources.ApplyResources(this.buttonStart, "buttonStart"); - this.buttonStart.Name = "buttonStart"; - this.buttonStart.UseVisualStyleBackColor = true; - this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); + resources.ApplyResources(this.groupBox3, "groupBox3"); + this.groupBox3.Controls.Add(this.FileSkinListView); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.TabStop = false; // - // groupBox1 + // FileSkinListView // - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Controls.Add(this.autostartoverlay); - this.groupBox1.Controls.Add(this.buttonDownload); - this.groupBox1.Controls.Add(this.buttonStart); - this.groupBox1.Controls.Add(this.buttonExit); - this.groupBox1.Controls.Add(this.buttonManage); - this.groupBox1.Controls.Add(this.progressBar); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; + resources.ApplyResources(this.FileSkinListView, "FileSkinListView"); + this.FileSkinListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Title}); + this.FileSkinListView.FullRowSelect = true; + this.FileSkinListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.FileSkinListView.HideSelection = false; + this.FileSkinListView.MultiSelect = false; + this.FileSkinListView.Name = "FileSkinListView"; + this.FileSkinListView.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.FileSkinListView.UseCompatibleStateImageBehavior = false; + this.FileSkinListView.View = System.Windows.Forms.View.Details; + this.FileSkinListView.SelectedIndexChanged += new System.EventHandler(this.FileSkinListView_SelectedIndexChanged); // - // autostartoverlay + // Title // - resources.ApplyResources(this.autostartoverlay, "autostartoverlay"); - this.autostartoverlay.BackColor = System.Drawing.Color.Transparent; - this.autostartoverlay.Name = "autostartoverlay"; - this.autostartoverlay.UseVisualStyleBackColor = false; - // - // groupBox2 - // - resources.ApplyResources(this.groupBox2, "groupBox2"); - this.groupBox2.Controls.Add(this.buttonOpen); - this.groupBox2.Controls.Add(this.buttonURL); - this.groupBox2.Controls.Add(this.skinList); - this.groupBox2.Controls.Add(this.copyURL); - this.groupBox2.Controls.Add(this.buttonAddURL); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.TabStop = false; + resources.ApplyResources(this.Title, "Title"); // // ACTWebSocketMain // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.serverStatus); @@ -439,8 +486,9 @@ private void InitializeComponent() this.othersets.ResumeLayout(false); this.serverStatus.ResumeLayout(false); this.serverStatus.PerformLayout(); - this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); this.ResumeLayout(false); } @@ -477,8 +525,38 @@ public ACTWebSocketMain() JObject overlayWindows = new JObject(); // 설정 전부 + public bool SendMessage(string caption, JObject obj) + { + return ipc.SendMessage(caption, 0, obj.ToString()); + } + + + IPC_COPYDATA ipc = null; public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { + if(ipc == null) + { + ipc = new IPC_COPYDATA(); + ipc.Show(); + ipc.Text = "Client"+overlayCaption; + ipc.onMessage = (code, message) => + { + if (message == ".") + return; + JObject obj = JObject.Parse(message); + JToken token; + if (obj.TryGetValue("cmd", out token)) + { + String cmd = token.ToObject(); + switch(cmd) + { + case "get_urllist": + hostnames_TextChanged(null, null); + break; + } + } + }; + } if (core == null) { core = new ACTWebSocketCore(); @@ -486,8 +564,6 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) core.overlaySkinDirectory = overlaySkinDirectory; core.hwnd = Handle; } - progressBar.Hide(); - progressBar.BringToFront(); lblStatus = pluginStatusText; // Hand the status label's reference to our local var pluginScreenSpace.Controls.Add(this); // Add this UserControl to the tab ACT provides Dock = DockStyle.Fill; // Expand the UserControl to fill the tab's client space @@ -501,6 +577,8 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) chatFilter.Checked = ChatFilter; autostart.Checked = AutoRun; autostartoverlay.Checked = AutoOverlay; + progressBar.Hide(); + progressBar.BringToFront(); StopServer(); if (core != null) @@ -534,7 +612,7 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { if (autostartoverlay.Checked) { - buttonStart_Click(null, null); + StartOverlayProc(); } } catch (Exception e) @@ -558,8 +636,11 @@ public void DeInitPlugin() ActGlobals.oFormActMain.OnLogLineRead -= oFormActMain_OnLogLineRead; SaveSettings(); - buttonExit_Click(null, null); - //browser.ExecuteScriptAsync("api_overlaywindow_close_all();"); + + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "stop" + })); lblStatus.Text = "Plugin Exited"; } @@ -721,7 +802,6 @@ void SaveSettings() private List addrs = new List(); private void ACTWebSocket_Load(object sender, EventArgs e) { - Task task = Task.Factory.StartNew(() => { String strHostName = string.Empty; @@ -998,7 +1078,7 @@ public bool MiniParse public string overlayProcDir { get; private set; } public string overlayProcExe { get; private set; } - public List GetSkinList() + public List GetFileSkinList() { string dir = SkinOnAct ? overlaySkinDirectory : pluginDirectory; List list = new List(); @@ -1149,26 +1229,54 @@ private void buttonAddURL_Click(object sender, EventArgs e) { string url = ShowDialog("Add URL", "Add URL").Trim() ; SkinURLList.Add(url); - AddURL(url); + AddWebURL(url); } private void buttonURL_Click(object sender, EventArgs e) { - if (skinList.SelectedItems == null) return; - if(skinList.SelectedItems.Count > 0) + if (WebSkinListView.SelectedItems == null) return; + if(WebSkinListView.SelectedItems.Count > 0) { - string url = skinList.SelectedItems[0].Text; + string url = (string)WebSkinListView.SelectedItems[0].Tag; SkinURLList.Remove(url); - skinList.Items.RemoveAt(skinList.SelectedItems[0].Index); + WebSkinListView.Items.RemoveAt(WebSkinListView.SelectedItems[0].Index); + { + if (core != null) + { + lock (core.skinObject) + { + JArray urlConverted = new JArray(); + JArray array = (JArray)core.skinObject["URLList"]; + foreach (JToken obj in array) + { + if(obj["URL"].ToObject() == url) + { + obj.Remove(); + break; + } + } + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "urllist", + value = core.skinObject + })); + } + } + } } } private void copyURL_Click(object sender, EventArgs e) { - if (skinList.SelectedItems == null) return; - if (skinList.SelectedItems.Count > 0) + if (WebSkinListView.SelectedItems == null) return; + if (WebSkinListView.SelectedItems.Count > 0) { - string url = (string)skinList.SelectedItems[0].Tag; + string url = (string)WebSkinListView.SelectedItems[0].Tag; + copyURLPath(url); + } + else if (FileSkinListView.SelectedItems.Count > 0) + { + string url = (string)FileSkinListView.SelectedItems[0].Tag; copyURLPath(url); } else @@ -1176,7 +1284,7 @@ private void copyURL_Click(object sender, EventArgs e) copyURLPath(); } } - + string GetTitle(string path) { string dir = SkinOnAct ? overlaySkinDirectory : pluginDirectory; @@ -1196,6 +1304,7 @@ string GetTitle(string path) else { WebClient wc = new WebClient(); + wc.Encoding = Encoding.UTF8; string source = wc.DownloadString(path); title = Regex.Match(source, @"\]*\>\s*(?[\s\S]*?)\</title\>", RegexOptions.IgnoreCase).Groups["Title"].Value; } @@ -1207,7 +1316,7 @@ string GetTitle(string path) return title; } - private void AddURL(string a) + private void AddWebURL(string a) { string title = null; Task task = Task.Factory.StartNew(() => @@ -1217,7 +1326,7 @@ private void AddURL(string a) Task UITask = task.ContinueWith((t) => { bool find = false; - foreach (ListViewItem i in skinList.Items) + foreach (ListViewItem i in WebSkinListView.Items) { if (((string)i.Tag).CompareTo(a) == 0) { @@ -1225,39 +1334,108 @@ private void AddURL(string a) } } - if(!find) + if (!find) { title = title == null ? a : title; ListViewItem lvi = new ListViewItem(); lvi.Text = title; lvi.Tag = a; - skinList.Items.Add(lvi); + WebSkinListView.Items.Add(lvi); + if (core != null) + { + lock (core.skinObject) + { + JObject skinInfo = new JObject(); + skinInfo["Title"] = title; + skinInfo["URL"] = a; + JArray array = (JArray)core.skinObject["URLList"]; + array.Add(skinInfo); + hostnames_TextChanged(null, null); + } + } + } + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + + private void AddFileURL(string a) + { + string title = null; + Task task = Task.Factory.StartNew(() => + { + title = GetTitle(a); + }); + Task UITask = task.ContinueWith((t) => + { + bool find = false; + foreach (ListViewItem i in WebSkinListView.Items) + { + if (((string)i.Tag).CompareTo(a) == 0) + { + find = true; + } + } + + if (!find) + { + title = title == null ? a : title; + ListViewItem lvi = new ListViewItem(); + lvi.Text = title; + lvi.Tag = a; + FileSkinListView.Items.Add(lvi); + if (core != null) + { + lock (core.skinObject) + { + JObject skinInfo = new JObject(); + skinInfo["Title"] = title; + skinInfo["URL"] = a; + JArray array = (JArray)core.skinObject["URLList"]; + array.Add(skinInfo); + hostnames_TextChanged(null, null); + } + } } }, TaskScheduler.FromCurrentSynchronizationContext()); } private void buttonRefresh_Click(object sender, EventArgs e) { - skinList.Items.Clear(); + if (core != null) + { + lock (core.skinObject) + { + core.skinObject.RemoveAll(); + core.skinObject["Type"] = "URLList"; + core.skinObject["HostName"] = hostnames.Text; + core.skinObject["URLList"] = new JArray(); + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "urllist", + value = core.skinObject + })); + } + } + FileSkinListView.Items.Clear(); + WebSkinListView.Items.Clear(); foreach (var a in SkinURLList) { - AddURL(a); + AddWebURL(a); } - List<string> list = GetSkinList(); + List<string> list = GetFileSkinList(); foreach(var a in list) { bool find = false; - for(int i=0;i<skinList.Items.Count;++i) + for(int i=0;i< FileSkinListView.Items.Count;++i) { - if(skinList.Items[i].Tag == a) + if(FileSkinListView.Items[i].Tag == a) { find = true; } } if(!find) { - AddURL(a); + AddFileURL(a); } } } @@ -1296,43 +1474,77 @@ private void skinOnAct_CheckedChanged(object sender, EventArgs e) void UpdateOverlayProc() { bool b = File.Exists(overlayProcExe); - buttonOpen.Enabled = b; - buttonExit.Enabled = b; - buttonManage.Enabled = b; - buttonStart.Enabled = b; + buttonOverlay.Enabled = b; + buttonStartStopOverlayProc.Enabled = b; + buttonOpenOverlayProcManager.Enabled = b; } private void buttonOpen_Click(object sender, EventArgs e) { - if (skinList.SelectedItems.Count > 0) + if (WebSkinListView.SelectedItems.Count > 0) { - string url = (string)skinList.SelectedItems[0].Tag; + string url = (string)WebSkinListView.SelectedItems[0].Tag; url = getURLPath(url); if(url != null) { - ProcessStartInfo startInfo = new ProcessStartInfo(overlayProcExe); - startInfo.WorkingDirectory = overlayProcDir; - startInfo.Arguments = "-o " + Utility.Base64Encoding(url); - Process.Start(startInfo); + System.Diagnostics.Process.Start(url); + } + } + else if (FileSkinListView.SelectedItems.Count > 0) + { + string url = (string)FileSkinListView.SelectedItems[0].Tag; + url = getURLPath(url); + if (url != null) + { + System.Diagnostics.Process.Start(url); } } + else + { + copyURLPath(); + } } - private void buttonManage_Click(object sender, EventArgs e) + private void port_TextChanged(object sender, EventArgs e) { - UpdateOverlayProc(); - if (!buttonManage.Enabled) - return; + uPnPPort.Text = port.Text; + } + + private void skinList_SelectedIndexChanged(object sender, EventArgs e) + { + if (WebSkinListView.SelectedItems.Count > 0) + { + FileSkinListView.SelectedItems.Clear(); + } + } + + private void FileSkinListView_SelectedIndexChanged(object sender, EventArgs e) + { + if (FileSkinListView.SelectedItems.Count > 0) + { + WebSkinListView.SelectedItems.Clear(); + } + } + + public bool StartOverlayProc() + { + bool b = File.Exists(overlayProcExe); + if(!b) + { + return false; + } try { ProcessStartInfo startInfo = new ProcessStartInfo(overlayProcExe); startInfo.WorkingDirectory = overlayProcDir; - startInfo.Arguments = "-m"; + startInfo.Arguments = ""; Process.Start(startInfo); } - catch(Exception ex) + catch (Exception ex) { MessageBox.Show(ex.Message); + return false; } + return true; } private void buttonDownload_Click(object sender, EventArgs e) @@ -1340,12 +1552,12 @@ private void buttonDownload_Click(object sender, EventArgs e) UpdateOverlayProc(); try { - if(File.Exists(overlayProcExe)) + if (File.Exists(overlayProcExe)) { - ProcessStartInfo startInfo = new ProcessStartInfo(overlayProcExe); - startInfo.WorkingDirectory = overlayProcDir; - startInfo.Arguments = "-x"; - Process.Start(startInfo).WaitForExit(); + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "stop" + })); } buttonDownload.Enabled = false; string url = "https://www.dropbox.com/sh/ionr8nkmp49gr8d/AADzOjamXxPGjOzFuhBSthPHa?dl=1"; @@ -1396,51 +1608,104 @@ private void Completed(object sender, AsyncCompletedEventArgs e) progressBar.Hide(); buttonDownload.Enabled = true; UpdateOverlayProc(); - buttonStart_Click(null, null); + StartOverlayProc(); }, TaskScheduler.FromCurrentSynchronizationContext()); } - - private void buttonStart_Click(object sender, EventArgs e) + private void buttonStartStopOverlayProc_Click(object sender, EventArgs e) { - UpdateOverlayProc(); - if (!buttonStart.Enabled) - return; - try + bool b = File.Exists(overlayProcExe); + if (!SendMessage(overlayCaption, JObject.FromObject(new { - ProcessStartInfo startInfo = new ProcessStartInfo(overlayProcExe); - startInfo.WorkingDirectory = overlayProcDir; - startInfo.Arguments = ""; - Process.Start(startInfo); + cmd = "stop" + }))) + { + // run instance + StartOverlayProc(); } - catch (Exception ex) + } + + private void buttonOpenOverlayProcManager_Click(object sender, EventArgs e) + { + bool b = File.Exists(overlayProcExe); + if (!SendMessage(overlayCaption, JObject.FromObject(new { - MessageBox.Show(ex.Message); + cmd = "manager" + }))) + { + // run instance ? } } - private void buttonExit_Click(object sender, EventArgs e) + private void buttonOverlay_Click(object sender, EventArgs e) { - UpdateOverlayProc(); - if (!buttonExit.Enabled) - return; - try + if (FileSkinListView.SelectedItems.Count > 0) { - ProcessStartInfo startInfo = new ProcessStartInfo(overlayProcExe); - startInfo.WorkingDirectory = overlayProcDir; - startInfo.Arguments = "-x"; - Process.Start(startInfo); + string url = (string)FileSkinListView.SelectedItems[0].Tag; + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "set", + value = new + { + opacity = 1.0, + zoom = 1.0, + fps = 30.0, + hide = false, + useDragFilter = true, + useDragMove = true, + useResizeGrip = true, + NoActivate = false, + Transparent = false, + url = getURLPath(url), + title = FileSkinListView.SelectedItems[0].Text + } + })); } - catch (Exception ex) + else if (WebSkinListView.SelectedItems.Count > 0) { - MessageBox.Show(ex.Message); + string url = (string)WebSkinListView.SelectedItems[0].Tag; + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "set", + value = new + { + opacity = 1.0, + zoom = 1.0, + fps = 30.0, + hide = false, + useDragFilter = true, + useDragMove = true, + useResizeGrip = true, + NoActivate = false, + Transparent = false, + url = getURLPath(url), + title = WebSkinListView.SelectedItems[0].Text + } + })); } } - private void port_TextChanged(object sender, EventArgs e) + private void hostnames_TextChanged(object sender, EventArgs e) { - uPnPPort.Text = port.Text; + Hostname = hostnames.Text; + if (core != null) + { + lock (core.skinObject) + { + JToken skinObject = core.skinObject.DeepClone(); + JArray urlConverted = new JArray(); + JArray array = (JArray)skinObject["URLList"]; + foreach(JToken obj in array) + { + obj["URL"] = getURLPath(obj["URL"].ToObject<String>()); + } + SendMessage(overlayCaption, JObject.FromObject(new + { + cmd = "urllist", + value = skinObject + })); + } + } } - } } diff --git a/ACTWebSocket.Core/ACTWebSocket.ko.resx b/ACTWebSocket.Core/ACTWebSocket.ko.resx index 746f132..6360f92 100644 --- a/ACTWebSocket.Core/ACTWebSocket.ko.resx +++ b/ACTWebSocket.Core/ACTWebSocket.ko.resx @@ -182,49 +182,37 @@ <data name="serverStatus.Text" xml:space="preserve"> <value>서버 상태</value> </data> - <data name="copyURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>202, 325</value> - </data> <data name="copyURL.Text" xml:space="preserve"> <value>URL 복사</value> </data> - <data name="buttonAddURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>6, 325</value> - </data> <data name="buttonAddURL.Text" xml:space="preserve"> <value>URL 추가</value> </data> - <data name="buttonURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>104, 325</value> - </data> <data name="buttonURL.Text" xml:space="preserve"> <value>URL 삭제</value> </data> - <data name="skinList.Size" type="System.Drawing.Size, System.Drawing"> - <value>386, 299</value> + <data name="buttonOpen.Text" xml:space="preserve"> + <value>URL 열기</value> </data> - <data name="buttonOpen.Location" type="System.Drawing.Point, System.Drawing"> - <value>300, 325</value> + <data name="buttonOverlay.Text" xml:space="preserve"> + <value>오버레이</value> </data> - <data name="buttonOpen.Text" xml:space="preserve"> - <value>새 오버레이</value> + <data name="groupBox2.Text" xml:space="preserve"> + <value>웹 스킨</value> </data> - <data name="buttonManage.Text" xml:space="preserve"> - <value>오버레이 관리</value> + <data name="autostartoverlay.Text" xml:space="preserve"> + <value>오버레이 자동 시작/종료</value> </data> <data name="buttonDownload.Text" xml:space="preserve"> <value>다운로드</value> </data> - <data name="buttonExit.Text" xml:space="preserve"> - <value>오버레이 종료</value> + <data name="buttonStartStopOverlayProc.Text" xml:space="preserve"> + <value>OverlayProc 실행/종료</value> </data> - <data name="buttonStart.Text" xml:space="preserve"> - <value>실행</value> - </data> - <data name="autostartoverlay.Text" xml:space="preserve"> - <value>오버레이 자동 시작</value> + <data name="buttonOpenOverlayProcManager.Text" xml:space="preserve"> + <value>오버레이 관리자</value> </data> - <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> - <value>700, 500</value> + <data name="groupBox3.Text" xml:space="preserve"> + <value>파일 스킨</value> </data> </root> \ No newline at end of file diff --git a/ACTWebSocket.Core/ACTWebSocket.resx b/ACTWebSocket.Core/ACTWebSocket.resx index cb6ba0e..60659a3 100644 --- a/ACTWebSocket.Core/ACTWebSocket.resx +++ b/ACTWebSocket.Core/ACTWebSocket.resx @@ -126,52 +126,43 @@ <data name=">>othersets.Parent" xml:space="preserve"> <value>$this</value> </data> - <data name=">>groupBox1.ZOrder" xml:space="preserve"> - <value>1</value> - </data> - <data name=">>buttonManage.Type" xml:space="preserve"> + <data name=">>buttonOverlay.Type" xml:space="preserve"> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> + <data name=">>groupBox1.ZOrder" xml:space="preserve"> + <value>2</value> + </data> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="othersets.Location" type="System.Drawing.Point, System.Drawing"> <value>3, 248</value> </data> + <data name="randomURL.Location" type="System.Drawing.Point, System.Drawing"> + <value>11, 70</value> + </data> <data name=">>autostart.Parent" xml:space="preserve"> <value>startoption</value> </data> <data name=">>chatFilter.Parent" xml:space="preserve"> <value>othersets</value> </data> - <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="skinList.TabIndex" type="System.Int32, mscorlib"> - <value>23</value> - </data> <data name=">>port.ZOrder" xml:space="preserve"> <value>5</value> </data> <data name=">>label15.Name" xml:space="preserve"> <value>label15</value> </data> + <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="buttonOff.AutoSize" type="System.Boolean, mscorlib"> <value>True</value> </data> <data name=">>progressBar.ZOrder" xml:space="preserve"> - <value>5</value> - </data> - <data name="buttonExit.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <value>4</value> </data> <data name="chatFilter.Size" type="System.Drawing.Size, System.Drawing"> <value>231, 21</value> </data> - <data name="autostartoverlay.Text" xml:space="preserve"> - <value>OverlayProc Auto Start (with ACT</value> - </data> - <data name="buttonOff.Text" xml:space="preserve"> - <value>Off</value> - </data> - <data name="skinList.Location" type="System.Drawing.Point, System.Drawing"> - <value>6, 20</value> + <data name=">>WebSkinListView.Name" xml:space="preserve"> + <value>WebSkinListView</value> </data> <data name="groupBox1.TabIndex" type="System.Int32, mscorlib"> <value>30</value> @@ -183,11 +174,11 @@ <data name="chatFilter.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> - <data name="copyURL.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> - <value>Bottom, Left</value> + <data name="buttonDownload.Size" type="System.Drawing.Size, System.Drawing"> + <value>71, 23</value> </data> - <data name="buttonExit.Text" xml:space="preserve"> - <value>Exit</value> + <data name="buttonOpenOverlayProcManager.TabIndex" type="System.Int32, mscorlib"> + <value>17</value> </data> <data name="label14.AutoSize" type="System.Boolean, mscorlib"> <value>True</value> @@ -204,53 +195,68 @@ <data name="othersets.TabIndex" type="System.Int32, mscorlib"> <value>18</value> </data> - <data name="buttonStart.Location" type="System.Drawing.Point, System.Drawing"> - <value>104, 19</value> - </data> - <data name=">>hostnames.Type" xml:space="preserve"> - <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <data name="uPnPPort.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> + <value>Top, Bottom, Left, Right</value> </data> <data name=">>progressBar.Parent" xml:space="preserve"> <value>groupBox1</value> </data> + <data name="copyURL.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> + <value>Bottom, Left</value> + </data> <data name="BeforeLogLineReadUse.TabIndex" type="System.Int32, mscorlib"> <value>13</value> </data> <data name="buttonURL.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> - <data name=">>buttonExit.Name" xml:space="preserve"> - <value>buttonExit</value> + <data name="othersets.Size" type="System.Drawing.Size, System.Drawing"> + <value>248, 125</value> + </data> + <data name=">>buttonOpenOverlayProcManager.Type" xml:space="preserve"> + <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name=">>label15.Type" xml:space="preserve"> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> + <data name="FileSkinListView.Size" type="System.Drawing.Size, System.Drawing"> + <value>388, 120</value> + </data> <data name="buttonOn.AutoSize" type="System.Boolean, mscorlib"> <value>True</value> </data> <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> <value>404, 80</value> </data> - <data name="buttonURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>104, 331</value> + <data name=">>FileSkinListView.Name" xml:space="preserve"> + <value>FileSkinListView</value> + </data> + <data name="FileSkinListView.TabIndex" type="System.Int32, mscorlib"> + <value>23</value> </data> <data name="buttonOn.Size" type="System.Drawing.Size, System.Drawing"> <value>236, 25</value> </data> + <data name=">>FileSkinListView.Parent" xml:space="preserve"> + <value>groupBox3</value> + </data> <data name=">>buttonURL.Parent" xml:space="preserve"> <value>groupBox2</value> </data> + <data name=">>groupBox3.Name" xml:space="preserve"> + <value>groupBox3</value> + </data> <data name="randomURL.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Left, Right</value> </data> - <data name=">>buttonStart.Name" xml:space="preserve"> - <value>buttonStart</value> + <data name=">>serverStatus.Parent" xml:space="preserve"> + <value>$this</value> </data> <data name="label2.TabIndex" type="System.Int32, mscorlib"> <value>15</value> </data> <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing"> - <value>404, 368</value> + <value>404, 210</value> </data> <data name=">>skinOnAct.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -258,18 +264,18 @@ <data name="hostdata.Text" xml:space="preserve"> <value>Host</value> </data> - <data name="buttonDownload.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> - <value>NoControl</value> - </data> - <data name="buttonManage.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> - <value>NoControl</value> - </data> <data name=">>buttonOpen.Parent" xml:space="preserve"> <value>groupBox2</value> </data> <data name="buttonOn.Location" type="System.Drawing.Point, System.Drawing"> <value>6, 18</value> </data> + <data name="buttonStartStopOverlayProc.Size" type="System.Drawing.Size, System.Drawing"> + <value>151, 21</value> + </data> + <data name=">>WebSkinListView.Parent" xml:space="preserve"> + <value>groupBox2</value> + </data> <data name="groupBox2.TabIndex" type="System.Int32, mscorlib"> <value>31</value> </data> @@ -282,14 +288,23 @@ <data name="buttonOpen.TabIndex" type="System.Int32, mscorlib"> <value>24</value> </data> + <data name="buttonOpenOverlayProcManager.Text" xml:space="preserve"> + <value>Open Manager</value> + </data> + <data name="progressBar.Location" type="System.Drawing.Point, System.Drawing"> + <value>7, 45</value> + </data> <data name="randomURL.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> + <data name="groupBox1.Text" xml:space="preserve"> + <value>OverlayProc</value> + </data> <data name="MiniParseUse.Location" type="System.Drawing.Point, System.Drawing"> <value>11, 25</value> </data> - <data name="buttonDownload.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing"> + <value>404, 152</value> </data> <data name=">>hostnames.Parent" xml:space="preserve"> <value>hostdata</value> @@ -298,10 +313,10 @@ <value>Top, Bottom, Left, Right</value> </data> <data name=">>autostartoverlay.ZOrder" xml:space="preserve"> - <value>0</value> + <value>3</value> </data> <data name=">>groupBox2.ZOrder" xml:space="preserve"> - <value>0</value> + <value>1</value> </data> <data name=">>buttonOn.Type" xml:space="preserve"> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -339,6 +354,9 @@ <data name=">>startoption.Name" xml:space="preserve"> <value>startoption</value> </data> + <data name="WebSkinListView.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> + <value>Top, Bottom, Left, Right</value> + </data> <data name="autostart.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> @@ -369,6 +387,9 @@ <data name="buttonOn.TabIndex" type="System.Int32, mscorlib"> <value>0</value> </data> + <data name="Title.Width" type="System.Int32, mscorlib"> + <value>366</value> + </data> <data name=">>MiniParseUse.Name" xml:space="preserve"> <value>MiniParseUse</value> </data> @@ -376,7 +397,7 @@ <value>Start Options</value> </data> <data name=">>othersets.ZOrder" xml:space="preserve"> - <value>3</value> + <value>4</value> </data> <data name=">>MiniParseUse.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -384,8 +405,8 @@ <data name=">>port.Type" xml:space="preserve"> <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> - <data name=">>$this.Type" xml:space="preserve"> - <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <data name="progressBar.Size" type="System.Drawing.Size, System.Drawing"> + <value>391, 20</value> </data> <data name=">>label14.Parent" xml:space="preserve"> <value>hostdata</value> @@ -393,11 +414,11 @@ <data name=">>port.Name" xml:space="preserve"> <value>port</value> </data> - <data name="buttonDownload.TabIndex" type="System.Int32, mscorlib"> - <value>26</value> + <data name="buttonOverlay.Text" xml:space="preserve"> + <value>Overlay</value> </data> - <data name="hostnames.Size" type="System.Drawing.Size, System.Drawing"> - <value>162, 20</value> + <data name=">>startoption.ZOrder" xml:space="preserve"> + <value>6</value> </data> <data name="hostnames.Location" type="System.Drawing.Point, System.Drawing"> <value>79, 23</value> @@ -405,6 +426,9 @@ <data name="chatFilter.TabIndex" type="System.Int32, mscorlib"> <value>18</value> </data> + <data name=">>$this.Type" xml:space="preserve"> + <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> <data name="copyURL.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> @@ -429,20 +453,20 @@ <data name=">>groupBox1.Name" xml:space="preserve"> <value>groupBox1</value> </data> + <data name="buttonStartStopOverlayProc.Text" xml:space="preserve"> + <value>Start/Stop OverlayProc</value> + </data> <data name="UPNPUse.TabIndex" type="System.Int32, mscorlib"> <value>0</value> </data> - <data name="copyURL.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> - </data> <data name=">>label15.Parent" xml:space="preserve"> <value>hostdata</value> </data> - <data name=">>buttonManage.ZOrder" xml:space="preserve"> - <value>4</value> + <data name=">>autostartoverlay.Name" xml:space="preserve"> + <value>autostartoverlay</value> </data> - <data name="randomURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>11, 70</value> + <data name="buttonStartStopOverlayProc.Location" type="System.Drawing.Point, System.Drawing"> + <value>144, 44</value> </data> <data name=">>copyURL.Parent" xml:space="preserve"> <value>groupBox2</value> @@ -450,11 +474,8 @@ <data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> - <data name=">>label2.Name" xml:space="preserve"> - <value>label2</value> - </data> <data name=">>buttonDownload.ZOrder" xml:space="preserve"> - <value>1</value> + <value>0</value> </data> <data name=">>label14.ZOrder" xml:space="preserve"> <value>4</value> @@ -477,11 +498,8 @@ <data name="startoption.Size" type="System.Drawing.Size, System.Drawing"> <value>249, 124</value> </data> - <data name="serverStatus.Size" type="System.Drawing.Size, System.Drawing"> - <value>248, 79</value> - </data> - <data name=">>buttonExit.Parent" xml:space="preserve"> - <value>groupBox1</value> + <data name=">>hostnames.Type" xml:space="preserve"> + <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="BeforeLogLineReadUse.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Bottom, Left, Right</value> @@ -489,15 +507,18 @@ <data name=">>label15.ZOrder" xml:space="preserve"> <value>3</value> </data> - <data name="buttonExit.TabIndex" type="System.Int32, mscorlib"> - <value>27</value> - </data> <data name="buttonURL.TabIndex" type="System.Int32, mscorlib"> <value>22</value> </data> <data name="autostart.Size" type="System.Drawing.Size, System.Drawing"> <value>231, 21</value> </data> + <data name="Title2.Width" type="System.Int32, mscorlib"> + <value>366</value> + </data> + <data name="FileSkinListView.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> + <value>Top, Bottom, Left</value> + </data> <data name="label14.Location" type="System.Drawing.Point, System.Drawing"> <value>10, 52</value> </data> @@ -513,30 +534,30 @@ <data name="buttonURL.Text" xml:space="preserve"> <value>Delete URL</value> </data> + <data name=">>groupBox3.Type" xml:space="preserve"> + <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> <data name="BeforeLogLineReadUse.Location" type="System.Drawing.Point, System.Drawing"> <value>11, 69</value> </data> - <data name="skinList.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> - <value>Top, Bottom, Left, Right</value> - </data> <data name="MiniParseUse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> <data name=">>copyURL.ZOrder" xml:space="preserve"> - <value>3</value> + <value>4</value> </data> <data name=">>serverStatus.Type" xml:space="preserve"> <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="buttonURL.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> - </data> - <data name=">>buttonExit.ZOrder" xml:space="preserve"> - <value>3</value> + <value>75, 26</value> </data> <data name="OnLogLineReadUse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> + <data name="buttonOverlay.Size" type="System.Drawing.Size, System.Drawing"> + <value>75, 26</value> + </data> <data name="uPnPPort.TabIndex" type="System.Int32, mscorlib"> <value>14</value> </data> @@ -547,10 +568,13 @@ <value>TopLeft</value> </data> <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> - <value>258, 4</value> + <value>257, 5</value> + </data> + <data name="buttonStartStopOverlayProc.TabIndex" type="System.Int32, mscorlib"> + <value>18</value> </data> <data name=">>hostdata.ZOrder" xml:space="preserve"> - <value>4</value> + <value>5</value> </data> <data name=">>OnLogLineReadUse.ZOrder" xml:space="preserve"> <value>2</value> @@ -558,14 +582,23 @@ <data name="autostart.Location" type="System.Drawing.Point, System.Drawing"> <value>11, 24</value> </data> + <data name=">>buttonOpenOverlayProcManager.Name" xml:space="preserve"> + <value>buttonOpenOverlayProcManager</value> + </data> <data name=">>buttonAddURL.Name" xml:space="preserve"> <value>buttonAddURL</value> </data> <data name="uPnPPort.Location" type="System.Drawing.Point, System.Drawing"> <value>79, 76</value> </data> - <data name=">>buttonURL.Name" xml:space="preserve"> - <value>buttonURL</value> + <data name="WebSkinListView.TabIndex" type="System.Int32, mscorlib"> + <value>23</value> + </data> + <data name=">>buttonOverlay.ZOrder" xml:space="preserve"> + <value>0</value> + </data> + <data name="buttonOverlay.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> + <value>Bottom, Left</value> </data> <data name=">>buttonOff.Name" xml:space="preserve"> <value>buttonOff</value> @@ -573,8 +606,8 @@ <data name="uPnPPort.Size" type="System.Drawing.Size, System.Drawing"> <value>164, 21</value> </data> - <data name="UPNPUse.Text" xml:space="preserve"> - <value>Use UPNP</value> + <data name=">>label2.Name" xml:space="preserve"> + <value>label2</value> </data> <data name=">>startoption.Type" xml:space="preserve"> <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -582,14 +615,17 @@ <data name=">>OnLogLineReadUse.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> + <data name=">>FileSkinListView.ZOrder" xml:space="preserve"> + <value>0</value> + </data> <data name="buttonOff.Size" type="System.Drawing.Size, System.Drawing"> <value>236, 25</value> </data> <data name=">>progressBar.Name" xml:space="preserve"> <value>progressBar</value> </data> - <data name=">>startoption.ZOrder" xml:space="preserve"> - <value>5</value> + <data name="buttonOff.Text" xml:space="preserve"> + <value>Off</value> </data> <data name=">>UPNPUse.ZOrder" xml:space="preserve"> <value>1</value> @@ -616,10 +652,10 @@ <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="progressBar.TabIndex" type="System.Int32, mscorlib"> - <value>28</value> + <value>20</value> </data> - <data name="skinList.Size" type="System.Drawing.Size, System.Drawing"> - <value>386, 305</value> + <data name="groupBox3.Location" type="System.Drawing.Point, System.Drawing"> + <value>258, 90</value> </data> <data name=">>buttonOpen.Type" xml:space="preserve"> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -627,8 +663,8 @@ <data name=">>randomURL.ZOrder" xml:space="preserve"> <value>2</value> </data> - <data name=">>skinList.Name" xml:space="preserve"> - <value>skinList</value> + <data name=">>buttonStartStopOverlayProc.Type" xml:space="preserve"> + <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="port.TabIndex" type="System.Int32, mscorlib"> <value>3</value> @@ -636,8 +672,11 @@ <data name="OnLogLineReadUse.Location" type="System.Drawing.Point, System.Drawing"> <value>11, 47</value> </data> + <data name=">>groupBox3.Parent" xml:space="preserve"> + <value>$this</value> + </data> <data name="buttonAddURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>6, 331</value> + <value>6, 173</value> </data> <data name="autostart.TabIndex" type="System.Int32, mscorlib"> <value>8</value> @@ -654,8 +693,8 @@ <data name="label14.TabIndex" type="System.Int32, mscorlib"> <value>12</value> </data> - <data name="buttonManage.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <data name="UPNPUse.Text" xml:space="preserve"> + <value>Use UPNP</value> </data> <data name=">>label2.Type" xml:space="preserve"> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -664,31 +703,37 @@ <value>231, 21</value> </data> <data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing"> - <value>258, 90</value> + <value>258, 248</value> </data> <data name=">>autostartoverlay.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> + <data name=">>Title.Type" xml:space="preserve"> + <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> <data name="port.Text" xml:space="preserve"> <value>10501</value> </data> <data name=">>BeforeLogLineReadUse.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> - <data name="buttonExit.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> - <value>NoControl</value> + <data name="autostartoverlay.Text" xml:space="preserve"> + <value>OverlayProc Auto Start (with ACT</value> </data> - <data name="buttonStart.TabIndex" type="System.Int32, mscorlib"> - <value>29</value> + <data name=">>WebSkinListView.Type" xml:space="preserve"> + <value>System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="randomURL.TabIndex" type="System.Int32, mscorlib"> <value>14</value> </data> - <data name="chatFilter.Text" xml:space="preserve"> - <value>Using Chat</value> - </data> <data name="buttonOpen.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <value>75, 26</value> + </data> + <data name="FileSkinListView.Location" type="System.Drawing.Point, System.Drawing"> + <value>4, 20</value> + </data> + <data name=">>groupBox3.ZOrder" xml:space="preserve"> + <value>0</value> </data> <data name="randomURL.Text" xml:space="preserve"> <value>random URL</value> @@ -714,8 +759,11 @@ <data name="UPNPUse.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Left, Right</value> </data> - <data name="chatFilter.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing"> - <value>TopLeft</value> + <data name="buttonOpenOverlayProcManager.Size" type="System.Drawing.Size, System.Drawing"> + <value>124, 21</value> + </data> + <data name=">>Title.Name" xml:space="preserve"> + <value>Title</value> </data> <data name="buttonOn.Text" xml:space="preserve"> <value>On</value> @@ -729,14 +777,20 @@ <data name="$this.Font" type="System.Drawing.Font, System.Drawing"> <value>Gulim, 9pt</value> </data> - <data name=">>buttonStart.Type" xml:space="preserve"> - <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <data name="buttonOverlay.Location" type="System.Drawing.Point, System.Drawing"> + <value>318, 173</value> + </data> + <data name=">>buttonAddURL.ZOrder" xml:space="preserve"> + <value>5</value> + </data> + <data name="copyURL.Size" type="System.Drawing.Size, System.Drawing"> + <value>75, 26</value> </data> <data name="skinOnAct.TabIndex" type="System.Int32, mscorlib"> <value>15</value> </data> - <data name="groupBox1.Text" xml:space="preserve"> - <value>OverlayProc</value> + <data name=">>copyURL.Name" xml:space="preserve"> + <value>copyURL</value> </data> <data name="BeforeLogLineReadUse.Text" xml:space="preserve"> <value>Using BeforeLogLineRead</value> @@ -744,6 +798,9 @@ <data name=">>hostdata.Name" xml:space="preserve"> <value>hostdata</value> </data> + <data name=">>buttonOpenOverlayProcManager.Parent" xml:space="preserve"> + <value>groupBox1</value> + </data> <data name=">>buttonURL.Type" xml:space="preserve"> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> @@ -754,40 +811,43 @@ <value>79, 49</value> </data> <data name="buttonAddURL.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <value>75, 26</value> </data> <data name=">>buttonOff.ZOrder" xml:space="preserve"> <value>1</value> </data> - <data name="uPnPPort.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> - <value>Top, Bottom, Left, Right</value> - </data> - <data name=">>buttonStart.Parent" xml:space="preserve"> - <value>groupBox1</value> - </data> <data name=">>OnLogLineReadUse.Parent" xml:space="preserve"> <value>othersets</value> </data> - <data name=">>buttonManage.Parent" xml:space="preserve"> - <value>groupBox1</value> - </data> <data name="OnLogLineReadUse.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Bottom, Left, Right</value> </data> + <data name="buttonOverlay.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> + <value>NoControl</value> + </data> <data name="groupBox2.Text" xml:space="preserve"> - <value>Skin</value> + <value>Web Skins</value> </data> <data name=">>autostartoverlay.Parent" xml:space="preserve"> <value>groupBox1</value> </data> + <data name="buttonDownload.TabIndex" type="System.Int32, mscorlib"> + <value>19</value> + </data> + <data name="WebSkinListView.Location" type="System.Drawing.Point, System.Drawing"> + <value>4, 20</value> + </data> + <data name=">>FileSkinListView.Type" xml:space="preserve"> + <value>System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> <data name=">>serverStatus.Name" xml:space="preserve"> <value>serverStatus</value> </data> <data name=">>othersets.Type" xml:space="preserve"> <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> - <data name="progressBar.Size" type="System.Drawing.Size, System.Drawing"> - <value>288, 26</value> + <data name="Title2.Text" xml:space="preserve"> + <value>Title</value> </data> <data name=">>randomURL.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -804,23 +864,32 @@ <data name=">>randomURL.Name" xml:space="preserve"> <value>randomURL</value> </data> + <data name="buttonStartStopOverlayProc.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> + <value>NoControl</value> + </data> <data name=">>UPNPUse.Parent" xml:space="preserve"> <value>startoption</value> </data> + <data name=">>buttonURL.Name" xml:space="preserve"> + <value>buttonURL</value> + </data> + <data name=">>buttonStartStopOverlayProc.Parent" xml:space="preserve"> + <value>groupBox1</value> + </data> <data name="copyURL.TabIndex" type="System.Int32, mscorlib"> <value>13</value> </data> <data name=">>buttonURL.ZOrder" xml:space="preserve"> - <value>1</value> + <value>2</value> </data> <data name=">>$this.Name" xml:space="preserve"> <value>ACTWebSocketMain</value> </data> - <data name=">>skinList.ZOrder" xml:space="preserve"> - <value>2</value> + <data name="groupBox3.Text" xml:space="preserve"> + <value>File Skins</value> </data> - <data name="buttonManage.TabIndex" type="System.Int32, mscorlib"> - <value>25</value> + <data name="hostnames.Size" type="System.Drawing.Size, System.Drawing"> + <value>162, 20</value> </data> <data name="uPnPPort.Text" xml:space="preserve"> <value>10501</value> @@ -834,8 +903,11 @@ <data name="skinOnAct.Text" xml:space="preserve"> <value>Skin Dir On Act/OverlaySkin</value> </data> - <data name="buttonExit.Location" type="System.Drawing.Point, System.Drawing"> - <value>300, 19</value> + <data name=">>groupBox2.Name" xml:space="preserve"> + <value>groupBox2</value> + </data> + <data name=">>buttonOverlay.Parent" xml:space="preserve"> + <value>groupBox2</value> </data> <data name="label15.Text" xml:space="preserve"> <value>Host</value> @@ -846,14 +918,14 @@ <data name=">>MiniParseUse.Parent" xml:space="preserve"> <value>othersets</value> </data> - <data name=">>skinList.Type" xml:space="preserve"> - <value>System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </data> <data name=">>buttonDownload.Name" xml:space="preserve"> <value>buttonDownload</value> </data> + <data name="buttonOverlay.TabIndex" type="System.Int32, mscorlib"> + <value>25</value> + </data> <data name="copyURL.Location" type="System.Drawing.Point, System.Drawing"> - <value>202, 331</value> + <value>162, 173</value> </data> <data name="port.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Bottom, Left, Right</value> @@ -867,30 +939,21 @@ <data name=">>hostnames.ZOrder" xml:space="preserve"> <value>0</value> </data> - <data name="buttonStart.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> - <value>NoControl</value> - </data> - <data name=">>skinList.Parent" xml:space="preserve"> - <value>groupBox2</value> - </data> <data name="skinOnAct.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> - <data name="othersets.Size" type="System.Drawing.Size, System.Drawing"> - <value>248, 125</value> + <data name="buttonURL.Location" type="System.Drawing.Point, System.Drawing"> + <value>84, 173</value> </data> <data name=">>uPnPPort.ZOrder" xml:space="preserve"> <value>2</value> </data> - <data name=">>buttonAddURL.ZOrder" xml:space="preserve"> - <value>4</value> + <data name="chatFilter.CheckAlign" type="System.Drawing.ContentAlignment, System.Drawing"> + <value>TopLeft</value> </data> <data name="buttonURL.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Bottom, Left</value> </data> - <data name=">>buttonStart.ZOrder" xml:space="preserve"> - <value>2</value> - </data> <data name="MiniParseUse.TabIndex" type="System.Int32, mscorlib"> <value>13</value> </data> @@ -898,40 +961,46 @@ <value>164, 21</value> </data> <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> - <value>789, 500</value> + <value>700, 500</value> </data> <data name="serverStatus.Text" xml:space="preserve"> <value>Server Status</value> </data> - <data name="buttonStart.Size" type="System.Drawing.Size, System.Drawing"> - <value>92, 26</value> + <data name="buttonOpenOverlayProcManager.Location" type="System.Drawing.Point, System.Drawing"> + <value>7, 44</value> </data> - <data name="buttonManage.Text" xml:space="preserve"> - <value>Manager</value> + <data name=">>buttonOverlay.Name" xml:space="preserve"> + <value>buttonOverlay</value> </data> <data name=">>hostnames.Name" xml:space="preserve"> <value>hostnames</value> </data> + <data name=">>buttonStartStopOverlayProc.Name" xml:space="preserve"> + <value>buttonStartStopOverlayProc</value> + </data> + <data name=">>Title2.Type" xml:space="preserve"> + <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> <data name=">>buttonOpen.ZOrder" xml:space="preserve"> - <value>0</value> + <value>1</value> </data> <data name="autostartoverlay.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> <data name="autostartoverlay.Location" type="System.Drawing.Point, System.Drawing"> - <value>6, 51</value> + <value>6, 20</value> </data> - <data name=">>startoption.Parent" xml:space="preserve"> - <value>$this</value> + <data name="startoption.TabIndex" type="System.Int32, mscorlib"> + <value>15</value> </data> <data name=">>MiniParseUse.ZOrder" xml:space="preserve"> <value>3</value> </data> - <data name="buttonStart.Text" xml:space="preserve"> - <value>Run</value> + <data name="hostnames.TabIndex" type="System.Int32, mscorlib"> + <value>21</value> </data> <data name="buttonDownload.Location" type="System.Drawing.Point, System.Drawing"> - <value>6, 19</value> + <value>327, 18</value> </data> <data name=">>chatFilter.ZOrder" xml:space="preserve"> <value>0</value> @@ -945,17 +1014,23 @@ <data name="buttonAddURL.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>NoControl</value> </data> - <data name="hostnames.TabIndex" type="System.Int32, mscorlib"> - <value>21</value> + <data name="WebSkinListView.Size" type="System.Drawing.Size, System.Drawing"> + <value>388, 147</value> </data> - <data name=">>copyURL.Name" xml:space="preserve"> - <value>copyURL</value> + <data name="serverStatus.Size" type="System.Drawing.Size, System.Drawing"> + <value>248, 79</value> </data> <data name="buttonDownload.Text" xml:space="preserve"> <value>Download</value> </data> - <data name=">>groupBox2.Name" xml:space="preserve"> - <value>groupBox2</value> + <data name=">>WebSkinListView.ZOrder" xml:space="preserve"> + <value>3</value> + </data> + <data name="groupBox3.TabIndex" type="System.Int32, mscorlib"> + <value>32</value> + </data> + <data name=">>buttonOpenOverlayProcManager.ZOrder" xml:space="preserve"> + <value>2</value> </data> <data name=">>OnLogLineReadUse.Name" xml:space="preserve"> <value>OnLogLineReadUse</value> @@ -963,26 +1038,26 @@ <data name="label15.AutoSize" type="System.Boolean, mscorlib"> <value>True</value> </data> - <data name=">>buttonExit.Type" xml:space="preserve"> - <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <data name=">>buttonStartStopOverlayProc.ZOrder" xml:space="preserve"> + <value>1</value> </data> <data name="BeforeLogLineReadUse.Size" type="System.Drawing.Size, System.Drawing"> <value>231, 21</value> </data> + <data name=">>Title2.Name" xml:space="preserve"> + <value>Title2</value> + </data> <data name=">>autostart.ZOrder" xml:space="preserve"> <value>3</value> </data> - <data name=">>autostartoverlay.Name" xml:space="preserve"> - <value>autostartoverlay</value> - </data> - <data name=">>serverStatus.Parent" xml:space="preserve"> - <value>$this</value> + <data name="buttonOpenOverlayProcManager.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> + <value>NoControl</value> </data> <data name="autostartoverlay.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Top, Left, Right</value> </data> - <data name="progressBar.Location" type="System.Drawing.Point, System.Drawing"> - <value>104, 19</value> + <data name="chatFilter.Text" xml:space="preserve"> + <value>Using Chat</value> </data> <data name=">>autostart.Type" xml:space="preserve"> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> @@ -991,10 +1066,10 @@ <value>Use Miniparse Data</value> </data> <data name="buttonOpen.Text" xml:space="preserve"> - <value>New Overlay</value> + <value>Open URL</value> </data> <data name=">>serverStatus.ZOrder" xml:space="preserve"> - <value>2</value> + <value>3</value> </data> <data name="label15.Size" type="System.Drawing.Size, System.Drawing"> <value>30, 12</value> @@ -1002,12 +1077,12 @@ <data name="buttonOff.Location" type="System.Drawing.Point, System.Drawing"> <value>6, 46</value> </data> - <data name="buttonManage.Location" type="System.Drawing.Point, System.Drawing"> - <value>202, 19</value> - </data> <data name="hostdata.Size" type="System.Drawing.Size, System.Drawing"> <value>249, 109</value> </data> + <data name=">>startoption.Parent" xml:space="preserve"> + <value>$this</value> + </data> <data name="buttonAddURL.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <value>Bottom, Left</value> </data> @@ -1020,9 +1095,6 @@ <data name=">>skinOnAct.Name" xml:space="preserve"> <value>skinOnAct</value> </data> - <data name=">>buttonManage.Name" xml:space="preserve"> - <value>buttonManage</value> - </data> <data name="skinOnAct.Location" type="System.Drawing.Point, System.Drawing"> <value>10, 93</value> </data> @@ -1033,17 +1105,17 @@ <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="buttonOpen.Location" type="System.Drawing.Point, System.Drawing"> - <value>300, 331</value> + <value>240, 173</value> </data> <data name=">>othersets.Name" xml:space="preserve"> <value>othersets</value> </data> - <data name="startoption.TabIndex" type="System.Int32, mscorlib"> - <value>15</value> - </data> <data name="UPNPUse.Location" type="System.Drawing.Point, System.Drawing"> <value>11, 47</value> </data> + <data name="Title.Text" xml:space="preserve"> + <value>Title</value> + </data> <data name="autostartoverlay.TabIndex" type="System.Int32, mscorlib"> <value>16</value> </data> diff --git a/ACTWebSocket.Core/ACTWebSocketCore.cs b/ACTWebSocket.Core/ACTWebSocketCore.cs index 611df30..8a89bd9 100644 --- a/ACTWebSocket.Core/ACTWebSocketCore.cs +++ b/ACTWebSocket.Core/ACTWebSocketCore.cs @@ -29,6 +29,7 @@ public ACTWebSocketCore() Timer pingTimer = null; public string randomDir = null; internal IntPtr hwnd; + public JObject skinObject = new JObject(); void InitUpdate() { @@ -106,7 +107,26 @@ internal void StartServer(string address, int port, int extPort, string domain = if (content == null) { - res.StatusCode = (int)HttpStatusCode.NotFound; + if (path == "/skins.json") + { + if(skinObject != null) + { + lock (skinObject) + { + res.ContentType = "text/html"; + res.ContentEncoding = Encoding.UTF8; + res.WriteContent(res.ContentEncoding.GetBytes(skinObject.ToString())); + } + } + else + { + res.StatusCode = (int)HttpStatusCode.NotFound; + } + } + else + { + res.StatusCode = (int)HttpStatusCode.NotFound; + } return; } @@ -147,7 +167,6 @@ internal void StartServer(string address, int port, int extPort, string domain = } res.WriteContent(content); - //new System.Threading.Thread(InitUpdate).Start(); }; //// TODO : Basic Auth diff --git a/ACTWebSocket.Core/IPC_COPYDATA.Designer.cs b/ACTWebSocket.Core/IPC_COPYDATA.Designer.cs new file mode 100644 index 0000000..cdd64c8 --- /dev/null +++ b/ACTWebSocket.Core/IPC_COPYDATA.Designer.cs @@ -0,0 +1,52 @@ +namespace ACTWebSocket_Plugin +{ + partial class IPC_COPYDATA + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form_COPYDATA + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 261); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form_COPYDATA"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "Form_COPYDATA"; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.Load += new System.EventHandler(this.Form_COPYDATA_Load); + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/ACTWebSocket.Core/IPC_COPYDATA.cs b/ACTWebSocket.Core/IPC_COPYDATA.cs new file mode 100644 index 0000000..20b0c46 --- /dev/null +++ b/ACTWebSocket.Core/IPC_COPYDATA.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ACTWebSocket_Plugin +{ + public partial class IPC_COPYDATA : Form + { + public delegate void OnMessage(int code, string message) ; + public OnMessage onMessage; + public IPC_COPYDATA() + { + InitializeComponent(); + } + + private void Form_COPYDATA_Load(object sender, EventArgs e) + { + this.Hide(); + } + + [DllImport("User32.dll", CharSet = CharSet.Auto, EntryPoint = "SendMessage")] + public static extern int SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, ref Win32API.COPYDATASTRUCT lParam); + + [DllImport("User32.dll", CharSet = CharSet.Auto, EntryPoint = "SendMessage")] + public static extern int SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam); + + [DllImport("user32.dll", SetLastError = true)] + static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + + public class Win32API + { + public const Int32 WM_COPYDATA = 0x004A; + public struct COPYDATASTRUCT + { + public IntPtr dwData; + public int cbData; + public IntPtr lpData; + } + } + + protected override void WndProc(ref Message m) + { + switch (m.Msg) + { + case Win32API.WM_COPYDATA: + Win32API.COPYDATASTRUCT cds = (Win32API.COPYDATASTRUCT)m.GetLParam(typeof(Win32API.COPYDATASTRUCT)); + //Win32API.COPYDATASTRUCT cds2 = (Win32API.COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(Win32API.COPYDATASTRUCT)); + + byte[] data = new byte[cds.cbData]; + Marshal.Copy(cds.lpData, data, 0, cds.cbData); + + onMessage(cds.dwData.ToInt32(), Encoding.UTF8.GetString(data)); + break; + default: + break; + } + base.WndProc(ref m); + } + + public bool SendMessage(string caption, int code, string msg) + { + IntPtr hwnd = FindWindow(null, caption); + if (hwnd != IntPtr.Zero) + { + Win32API.COPYDATASTRUCT cds = new Win32API.COPYDATASTRUCT(); + cds.dwData = new IntPtr(code); + byte[] buff = Encoding.UTF8.GetBytes(msg); + cds.lpData = Marshal.AllocHGlobal(buff.Length); + Marshal.Copy(buff, 0, cds.lpData, buff.Length); + cds.cbData = buff.Length; + SendMessage(hwnd, Win32API.WM_COPYDATA, this.Handle, ref cds); + return true; + } + return false; + } + + } +} diff --git a/ACTWebSocket.Core/IPC_COPYDATA.resx b/ACTWebSocket.Core/IPC_COPYDATA.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ACTWebSocket.Core/IPC_COPYDATA.resx @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/OverlayProcWebUI/MainForm.html b/OverlayProcWebUI/MainForm.html new file mode 100644 index 0000000..978ca4b --- /dev/null +++ b/OverlayProcWebUI/MainForm.html @@ -0,0 +1,116 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> + <script src="js/app.js"></script> + <link rel="stylesheet" href="css/default.css" /> + </head> + <body> + <div class="newwindow" style="display:none;"> + <div class="url"> + <div class="label" data-id="new-url">URL or File</div> + <div class="inputcase" style="right:75px;"> + <input type="text" value="" data-flag="new-url"> + </div> + <button style="right:8px; width:55px;" data-id="new-add" data-flag="new-add">Add</button> + </div> + <div class="lists" data-parent="file://c:/Advanced Combat Tracker" data-net-parent="http://{servurl}:{servport}"> + </div> + </div> + <div class="body"> + <div class="center"> + <div class="listhead"> + <span data-id="overlays">Overlays</span> + <svg class="newbtn" viewbox="0 0 24 24"> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> + </svg> + </div> + <div class="list" data-selected-index="-1"> + <!-- EXAMPLE + <div data-url="http://overlay.project.so/testurl.html" data-opacity="100" data-zoom="100" data-fps="30" data-x="0" data-y="0" data-width="300" data-height="300" data-clickthru="false" data-nonfocus="false" data-dragging="false" data-dragndrop="true" data-hide="false" data-resize="true"><span>Laiglinne's Fancy Detail Overlay</span></div> + --> + </div> + <div class="setting"> + <div style="position:absolute; right:5px; top:5px; left:5px; background:#FFF;"> + <button style="right:5px; width:60px;" data-id="overlay-delete" data-flag="overlay-delete">Delete</button> + <button style="right:70px; width:60px;" data-id="overlay-reload" data-flag="overlay-reload">Reload</button> + </div> + <div> + <div class="label" data-id="overlay-title">Title</div> + <div class="inputcase"> + <input type="text" data-flag="overlay-title"> + </div> + </div> + <div> + <div class="label" data-id="overlay-url">URL</div> + <div class="inputcase" style="right:70px;"> + <input type="text" value="" data-flag="overlay-url"> + </div> + <button style="right:5px; width:55px;" data-id="overlay-open" data-flag="overlay-open">Open</button> + </div> + <div> + <div class="label" data-id="overlay-opacity">Opacity</div> + <div class="inputcase" style="right:70px;"> + <input type="range" min="0" max="100" data-str="%" value="100" data-flag="overlay-opacity"> + </div> + <div class="valueview">100%</div> + </div> + <div> + <div class="label" data-id="overlay-zoom">Zoom</div> + <div class="inputcase" style="right:70px;"> + <input type="range" min="50" max="200" data-str="%" value="100" data-flag="overlay-zoom"> + </div> + <div class="valueview">100%</div> + </div> + <div> + <div class="label" data-id="overlay-fps">FPS</div> + <div class="inputcase" style="right:70px;"> + <input type="range" min="0" max="60" data-str=" FPS" value="30" data-flag="overlay-fps"> + </div> + <div class="valueview">30 FPS</div> + </div> + <div data-checked="false" data-flag="overlay-clickthru" data-id="overlay-clickthru">Enable ClickThru</div> + <div data-checked="false" data-flag="overlay-nonfocus" data-id="overlay-nonfocus" style="margin-top:-30px; margin-left:180px;">Enable Non focusing</div> + <div data-checked="false" data-flag="overlay-dragging" data-id="overlay-dragging">Enable Dragging</div> + <div data-checked="false" data-flag="overlay-dragndrop" data-id="overlay-dragndrop" style="margin-top:-30px; margin-left:180px;">Enable Drag & Drop</div> + <div data-checked="false" data-flag="overlay-hide" data-id="overlay-hide">Hide Overlay</div> + <div data-checked="false" data-flag="overlay-resize" data-id="overlay-resize" style="margin-top:-30px; margin-left:180px;">Enable Resize</div> + <div> + <div class="label" data-id="overlay-x">pos X</div> + <div class="inputcase" style="right:auto; width:80px;"> + <input type="number" value="0" data-flag="overlay-x"> + </div> + </div> + <div style="margin-top:-30px; margin-left:150px;"> + <div class="label" data-id="overlay-width">Width</div> + <div class="inputcase" style="right:auto; width:80px;"> + <input type="number" value="0" min="0" data-flag="overlay-width"> + </div> + </div> + <div> + <div class="label" data-id="overlay-y">pos Y</div> + <div class="inputcase" style="right:auto; width:80px;"> + <input type="number" value="0" data-flag="overlay-y"> + </div> + </div> + <div style="margin-top:-30px; margin-left:150px;"> + <div class="label" data-id="overlay-height">Height</div> + <div class="inputcase" style="right:auto; width:80px;"> + <input type="number" value="0" min="0" data-flag="overlay-height"> + </div> + </div> + <div style="margin-top:-30px; margin-left:150px;"> + <div class="label" data-id="overlay-height">Height</div> + <div class="inputcase" style="right:auto; width:80px;"> + <input type="number" value="0" min="0" data-flag="overlay-height"> + </div> + </div> + </div> + </div> + <div class="console"> + + </div> + </div> + </body> +</html> \ No newline at end of file diff --git a/OverlayProcWebUI/css/default.css b/OverlayProcWebUI/css/default.css new file mode 100644 index 0000000..36ca4ed --- /dev/null +++ b/OverlayProcWebUI/css/default.css @@ -0,0 +1,79 @@ +@charset "utf-8"; +@import url(http://fonts.googleapis.com/earlyaccess/notosanskr.css); +* {font-family:'Noto Sans KR';} +* [data-checked] {cursor:pointer;} +* [disabled] {cursor:default; color:#AAA;} +* ::selection {background:rgba(161, 127, 255, .5); color:inherit; border:1px solid #A17FFF;} +body +{ + -webkit-user-select: none; + -moz-user-select: -moz-none; + -ms-user-select: none; + user-select: none; +} +input, textarea +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + -o-user-select: text; + -moz-user-select:text; +} +html, body{padding:0px; margin:0px; font-size:12px;} +.disableall, .disablemenu {z-index:9999; position:fixed; left:0px; top:0px; bottom:0px; right:0px; background:rgba(192, 192, 192, .5);} + +.body {position:fixed; left:0px; top:0px; bottom:0px; right:0px; background:#FFF;} + +.body>.console {bottom:0px; left:0px; right:0px; top:0px; border-top:1px solid #E5E5E5; position:absolute; display:none;} + +.body>.center {position:absolute; left:0px; top:0px; bottom:0px; right:0px;} +.body>.center>.listhead {position:absolute; left:0px; top:0px; height:40px; line-height:40px; padding-left:15px; font-size:18px; font-weight:bold; width:265px; border-bottom:1px solid #E5E5E5;} +.body>.center>.listhead>svg {cursor:pointer; width:24px; height:24px; position:absolute; right:12px; top:8px; border-radius:50%; fill:#4D89C1;} +.body>.center>.listhead>svg:hover {fill:#2061A1;} +.body>.center>.listhead>svg:active {fill:#0B4680;} + +.body>.center>.list {width:280px; position:Absolute; left:0px; right:0px; top:40px; bottom:0px;} +.body>.center>.list>div {height:32px; line-height:32px; padding-left:38px; cursor:pointer; position:relative; overflow:hidden;} +.body>.center>.list>div::after{content:" "; position:absolute; left:8px; height:24px; width:24px; top:4px; background-color:#AAA;} +.body>.center>.list>div[data-url^="file"]::after {-webkit-mask-image:url(../img/file.svg); background-repeat:no-repeat;} +.body>.center>.list>div[data-url^="http"]::after {-webkit-mask-image:url(../img/link.svg); background-repeat:no-repeat;} +.body>.center>.list>div:hover {background-color:#E5E5E5;} +.body>.center>.list>div:active, .body>.center>.list>div.selected {background-color:#3998D6; color:#FFF;} +.body>.center>.list>div:hover::after {background-color:#AAA;} +.body>.center>.list>div:active::after {background-color:#FFF;} +.body>.center>.list>div.selected::after {background-color:#FFF;} + +.body>.center>.setting {position:absolute; overflow:auto; left:280px; top:0px; right:0px; bottom:0px; border-left:1px solid #E5E5E5; padding-top:37px; padding-right:10px;} +.body>.center>.setting>div {height:30px; line-height:30px; padding-left:12px; position:relative;} +.body>.center>.setting>div[data-checked] {padding-left:55px;} +.body>.center>.setting>div[data-checked=true][disabled]:after {background:#AAA;} +.body>.center>.setting>div[data-checked=false]:after {float:left; margin-left:-24px; margin-top:6px; width:18px; height:18px; background:#DDD; content:' '; border-radius:4px;} +.body>.center>.setting>div[data-checked=true]:after {float:left; margin-left:-24px; margin-top:6px; width:18px; height:18px; background:#4D89C1; content:'✓'; border-radius:4px; line-height:18px; font-weight:bold; text-align:center; color:#FFF;} +.body>.center>.setting>div>.label {float:left; width:50px; text-align:right;} +.body>.center>.setting>div>.inputcase {position:absolute; left:70px; right:10px; } +.body>.center>.setting>div>.inputcase>input[type=text] {width:100%; height:16px; border:1px solid #E5E5E5; border-radius:4px; padding:2px; font-size:12px;} +.body>.center>.setting>div>.inputcase>input[type=number] {width:100%; height:16px; border:1px solid #E5E5E5; border-radius:4px; padding:2px; font-size:12px;} +.body>.center>.setting>div>.inputcase>input[type=range] {width:100%; border:0px; margin-top:6px; height:22px; -webkit-appearance: none;} +.body>.center>.setting>div>.inputcase>input[type=range]::-webkit-slider-runnable-track {background:#E5E5E5; height:4px;} +.body>.center>.setting>div>.inputcase>input[type=range]::-webkit-slider-thumb {background: #4D89C1; -webkit-appearance: none; height:16px; width:8px; margin-top:-6px; border:2px solid #FFF;} +.body>.center>.setting>div>button {position:absolute; z-index:9; border:1px solid #E5E5E5; background:transparent; height:22px; top:4px; font-size:12px; border-radius:4px;} +.body>.center>.setting>div>button:hover {background:rgba(0,192,255,0.15);} +.body>.center>.setting>div>button:active {background:#E5E5E5;} +.body>.center>.setting>div>.valueview {position:absolute; border:1px solid #E5E5E5; background:transparent; right:5px; width:53px; height:20px; top:4px; font-size:12px; line-height:22px; border-radius:4px; text-align:center;} + +.newwindow {position:fixed; z-index:10000; left:10px; top:130px; width:400px; min-height:70px; max-height:600px; background:#FFF; border-radius:2px; -webkit-filter:drop-shadow(0px 0px 2px rgba(0,0,0,0.5));} +.newwindow::after {position:absolute; right:146px; width:15px; height:15px; transform:rotate(45deg); content:" "; background:#FFF; top:-3px;} +.newwindow>.url {height:40px; border-bottom:1px solid #E5E5E5; line-height:40px;} +.newwindow>.url>.label {float:left; width:80px; text-align:right;} +.newwindow>.url>.inputcase {position:absolute; left:90px; right:10px; z-index:99;} +.newwindow>.url>.inputcase>input[type=text] {width:100%; height:16px; border:1px solid #E5E5E5; border-radius:4px; padding:2px; font-size:12px;} +.newwindow>.url>button {position:absolute; border:1px solid #E5E5E5; background:transparent; height:22px; top:9px; font-size:12px; border-radius:4px; z-index:99;} +.newwindow>.lists>div {height:29px; line-height:30px; padding-left:12px; cursor:default; border-bottom:1px solid #E5E5E5; position:relative; padding-right:50px;} +.newwindow>.lists>div:last-child {height:30px; border:0px;} +.newwindow>.lists>div>.link, .newwindow>.lists>div>.select{position:absolute; right:5px; content:" "; width:20px; height:20px; top:5px; background:#E5E5E5; border-radius:3px;} +.newwindow>.lists>div>.select {right:30px;} +.newwindow>.lists>div>.select:hover, .newwindow>.lists>div>.link:hover {background:#4D89C1;} +.newwindow>.lists>div>.link::after, .newwindow>.lists>div>.select::after{-webkit-mask-size:18px 18px; -webkit-mask-repeat:no-repeat; -webkit-mask-position:center center; background-color:#333; content:" "; width:20px; height:20px; position:absolute;} +.newwindow>.lists>div>.link:hover::after, .newwindow>.lists>div>.select:hover::after {background-color:#FFF;} +.newwindow>.lists>div>.link::after {-webkit-mask-image:url(../img/copy.svg);} +.newwindow>.lists>div>.select::after {-webkit-mask-image:url(../img/done.svg);} \ No newline at end of file diff --git a/OverlayProcWebUI/img/copy.svg b/OverlayProcWebUI/img/copy.svg new file mode 100644 index 0000000..be9d591 --- /dev/null +++ b/OverlayProcWebUI/img/copy.svg @@ -0,0 +1,4 @@ +<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/detail.svg b/OverlayProcWebUI/img/detail.svg new file mode 100644 index 0000000..c2834b3 --- /dev/null +++ b/OverlayProcWebUI/img/detail.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/done.svg b/OverlayProcWebUI/img/done.svg new file mode 100644 index 0000000..446af14 --- /dev/null +++ b/OverlayProcWebUI/img/done.svg @@ -0,0 +1,4 @@ +<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/file.svg b/OverlayProcWebUI/img/file.svg new file mode 100644 index 0000000..4d60655 --- /dev/null +++ b/OverlayProcWebUI/img/file.svg @@ -0,0 +1,4 @@ +<svg fill="#AAA" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/gear.svg b/OverlayProcWebUI/img/gear.svg new file mode 100644 index 0000000..875fb01 --- /dev/null +++ b/OverlayProcWebUI/img/gear.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/link.svg b/OverlayProcWebUI/img/link.svg new file mode 100644 index 0000000..a2a1ab3 --- /dev/null +++ b/OverlayProcWebUI/img/link.svg @@ -0,0 +1,4 @@ +<svg fill="#AAA" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/off.svg b/OverlayProcWebUI/img/off.svg new file mode 100644 index 0000000..2ceecdb --- /dev/null +++ b/OverlayProcWebUI/img/off.svg @@ -0,0 +1,4 @@ +<svg fill="#FFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0zm0 0h24v24H0z" fill="none"/> + <path d="M17.56 14.24c.28-.69.44-1.45.44-2.24 0-3.31-2.69-6-6-6-.79 0-1.55.16-2.24.44l1.62 1.62c.2-.03.41-.06.62-.06 2.21 0 4 1.79 4 4 0 .21-.02.42-.05.63l1.61 1.61zM12 4c4.42 0 8 3.58 8 8 0 1.35-.35 2.62-.95 3.74l1.47 1.47C21.46 15.69 22 13.91 22 12c0-5.52-4.48-10-10-10-1.91 0-3.69.55-5.21 1.47l1.46 1.46C9.37 4.34 10.65 4 12 4zM3.27 2.5L2 3.77l2.1 2.1C2.79 7.57 2 9.69 2 12c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 17.53 4 14.96 4 12c0-1.76.57-3.38 1.53-4.69l1.43 1.44C6.36 9.68 6 10.8 6 12c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-.65.17-1.25.44-1.79l1.58 1.58L10 12c0 1.1.9 2 2 2l.21-.02.01.01 7.51 7.51L21 20.23 4.27 3.5l-1-1z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/on.svg b/OverlayProcWebUI/img/on.svg new file mode 100644 index 0000000..0b714cb --- /dev/null +++ b/OverlayProcWebUI/img/on.svg @@ -0,0 +1,4 @@ +<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M12 11c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 2c0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.48-.81 2.75-2 3.45l1 1.74c1.79-1.04 3-2.97 3-5.19zM12 3C6.48 3 2 7.48 2 13c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 18.53 4 15.96 4 13c0-4.42 3.58-8 8-8s8 3.58 8 8c0 2.96-1.61 5.53-4 6.92l1 1.73c2.99-1.73 5-4.95 5-8.65 0-5.52-4.48-10-10-10z"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/img/wide.svg b/OverlayProcWebUI/img/wide.svg new file mode 100644 index 0000000..d2a24ed --- /dev/null +++ b/OverlayProcWebUI/img/wide.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> + <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> \ No newline at end of file diff --git a/OverlayProcWebUI/js/app.js b/OverlayProcWebUI/js/app.js new file mode 100644 index 0000000..f4c57d3 --- /dev/null +++ b/OverlayProcWebUI/js/app.js @@ -0,0 +1,855 @@ +var language = { + "new-url":{"ko":"주소 또는 파일", "ja-JP":"", "en":"URL or File"}, + "new-add":{"ko":"추가", "ja-JP":"", "en":"Add"}, + "start-option":{"ko":"시작 설정", "ja-JP":"", "en":"Start Option"}, + "autorun":{"ko":"ACT와 함께 시작", "ja-JP":"", "en":"Auto Running With ACT"}, + "localhost":{"ko":"이 PC만 사용", "ja-JP":"", "en":"Localhost Only"}, + "randurl":{"ko":"무작위 주소 사용", "ja-JP":"", "en":"Random URL"}, + "url":{"ko":"IP 주소", "ja-JP":"", "en":"URL"}, + "port":{"ko":"포트", "ja-JP":"", "en":"Port"}, + "server-status":{"ko":"서버 설정", "ja-JP":"", "en":"Server Option"}, + "miniparse":{"ko":"전투기록 사용", "ja-JP":"", "en":"Use Mini Parse"}, + "onloglineread":{"ko":"OnLogLineRead 사용", "ja-JP":"", "en":"Use OnLogLineRead"}, + "beforeloglineread":{"ko":"BeforeLogLineRead 사용", "ja-JP":"", "en":"Use BeforeLogLineRead"}, + "miniparseset":{"ko":"전투기록 설정", "ja-JP":"", "en":"Mini Parse Setting"}, + "miniparseSortkey":{"ko":"정렬 키", "ja-JP":"", "en":"Sort Key"}, + "miniparseSorttype":{"ko":"정렬 방법", "ja-JP":"", "en":"Sort Type"}, + "opt-none":{"ko":"없음", "ja-JP":"", "en":"None"}, + "opt-sa":{"ko":"문자-오름차순", "ja-JP":"", "en":"StringAscending"}, + "opt-sd":{"ko":"문자-내림차순", "ja-JP":"", "en":"StringDescending"}, + "opt-na":{"ko":"숫자-오름차순", "ja-JP":"", "en":"NumericAscending"}, + "opt-nd":{"ko":"숫자-내림차순", "ja-JP":"", "en":"NumericDescending"}, + "overlays":{"ko":"오버레이 목록", "ja-JP":"", "en":"Overlays"}, + "overlay-title":{"ko":"제목", "ja-JP":"", "en":"Title"}, + "overlay-url":{"ko":"주소", "ja-JP":"", "en":"URL"}, + "overlay-open":{"ko":"열기", "ja-JP":"", "en":"Open"}, + "overlay-opacity":{"ko":"투명도", "ja-JP":"", "en":"Opacity"}, + "overlay-zoom":{"ko":"확축", "ja-JP":"", "en":"Zoom"}, + "overlay-fps":{"ko":"프레임", "ja-JP":"", "en":"FPS"}, + "overlay-clickthru":{"ko":"클릭 통과 사용", "ja-JP":"", "en":"Enable ClickThru"}, + "overlay-nonfocus":{"ko":"포커스를 주지 않음", "ja-JP":"", "en":"Enable Non focusing"}, + "overlay-dragging":{"ko":"화면 내 드래그 사용", "ja-JP":"", "en":"Enable Dragging"}, + "overlay-dragndrop":{"ko":"드래그 화면 이동 사용", "ja-JP":"", "en":"Enable Drag & Drop"}, + "overlay-hide":{"ko":"오버레이 숨김", "ja-JP":"", "en":"Hide Overlay"}, + "overlay-resize":{"ko":"크기 조절 사용", "ja-JP":"", "en":"Enable Resize"}, + "overlay-x":{"ko":"X좌표", "ja-JP":"", "en":"pos X"}, + "overlay-y":{"ko":"Y좌표", "ja-JP":"", "en":"pos Y"}, + "overlay-width":{"ko":"폭", "ja-JP":"", "en":"Width"}, + "overlay-height":{"ko":"높이", "ja-JP":"", "en":"Height"}, + "overlay-save":{"ko":"저장", "ja-JP":"", "en":"Save"}, + "overlay-delete":{"ko":"삭제", "ja-JP":"", "en":"Delete"}, + "overlay-reload":{"ko":"리로드", "ja-JP":"", "en":"Reload"}, + "overlay-opendevtool":{"ko":"개발자 도구 열기", "ja":"","en":"Open DevTool"}, + "serverstatus": + { + "ko": + { + "on":"서버 상태 : 작동중 <span style='color:rgba(255,255,255,.5);'> (멈추려면 클릭)</span>", + "off":"서버 상태 : 멈춤 <span style='color:rgba(255,255,255,.5);'> (시작하려면 클릭)</span>", + }, + "ja": + { + "on":"Server Status : Running <span style='color:rgba(255,255,255,.5);'> (Stop at Click)</span>", + "off":"Server Status : Stoped <span style='color:rgba(255,255,255,.5);'> (Run at Click)</span>", + }, + "en": + { + "on":"Server Status : Running <span style='color:rgba(255,255,255,.5);'> (Stop at Click)</span>", + "off":"Server Status : Stoped <span style='color:rgba(255,255,255,.5);'> (Run at Click)</span>", + } + } +}; + +function closeMenu() +{ + $(".wideswap").attr("data-checked", "true"); + $(".left").css({"left":"-261px", "box-shadow":"0px 0px 0px transparent"}); + $(".wideswap").css({"left":"8px"}); +} + +function api_overlaywindow_get(json, callback) +{ + websocket.send( + JSON.stringify({ + cmd: "get", + value: json + }) + ); +} + +function api_overlaywindow_set(json, callback) +{ + websocket.send( + JSON.stringify({ + cmd: "set", + value: json + }) + ); +} + +function api_overlaywindow_set_all(json) +{ + websocket.send( + JSON.stringify({ + cmd: "set_all", + value: json + }) + ); +} + +function api_overlaywindow_close_all() +{ + websocket.send( + JSON.stringify({ + cmd: "close_all" + }) + ); +} + +function api_overlaywindow_get_all() +{ + websocket.send( + JSON.stringify({ + cmd: "get_all" + }) + ); +} + +function api_overlaywindow_close(json) +{ + websocket.send( + JSON.stringify({ + cmd: "close", + value: json + }) + ); +} + +var wsUri = "ws://localhost:9991/"; +var pageActive = true; +var websocket = null; +function connectWebSocket(uri) +{ + websocket = new WebSocket(uri); + websocket.onopen = function(evt) { + $(".list").empty(); + api_overlaywindow_get_all(); + // //api_overlaywindow_close_all(); + // var count = $(".list div").length; + // var objs = {}; + // for(var i = 0; i<count;++i) + // { + // var obj = divToJSON(i) + // objs[obj["id"]] = obj; + // } + // api_overlaywindow_set_all(objs); + } + websocket.onmessage = function(evt) { + if (evt.data == ".") + { + // ping pong + websocket.send("."); + } + else + { + document.dispatchEvent(new CustomEvent('onOverlaySettingChanged', { detail: evt.data })); + } + }; + + //websocket.onopen = function(evt) { }; + websocket.onclose = function(evt) { + //$(".list").empty(); + // 접속 불가 메세지 필요. + setTimeout(function(){connectWebSocket(uri)}, 5000); + }; + websocket.onerror = function(evt) { + websocket.close(); + }; +} + +function disconnectWebSocket(){ + pageActive = false; + websocket.close(); +}; + + +$(document).ready(function() { + pageActive = true; + connectWebSocket(wsUri); +}); + +if (document.addEventListener) { + window.onbeforeunload = function() { + disconnectWebSocket(); + }; + window.addEventListener("unload", function() { + disconnectWebSocket(); + }, false); +} +document.addEventListener('onOverlaySettingChanged', onOverlaySettingChanged); +window.addEventListener('message', function (e) +{ + if (e.data.type === 'onOverlaySettingChanged') + { + onOverlaySettingChanged(e.data); + } +}); +// 변수 이름 변환 부분 추후 정리. +var savedvar = [ + "id", + "url", + "opacity", + "zoom", + "fps", + "clickthru", + "nonfocus", + "dragging", + "dragndrop", + "hide", + "resize", + "x", + "y", + "width", + "height" +]; +var nativevar = [ + "id", + "url", + "opacity", + "zoom", + "fps", + "Transparent", + "NoActivate", + "useDragFilter", + "useDragMove", + "hide", + "useResizeGrip", + "x", + "y", + "width", + "height" +]; +var floatvar = [ + "opacity", + "zoom", + ]; +var intvar = [ + "x", + "y", + "width", + "height", + "fps", +]; +nameNativeToJSMap = {}; +nameJSToNativeMap = {}; +for(i=0;i<savedvar.length;++i) +{ + nameJSToNativeMap[savedvar[i]] = nativevar[i]; + nameNativeToJSMap[nativevar[i]] = savedvar[i]; +} + +function JSONToDivPos(index, obj) +{ + var selectedIndex = parseInt($(".list").attr("data-selected-index")); + $($(".list div")[index]).find("span")[0].innerText = obj["title"]; + for(var i in intvar) + { + obj[intvar[i]] = parseFloat(obj[intvar[i]]); + } + for(var i in intvar) + { + if($("*[data-flag=overlay-"+intvar[i]+"]").is("[data-checked]")) + { + $($(".list div")[index]).attr("data-"+intvar[i], obj[nameJSToNativeMap[intvar[i]]]) + if(index == selectedIndex) + { + $("*[data-flag=overlay-"+intvar[i]+"]").attr("data-checked", obj[nameJSToNativeMap[intvar[i]]]); + } + //$($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").attr("data-checked")=="true"?"true":"false"); + } + else + { + $($(".list div")[index]).attr("data-"+intvar[i], obj[nameJSToNativeMap[intvar[i]]]); + if(index == selectedIndex) + { + $("*[data-flag=overlay-"+intvar[i]+"]").val(obj[nameJSToNativeMap[intvar[i]]]); + } + //$($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").val()); + } + } +} + +function JSONToDiv(index, obj) +{ + var selectedIndex = parseInt($(".list").attr("data-selected-index")); + $($(".list div")[index]).find("span")[0].innerText = obj["title"]; + if(index == selectedIndex) + { + $("*[data-flag=overlay-title]").val(obj["title"]); + $("*[data-flag=overlay-id]").val(obj["id"]); + $("*[data-flag=overlay-url]").val(obj["url"]); + } + $($(".list div")[index]).attr("data-id", obj["id"]); + $($(".list div")[index]).attr("data-url", obj["url"]); + //obj["title"] = $($(".list div")[index]).find("span").html($("*[data-flag=overlay-title]").val()); + for(var i in floatvar) + { + obj[floatvar[i]] = parseFloat(obj[floatvar[i]]) * 100.0; + } + for(var i in intvar) + { + obj[intvar[i]] = parseFloat(obj[intvar[i]]); + } + for(var i in savedvar) + { + if($("*[data-flag=overlay-"+savedvar[i]+"]").is("[data-checked]")) + { + $($(".list div")[index]).attr("data-"+savedvar[i], obj[nameJSToNativeMap[savedvar[i]]]) + if(index == selectedIndex) + { + $("*[data-flag=overlay-"+savedvar[i]+"]").attr("data-checked", obj[nameJSToNativeMap[savedvar[i]]]); + } + //$($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").attr("data-checked")=="true"?"true":"false"); + } + else + { + $($(".list div")[index]).attr("data-"+savedvar[i], obj[nameJSToNativeMap[savedvar[i]]]); + if(index == selectedIndex) + { + $("*[data-flag=overlay-"+savedvar[i]+"]").val(obj[nameJSToNativeMap[savedvar[i]]]); + } + //$($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").val()); + } + } +} +// overlay window의 json으로 정리. +function divToJSON(index) +{ + var selectedIndex = parseInt($(".list").attr("data-selected-index")); + var count = $(".list div").length; + var obj = null; + if(index < count && index >= 0) + { + obj = {}; + obj["title"] = $($(".list div")[index]).find("span")[0].innerText; + obj["id"] = $($(".list div")[index]).attr("data-id"); + obj["url"] = $($(".list div")[index]).attr("data-url"); + //obj["title"] = $($(".list div")[index]).find("span").html($("*[data-flag=overlay-title]").val()); + for(var i in savedvar) + { + if($("*[data-flag=overlay-"+savedvar[i]+"]").is("[data-checked]")) + { + if(index == selectedIndex) + { + $($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").attr("data-checked")=="true"?"true":"false"); + } + obj[nameJSToNativeMap[savedvar[i]]] = $($(".list div")[index]).attr("data-"+savedvar[i])=="true"?true:false; + } + else + { + if(index == selectedIndex) + { + $($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").val()); + } + obj[nameJSToNativeMap[savedvar[i]]] = $($(".list div")[index]).attr("data-"+savedvar[i]); + } + } + for(var i in floatvar) + { + obj[floatvar[i]] = parseFloat(obj[floatvar[i]]) / 100.0; + } + for(var i in intvar) + { + obj[intvar[i]] = parseFloat(obj[intvar[i]]); + } + } + return obj; +} +function addHostname(hostname) +{ + var html ="<option value=\""+hostname+"\">"+hostname+"</div>"; + $("*[data-flag=hostnames]").append(html); +} +function Hex2Str(hexx) { + var hex = hexx.toString();//force conversion + var str = ''; + for (var i = 0; i < hex.length; i += 2) + str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); + return str; +} + +function update_all(vals) +{ + for(var key in vals) + { + var val = vals[key]; + update(val); + } +} + +function update(obj) +{ + try{ + var count = $(".list div").length; + var find = false; + for(var index=0;index<count;++index) + { + if (obj["id"] == $($(".list div")[index]).attr("data-id")) + { + JSONToDiv(index, obj); + find = true; + break; + } + } + if(!find) + { + var html = "<div "; + html+='data-url="'+ obj["url"] +'"' + +' data-id="' + obj["id"] +'"' + +' data-opacity="' + obj["opacity"]*100 +'"' + +' data-zoom="' + obj["zoom"]*100 +'"' + +' data-fps="' + obj["fps"] +'"' + +' data-x="' + obj["x"] +'"' + +' data-y="' + obj["y"] +'"' + +' data-width="' + obj["width"] +'"' + +' data-height="' + obj["height"] +'"' + +' data-clickthru="' + (obj["Transparent"]?'true':'false') +'"' + +' data-nonfocus="' + (obj["NoActivate"]?'true':'false') +'"' + +' data-dragging="' + (obj["useDragFilter"]?'true':'false') +'"' + +' data-dragndrop="' + (obj["useDragMove"]?'true':'false') +'"' + +' data-hide="' + (obj["hide"]?'true':'false') +'"' + +' data-resize="' + (obj["useResizeGrip"]?'true':'false') +'"' + ; + + html+="><span>"+obj["title"]+"</span></div>"; + $(".list").append(html); + actAttach(); + } + } + catch(e) + { + alert(e); + } +} +function update_pos(obj) +{ + try{ + var count = $(".list div").length; + var find = false; + for(var index=0;index<count;++index) + { + if (obj["id"] == $($(".list div")[index]).attr("data-id")) + { + JSONToDivPos(index, obj); + find = true; + break; + } + } + if(find == false) + { + api_overlaywindow_get(obj); + } + } + catch(e) + { + alert(e); + } +} + +function onOverlaySettingChanged(e) +{ + try{ + var obj = JSON.parse(e.detail); + var cmd = obj["cmd"]; + if(cmd == "update") + { + var val = obj["value"]; + update_pos(val); + } + if(cmd == "get" || cmd == "set") + { + var val = obj["value"]; + update(val); + } + if(cmd == "close_all") + { + $(".list").empty(); + } + if(cmd == "get_all") + { + var vals = obj["value"]; + for(var key in vals) + { + var val = vals[key]; + update(val); + } + + } + } + catch(e) + { + alert(e); + } +} +function settingsTojson() +{ + var count = $(".list div").length; + + $(".list div span")[0].innerText + var savedvar = [ + "url", + "opacity", + "zoom", + "fps", + "clickthru", + "nonfocus", + "dragging", + "dragndrop", + "hide", + "resize", + "x", + "y", + "width", + "height" + ]; + var savedvar = [ + "url", + "opacity", + "zoom", + "fps", + "Transparent", + "NoActivate", + "useDragFilter", + "useDragMove", + "hide", + "useResizeGrip", + "x", + "y", + "width", + "height" + ]; + var divs = $(".list div"); + +} + +function saveOption() +{ + var savedvar = [ + "url", + "opacity", + "zoom", + "fps", + "clickthru", + "nonfocus", + "dragging", + "dragndrop", + "hide", + "resize", + "x", + "y", + "width", + "height" + ]; + var index = parseInt($(".list").attr("data-selected-index")); + $($(".list div")[index]).find("span").html($("*[data-flag=overlay-title]").val()); + for(var i in savedvar) + { + if($("*[data-flag=overlay-"+savedvar[i]+"]").is("[data-checked]")) + { + $($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").attr("data-checked")=="true"?"true":"false"); + } + else + { + $($(".list div")[index]).attr("data-"+savedvar[i], $("*[data-flag=overlay-"+savedvar[i]+"]").val()); + } + } +} + +function forceChange(obj) +{ + $(obj).attr("data-checked", $(obj).attr("data-checked")=="true"?"false":"true"); + if($(obj).is("[data-status-off]") && $(obj).attr("data-checked") == "false") + { + $(obj).html($(obj).attr("data-status-off")); + if($(obj).is("[data-status-off-css]")) + { + $(obj).css(JSON.parse($(obj).attr("data-status-off-css").replace(/'/ig, "\""))); + } + } + else if($(obj).is("[data-status-on]") && $(obj).attr("data-checked") == "true") + { + $(obj).html($(obj).attr("data-status-on")); + if($(obj).is("[data-status-on-css]")) + { + $(obj).css(JSON.parse($(obj).attr("data-status-on-css").replace(/'/ig, "\""))); + } + } + + if($(obj).is("[data-disableobject]")) + { + if($(obj).attr("data-checked")=="true") + { + var obj = JSON.parse($(obj).attr("data-disableobject").replace(/'/ig, "\"")); + for(var i in obj.objects) + { + $("*[data-id=\""+obj.objects[i]+"\"]").attr("disabled","disabled"); + $("*[data-flag=\""+obj.objects[i]+"\"]").attr("disabled","disabled"); + } + } + else + { + var obj = JSON.parse($(obj).attr("data-disableobject").replace(/'/ig, "\"")); + for(var i in obj.objects) + { + $("*[data-id=\""+obj.objects[i]+"\"]").removeAttr("disabled"); + $("*[data-flag=\""+obj.objects[i]+"\"]").removeAttr("disabled"); + } + } + } +} + +$(document).ready(function(){ + { + $("*[data-flag=hostnames]").change(function() { + $("*[data-flag=hostname]").val($("*[data-flag=hostnames]").val()); + }); + } + try{ + $(".list").empty(); + } + catch(e) + { + alert(e); + } + setTimeout(function(){$(".left").css("transition", ".2s"); $(".wideswap").css("transition", ".2s");},1000) + + // 초기 로드 시 선택된 Overlay가 없으므로 disable 시킨다. + $(".setting *[data-flag]").attr("disabled", "disabled"); + $(".setting *[data-id]").attr("disabled", "disabled"); + + $(".listhead .newbtn").click(function(){ + // api_skin_get_list(function(data){ + // console.log(data.skins); + // }); + if($(".newwindow").css("display") == "none") + { + $(".disableall").show(); + $(".newwindow").show(); + } + else + { + $(".disableall").hide(); + $(".newwindow").hide(); + } + }); + + $("*[data-flag=new-add]").click(function(){ + try + { + var url = $("*[data-flag=new-url]").val(); + var title = $("*[data-flag=new-url]").val(); + var obj = { + "Transparent": false, + "NoActivate": false, + "hide": false, + "useDragFilter": true, + "useDragMove": true, + "useResizeGrip": true, + "opacity": 1.0, + "zoom": 1.0, + "url": url, + "title": title, + "fps": 30.0, + "x": 0, + "y": 0, + "width": 300, + "height": 300 + }; + api_overlaywindow_set(obj); + $("*[data-flag=new-url]").val(""); + $(".disableall").hide(); + $(".newwindow").hide(); + } + catch(ex) + { + alert(ex); + } + }); + + $("*[data-flag=overlay-open]").click(function(){ + var index = parseInt($(".list").attr("data-selected-index")); + var obj = divToJSON(index); + if(obj != null) + { + api_overlaywindow_set(obj); + } + }); + $("*[data-flag=overlay-save]").click(function(){ + api_overlaywindow_get_all(); + }); + $("*[data-flag=overlay-delete]").click(function(){ + var index = parseInt($(".list").attr("data-selected-index")); + var obj = divToJSON(index); + api_overlaywindow_close(obj); + $(".setting *[data-flag]").attr("disabled", "disabled"); + $(".setting *[data-id]").attr("disabled", "disabled"); + $(".setting *[data-flag]").each(function(){ + if($(this).is("[data-checked]")) + { + $(this).attr("data-checked", "false"); + } + else + { + $(this).val(""); + } + }); + $($(".list div")[parseInt($(".list").attr("data-selected-index"))]).remove(); + $(".list").attr("data-selected-index", "-1"); + }); + + $("*[data-flag]").change(function(){ + saveOption(); + }); + + $("*[data-checked]").click(function(){ + if($(this).is("[disabled]")) return; + if($(this).parent().is("[disabled]")) return; + + $(this).attr("data-checked", $(this).attr("data-checked")=="true"?"false":"true"); + if($(this).is("[data-status-off]") && $(this).attr("data-checked") == "false") + { + $(this).html($(this).attr("data-status-off")); + if($(this).is("[data-status-off-css]")) + { + $(this).css(JSON.parse($(this).attr("data-status-off-css").replace(/'/ig, "\""))); + } + } + else if($(this).is("[data-status-on]") && $(this).attr("data-checked") == "true") + { + $(this).html($(this).attr("data-status-on")); + if($(this).is("[data-status-on-css]")) + { + $(this).css(JSON.parse($(this).attr("data-status-on-css").replace(/'/ig, "\""))); + } + } + + if($(this).is("[data-disableobject]")) + { + if($(this).attr("data-checked")=="true") + { + var obj = JSON.parse($(this).attr("data-disableobject").replace(/'/ig, "\"")); + for(var i in obj.objects) + { + $("*[data-id=\""+obj.objects[i]+"\"]").attr("disabled","disabled"); + $("*[data-flag=\""+obj.objects[i]+"\"]").attr("disabled","disabled"); + } + } + else + { + var obj = JSON.parse($(this).attr("data-disableobject").replace(/'/ig, "\"")); + for(var i in obj.objects) + { + $("*[data-id=\""+obj.objects[i]+"\"]").removeAttr("disabled"); + $("*[data-flag=\""+obj.objects[i]+"\"]").removeAttr("disabled"); + } + } + } + + var index = parseInt($(".list").attr("data-selected-index")); + var obj = divToJSON(index); + if(obj != null) + { + api_overlaywindow_set(obj); + } + + if($(this).parent().hasClass("setting")) + { + saveOption(); + } + }); + + $("input[type=range]").change(function(){ + $(this).parent().parent().find(".valueview").html($(this).val()+$(this).attr("data-str")); + var index = parseInt($(".list").attr("data-selected-index")); + var obj = divToJSON(index); + api_overlaywindow_set(obj); + }); + + actAttach(); + var userLang = navigator.language || navigator.userLanguage; + + userLang = userLang+"-"; + $("*[data-id]").each(function(){ + try + { + $("*[data-id="+$(this).attr("data-id")+"]").html(language[$(this).attr("data-id")][userLang.substr(0, userLang.indexOf("-"))]); + } + catch(ex) + { + + } + }); + + $("*[data-id-ext]").each(function(){ + $(this).attr("data-status-on", language[$(this).attr("data-id-ext")][userLang.substr(0, userLang.indexOf("-"))].on); + $(this).attr("data-status-off", language[$(this).attr("data-id-ext")][userLang.substr(0, userLang.indexOf("-"))].off); + + if($(this).attr("data-checked")) + $(this).html(language[$(this).attr("data-id-ext")][userLang.substr(0, userLang.indexOf("-"))].off); + else + $(this).html(language[$(this).attr("data-id-ext")][userLang.substr(0, userLang.indexOf("-"))].on); + }); + + $(".wideswap").click(function(){ + if($(this).attr("data-checked") == "true") + { + $(".left").css({"left":"-261px", "box-shadow":"0px 0px 0px transparent"}); + $(".wideswap").css({"left":"8px"}); + $(".disablemenu").hide(); + } + else + { + $(".left").css({"left":"0px", "box-shadow":"0px 0px 10px rgba(0,0,0,0.5)"}); + $(".wideswap").css({"left":"228px"}); + $(".disablemenu").show(); + } + localStorage.setItem("mordernizer_collapse", $(this).attr("data-checked")); + }); +}); + +function actAttach() +{ + // 파일 선택 목록, list 아이템이 추가될 때 한번씩 호출하면 되는 함수 + $(".lists>div>.select").click(function(){ + $("*[data-flag=new-url]").val($(".lists").attr("data-parent")+$(this).parent().text()); + $("*[data-flag=new-url]").focus(); + }); + + $(".list div").click(function(){ + $(".list div").each(function(){$(this).removeClass("selected");}); + $(this).addClass("selected"); + var i = 0; + $(".list div").each(function(){ + if($(this).hasClass("selected")) $(".list").attr("data-selected-index", i); + i++; + }); + $("*[data-id]").removeAttr("disabled"); + $("*[data-flag]").removeAttr("disabled"); + + $(".setting *[data-flag=overlay-title]").val($(this).find("span").html()); + $.each(this.attributes, function(){ + if(this.specified) + { + if($(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").is("[data-checked]")) + { + $(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").attr("data-checked", this.value); + } + else + { + $(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").val(this.value.replace(/%20/ig, " ")); + $(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").parent().parent().find(".valueview").html($(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").val()+$(".setting *[data-flag=\""+this.name.replace("data", "overlay")+"\"]").attr("data-str")); + } + } + }); + }); +} \ No newline at end of file