10856 lines
559 KiB
C#
10856 lines
559 KiB
C#
using ClosedXML.Excel;
|
||
using DevExpress.XtraEditors;
|
||
using K3DAsyncEngineLib;
|
||
using Microsoft.VisualBasic.FileIO;
|
||
using Microsoft.Win32;
|
||
using Newtonsoft.Json;
|
||
using Newtonsoft.Json.Linq;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Drawing;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Net;
|
||
using System.Text;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
using System.Web;
|
||
using System.Windows.Forms;
|
||
using static System.Environment;
|
||
|
||
namespace SSG_Coder
|
||
{
|
||
public partial class MainForm : DevExpress.XtraEditors.XtraForm
|
||
{
|
||
#region 변수선언
|
||
|
||
|
||
//Tornado SDK 관련
|
||
public KAEngine KAEngine;
|
||
public KAScenePlayer KAScenePlayer;
|
||
public KAScene KAScene;
|
||
public KAEventHandler KAEvent;
|
||
|
||
string channel = "채널1";
|
||
|
||
string path1 = CurrentDirectory + @"\Degisn\판매수량\판매수량.t2s";
|
||
string path2 = CurrentDirectory + @"\Degisn\경품추첨\경품추첨.t2s";
|
||
string path3_1 = CurrentDirectory + @"\Degisn\텍스트\텍스트_1.t2s";
|
||
string path3_2 = CurrentDirectory + @"\Degisn\텍스트\텍스트_2.t2s";
|
||
string path3_3 = CurrentDirectory + @"\Degisn\텍스트\텍스트_3.t2s";
|
||
string path3_4 = CurrentDirectory + @"\Degisn\텍스트\텍스트_4.t2s";
|
||
string path3_5 = CurrentDirectory + @"\Degisn\텍스트\텍스트_5.t2s";
|
||
string path3_6 = CurrentDirectory + @"\Degisn\텍스트\텍스트_6.t2s";
|
||
string path3_7 = CurrentDirectory + @"\Degisn\텍스트\텍스트_7.t2s";
|
||
string path3_8 = CurrentDirectory + @"\Degisn\텍스트\텍스트_8.t2s";
|
||
string path3_9 = CurrentDirectory + @"\Degisn\텍스트\텍스트_9.t2s";
|
||
string path3_10 = CurrentDirectory + @"\Degisn\텍스트\텍스트_10.t2s";
|
||
string path3_11 = CurrentDirectory + @"\Degisn\텍스트\텍스트_11.t2s";
|
||
string path3_12 = CurrentDirectory + @"\Degisn\텍스트\텍스트_12.t2s";
|
||
string path3_13 = CurrentDirectory + @"\Degisn\텍스트\텍스트_13.t2s";
|
||
string path3_14 = CurrentDirectory + @"\Degisn\텍스트\텍스트_14.t2s";
|
||
string path3_15 = CurrentDirectory + @"\Degisn\텍스트\텍스트_15.t2s";
|
||
string path3_16 = CurrentDirectory + @"\Degisn\텍스트\텍스트_16.t2s";
|
||
string path3_17 = CurrentDirectory + @"\Degisn\텍스트\텍스트_17.t2s";
|
||
string path3_18 = CurrentDirectory + @"\Degisn\텍스트\텍스트_18.t2s";
|
||
string path3_19 = CurrentDirectory + @"\Degisn\텍스트\텍스트_19.t2s";
|
||
string path3_20 = CurrentDirectory + @"\Degisn\텍스트\텍스트_20.t2s";
|
||
|
||
|
||
|
||
|
||
string path4 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_0 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_1 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_2 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_3 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_4 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path4_5 = CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
string path5 = CurrentDirectory + @"\Degisn\라이브톡\상품평.t2s";
|
||
string path6 = CurrentDirectory + @"\Degisn\라이브톡\QnA.t2s";
|
||
string path7 = CurrentDirectory + @"\Degisn\라이브톡\공지.t2s";
|
||
string path8 = CurrentDirectory + @"\Degisn\라이브톡\채팅백판.t2s";
|
||
string path9 = CurrentDirectory + @"\Degisn\라이브톡\동영상.t2s";
|
||
|
||
|
||
string dbIP = "211.42.188.8";
|
||
string port = "60021";
|
||
string getURL() { return "http://" + dbIP + ":" + port + "/"; }
|
||
#endregion
|
||
|
||
#region 생성자
|
||
|
||
public MainForm()
|
||
{
|
||
InitializeComponent();
|
||
|
||
//SKD 선언
|
||
KAEngine = new KAEngine();
|
||
KAEvent = new KAEventHandler();
|
||
|
||
|
||
for (int i = 1; i < 12; i++)
|
||
{
|
||
cmbDisplayTerm.Items.Add((i * 5) + "초 갱신");
|
||
}
|
||
|
||
listViewInitation();
|
||
|
||
loadSettingData();
|
||
|
||
|
||
loadPushName();
|
||
cmbPushChoice.SelectedIndex = 0;
|
||
cmbPushType.SelectedIndex = 0;
|
||
|
||
Run_Watcher();
|
||
UpdateVideo();
|
||
}
|
||
|
||
private void Run_Watcher()
|
||
{
|
||
this.m_FolderWatcher = new FileSystemWatcher();
|
||
this.m_FolderWatcher.Filter = "*.*";
|
||
DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(path9) + "\\동영상");
|
||
if (!directoryInfo.Exists) directoryInfo.Create();
|
||
this.m_FolderWatcher.Path = directoryInfo.FullName;
|
||
this.m_FolderWatcher.IncludeSubdirectories = true;
|
||
this.m_FolderWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;
|
||
this.m_FolderWatcher.Changed += new FileSystemEventHandler(Watcher_OnChanged);
|
||
this.m_FolderWatcher.Created += new FileSystemEventHandler(Watcher_OnChanged);
|
||
this.m_FolderWatcher.Deleted += new FileSystemEventHandler(Watcher_OnChanged);
|
||
this.m_FolderWatcher.Renamed += new RenamedEventHandler(Watcher_OnRenamed);
|
||
this.m_FolderWatcher.EnableRaisingEvents = true;
|
||
}
|
||
|
||
private void UpdateVideo()
|
||
{
|
||
//임시
|
||
return;
|
||
|
||
try
|
||
{
|
||
string saveStr = "";
|
||
|
||
if (System.IO.Directory.Exists(m_FolderWatcher.Path))
|
||
{
|
||
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(m_FolderWatcher.Path);
|
||
List<FileInfo> files = new List<FileInfo>();
|
||
|
||
foreach (var f in di.GetFiles()) if (f.Extension.ToLower().Equals(".vrv")) files.Add(f);
|
||
|
||
|
||
foreach (var item in files)
|
||
{
|
||
|
||
if (saveStr != "") saveStr += "|";
|
||
|
||
saveStr += item.Name;
|
||
}
|
||
}
|
||
|
||
string requestURL = getURL() + "동영상/씬이름/입력?씬이름=" + saveStr;
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
//저장 완료
|
||
}
|
||
}
|
||
catch(Exception ex) { }
|
||
|
||
}
|
||
|
||
|
||
private void Watcher_OnChanged(object sender, FileSystemEventArgs e) {
|
||
UpdateVideo();
|
||
}
|
||
|
||
private void Watcher_OnRenamed(object sender, RenamedEventArgs e) {
|
||
UpdateVideo();
|
||
}
|
||
|
||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||
{
|
||
if (DialogResult.Yes == MessageBox.Show("SSG 코더 프로그램을 종료합니까?", "프로그램 종료", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
|
||
{
|
||
if (!(mWorkerThread is null))
|
||
{
|
||
if (mWorkerThread.IsAlive)
|
||
{
|
||
mWorkerThread.Abort();
|
||
}
|
||
}
|
||
|
||
Dispose(true);
|
||
|
||
Application.Exit();
|
||
}
|
||
else
|
||
{
|
||
e.Cancel = true;
|
||
return;
|
||
}
|
||
}
|
||
|
||
private void listViewInitation()
|
||
{
|
||
listView1.OwnerDraw = true;
|
||
listView1.DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(lv_DrawColumnHeader);
|
||
listView1.DrawSubItem += new DrawListViewSubItemEventHandler(lv_DrawSubItem);
|
||
listView1.MultiSelect = false;
|
||
listView1.Scrollable = true;
|
||
|
||
listView1.View = View.Details;
|
||
ColumnHeader header = new ColumnHeader();
|
||
header.Text = "당첨자를 확인해주세요.";
|
||
header.Name = "col1";
|
||
listView1.Columns.Add(header);
|
||
listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
|
||
}
|
||
|
||
#endregion
|
||
|
||
|
||
#region Tornado2 실행 및 커넥션 (커넥션 시 매초 검사) 관련
|
||
|
||
bool isConnected = false;
|
||
|
||
|
||
private Thread mWorkerThread = null;
|
||
private bool isDisplay1 = false;
|
||
private bool isDisplay2 = false;
|
||
private bool isDisplay3 = false;
|
||
private bool isDisplay4 = false;
|
||
private bool isDisplay5 = false;
|
||
private bool isDisplay6 = false;
|
||
private bool isDisplay7 = false;
|
||
private bool isDisplay8 = false;
|
||
private bool isDisplay9 = false;
|
||
private bool isDisplay10 = false;
|
||
private bool isDisplay11 = false;
|
||
private bool isDisplay13 = false;
|
||
|
||
string strDisp8 = "";
|
||
|
||
private void buttonConnection_Click(object sender, EventArgs e)
|
||
{
|
||
if (!isConnected)
|
||
{
|
||
if (KAEngine == null)
|
||
return;
|
||
}
|
||
|
||
isConnected = !isConnected;
|
||
|
||
if (!isConnected) //연결됨 => 연결 끊김
|
||
{
|
||
KAEngine.Disconnect();
|
||
|
||
setConnection(false);
|
||
|
||
DoChangeAdjust(false, false, false, false, false, false, false, false, false);
|
||
timer4.Stop();
|
||
timer5.Stop();
|
||
}
|
||
else //연결 끊김 => 연결됨
|
||
{
|
||
if (KAEngine == null)
|
||
return;
|
||
|
||
KAEngine.KTAPConnect(1, "127.0.0.1", 30001, 0, KAEvent);
|
||
KAScenePlayer = KAEngine.GetScenePlayer();
|
||
|
||
setConnection(true);
|
||
|
||
mWorkerThread = new Thread(new ThreadStart(CheckerWorker));
|
||
mWorkerThread.Start();
|
||
}
|
||
|
||
seq매진 = "";
|
||
|
||
}
|
||
|
||
|
||
public void setConnection(bool connect)
|
||
{
|
||
if (connect)
|
||
{
|
||
label_connection.Text = "CONNECTED";
|
||
label_connection.BackColor = Color.Green;
|
||
lblExtraDisplay.Text = "외부제어 송출 ON";
|
||
lblExtraDisplay.BackColor = Color.Green;
|
||
btnConnection.Text = "Disconnection";
|
||
}
|
||
else
|
||
{
|
||
label_connection.Text = "DISCONNECTED";
|
||
label_connection.BackColor = Color.DarkRed;
|
||
lblExtraDisplay.Text = "외부제어 송출 OFF";
|
||
lblExtraDisplay.BackColor = Color.DarkRed;
|
||
btnConnection.Text = "Connection";
|
||
}
|
||
}
|
||
|
||
|
||
int for매진콜 = 1;
|
||
|
||
public void CheckerWorker()
|
||
{
|
||
while (isConnected)
|
||
{
|
||
try
|
||
{
|
||
//서버에서 정보를 읽어온다.
|
||
string requestURL = getURL() + channel + "/자막상황/조회?보낸사람=코더";
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
string item1 = obj["상품"].ToString();
|
||
string item2 = obj["경품"].ToString();
|
||
string item3 = obj["텍스트"].ToString();
|
||
string item4 = obj["채팅"].ToString();
|
||
string item5 = obj["상품평"].ToString();
|
||
string item6 = obj["QNA"].ToString();
|
||
string item7 = obj["공지"].ToString();
|
||
string item8 = obj["채팅판"].ToString();
|
||
string item9 = obj["동영상"].ToString();
|
||
|
||
bool b1 = item1.Equals("N") ? false : true;
|
||
bool b2 = item2.Equals("N") ? false : true;
|
||
bool b3 = item3.Equals("N") ? false : true;
|
||
bool b4 = item4.Equals("N") ? false : true;
|
||
bool b5 = item5.Equals("N") ? false : true;
|
||
bool b6 = item6.Equals("N") ? false : true;
|
||
bool b7 = item7.Equals("N") ? false : true;
|
||
bool b8 = item8.Equals("N") ? false : true;
|
||
bool b9 = item9.Equals("N") ? false : true;
|
||
|
||
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
DoChangeAdjust(b1, b2, b3, b4, b5, b6, b7, b8, b9);
|
||
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
DoChangeAdjust(b1, b2, b3, b4, b5, b6, b7, b8, b9);
|
||
}
|
||
}
|
||
Thread.Sleep(1000);
|
||
|
||
|
||
for매진콜--;
|
||
|
||
if (for매진콜 < 0 && toggleSwitch주문콜전체.IsOn)
|
||
{
|
||
|
||
for매진콜 = 4;
|
||
|
||
string mcode = channel == "채널1" ? "TV01" : "TV05";
|
||
|
||
//string date1 = DateTime.Now.ToString("yyyyMMdd") + "000000";
|
||
//string date2 = DateTime.Now.AddDays(1).ToString("yyyyMMdd") + "000000";
|
||
|
||
|
||
//string date1 = DateTime.Now.AddHours(-6).ToString("yyyyMMddHHmmss");
|
||
//string date2 = DateTime.Now.AddHours(6).ToString("yyyyMMddHHmmss");
|
||
double 테스트시간 = Convert.ToDouble(textEdit1.Text);
|
||
기존조회시간 = DateTime.Now.AddHours(-테스트시간);
|
||
//기존조회시간 = DateTime.Now;
|
||
string date1 = 기존조회시간.AddHours(-6).ToString("yyyyMMddHHmmss");
|
||
string date2 = 기존조회시간.AddHours(6).ToString("yyyyMMddHHmmss");
|
||
//string date1 = 기존조회시간.AddHours(-6).ToString("yyyyMMddHHmmss");
|
||
//string date2 = 기존조회시간.AddHours(6).ToString("yyyyMMddHHmmss");
|
||
|
||
string urlAddOn = "&confirmYn=1";
|
||
//urlAddOn += "&livetalkYn=1";
|
||
requestURL = getURL() + "방송용/새데이터조회/방송편성?보낸사람=web&mediaCode=" + mcode + "&broadStartFromDate=" + date1 + "&broadStartToDate=" + date2 + urlAddOn;
|
||
|
||
request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
DateTime 조회시간 = Convert.ToDateTime(obj["조회시간"].ToString());
|
||
조회시간 = 조회시간.AddHours(-테스트시간); //임시
|
||
|
||
|
||
foreach (var v in (JArray)obj["scheduleChart"])
|
||
{
|
||
DateTime start = Convert.ToDateTime(v["startTime"].ToString());
|
||
DateTime end = Convert.ToDateTime(v["endTime"].ToString());
|
||
|
||
if (조회시간 > start && 조회시간 < end)
|
||
{
|
||
if (v["seqGFrameNo"] != null)
|
||
{
|
||
string seqGFrameNo = v["seqGFrameNo"].ToString();
|
||
string programName = v["programName"].ToString();
|
||
tapeTime = Convert.ToInt32(v["tapeTime"].ToString());
|
||
int duration = Convert.ToInt32(v["duration"].ToString());
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
set마진콜(start, end, seqGFrameNo, programName, 조회시간, duration);
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
set마진콜(start, end, seqGFrameNo, programName, 조회시간, duration);
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("Err : " + ex.Message); ;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
DateTime 기존조회시간 = DateTime.Now;
|
||
|
||
public class 매진정보C
|
||
{
|
||
|
||
public bool 전체매진 = false;
|
||
public bool 전체매진송출 = false;
|
||
public bool 전상담원통화 = false;
|
||
public bool 전상담원통화송출 = false;
|
||
public bool 자동주문유도 = false;
|
||
public bool 자동주문유도2 = false;
|
||
public bool 자동주문유도송출 = false;
|
||
public bool 카드프로모션송출 = false;
|
||
public bool VVIP송출 = false;
|
||
public bool VVIP전면송출 = false;
|
||
public bool 배송정보송출 = false;
|
||
public DateTime 배송송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
public DateTime VVIP송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
public DateTime VVIP전면송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
public List<상품C> 상품 = new List<상품C>();
|
||
public List<카드프로모션C> 카드프로모션 = new List<카드프로모션C>();
|
||
}
|
||
public class 상품C
|
||
{
|
||
public int 순서 = -1;
|
||
public string 상품명 = "";
|
||
public string 남녀 = "";
|
||
public string 배송 = "";
|
||
public bool 상품매진 = false;
|
||
public bool 상품매진송출 = false;
|
||
|
||
public List<세부상품C> 세부상품 = new List<세부상품C>();
|
||
}
|
||
public class 세부상품C
|
||
{
|
||
public string 세부상품코드 = "";
|
||
public string 세부상품명 = "";
|
||
public bool 세부매진 = false;
|
||
public bool 매진예상 = false;
|
||
public bool 주문집중 = false;
|
||
|
||
public string 누적주문량 = "0";
|
||
public string 주문량 = "0";
|
||
public string 주문량기록시간 = "";
|
||
public DateTime 이전주문량시간 = DateTime.Now;
|
||
public DateTime 현재주문량시간 = DateTime.Now;
|
||
public bool 세부매진송출 = false;
|
||
public bool 매진예상송출 = false;
|
||
public bool 주문집중송출 = false;
|
||
}
|
||
public class 카드프로모션C
|
||
{
|
||
private string _카드사 = "";
|
||
public string 카드사
|
||
{
|
||
get
|
||
{
|
||
string rtn = _카드사;
|
||
if (rtn.Length > 2)
|
||
{
|
||
rtn = rtn.Substring(0, 2).Replace("국민","KB") + Environment.NewLine + rtn.Substring(2);
|
||
}
|
||
if (_카드사.Equals("우리독자카드"))
|
||
{
|
||
rtn = rtn.Substring(0, 2) + Environment.NewLine + "카드";
|
||
}
|
||
|
||
return rtn;
|
||
}
|
||
set { _카드사 = value; }
|
||
}
|
||
public string 할인율 = "";
|
||
private string _기준적용금액 = "";
|
||
public string 기준적용금액
|
||
{
|
||
get {
|
||
string rtn = _기준적용금액;
|
||
try
|
||
{
|
||
rtn = (Convert.ToInt32(rtn) / 10000).ToString();
|
||
}
|
||
catch(Exception ex) { }
|
||
|
||
return rtn + "만원 이상 실 결제시, 1인 1일";
|
||
}
|
||
set { _기준적용금액 = value; }
|
||
}
|
||
public string _최대할인금액 = "";
|
||
public string 최대할인금액
|
||
{
|
||
get
|
||
{
|
||
string rtn = _최대할인금액;
|
||
try
|
||
{
|
||
rtn = (Convert.ToInt32(rtn) / 10000).ToString();
|
||
}
|
||
catch (Exception ex) { }
|
||
|
||
return "최대 할인 금액 "+ rtn + "만원 법인";
|
||
}
|
||
set
|
||
{
|
||
_최대할인금액 = value;
|
||
}
|
||
}
|
||
}
|
||
|
||
매진정보C 매진정보 = new 매진정보C();
|
||
string seq매진 = "";
|
||
|
||
bool CheckYN(object obj)
|
||
{
|
||
return obj.ToString().Equals("Y");
|
||
}
|
||
|
||
int tapeTime = 1200;
|
||
bool isRestTime = false;
|
||
|
||
public sealed class AbsoluteWindow
|
||
{
|
||
public DateTime StartLocal { get; }
|
||
public DateTime EndLocal { get; } // [StartLocal, EndLocal) 관례 (끝 미포함)
|
||
|
||
public AbsoluteWindow(DateTime startLocal, DateTime endLocal)
|
||
{
|
||
if (endLocal <= startLocal) throw new ArgumentException("End must be > Start");
|
||
|
||
StartLocal = startLocal;
|
||
EndLocal = endLocal;
|
||
}
|
||
|
||
public bool Contains(DateTime tLocal) =>
|
||
tLocal >= StartLocal && tLocal < EndLocal;
|
||
}
|
||
private static bool TryParseExtendedTime(string text, out TimeSpan span)
|
||
{
|
||
span = default;
|
||
if (!TryParseHMS(text, out int h, out int m, out int s)) return false;
|
||
// TimeSpan은 24시간 초과도 표현 가능
|
||
try
|
||
{
|
||
span = new TimeSpan(h, m, s);
|
||
return true;
|
||
}
|
||
catch { return false; }
|
||
}
|
||
|
||
private static bool TryParseHMS(string text, out int h, out int m, out int s)
|
||
{
|
||
h = m = s = 0;
|
||
if (string.IsNullOrWhiteSpace(text)) return false;
|
||
var parts = text.Split(':');
|
||
if (parts.Length != 3) return false;
|
||
return int.TryParse(parts[0], out h)
|
||
&& int.TryParse(parts[1], out m)
|
||
&& int.TryParse(parts[2], out s)
|
||
&& (m >= 0 && m < 60) && (s >= 0 && s < 60);
|
||
}
|
||
|
||
List<AbsoluteWindow> VVIP금지시각 = new List<AbsoluteWindow>();
|
||
List<카드프로모션C> 카드프로모션변경감지용 = new List<카드프로모션C>();
|
||
string 이전배송정보 = "";
|
||
|
||
public void set마진콜(DateTime start, DateTime end, string seq, string prm, DateTime 조회시간, int duration)
|
||
{
|
||
기존조회시간 = 조회시간;
|
||
|
||
bool isFirst = false;
|
||
|
||
if (seq매진 != seq || 매진정보.상품.Count < 1)
|
||
{
|
||
isRestTime = false;
|
||
isFirst = true;
|
||
매진정보 = new 매진정보C();
|
||
seq매진 = seq;
|
||
카드프로모션변경감지용 = new List<카드프로모션C>();
|
||
이전배송정보 = "";
|
||
|
||
VVIP금지시각 = new List<AbsoluteWindow>();
|
||
try
|
||
{
|
||
DateTime now = DateTime.Now;
|
||
string filePath = "VVIP\\" + now.ToString("yyMMdd") + ".csv";
|
||
DateTime baseDate = now.Date;
|
||
|
||
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||
using (var sr = new StreamReader(fs, Encoding.UTF8, detectEncodingFromByteOrderMarks: true))
|
||
using (var parser = new TextFieldParser(sr))
|
||
{
|
||
parser.TextFieldType = FieldType.Delimited;
|
||
parser.SetDelimiters(","); // CSV 구분자
|
||
parser.HasFieldsEnclosedInQuotes = true; // "값,값" 같은 케이스 처리
|
||
|
||
int rowIndex = 0;
|
||
while (!parser.EndOfData)
|
||
{
|
||
rowIndex++;
|
||
string[] fields = parser.ReadFields();
|
||
|
||
// 빈 줄/열 부족 스킵
|
||
if (fields == null || fields.Length < 2) continue;
|
||
|
||
string startText = fields[0]?.Trim() ?? "";
|
||
string endText = fields[1]?.Trim() ?? "";
|
||
|
||
// 헤더 가능성(예: "시작","종료")은 TryParse에서 걸러짐
|
||
if (!TryParseExtendedTime(startText, out var startSpan)) continue;
|
||
|
||
// 종료시각 계산 (24시 이상 허용)
|
||
if (!TryParseHMS(endText, out int h, out int m, out int s)) continue;
|
||
|
||
DateTime 금지시작시각 = baseDate.Add(startSpan);
|
||
DateTime 금지종료시각;
|
||
|
||
if (h >= 24)
|
||
{
|
||
금지종료시각 = baseDate.AddDays(1).AddHours(h - 24).AddMinutes(m).AddSeconds(s);
|
||
}
|
||
else
|
||
{
|
||
금지종료시각 = baseDate.AddHours(h).AddMinutes(m).AddSeconds(s);
|
||
}
|
||
|
||
try
|
||
{
|
||
VVIP금지시각.Add(new AbsoluteWindow(금지시작시각, 금지종료시각));
|
||
}
|
||
catch { /* 구간 유효성 오류는 무시 */ }
|
||
}
|
||
}
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
|
||
}
|
||
}
|
||
|
||
lblstartTime.Text = start.ToString();
|
||
lblendTime.Text = end.ToString();
|
||
lblseqGFrameNo.Text = seq;
|
||
lblprogramName.Text = prm;
|
||
|
||
|
||
TimeSpan timeSpanStart = 조회시간 - start;
|
||
TimeSpan timeSpan = end - 조회시간;
|
||
int noStart = Convert.ToInt32(txtNoCGStart.Text);
|
||
int noEnd = Convert.ToInt32(txtNoCGEnd.Text);
|
||
|
||
bool noTimeCheck(int min, bool isSec = false)
|
||
{
|
||
double 방송시각 = timeSpanStart.TotalSeconds;
|
||
double 남은종료시간 = timeSpan.TotalSeconds;
|
||
int sec = isSec ? min : min * 60;
|
||
//처음과 끝 검사
|
||
if (방송시각 < sec) return true;
|
||
|
||
|
||
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
var newTapeTime = tapeTime * i;
|
||
|
||
//1번째 VOD 앞
|
||
if (방송시각 > newTapeTime)
|
||
if (방송시각 < newTapeTime + sec) return true;
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
bool noCGTimeCheck()
|
||
{
|
||
double 방송시각 = timeSpanStart.TotalSeconds;
|
||
double 남은종료시간 = timeSpan.TotalSeconds;
|
||
|
||
//처음과 끝 검사
|
||
if (방송시각 < noStart) return true;
|
||
if (남은종료시간 < noEnd) return true;
|
||
|
||
|
||
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
var newTapeTime = tapeTime * i;
|
||
|
||
//1번째 VOD 앞
|
||
if (방송시각 > newTapeTime)
|
||
if (방송시각 < newTapeTime + noStart) return true;
|
||
//1번째 VOD 뒤
|
||
if (남은종료시간 > newTapeTime)
|
||
if (남은종료시간 < newTapeTime + noEnd) return true;
|
||
}
|
||
|
||
//Console.WriteLine(DateTime.Now.ToString("HHmmss") + " : 매진송출 가능");
|
||
|
||
return false;
|
||
}
|
||
|
||
if (noCGTimeCheck())
|
||
{
|
||
//Console.WriteLine(DateTime.Now.ToString("HHmmss") + " : 매진송출 불가능");
|
||
|
||
if (!isRestTime) KAEngine.UnloadAll();
|
||
|
||
isRestTime = true;
|
||
for매진콜 = 4;
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
|
||
|
||
|
||
if (toggleSwitch매진팁.IsOn)
|
||
{
|
||
KAScenePlayer.Prepare(Layer12, KAScene);
|
||
KAScenePlayer.Play(Layer12);
|
||
}
|
||
|
||
|
||
if (toggleSwitch카드프로모션.IsOn)
|
||
{
|
||
KAScenePlayer.Prepare(Layer13, KAScene);
|
||
KAScenePlayer.Play(Layer13);
|
||
}
|
||
|
||
if (toggleSwitch배송정보.IsOn)
|
||
{
|
||
KAScenePlayer.Prepare(Layer14, KAScene);
|
||
KAScenePlayer.Play(Layer14);
|
||
}
|
||
|
||
if (toggleSwitchVVIP.IsOn || toggleSwitchVVIP전면.IsOn)
|
||
{
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
}
|
||
|
||
timer4.Stop();
|
||
timer5.Stop();
|
||
timer6.Stop();
|
||
timer7.Stop();
|
||
매진정보.카드프로모션송출 = false;
|
||
매진정보.VVIP송출 = false;
|
||
매진정보.VVIP전면송출 = false;
|
||
매진정보.배송정보송출 = false;
|
||
|
||
richTextBox1.Text = "미송출 시간이므로 콜 데이터와 매진 데이터를 수신하지 않습니다.";
|
||
|
||
return;
|
||
}
|
||
|
||
//매진정보 조회try{try
|
||
try
|
||
{
|
||
//http://inf.shinsegaetvshopping.com/broadcast/callScheduleChart?mediaCode=TV05&broadStartFromDate=20240711000000&broadStartToDate=20240712000000
|
||
//mediaCode=" + mcode + "&broadStartFromDate=" + date1 + "&broadStartToDate=" + date2 + urlAddOn;
|
||
//seq = "1000150039";
|
||
string requestURL = getURL() + @"방송용/새데이터조회/매진조회?보낸사람=코더&seqGFrameNo=" + seq;
|
||
//+ "&broadStartFromDate=" + start.ToString("yyyyMMddhhmmss") + "&broadStartToDate=" + end.ToString("yyyyMMddhhmmss");
|
||
|
||
var request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
if (data != "" && !data.Contains("조회된 내역이 없습니다"))
|
||
{
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
richTextBox1.Text = obj["cgGoodsList"].ToString();
|
||
|
||
//상품에 남녀가 둘다 있는지 여부를 확인해야 한다.
|
||
string allGenderGb = "";
|
||
|
||
foreach (var v in (JArray)obj["cgGoodsList"])
|
||
{
|
||
int displayPriority = Convert.ToInt16(v["displayPriority"].ToString());
|
||
string mobileGoodsName = v["mobileGoodsName"].ToString().Trim();
|
||
bool 상품매진 = CheckYN(v["soldOut"]);
|
||
string genderGb = v["genderGb"].ToString();
|
||
string deliveryName = v["deliveryName"].ToString();
|
||
|
||
if (isFirst)
|
||
{
|
||
상품C 상품 = new 상품C();
|
||
상품.순서 = displayPriority;
|
||
상품.상품명 = mobileGoodsName;
|
||
상품.상품매진 = 상품매진;
|
||
상품.상품매진송출 = 상품매진;
|
||
상품.남녀 = genderGb;
|
||
상품.배송 = deliveryName;
|
||
매진정보.상품.Add(상품);
|
||
|
||
allGenderGb += genderGb;
|
||
}
|
||
else
|
||
{
|
||
if (상품매진 == true) 매진정보.상품.Find(x => x.순서 == displayPriority).상품매진 = 상품매진;
|
||
매진정보.상품.Find(x => x.순서 == displayPriority).배송 = deliveryName;
|
||
}
|
||
|
||
|
||
foreach (var d in (JArray)v["cgGoodsdtList"])
|
||
{
|
||
var 현재상품 = 매진정보.상품.Find(x => x.순서.Equals(displayPriority));
|
||
|
||
|
||
string goodsdtName = d["goodsdtName"].ToString().Trim();
|
||
string goodsdtCode = d["goodsdtCode"].ToString();
|
||
bool expectSoldOut = CheckYN(d["expectSoldOut"]);
|
||
bool soldOut = CheckYN(d["soldOut"]);
|
||
string orderConcent = d["orderConcent"].ToString();
|
||
string aggregatedTime = d["aggregatedTime"].ToString().Substring(0,14);
|
||
|
||
|
||
if (isFirst)
|
||
{
|
||
var 세부상품 = new 세부상품C();
|
||
세부상품.세부상품코드 = goodsdtCode;
|
||
세부상품.세부상품명 = goodsdtName;
|
||
세부상품.매진예상 = expectSoldOut;
|
||
세부상품.매진예상송출 = expectSoldOut;
|
||
세부상품.세부매진 = soldOut;
|
||
세부상품.세부매진송출 = false; // 24.10.14 - 수정
|
||
세부상품.누적주문량 = orderConcent;
|
||
세부상품.주문량 = orderConcent;
|
||
세부상품.주문량기록시간 = aggregatedTime;
|
||
세부상품.이전주문량시간 = DateTime.Now;
|
||
|
||
현재상품.세부상품.Add(세부상품);
|
||
|
||
|
||
}
|
||
else
|
||
{
|
||
var 현재세부상품 = 현재상품.세부상품.Find(x => x.세부상품코드.Equals(goodsdtCode));
|
||
//현재세부상품.세부상품명 = goodsdtName;
|
||
현재세부상품.매진예상 = expectSoldOut;
|
||
if (soldOut == true) 현재세부상품.세부매진 = soldOut;
|
||
|
||
if (현재세부상품.주문량기록시간 != aggregatedTime)
|
||
{
|
||
현재세부상품.누적주문량 = (Convert.ToInt32(현재세부상품.누적주문량) + Convert.ToInt32(orderConcent)).ToString();
|
||
현재세부상품.주문량 = orderConcent;
|
||
현재세부상품.주문량기록시간 = aggregatedTime;
|
||
}
|
||
|
||
현재세부상품.현재주문량시간 = DateTime.Now;
|
||
}
|
||
}
|
||
}
|
||
|
||
//남녀표기 여부를 위한 재 확인 작업
|
||
if (isFirst)
|
||
{
|
||
bool 남녀표기여부 = false;
|
||
//남녀가 중복되었는지 여부를 기록해 놓는다
|
||
if (allGenderGb.Contains("M") && allGenderGb.Contains("F")) 남녀표기여부 = true;
|
||
|
||
foreach (var v in (JArray)obj["cgGoodsList"])
|
||
{
|
||
int displayPriority = Convert.ToInt16(v["displayPriority"].ToString());
|
||
var 타겟상품 = 매진정보.상품.Find(x => x.순서 == displayPriority);
|
||
|
||
if (남녀표기여부)
|
||
{
|
||
if (타겟상품.남녀.Contains("M")) 타겟상품.남녀 = "[남] ";
|
||
if (타겟상품.남녀.Contains("F")) 타겟상품.남녀 = "[여] ";
|
||
}
|
||
else 타겟상품.남녀 = "";
|
||
}
|
||
}
|
||
|
||
if (obj["cgCardPromoList"] != null)
|
||
{
|
||
richTextBox1.Text += obj["cgCardPromoList"].ToString();
|
||
|
||
//if (isFirst)
|
||
{
|
||
매진정보.카드프로모션 = new List<카드프로모션C>();
|
||
|
||
foreach (var d in (JArray)obj["cgCardPromoList"])
|
||
{
|
||
var 카드프로모션 = new 카드프로모션C();
|
||
카드프로모션.카드사 = d["cardName"].ToString();
|
||
카드프로모션.할인율 = d["doRate"].ToString();
|
||
카드프로모션.기준적용금액 = d["appAmt"].ToString();
|
||
카드프로모션.최대할인금액 = d["limitAmt"].ToString();
|
||
|
||
매진정보.카드프로모션.Add(카드프로모션);
|
||
}
|
||
|
||
if (매진정보.카드프로모션.Count > 1)
|
||
{
|
||
//2개라고 가정하고 카드사 확인 후 할인율을 기준으로 삭제한다.
|
||
if (매진정보.카드프로모션[0].카드사 == 매진정보.카드프로모션[1].카드사)
|
||
{
|
||
if (Convert.ToInt32(매진정보.카드프로모션[0].할인율) > Convert.ToInt32(매진정보.카드프로모션[1].할인율))
|
||
매진정보.카드프로모션.RemoveAt(1);
|
||
else
|
||
매진정보.카드프로모션.RemoveAt(0);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
richTextBox1.Text = "조회내역이 없습니다..";
|
||
}
|
||
}
|
||
|
||
int 테스트강제매진 = 0;
|
||
int 테스트강제매진예상 = 0;
|
||
int 테스트강제주문집중 = 0;
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
if (comboBox4.SelectedIndex > 테스트강제매진)
|
||
{
|
||
세부상품.세부매진 = true;
|
||
테스트강제매진++;
|
||
}
|
||
if (comboBox5.SelectedIndex > 테스트강제매진예상)
|
||
{
|
||
세부상품.매진예상 = true;
|
||
테스트강제매진예상++;
|
||
}
|
||
if (comboBox6.SelectedIndex > 테스트강제주문집중)
|
||
{
|
||
세부상품.주문집중 = true;
|
||
테스트강제주문집중++;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
//콜 데이터 조회
|
||
requestURL = getURL() + "방송용/새데이터조회/콜데이터조회?보낸사람=코더&seqGFrameNo=" + seq;
|
||
|
||
request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
if (data != "" && !data.Contains("조회된 내역이 없습니다"))
|
||
{
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
int inqueue = 0;
|
||
int onacd = 0;
|
||
|
||
foreach (var v in (JArray)obj["broadCallInfo"])
|
||
{
|
||
inqueue = Convert.ToInt32(v["inqueue"].ToString());
|
||
onacd = Convert.ToInt32(v["onacd"].ToString());
|
||
}
|
||
|
||
lblinqueue.Text = inqueue.ToString();
|
||
lblonacd.Text = onacd.ToString();
|
||
|
||
매진정보.자동주문유도 = inqueue >= Convert.ToInt32(txtonacd.Text);
|
||
매진정보.자동주문유도2 = inqueue >= Convert.ToInt32(txtonacd2.Text);
|
||
매진정보.전상담원통화 = inqueue > 0;
|
||
}
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
}
|
||
|
||
//상품순서 재정리
|
||
매진정보.상품.Sort((x,y) => x.순서.CompareTo(y.순서));
|
||
|
||
for매진콜 = Convert.ToInt32(txtBarSec.Text) + Convert.ToInt32(txtCGSec.Text);
|
||
|
||
//송출검사파트
|
||
if (매진정보.전체매진송출) return;
|
||
if (매진정보.상품.Count > 0 && 매진정보.상품.Find(x => x.상품매진.Equals(false)) == null) 매진정보.전체매진 = true;
|
||
|
||
for매진콜아웃 = Convert.ToInt32(txtBarSec.Text);
|
||
timer4.Start();
|
||
|
||
|
||
//카드프로모션
|
||
bool isSame(List<카드프로모션C> 프로모션1, List<카드프로모션C> 프로모션2)
|
||
{
|
||
if (프로모션1.Count != 프로모션2.Count) return false;
|
||
for (int i = 0; i < 프로모션1.Count; i++)
|
||
{
|
||
if (프로모션1[i].할인율 != 프로모션2[i].할인율) return false;
|
||
if (프로모션1[i].카드사 != 프로모션2[i].카드사) return false;
|
||
if (프로모션1[i].최대할인금액 != 프로모션2[i].최대할인금액) return false;
|
||
if (프로모션1[i].기준적용금액 != 프로모션2[i].기준적용금액) return false;
|
||
if (프로모션1[i]._최대할인금액 != 프로모션2[i]._최대할인금액) return false;
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
if (매진정보.카드프로모션.Count > 0 && toggleSwitch카드프로모션.IsOn && duration > 1900)
|
||
{
|
||
if (!매진정보.카드프로모션송출 || !isSame(카드프로모션변경감지용, 매진정보.카드프로모션))
|
||
{
|
||
카드프로모션변경감지용 = 매진정보.카드프로모션;
|
||
|
||
if (매진정보.카드프로모션.Count == 1)
|
||
{
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\카드프로모션1.t2s", "카드프로모션1");
|
||
|
||
|
||
KAScene.GetObject("cardName1").SetValue(매진정보.카드프로모션[0].카드사);
|
||
KAScene.GetObject("doRate1").SetValue(매진정보.카드프로모션[0].할인율);
|
||
KAScene.GetObject("appAmt1_1").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
KAScene.GetObject("limitAmt1").SetValue(매진정보.카드프로모션[0].최대할인금액);
|
||
KAScene.GetObject("appAmt1_2").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
|
||
}
|
||
else
|
||
{
|
||
|
||
if (매진정보.카드프로모션[0].할인율 == 매진정보.카드프로모션[1].할인율 && 매진정보.카드프로모션[0].기준적용금액 == 매진정보.카드프로모션[1].기준적용금액 && 매진정보.카드프로모션[0].최대할인금액 == 매진정보.카드프로모션[1].최대할인금액)
|
||
{
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\카드프로모션2.t2s", "카드프로모션2");
|
||
|
||
string cardText = 매진정보.카드프로모션[0].카드사.Substring(0, 2) + Environment.NewLine + 매진정보.카드프로모션[1].카드사.Substring(0, 2);
|
||
|
||
if (매진정보.카드프로모션[0].카드사.Substring(0, 2).Equals(매진정보.카드프로모션[1].카드사.Substring(0, 2)))
|
||
cardText = 매진정보.카드프로모션[0].카드사.Substring(0, 2) + Environment.NewLine + "카드";
|
||
|
||
KAScene.GetObject("cardName1").SetValue(cardText);
|
||
KAScene.GetObject("doRate1").SetValue(매진정보.카드프로모션[0].할인율);
|
||
KAScene.GetObject("appAmt1_1").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
KAScene.GetObject("limitAmt1").SetValue(매진정보.카드프로모션[0].최대할인금액);
|
||
KAScene.GetObject("appAmt1_2").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
}
|
||
else
|
||
{
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\카드프로모션.t2s", "카드프로모션");
|
||
|
||
KAScene.GetObject("cardName1").SetValue(매진정보.카드프로모션[0].카드사);
|
||
KAScene.GetObject("doRate1").SetValue(매진정보.카드프로모션[0].할인율);
|
||
KAScene.GetObject("appAmt1_1").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
KAScene.GetObject("limitAmt1").SetValue(매진정보.카드프로모션[0].최대할인금액);
|
||
KAScene.GetObject("appAmt1_2").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
|
||
KAScene.GetObject("cardName2").SetValue(매진정보.카드프로모션[1].카드사);
|
||
KAScene.GetObject("doRate2").SetValue(매진정보.카드프로모션[1].할인율);
|
||
KAScene.GetObject("appAmt2_1").SetValue(매진정보.카드프로모션[1].기준적용금액);
|
||
KAScene.GetObject("limitAmt2").SetValue(매진정보.카드프로모션[1].최대할인금액);
|
||
|
||
KAScene.GetObject("appAmt2_2").SetValue(매진정보.카드프로모션[0].기준적용금액);
|
||
}
|
||
}
|
||
|
||
|
||
KAScenePlayer.Prepare(Layer13, KAScene);
|
||
KAScenePlayer.Play(Layer13);
|
||
|
||
매진정보.카드프로모션송출 = true;
|
||
}
|
||
}
|
||
|
||
//배송정보
|
||
if (toggleSwitch배송정보.IsOn)
|
||
{
|
||
if (!noTimeCheck(Convert.ToInt32(txtNoDelivery.Text)))
|
||
{
|
||
try
|
||
{
|
||
//배송 정보가 있는지 부터 확인
|
||
string 배송정보 = "";
|
||
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
if (상품.배송 == "오늘") 배송정보 = "오늘";
|
||
else if (상품.배송 == "내일") 배송정보 = "내일";
|
||
else if (상품.배송 == "일요") 배송정보 = "일요";
|
||
}
|
||
|
||
if (배송정보 != "")
|
||
{
|
||
if ((DateTime.Now - 매진정보.배송송출시각).TotalSeconds > Convert.ToInt32(txtDeliveryTerm.Text) * 60 ||
|
||
이전배송정보 != 배송정보) //송출중인지 확인
|
||
{
|
||
매진정보.배송송출시각 = DateTime.Now;
|
||
이전배송정보 = 배송정보;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\" + 배송정보 + "도착.t2s", 배송정보 + "도착");
|
||
|
||
KAScenePlayer.Prepare(Layer14, KAScene);
|
||
KAScenePlayer.Play(Layer14);
|
||
|
||
매진정보.배송정보송출 = true;
|
||
for배송정보아웃 = Convert.ToInt32(txtDeliverySec.Text);
|
||
timer6.Start();
|
||
}
|
||
}
|
||
else
|
||
{
|
||
for배송정보아웃 = 0;
|
||
이전배송정보 = "";
|
||
}
|
||
}
|
||
catch (Exception ex) { }
|
||
}
|
||
}
|
||
|
||
|
||
//VVIP
|
||
bool VVIP송출가능여부 = true;
|
||
foreach(var v in VVIP금지시각)
|
||
{
|
||
if (v.Contains(DateTime.Now))
|
||
{
|
||
VVIP송출가능여부 = false;
|
||
}
|
||
}
|
||
|
||
//바 VVIP
|
||
if (toggleSwitchVVIP.IsOn && VVIP송출가능여부)
|
||
{
|
||
if (!noTimeCheck(Convert.ToInt32(txtNoVVIP.Text)))
|
||
{
|
||
if (!매진정보.VVIP전면송출 && !매진정보.VVIP송출)
|
||
{
|
||
if ((DateTime.Now - 매진정보.VVIP송출시각).TotalSeconds > Convert.ToInt32(txtVVIPTerm.Text))
|
||
{
|
||
try
|
||
{
|
||
//http://inf.shinsegaetvshopping.com/broadcast/callScheduleChart?mediaCode=TV05&broadStartFromDate=20240711000000&broadStartToDate=20240712000000
|
||
string requestURL = getURL() + @"방송용/새데이터조회/방송VVIP?보낸사람=코더&seqGFrameNo=" + seq;
|
||
|
||
var request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
if (data != "" && !data.Contains("조회된 내역이 없습니다"))
|
||
{
|
||
JObject obj = JObject.Parse(data);
|
||
string 상품판매가 = obj["salePrice"].ToString();
|
||
string 할부조건 = obj["norestAllotMonths"].ToString();
|
||
string 최종할인가 = obj["bestPrice"].ToString();
|
||
string 선택사항 = obj["choiceGoods"].ToString();
|
||
string 할인쿠폰적용여부 = obj["vvipCoupon"].ToString();
|
||
string 맴버십할인여부 = obj["vvipMembership"].ToString();
|
||
string 맴버십할인액 = obj["vvipMembershipDcAmt"].ToString();
|
||
string 행사카드할인율 = obj["cardDcRate"].ToString();
|
||
string 일시불할인액 = obj["payInFullDcAmt"].ToString();
|
||
string 자동주문할인액 = obj["arsDcAmt"].ToString();
|
||
string 총할인액 = obj["totalDcAmt"].ToString();
|
||
string 즉시할인액 = obj["immediateDcAmt"].ToString();
|
||
string 카드할인액 = obj["cardDcAmt"].ToString();
|
||
string 맴버십쿠폰할인액 = obj["vvipCouponDcAmt"] == null ? "0" : obj["vvipCouponDcAmt"].ToString();
|
||
|
||
|
||
|
||
|
||
string tt = "[salePrice]상품판매가 : " + 상품판매가 + Environment.NewLine;
|
||
tt += "[norestAllotMonths]할부조건 : " + 할부조건 + Environment.NewLine;
|
||
tt += "[bestPrice]최종할인가 : " + 최종할인가 + Environment.NewLine;
|
||
tt += "[choiceGoods]선택사항 : " + 선택사항 + Environment.NewLine;
|
||
tt += "[vvipCoupon]할인쿠폰적용여부 : " + 할인쿠폰적용여부 + Environment.NewLine;
|
||
tt += "[vvipMembership]맴버십할인여부 : " + 맴버십할인여부 + Environment.NewLine;
|
||
tt += "[vvipMembershipDcAmt]맴버십할인액 : " + 맴버십할인액 + Environment.NewLine;
|
||
tt += "[cardDcRate]행사카드할인율 : " + 행사카드할인율 + Environment.NewLine;
|
||
tt += "[payInFullDcAmt]일시불할인액 : " + 일시불할인액 + Environment.NewLine;
|
||
tt += "[arsDcAmt]자동주문할인액 : " + 자동주문할인액 + Environment.NewLine;
|
||
tt += "[totalDcAmt]총할인액 : " + 총할인액 + Environment.NewLine;
|
||
tt += "[immediateDcAmt]즉시할인액 : " + 즉시할인액 + Environment.NewLine;
|
||
tt += "[cardDcAmt]카드할인액 : " + 카드할인액 + Environment.NewLine;
|
||
tt += "[vvipCouponDcAmt]맴버십쿠폰할인액 : " + 맴버십쿠폰할인액 + Environment.NewLine;
|
||
|
||
//richTextBox2.Text = tt;
|
||
richTextBox2.Text = obj.ToString();
|
||
|
||
|
||
if (할인쿠폰적용여부 == "적용" && 맴버십할인액 != "0" && 행사카드할인율 == "5")
|
||
{
|
||
//VVIP 송출 정보
|
||
매진정보.VVIP송출시각 = DateTime.Now;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\(5프로)vvip바.t2s", "VVIP바");
|
||
|
||
|
||
string 원변환(string s)
|
||
{
|
||
int ii = Convert.ToInt32(s);
|
||
return "- " + ii.ToString("#,##0") + "원";
|
||
}
|
||
|
||
int 상품판매가int = Convert.ToInt32(상품판매가);
|
||
string 상품판매가Str = 상품판매가int.ToString("#,##0");
|
||
int 최종할인가int = Convert.ToInt32(최종할인가);
|
||
string 최종할인가Str = 최종할인가int.ToString("#,##0");
|
||
KAScene.GetObject("salePrice").SetValue(상품판매가Str + "원");
|
||
|
||
KAScene.GetObject("price2").SetValue(최종할인가Str);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(0, 상품판매가int);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(1, 최종할인가int);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(2, 최종할인가int);
|
||
|
||
List<KeyValuePair<string, string>> dics = new List<KeyValuePair<string, string>>();
|
||
|
||
if (자동주문할인액 != "0") dics.Add(new KeyValuePair<string, string>("자동주문", 원변환(자동주문할인액)));
|
||
if (맴버십쿠폰할인액 != "0") dics.Add(new KeyValuePair<string, string>("멤버십 쿠폰 6%", 원변환(맴버십쿠폰할인액)));
|
||
if (일시불할인액 != "0") dics.Add(new KeyValuePair<string, string>("일시불", 원변환(일시불할인액)));
|
||
if (맴버십할인액 != "0") dics.Add(new KeyValuePair<string, string>("맴버십 할인 5%", 원변환(맴버십할인액)));
|
||
if (행사카드할인율 != "0") dics.Add(new KeyValuePair<string, string>("행사카드 5%", 원변환(카드할인액)));
|
||
dics.Add(new KeyValuePair<string, string>("", ""));
|
||
dics.Add(new KeyValuePair<string, string>(" ", " "));
|
||
dics.Add(new KeyValuePair<string, string>(" ", " "));
|
||
|
||
for (int i = 0; i < 5; i++)
|
||
{
|
||
string key = dics[i].Key;
|
||
string value = dics[i].Value;
|
||
|
||
KAScene.GetObject("sub" + (i + 1)).SetValue(key);
|
||
KAScene.GetObject("txt" + (i + 1)).SetValue(value);
|
||
}
|
||
|
||
if (선택사항 != "없음")
|
||
{
|
||
KAScene.GetObject("title").SetValue("(" + 선택사항 + ")");
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject("title").SetValue("");
|
||
}
|
||
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
|
||
매진정보.VVIP송출 = true;
|
||
forVVIP아웃 = Convert.ToInt32(txtVVIPSec.Text);
|
||
timer7.Start();
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//전면VVIP
|
||
if (toggleSwitchVVIP전면.IsOn && VVIP송출가능여부)
|
||
{
|
||
|
||
if (!noTimeCheck(Convert.ToInt32(txtNoVVIP전면.Text), true))
|
||
{
|
||
if (!매진정보.VVIP전면송출 && !매진정보.VVIP송출)
|
||
{
|
||
if ((DateTime.Now - 매진정보.VVIP전면송출시각).TotalSeconds > Convert.ToInt32(txtVVIPTerm전면.Text))
|
||
{
|
||
try
|
||
{
|
||
//http://inf.shinsegaetvshopping.com/broadcast/callScheduleChart?mediaCode=TV05&broadStartFromDate=20240711000000&broadStartToDate=20240712000000
|
||
string requestURL = getURL() + @"방송용/새데이터조회/방송VVIP?보낸사람=코더&seqGFrameNo=" + seq;
|
||
|
||
var request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
if (data != "" && !data.Contains("조회된 내역이 없습니다"))
|
||
{
|
||
JObject obj = JObject.Parse(data);
|
||
string 상품판매가 = obj["salePrice"].ToString();
|
||
string 할부조건 = obj["norestAllotMonths"].ToString();
|
||
string 최종할인가 = obj["bestPrice"].ToString();
|
||
string 선택사항 = obj["choiceGoods"].ToString();
|
||
string 할인쿠폰적용여부 = obj["vvipCoupon"].ToString();
|
||
string 맴버십할인여부 = obj["vvipMembership"].ToString();
|
||
string 맴버십할인액 = obj["vvipMembershipDcAmt"].ToString();
|
||
string 행사카드할인율 = obj["cardDcRate"].ToString();
|
||
string 일시불할인액 = obj["payInFullDcAmt"].ToString();
|
||
string 자동주문할인액 = obj["arsDcAmt"].ToString();
|
||
string 총할인액 = obj["totalDcAmt"].ToString();
|
||
string 즉시할인액 = obj["immediateDcAmt"].ToString();
|
||
string 카드할인액 = obj["cardDcAmt"].ToString();
|
||
string 맴버십쿠폰할인액 = obj["vvipCouponDcAmt"] == null ? "0" : obj["vvipCouponDcAmt"].ToString();
|
||
|
||
|
||
|
||
|
||
string tt = "[salePrice]상품판매가 : " + 상품판매가 + Environment.NewLine;
|
||
tt += "[norestAllotMonths]할부조건 : " + 할부조건 + Environment.NewLine;
|
||
tt += "[bestPrice]최종할인가 : " + 최종할인가 + Environment.NewLine;
|
||
tt += "[choiceGoods]선택사항 : " + 선택사항 + Environment.NewLine;
|
||
tt += "[vvipCoupon]할인쿠폰적용여부 : " + 할인쿠폰적용여부 + Environment.NewLine;
|
||
tt += "[vvipMembership]맴버십할인여부 : " + 맴버십할인여부 + Environment.NewLine;
|
||
tt += "[vvipMembershipDcAmt]맴버십할인액 : " + 맴버십할인액 + Environment.NewLine;
|
||
tt += "[cardDcRate]행사카드할인율 : " + 행사카드할인율 + Environment.NewLine;
|
||
tt += "[payInFullDcAmt]일시불할인액 : " + 일시불할인액 + Environment.NewLine;
|
||
tt += "[arsDcAmt]자동주문할인액 : " + 자동주문할인액 + Environment.NewLine;
|
||
tt += "[totalDcAmt]총할인액 : " + 총할인액 + Environment.NewLine;
|
||
tt += "[immediateDcAmt]즉시할인액 : " + 즉시할인액 + Environment.NewLine;
|
||
tt += "[cardDcAmt]카드할인액 : " + 카드할인액 + Environment.NewLine;
|
||
tt += "[vvipCouponDcAmt]맴버십쿠폰할인액 : " + 맴버십쿠폰할인액 + Environment.NewLine;
|
||
|
||
//richTextBox2.Text = tt;
|
||
richTextBox2.Text = obj.ToString();
|
||
|
||
|
||
if (할인쿠폰적용여부 == "적용" && 맴버십할인액 != "0" && 행사카드할인율 == "5")
|
||
{
|
||
//VVIP 송출 정보
|
||
매진정보.VVIP전면송출시각 = DateTime.Now;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\(5프로)vvip전면.t2s", "VVIP전면");
|
||
|
||
|
||
string 원변환(string s)
|
||
{
|
||
int ii = Convert.ToInt32(s);
|
||
return "- " + ii.ToString("#,##0") + "원";
|
||
}
|
||
|
||
int 상품판매가int = Convert.ToInt32(상품판매가);
|
||
string 상품판매가Str = 상품판매가int.ToString("#,##0");
|
||
int 최종할인가int = Convert.ToInt32(최종할인가);
|
||
string 최종할인가Str = 최종할인가int.ToString("#,##0");
|
||
KAScene.GetObject("salePrice").SetValue(상품판매가Str + "원");
|
||
|
||
KAScene.GetObject("price2").SetValue(최종할인가Str);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(0, 상품판매가int);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(1, 최종할인가int);
|
||
KAScene.GetObject("price1").SetCounterNumberKey(2, 최종할인가int);
|
||
|
||
List<KeyValuePair<string, string>> dics = new List<KeyValuePair<string, string>>();
|
||
|
||
if (자동주문할인액 != "0") dics.Add(new KeyValuePair<string, string>("자동주문", 원변환(자동주문할인액)));
|
||
if (맴버십쿠폰할인액 != "0") dics.Add(new KeyValuePair<string, string>("멤버십 쿠폰 6%", 원변환(맴버십쿠폰할인액)));
|
||
if (즉시할인액 != "0") dics.Add(new KeyValuePair<string, string>("일시불", 원변환(즉시할인액)));
|
||
if (맴버십할인액 != "0") dics.Add(new KeyValuePair<string, string>("맴버십 할인 5%", 원변환(맴버십할인액)));
|
||
if (행사카드할인율 != "0") dics.Add(new KeyValuePair<string, string>("행사카드 5%", 원변환(카드할인액)));
|
||
dics.Add(new KeyValuePair<string, string>("", ""));
|
||
dics.Add(new KeyValuePair<string, string>(" ", " "));
|
||
dics.Add(new KeyValuePair<string, string>(" ", " "));
|
||
|
||
for (int i = 0; i < 5; i++)
|
||
{
|
||
string key = dics[i].Key;
|
||
string value = dics[i].Value;
|
||
|
||
KAScene.GetObject("sub" + (i + 1)).SetValue(key);
|
||
KAScene.GetObject("txt" + (i + 1)).SetValue(value);
|
||
}
|
||
|
||
|
||
if (선택사항 != "없음")
|
||
{
|
||
KAScene.GetObject("title").SetValue("(" + 선택사항 +")");
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject("title").SetValue("");
|
||
}
|
||
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
|
||
매진정보.VVIP전면송출 = true;
|
||
forVVIP전면아웃 = Convert.ToInt32(txtVVIP전면Sec.Text);
|
||
timer8.Start();
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//전체매진
|
||
if (매진정보.전체매진 && toggleSwitch전체매진.IsOn)
|
||
{
|
||
매진정보.전체매진송출 = true;
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\전체매진.t2s", "전체매진");
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
timer4.Stop();
|
||
return;
|
||
}
|
||
|
||
//매진예상
|
||
List<string[]> 매진예상 = new List<string[]>();
|
||
foreach(var 상품 in 매진정보.상품)
|
||
{
|
||
string 상품명 = 상품.상품명;
|
||
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
//이미 매진이라면 매진예상이 아닌 매진으로 송출한다.
|
||
if (!세부상품.세부매진 && 세부상품.매진예상 && !세부상품.매진예상송출)
|
||
{
|
||
매진예상.Add(new string[] { 상품.순서.ToString(), 세부상품.세부상품코드 });
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
if (매진예상.Count > 0 && toggleSwitch매진예상.IsOn)
|
||
{
|
||
List<string> 송출텍스트 = new List<string>();
|
||
var 상품 = 매진정보.상품.Find(x => x.순서.ToString().Equals(매진예상[0][0]));
|
||
var 세부상품 = 상품.세부상품.Find(x => x.세부상품코드.Equals(매진예상[0][1]));
|
||
세부상품.매진예상송출 = true;
|
||
if (세부상품.세부상품명.Equals("단일상품"))
|
||
{
|
||
송출텍스트.Add(상품.상품명);
|
||
}
|
||
else
|
||
{
|
||
송출텍스트.Add("<선택" + 상품.순서.ToString() + ">");
|
||
송출텍스트.Add(상품.남녀 + 상품.상품명);
|
||
송출텍스트.Add(세부상품.세부상품명);
|
||
}
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\매진예상"+ 송출텍스트.Count +"줄.t2s", "매진예상" + 송출텍스트.Count);
|
||
|
||
KAScene.GetObject("txt1").SetValue(송출텍스트[0]);
|
||
if (송출텍스트.Count > 1) {
|
||
KAScene.GetObject("txt2").SetValue(송출텍스트[1]);
|
||
KAScene.GetObject("txt3").SetValue(송출텍스트[2]);
|
||
}
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
return;
|
||
}
|
||
//단품매진
|
||
List<string[]> 단품매진 = new List<string[]>();
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
string 상품명 = 상품.상품명;
|
||
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
//세부상품.세부매진 = true; //임시
|
||
//이미 매진이라면 매진예상이 아닌 매진으로 송출한다.
|
||
if (세부상품.세부매진 && !세부상품.세부매진송출)
|
||
{
|
||
단품매진.Add(new string[] { 상품.순서.ToString(), 세부상품.세부상품코드 });
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
if (단품매진.Count > 0 && toggleSwitch매진.IsOn)
|
||
{
|
||
List<string> 송출텍스트 = new List<string>();
|
||
var 상품 = 매진정보.상품.Find(x => x.순서.ToString().Equals(단품매진[0][0]));
|
||
var 세부상품 = 상품.세부상품.Find(x => x.세부상품코드.Equals(단품매진[0][1]));
|
||
세부상품.세부매진송출 = true;
|
||
if (세부상품.세부상품명.Equals("단일상품"))
|
||
{
|
||
송출텍스트.Add(상품.상품명);
|
||
}
|
||
else
|
||
{
|
||
송출텍스트.Add("<선택" + 상품.순서.ToString() + ">");
|
||
송출텍스트.Add(상품.남녀 + 상품.상품명);
|
||
송출텍스트.Add(세부상품.세부상품명);
|
||
}
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\단품매진" + 송출텍스트.Count + "줄.t2s", "단품매진" + 송출텍스트.Count);
|
||
|
||
KAScene.GetObject("txt1").SetValue(송출텍스트[0]);
|
||
if (송출텍스트.Count > 1)
|
||
{
|
||
KAScene.GetObject("txt2").SetValue(송출텍스트[1]);
|
||
KAScene.GetObject("txt3").SetValue(송출텍스트[2]);
|
||
}
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
for매진팁 = 5 + Convert.ToInt32(txtBarSec.Text);
|
||
timer5.Start();
|
||
return;
|
||
}
|
||
|
||
//중간 휴지기간 이후 시작 시
|
||
if (isRestTime)
|
||
{
|
||
isRestTime = false;
|
||
if (toggleSwitch매진.IsOn)
|
||
{
|
||
for매진팁 = 5 + Convert.ToInt32(txtBarSec.Text);
|
||
timer5.Start();
|
||
}
|
||
}
|
||
|
||
//주문집중
|
||
if (timeSpanStart.TotalSeconds > Convert.ToInt32(txtNoSellFocus.Text) * 60)
|
||
{
|
||
try
|
||
{
|
||
if (매진정보.상품.Count == 1 && 매진정보.상품[0].세부상품.Count == 1)
|
||
{
|
||
//전체 상품 가짓수가 1개면 주문집중을 보낼 필요는 없다.
|
||
}
|
||
else
|
||
{
|
||
if ((매진정보.상품[0].세부상품[0].현재주문량시간 - 매진정보.상품[0].세부상품[0].이전주문량시간).TotalSeconds > Convert.ToInt32(txtSellFocusTerm.Text) * 60)
|
||
{
|
||
if (toggleSwitch최소판매표출.IsOn)
|
||
{
|
||
//가장 적게 팔린 놈을 확인한다
|
||
int mostSellCount = 1000000;
|
||
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
int nowSellCount = Convert.ToInt32(세부상품.누적주문량);
|
||
if (nowSellCount < mostSellCount) mostSellCount = nowSellCount;
|
||
}
|
||
}
|
||
|
||
//if (mostSellCount != 0)
|
||
|
||
//가장많이 판매한 숫자와 같으면 송출을 진행한다.
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
int nowSellCount = Convert.ToInt32(세부상품.누적주문량);
|
||
|
||
세부상품.주문집중송출 = false;
|
||
세부상품.누적주문량 = "0";
|
||
세부상품.주문집중 = false;
|
||
//세부상품.주문량기록시간 = "";
|
||
세부상품.이전주문량시간 = 세부상품.현재주문량시간;
|
||
|
||
if (nowSellCount == mostSellCount)
|
||
{
|
||
세부상품.주문집중 = true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//가장 많이 팔린 놈을 확인한다
|
||
int mostSellCount = 0;
|
||
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
int nowSellCount = Convert.ToInt32(세부상품.누적주문량);
|
||
if (nowSellCount > mostSellCount) mostSellCount = nowSellCount;
|
||
}
|
||
}
|
||
|
||
//if (mostSellCount != 0)
|
||
|
||
//가장많이 판매한 숫자와 같으면 송출을 진행한다.
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
int nowSellCount = Convert.ToInt32(세부상품.누적주문량);
|
||
|
||
세부상품.주문집중송출 = false;
|
||
세부상품.누적주문량 = "0";
|
||
세부상품.주문집중 = false;
|
||
//세부상품.주문량기록시간 = "";
|
||
세부상품.이전주문량시간 = 세부상품.현재주문량시간;
|
||
|
||
if (nowSellCount == mostSellCount)
|
||
{
|
||
if (mostSellCount != 0) 세부상품.주문집중 = true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
catch(Exception ex) { }
|
||
|
||
|
||
List<string[]> 주문집중 = new List<string[]>();
|
||
foreach (var 상품 in 매진정보.상품)
|
||
{
|
||
string 상품명 = 상품.상품명;
|
||
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
//이미 매진이라면 매진예상이 아닌 매진으로 송출한다.
|
||
if (!세부상품.세부매진 && 세부상품.주문집중 && !세부상품.주문집중송출)
|
||
{
|
||
주문집중.Add(new string[] { 상품.순서.ToString(), 세부상품.세부상품코드 });
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
if (주문집중.Count > 0 && toggleSwitch주문집중.IsOn)
|
||
{
|
||
List<string> 송출텍스트 = new List<string>();
|
||
var 상품 = 매진정보.상품.Find(x => x.순서.ToString().Equals(주문집중[0][0]));
|
||
var 세부상품 = 상품.세부상품.Find(x => x.세부상품코드.Equals(주문집중[0][1]));
|
||
세부상품.주문집중송출 = true;
|
||
if (세부상품.세부상품명.Equals("단일상품"))
|
||
{
|
||
송출텍스트.Add(상품.상품명);
|
||
}
|
||
else
|
||
{
|
||
송출텍스트.Add("<선택" + 상품.순서.ToString() + ">");
|
||
송출텍스트.Add(상품.남녀 + 상품.상품명);
|
||
송출텍스트.Add(세부상품.세부상품명);
|
||
}
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\주문집중" + 송출텍스트.Count + "줄.t2s", "주문집중" + 송출텍스트.Count);
|
||
|
||
if (toggleSwitch최소판매표출.IsOn) KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\인기" + 송출텍스트.Count + "줄.t2s", "인기" + 송출텍스트.Count);
|
||
|
||
KAScene.GetObject("txt1").SetValue(송출텍스트[0]);
|
||
if (송출텍스트.Count > 1)
|
||
{
|
||
KAScene.GetObject("txt2").SetValue(송출텍스트[1]);
|
||
KAScene.GetObject("txt3").SetValue(송출텍스트[2]);
|
||
}
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
if ((매진정보.자동주문유도 || 매진정보.자동주문유도2) && toggleSwitch자동주문.IsOn)
|
||
{
|
||
if ((DateTime.Now - 자동주문유도송출시각).TotalSeconds > Convert.ToInt32(txtCallSec.Text))
|
||
{
|
||
자동주문유도송출시각 = DateTime.Now;
|
||
매진정보.자동주문유도송출 = true;
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\자동주문1.t2s", "자동주문1");
|
||
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
|
||
return;
|
||
}
|
||
else if ((DateTime.Now - 자동주문유도송출시각).TotalSeconds > Convert.ToInt32(txtCallSec2.Text))
|
||
{
|
||
자동주문유도송출시각 = DateTime.Now;
|
||
매진정보.자동주문유도송출 = true;
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\자동주문1.t2s", "자동주문1");
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
return;
|
||
}
|
||
}
|
||
|
||
for매진콜 = 4;
|
||
}
|
||
DateTime 자동주문유도송출시각 = new DateTime(2022,1,1);
|
||
|
||
int for매진콜아웃 = 7;
|
||
private void timer4_Tick(object sender, EventArgs e)
|
||
{
|
||
for매진콜아웃--;
|
||
|
||
if (for매진콜아웃 < 0) {
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
timer4.Stop();
|
||
}
|
||
}
|
||
|
||
int for배송정보아웃 = 7;
|
||
private void timer6_Tick(object sender, EventArgs e)
|
||
{
|
||
for배송정보아웃--;
|
||
|
||
if (for배송정보아웃 < 0)
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer14, KAScene);
|
||
KAScenePlayer.Play(Layer14);
|
||
매진정보.배송정보송출 = false;
|
||
timer6.Stop();
|
||
}
|
||
}
|
||
|
||
int forVVIP아웃 = 7;
|
||
int forVVIP전면아웃 = 7;
|
||
private void timer7_Tick(object sender, EventArgs e)
|
||
{
|
||
forVVIP아웃--;
|
||
|
||
if (forVVIP아웃 < 0)
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
매진정보.VVIP송출 = false;
|
||
timer7.Stop();
|
||
}
|
||
}
|
||
|
||
int for매진팁 = 5;
|
||
int for매진팁Count = 0;
|
||
private void timer5_Tick(object sender, EventArgs e)
|
||
{
|
||
for매진팁--;
|
||
|
||
if (for매진팁 < 0 && toggleSwitch매진팁.IsOn)
|
||
{
|
||
|
||
for매진팁Count++;
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\매진콜\매진팁.t2s", "매진팁" + for매진팁Count);
|
||
|
||
KAScene.GetObject("txt1").StoreTextStyle();
|
||
KAScene.GetObject("txt1").SetValue("매진");
|
||
|
||
List<string> 매진상품들 = new List<string>();
|
||
foreach(var 상품 in 매진정보.상품)
|
||
{
|
||
foreach (var 세부상품 in 상품.세부상품)
|
||
{
|
||
if (세부상품.세부매진 && 세부상품.세부매진송출)
|
||
{
|
||
if (세부상품.세부상품명.Trim() == "단일상품")
|
||
{
|
||
매진상품들.Add(상품.상품명);
|
||
}
|
||
else
|
||
{
|
||
|
||
string 상품성별 = 상품.남녀;
|
||
상품성별 = 상품성별.Replace("[남] ", "남)");
|
||
상품성별 = 상품성별.Replace("[여] ", "여)");
|
||
string 매진상품명 = "선택" + 상품.순서 + "." + 상품성별 + 상품.상품명 + Environment.NewLine;
|
||
bool isAdd = false;
|
||
string 세부상품명 = 세부상품.세부상품명;
|
||
string right2 = 세부상품명.Substring(세부상품명.Length - 2).ToLower();
|
||
if (right2 == "mm" || right2 == "cm") 세부상품명 = 세부상품명.Substring(0, 세부상품명.Length - 2);
|
||
|
||
// '/'가 없는 경우
|
||
if (!세부상품명.Contains("/") && 매진상품들.FindAll(x => x.Contains(매진상품명)).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains(매진상품명));
|
||
매진상품들[index] += ", " + 세부상품명;
|
||
isAdd = true;
|
||
}
|
||
|
||
// '/'가 있는 경우
|
||
if (세부상품명.Contains("/"))
|
||
{
|
||
string[] 세부상품명분할 = 세부상품명.Split('/');
|
||
// '/'가 1개만 있는 경우 일반적인 상태
|
||
if (세부상품명분할.Length == 2)
|
||
{
|
||
string 접미사 = 매진상품명 + 세부상품명분할[0];
|
||
if (매진상품들.FindAll(x => x.Contains(접미사)).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains(접미사));
|
||
매진상품들[index] += ", " + 세부상품명분할[1];
|
||
isAdd = true;
|
||
}
|
||
}
|
||
else if (세부상품명분할.Length == 3)
|
||
{
|
||
string 접미사 = 매진상품명 + 세부상품명분할[0] + "/" + 세부상품명분할[1];
|
||
if (매진상품들.FindAll(x => x.Contains(접미사)).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains(접미사));
|
||
매진상품들[index] += ", " + 세부상품명분할[2];
|
||
isAdd = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
if (!isAdd)
|
||
{
|
||
//처음 들어간 경우
|
||
string 매진상품 = 매진상품명 + 세부상품명;
|
||
매진상품들.Add(매진상품);
|
||
}
|
||
/* 남녀 넣기 전
|
||
// '/'가 없는 경우
|
||
if (!세부상품명.Contains("/") && 매진상품들.FindAll(x => x.Contains("선택" + 상품.순서 + ".")).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains("선택" + 상품.순서 + "."));
|
||
매진상품들[index] += ", " + 세부상품명;
|
||
isAdd = true;
|
||
}
|
||
|
||
// '/'가 있는 경우
|
||
if (세부상품명.Contains("/"))
|
||
{
|
||
string[] 세부상품명분할 = 세부상품명.Split('/');
|
||
// '/'가 1개만 있는 경우 일반적인 상태
|
||
if (세부상품명분할.Length == 2)
|
||
{
|
||
string 접미사 = "선택" + 상품.순서 + "." + 세부상품명분할[0];
|
||
if (매진상품들.FindAll(x => x.Contains(접미사)).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains(접미사));
|
||
매진상품들[index] += ", " + 세부상품명분할[1];
|
||
isAdd = true;
|
||
}
|
||
}
|
||
else if (세부상품명분할.Length == 3)
|
||
{
|
||
string 접미사 = "선택" + 상품.순서 + "." + 세부상품명분할[0] + "/" + 세부상품명분할[1];
|
||
if (매진상품들.FindAll(x => x.Contains(접미사)).Count > 0)
|
||
{
|
||
int index = 매진상품들.FindIndex(x => x.Contains(접미사));
|
||
매진상품들[index] += ", " + 세부상품명분할[2];
|
||
isAdd = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
if (!isAdd)
|
||
{
|
||
//처음 들어간 경우
|
||
string 매진상품 = "선택" + 상품.순서 + "." + 세부상품명;
|
||
매진상품들.Add(매진상품);
|
||
}
|
||
*/
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
List<string> 줄단위확인 = new List<string>();
|
||
string 지워야하는값 = "";
|
||
foreach (var v in 매진상품들)
|
||
{
|
||
//중복된 값을 지우는 과정을 거친다.
|
||
var v2 = v.Replace(Environment.NewLine, "^").Split('^');
|
||
foreach (var v3 in v2)
|
||
{
|
||
if (v3.Contains("선택"))
|
||
{
|
||
if (줄단위확인.Contains(v3))
|
||
{
|
||
지워야하는값 = v3 + Environment.NewLine;
|
||
}
|
||
else
|
||
{
|
||
줄단위확인.Add(v3);
|
||
}
|
||
}
|
||
}
|
||
|
||
string addText = Environment.NewLine + v;
|
||
|
||
if (지워야하는값 != "")
|
||
{
|
||
addText = Environment.NewLine + v.Replace(지워야하는값, "");
|
||
}
|
||
|
||
KAScene.GetObject("txt1").AddText(addText, 4);
|
||
}
|
||
|
||
if (매진상품들.Count != 0)
|
||
{
|
||
KAScenePlayer.Prepare(Layer12, KAScene);
|
||
KAScenePlayer.Play(Layer12);
|
||
}
|
||
|
||
timer5.Stop();
|
||
}
|
||
}
|
||
|
||
public void DoChangeAdjust(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h, bool i)
|
||
{
|
||
try
|
||
{
|
||
if (!h)
|
||
{
|
||
label56.BackColor = Color.DarkRed;
|
||
label56.Text = "채팅백판";
|
||
btnDisp8.Text = "채팅백판";
|
||
SetDisplay(8, false);
|
||
}
|
||
else
|
||
{
|
||
label56.BackColor = Color.Green;
|
||
label56.Text = "채팅백판 송출중..";
|
||
btnDisp8.Text = "채팅백판 OUT";
|
||
SetDisplay(8, true);
|
||
}
|
||
|
||
if (!i)
|
||
{
|
||
label80.BackColor = Color.DarkRed;
|
||
label80.Text = "동영상";
|
||
btnDisp9.Text = "동영상";
|
||
SetDisplay(9, false);
|
||
}
|
||
else
|
||
{
|
||
label80.BackColor = Color.Green;
|
||
label80.Text = "동영상 송출중..";
|
||
btnDisp9.Text = "동영상 OUT";
|
||
SetDisplay(9, true);
|
||
}
|
||
|
||
if (!a)
|
||
{
|
||
label11.BackColor = Color.DarkRed;
|
||
label11.Text = "판매수량";
|
||
btnDisp1.Text = "판매수량";
|
||
SetDisplay(1, false);
|
||
}
|
||
else
|
||
{
|
||
label11.BackColor = Color.Green;
|
||
label11.Text = "판매수량 송출중..";
|
||
btnDisp1.Text = "판매수량 OUT";
|
||
SetDisplay(1, true);
|
||
}
|
||
|
||
if (!b)
|
||
{
|
||
label12.BackColor = Color.DarkRed;
|
||
label12.Text = "경품추첨";
|
||
btnDisp2.Text = "경품추첨";
|
||
SetDisplay(2, false);
|
||
}
|
||
else
|
||
{
|
||
label12.BackColor = Color.Green;
|
||
label12.ForeColor = Color.White;
|
||
label12.Text = "경품추첨 송출중..";
|
||
btnDisp2.Text = "경품추첨 OUT";
|
||
SetDisplay(2, true);
|
||
}
|
||
|
||
if (!c)
|
||
{
|
||
label19.BackColor = Color.DarkRed;
|
||
label19.Text = "텍스트";
|
||
btnDisp3.Text = "텍스트";
|
||
SetDisplay(3, false);
|
||
}
|
||
else
|
||
{
|
||
label19.BackColor = Color.Green;
|
||
label19.Text = "텍스트 송출중..";
|
||
btnDisp3.Text = "텍스트 OUT";
|
||
SetDisplay(3, true);
|
||
}
|
||
|
||
if (!d)
|
||
{
|
||
label66.BackColor = Color.DarkRed;
|
||
label66.Text = "채팅";
|
||
btnDisp4.Text = "채팅";
|
||
SetDisplay(4, false);
|
||
}
|
||
else
|
||
{
|
||
label66.BackColor = Color.Green;
|
||
label66.Text = "채팅 송출중..";
|
||
btnDisp4.Text = "채팅 OUT";
|
||
SetDisplay(4, true);
|
||
}
|
||
|
||
if (!e)
|
||
{
|
||
label67.BackColor = Color.DarkRed;
|
||
label67.Text = "상품평";
|
||
btnDisp5.Text = "상품평";
|
||
SetDisplay(5, false);
|
||
}
|
||
else
|
||
{
|
||
label67.BackColor = Color.Green;
|
||
label67.Text = "상품평 송출중..";
|
||
btnDisp5.Text = "상품평 OUT";
|
||
SetDisplay(5, true);
|
||
}
|
||
|
||
if (!f)
|
||
{
|
||
label68.BackColor = Color.DarkRed;
|
||
label68.Text = "QnA";
|
||
btnDisp6.Text = "QnA";
|
||
SetDisplay(6, false);
|
||
}
|
||
else
|
||
{
|
||
label68.BackColor = Color.Green;
|
||
label68.Text = "QnA 송출중..";
|
||
btnDisp6.Text = "QnA OUT";
|
||
SetDisplay(6, true);
|
||
}
|
||
|
||
if (!g)
|
||
{
|
||
label55.BackColor = Color.DarkRed;
|
||
label55.Text = "공지";
|
||
btnDisp7.Text = "공지";
|
||
SetDisplay(7, false);
|
||
}
|
||
else
|
||
{
|
||
label55.BackColor = Color.Green;
|
||
label55.Text = "공지 송출중..";
|
||
btnDisp7.Text = "공지 OUT";
|
||
SetDisplay(7, true);
|
||
}
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
}
|
||
|
||
}
|
||
|
||
int Layer1 = 1;
|
||
int Layer2 = 2;
|
||
int Layer3 = 3;
|
||
int Layer4 = 4;
|
||
int Layer5 = 5;
|
||
int Layer6 = 6;
|
||
int Layer7 = 7;
|
||
int Layer8 = 8;
|
||
int Layer9 = 9;
|
||
int Layer10 = 10;
|
||
int Layer11 = 11;
|
||
int Layer12 = 12;
|
||
int Layer13 = 13;
|
||
int Layer14 = 14;
|
||
int Layer15 = 14;
|
||
int fadeOutTime = 10;
|
||
string[] informationDisp1 = new string[4];
|
||
string disp1TxtStr = "";
|
||
int termDisp1 = 10;
|
||
int orderDisp1Index = 0;
|
||
int orderDisp4Index = 0;
|
||
int orderDisp9Index = 0;
|
||
string liveChatBefore = "";
|
||
string liveChatBefore2 = "";
|
||
string[] aliveLiveChatText = { "", "", "", "", "", "", "", "", "" };
|
||
string[] aliveLiveChatText2 = { "", "", "", "", "", "", "", "", "" };
|
||
string[] aliveLiveChatText3 = { "", "", "", "", "", "", "", "", "" };
|
||
string[] aliveLiveChatText4 = { "", "", "", "", "", "", "", "", "" };
|
||
bool isTopLeft = true;
|
||
List<NewGroup> beforeNewGroups = new List<NewGroup>();
|
||
|
||
|
||
public void SetDisplay(int DisplayIndex, bool showing)
|
||
{
|
||
//DisplayIndex : 1 판매량, 2 경품, 3 텍스트
|
||
if (DisplayIndex == 1)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay1)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//주기적으로 송출하게 되므로
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
//주기적 송출을 할 것이므로 Disp1Worker의 함수로 넘겨서 진행한다.
|
||
isDisplay1 = true;
|
||
string dispStr = "";
|
||
//211.42.188.8
|
||
string requestURL = getURL() + channel + "/입력데이터조회/상품수량";
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["텍스트"].ToString();
|
||
|
||
}
|
||
//송출부분
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
|
||
//서버에 있는 정보를 저장해야 한다
|
||
disp1TxtStr = strs[0];
|
||
informationDisp1[0] = strs[2];
|
||
informationDisp1[1] = strs[3];
|
||
informationDisp1[2] = strs[4];
|
||
termDisp1 = Convert.ToInt32(strs[5]);
|
||
orderDisp1Index = Convert.ToInt32(strs[6]);
|
||
//순서 : 텍스트로 나갈 정보,판매수량, PGM, 시작일, 종료일, 주기, 순번의 형태로 저장
|
||
mWorkerThread = new Thread(new ThreadStart(Disp1Worker));
|
||
mWorkerThread.Start();
|
||
}
|
||
|
||
isDisplay1 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay1)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer1, KAScene);
|
||
KAScenePlayer.Play(Layer1);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
|
||
isDisplay1 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 2)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay2)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/입력데이터조회/경품프로모션";
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["텍스트"].ToString();
|
||
|
||
}
|
||
//송출부분
|
||
KAScene = KAEngine.LoadScene(path2, "경품추첨");
|
||
|
||
KAObject KAObject;
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
for (int i = 0; i < strs.Length / 3; i++)
|
||
{
|
||
KAObject = KAScene.GetObject("name" + (i + 1));
|
||
KAObject.SetValue(strs[i * 3]);
|
||
KAObject = KAScene.GetObject("address" + (i + 1));
|
||
KAObject.SetValue(strs[i * 3 + 1]);
|
||
KAObject = KAScene.GetObject("phone" + (i + 1));
|
||
KAObject.SetValue(strs[i * 3 + 2]);
|
||
}
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer2, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer2);
|
||
}
|
||
isDisplay2 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay2)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer2, KAScene);
|
||
KAScenePlayer.Play(Layer2);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay2 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 3)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay3)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/텍스트/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["텍스트"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
string path3 = path3_1;
|
||
|
||
if (strs[0].Equals("1")) path3 = path3_1;
|
||
else if (strs[0].Equals("2")) path3 = path3_2;
|
||
else if (strs[0].Equals("3")) path3 = path3_3;
|
||
else if (strs[0].Equals("4")) path3 = path3_4;
|
||
else if (strs[0].Equals("5")) path3 = path3_5;
|
||
else if (strs[0].Equals("6")) path3 = path3_6;
|
||
else if (strs[0].Equals("7")) path3 = path3_7;
|
||
else if (strs[0].Equals("8")) path3 = path3_8;
|
||
else if (strs[0].Equals("9")) path3 = path3_9;
|
||
else if (strs[0].Equals("10")) path3 = path3_10;
|
||
|
||
else if (strs[0].Equals("11")) path3 = path3_11;
|
||
else if (strs[0].Equals("12")) path3 = path3_12;
|
||
else if (strs[0].Equals("13")) path3 = path3_13;
|
||
else if (strs[0].Equals("14")) path3 = path3_14;
|
||
else if (strs[0].Equals("15")) path3 = path3_15;
|
||
else if (strs[0].Equals("16")) path3 = path3_16;
|
||
else if (strs[0].Equals("17")) path3 = path3_17;
|
||
else if (strs[0].Equals("18")) path3 = path3_18;
|
||
else if (strs[0].Equals("19")) path3 = path3_19;
|
||
else if (strs[0].Equals("20")) path3 = path3_20;
|
||
|
||
//송출부분
|
||
KAScene = KAEngine.LoadScene(path3, "텍스트" + strs[0]);
|
||
|
||
KAObject KAObject;
|
||
|
||
for (int i = 1; i < 6; i++)
|
||
{
|
||
|
||
KAObject = KAScene.GetObject("txt" + i);
|
||
KAObject.SetValue(strs.Length - 1 < i ? "" : strs[i]);
|
||
}
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer3, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer3);
|
||
}
|
||
isDisplay3 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay3)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer3, KAScene);
|
||
KAScenePlayer.Play(Layer3);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay3 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 4)
|
||
{
|
||
if (showing)
|
||
{
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/채팅/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["채팅"].ToString();
|
||
}
|
||
|
||
//if (isDisplay4)
|
||
if (isDisplay4 && dispStr.Equals(liveChatBefore))
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
if (timer1.Enabled) timer1.Stop();
|
||
if (timer2.Enabled) timer2.Stop();
|
||
if (timer3.Enabled) timer3.Stop();
|
||
|
||
liveChatBefore2 = liveChatBefore;
|
||
liveChatBefore = dispStr;
|
||
int dispLines = 0;
|
||
|
||
int timeOfChange = 15;
|
||
int timeOfWait = 60;
|
||
int timeOfBefore = 0;
|
||
int timeOfClear = 30;
|
||
string isLoop = "";
|
||
|
||
|
||
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
if (strs[8].Equals("Y"))
|
||
isLoop = "true";
|
||
else if (strs[8].Equals("C"))
|
||
isLoop = "clear";
|
||
|
||
dispLines = Convert.ToInt16(strs[9]);
|
||
|
||
timeOfChange = Convert.ToInt32(strs[10]);
|
||
//timeOfChange = 1;
|
||
timeOfWait = Convert.ToInt32(strs[11]);
|
||
timeOfClear = Convert.ToInt32(strs[12]);
|
||
|
||
|
||
//색상리턴용 내부함수
|
||
sKStyleColor getColor(Label lbl)
|
||
{
|
||
sKStyleColor sKStyleColor = new sKStyleColor();
|
||
|
||
sKStyleColor.A = lbl.BackColor.A;
|
||
sKStyleColor.R = lbl.BackColor.R;
|
||
sKStyleColor.G = lbl.BackColor.G;
|
||
sKStyleColor.B = lbl.BackColor.B;
|
||
|
||
return sKStyleColor;
|
||
}
|
||
|
||
//송출부분
|
||
|
||
orderDisp4Index++;
|
||
if (dispLines == 2)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 1)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_1, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 3)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_2, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 4)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_3, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 5)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_4, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 6)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_5, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 0)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_0, "채팅" + orderDisp4Index);
|
||
}
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
if (dispLines == 2)
|
||
{
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
//5번의 위치만 변동될 수 있다
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//2번째 택스트가 1개인 경우
|
||
KAObject.SetPositionKey(5, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
//아래가 2줄 이상 올라오게 되면
|
||
KAObject.SetPositionKey(5, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 4; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//-432.38
|
||
KAObject.SetPositionKey(1, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -362.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_3 : lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_4 : lbl_color_2));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
//색상 설정의 경우의 수
|
||
// n1,t1,t2가 있는 경우 : 일반적인 상황
|
||
// n1 = color3, t1 = color4, t2 = color4
|
||
|
||
//n2가 존재하면
|
||
// n1,n2,t1,t2 다 있는 경우 : n2는 이때만 존재
|
||
// n1 = color1, t1 = color2, n2 = color3, t2 = color4
|
||
|
||
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
for (int i = 0; i < 10; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[2].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + 6, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + 5, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst;
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[3].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, 30f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
}
|
||
|
||
//시간 계산 변경
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(4, 0, -0.3f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(4, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("txt2");
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[0];
|
||
if (strs[3] != "")
|
||
{
|
||
aliveLiveChatText[1] = strs[3];
|
||
}
|
||
else if (strs[2] != "")
|
||
{
|
||
aliveLiveChatText[1] = strs[2];
|
||
}
|
||
else
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
}
|
||
|
||
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[7].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[5];
|
||
aliveLiveChatText[2] = "";
|
||
aliveLiveChatText[3] = strs[6];
|
||
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[6];
|
||
aliveLiveChatText[2] = "";
|
||
aliveLiveChatText[3] = strs[7];
|
||
|
||
}
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
}
|
||
else if (dispLines == 11)
|
||
{
|
||
KAObject = KAScene.GetObject("name1");
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
//5번의 위치만 변동될 수 있다
|
||
KAObject.SetPositionKey(0, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 4; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//-432.38
|
||
KAObject.SetPositionKey(1, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -362.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
for (int i = 0; i < 10; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[2].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[3].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, 30f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
}
|
||
|
||
//시간 계산 변경
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
aliveLiveChatText[0] = "";
|
||
aliveLiveChatText[1] = "";
|
||
aliveLiveChatText[2] = strs[4];
|
||
|
||
KAObject = KAScene.GetObject("txt2");
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait;
|
||
|
||
|
||
aliveLiveChatText[3] = strs[5];
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[7].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[3] = strs[6];
|
||
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 105.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[3] = strs[7];
|
||
|
||
}
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
}
|
||
else if (dispLines == 3)
|
||
{
|
||
int lineCountQuestion = 3;
|
||
int lineCountAnswer = 3;
|
||
|
||
//이전 텍스트 처리
|
||
int countOfNames = 0;
|
||
|
||
if (aliveLiveChatText[0] != "") countOfNames++;
|
||
if (aliveLiveChatText[2] != "") countOfNames++;
|
||
if (aliveLiveChatText[4] != "") countOfNames++;
|
||
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
KAObject = KAScene.GetObject("txt0_" + i);
|
||
KAObject.SetValue("");
|
||
|
||
KAObject = KAScene.GetObject("name0_" + i);
|
||
KAObject.SetValue("");
|
||
}
|
||
|
||
if (countOfNames == 1)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("txt0_3");
|
||
KAObject.SetValue(aliveLiveChatText[5]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
else if (countOfNames == 2)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_2 : lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("name0_3");
|
||
KAObject.SetValue(aliveLiveChatText[4]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_3");
|
||
KAObject.SetValue(aliveLiveChatText[5]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
|
||
|
||
if (strs[2].Trim() == "") lineCountQuestion = 1;
|
||
else if (strs[3].Trim() == "") lineCountQuestion = 2;
|
||
|
||
if (strs[6].Trim() == "") lineCountAnswer = 1;
|
||
else if (strs[7].Trim() == "") lineCountAnswer = 2;
|
||
|
||
KAObject = KAScene.GetObject("txt0");
|
||
KAObject.SetPosition(0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 6; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
//이전에 상위 2줄을 쓰는 경우
|
||
bool isBeforeLine2 = true;
|
||
int timeOfAdded = 0;
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (i < 4)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() == "") isBeforeLine2 = false;
|
||
}
|
||
else
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") isBeforeLine2 = false;
|
||
}
|
||
|
||
}
|
||
|
||
if (isBeforeLine2) timeOfAdded = timeOfChange + timeOfWait;
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfAdded + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfAdded + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfAdded + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfAdded + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfAdded + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, timeOfAdded, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name1" : "txt1");
|
||
|
||
for (int i = 0; i < 12; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 11, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 10, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(10, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(11, 0, 140f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst;
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst;
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait;
|
||
}
|
||
|
||
//기준이 되는 수치를 집어넣고 변경되는 경우마다 처리한다
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
|
||
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
if (lineCountAnswer == 1)
|
||
{
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetPositionKey(7, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
KAObject.SetPositionKey(6, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (lineCountQuestion == 2)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
for (int i = 9; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
KAObject.SetPositionKey(4, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
|
||
timeOfBefore += lineCountQuestion == 1 ? 2 * (timeOfChange + timeOfWait) : timeOfChange + timeOfWait;
|
||
}
|
||
else if (lineCountAnswer == 2)
|
||
{
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
KAObject.SetPositionKey(6, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
//name1과 txt1의 위치를 조절해야 한다.
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetPositionKey(7, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
for (int i = 9; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
KAObject.SetPositionKey(11, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
|
||
}
|
||
else if (lineCountAnswer == 3)
|
||
{
|
||
|
||
//3줄다 기록된 경우
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
timeOfBefore += timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfBefore - timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore - timeOfWait - timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
}
|
||
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
|
||
//경우의 수를 통한 표출 텍스트 정보를 저장
|
||
for (int i = 0; i < aliveLiveChatText.Length; i++)
|
||
{
|
||
aliveLiveChatText[i] = "";
|
||
}
|
||
|
||
if (lineCountAnswer == 3)
|
||
{
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[5];
|
||
aliveLiveChatText[3] = strs[6];
|
||
aliveLiveChatText[5] = strs[7];
|
||
}
|
||
else if (lineCountAnswer == 2)
|
||
{
|
||
aliveLiveChatText[0] = strs[0];
|
||
aliveLiveChatText[1] = strs[lineCountQuestion];
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
aliveLiveChatText[5] = strs[6];
|
||
}
|
||
else if (lineCountAnswer == 1)
|
||
{
|
||
aliveLiveChatText[0] = strs[0];
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
aliveLiveChatText[3] = strs[2];
|
||
aliveLiveChatText[4] = strs[4];
|
||
aliveLiveChatText[5] = strs[5];
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
aliveLiveChatText[1] = strs[2];
|
||
aliveLiveChatText[3] = strs[3];
|
||
aliveLiveChatText[4] = strs[4];
|
||
aliveLiveChatText[5] = strs[5];
|
||
}
|
||
}
|
||
}
|
||
else if (dispLines == 4)
|
||
{
|
||
//구조체를 생성 값을 넣고 계산하고 동작하게 진행하는 방식
|
||
//시작점의 위치를 입력 => 보여지는 영역인 경우 텍스트 마지막 글자까지 남아있다 올라가는 방식으로 진행
|
||
// 해당알고리즘을 진행하는 방식을 어떻게 적용할 것인가?!
|
||
|
||
|
||
//텍스트 위치를 정렬
|
||
|
||
|
||
|
||
int lineCountQuestion = 3;
|
||
int lineCountAnswer = 3;
|
||
|
||
|
||
//텍스트 값 변경
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
List<string> txts = new List<string>();
|
||
lineCountQuestion = 0;
|
||
lineCountAnswer = 0;
|
||
for (int i = 1; i < 8; i++)
|
||
{
|
||
if (i != 4 && strs[i].Trim() != "")
|
||
{
|
||
if (i < 4)
|
||
{
|
||
lineCountQuestion++;
|
||
}
|
||
else
|
||
{
|
||
lineCountAnswer++;
|
||
}
|
||
txts.Add(strs[i]);
|
||
}
|
||
}
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (i < txts.Count)
|
||
{
|
||
KAObject = KAScene.GetObject("txt1_" + (i + 1));
|
||
KAObject.SetStyleColor(getColor(i < lineCountQuestion ? lbl_color_2 : lbl_color_4));
|
||
KAObject.SetValue(txts[i]);
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject("txt1_" + (i + 1));
|
||
KAObject.SetValue("");
|
||
}
|
||
}
|
||
|
||
|
||
//기본 시간 계산
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
//Name,Text 위치 및 시간계산
|
||
for (int j = 0; j < 3; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name1" : j == 1 ? "txts" : "name2");
|
||
|
||
for (int i = 0; i < 12; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 11, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 10, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (j != 2)
|
||
{
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2)) - 85;
|
||
if (j == 0) yPos += 15; //name
|
||
else
|
||
{
|
||
if (lineCountAnswer + lineCountQuestion < 5 && i > 8)
|
||
{
|
||
yPos = 30 * 4 - 85;
|
||
}
|
||
else if (lineCountAnswer + lineCountQuestion == 5 && i > 9)
|
||
{
|
||
yPos = 30 * 5 - 85;
|
||
}
|
||
}
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
Console.WriteLine("YPos Name1 : " + yPos);
|
||
}
|
||
}
|
||
else //name2
|
||
{
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2)) - 70;
|
||
yPos += lineCountQuestion * -30;
|
||
|
||
//가장아래에 있는 경우
|
||
if (lineCountQuestion == 3 && lineCountAnswer == 1)
|
||
{
|
||
if (yPos > -40) yPos = -40;
|
||
}
|
||
else if ((lineCountQuestion == 2 && lineCountAnswer == 1) ||
|
||
(lineCountQuestion == 2 && lineCountAnswer == 2) ||
|
||
(lineCountQuestion == 3 && lineCountAnswer == 2))
|
||
{
|
||
if (yPos > -10) yPos = -10;
|
||
}
|
||
else
|
||
{
|
||
if (yPos > 20) yPos = 20;
|
||
}
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
Console.WriteLine("YPos Name2 : " + yPos);
|
||
}
|
||
}
|
||
}
|
||
|
||
//이전 텍스트 처리
|
||
bool isReply = false;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (i == 0)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue("");
|
||
}
|
||
else if (i % 2 == 0)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "")
|
||
{
|
||
isReply = true;
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[i]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject("txt0_" + (i / 2 + 1));
|
||
KAObject.SetValue(aliveLiveChatText[i]);
|
||
KAObject.SetStyleColor(getColor(isReply ? lbl_color_4 : lbl_color_2));
|
||
}
|
||
}
|
||
|
||
int beforeTextReplayPos()
|
||
{
|
||
if (aliveLiveChatText[6].Trim() != "") return 4;
|
||
else if (aliveLiveChatText[4].Trim() != "") return 3;
|
||
else if (aliveLiveChatText[2].Trim() != "") return 2;
|
||
else return 0;
|
||
}
|
||
int beforeTextReplayCount()
|
||
{
|
||
if (aliveLiveChatText[6].Trim() != "") return 1;
|
||
else if (aliveLiveChatText[4].Trim() != "")
|
||
{
|
||
return aliveLiveChatText[7].Trim() == "" ? 1 : 2;
|
||
|
||
}
|
||
else if (aliveLiveChatText[2].Trim() != "")
|
||
{
|
||
if (aliveLiveChatText[7].Trim() != "") return 3;
|
||
else if (aliveLiveChatText[5].Trim() != "") return 2;
|
||
else return 1;
|
||
}
|
||
else return 0;
|
||
}
|
||
|
||
|
||
string[] keyNames = { "group0", "", "name0_1t", "name0_2t" };
|
||
foreach (var k in keyNames)
|
||
{
|
||
KAObject = KAScene.GetObject(k);
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
}
|
||
|
||
|
||
int blankCount = 0;
|
||
if (aliveLiveChatText[7] == "")
|
||
{
|
||
blankCount++;
|
||
if (aliveLiveChatText[5] == "") blankCount++;
|
||
}
|
||
int blankWait = 0;
|
||
for (int i = 0; i < blankCount; i++) blankWait += timeOfChange + timeOfWaitFirst;
|
||
|
||
foreach (var k in keyNames)
|
||
{
|
||
KAObject = KAScene.GetObject(k);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, blankWait + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, blankWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, blankWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
KAObject = KAScene.GetObject("name0_1t");
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
|
||
if (beforeTextReplayPos() == 2)
|
||
{ }
|
||
else if (beforeTextReplayPos() == 3)
|
||
{
|
||
yPos -= 30;
|
||
}
|
||
else if (beforeTextReplayPos() == 4)
|
||
{
|
||
yPos -= 60;
|
||
}
|
||
if (yPos < 0) yPos = 0;
|
||
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name0_2t");
|
||
int countOfZero = 0;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
yPos -= (beforeTextReplayPos() - 1) * 30;
|
||
|
||
if (yPos > 0)
|
||
{
|
||
countOfZero++;
|
||
if (countOfZero <= (beforeTextReplayCount() - 1) * 2) yPos = 0;
|
||
|
||
if (yPos > 0) yPos = 30;
|
||
}
|
||
|
||
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
//보이는 값 저장하기
|
||
for (int i = 0; i < aliveLiveChatText.Length; i++)
|
||
{
|
||
aliveLiveChatText[i] = "";
|
||
}
|
||
txts.Reverse();
|
||
for (int i = 0; i < 4; i++)
|
||
{
|
||
if (txts.Count > i) aliveLiveChatText[7 - (i * 2)] = txts[i];
|
||
}
|
||
|
||
for (int i = 0; i < 2; i++)
|
||
{
|
||
if (aliveLiveChatText[1].Trim() == "")
|
||
{
|
||
aliveLiveChatText[1] = aliveLiveChatText[3];
|
||
aliveLiveChatText[3] = aliveLiveChatText[5];
|
||
aliveLiveChatText[5] = aliveLiveChatText[7];
|
||
aliveLiveChatText[7] = "";
|
||
}
|
||
}
|
||
|
||
|
||
aliveLiveChatText[0] = strs[0];
|
||
if (lineCountQuestion == 3 && lineCountAnswer == 1)
|
||
{
|
||
aliveLiveChatText[6] = strs[4];
|
||
}
|
||
else if ((lineCountQuestion == 2 && lineCountAnswer == 1) ||
|
||
(lineCountQuestion == 2 && lineCountAnswer == 2) ||
|
||
(lineCountQuestion == 3 && lineCountAnswer == 2))
|
||
{
|
||
aliveLiveChatText[4] = strs[4];
|
||
}
|
||
else
|
||
{
|
||
aliveLiveChatText[2] = strs[4];
|
||
}
|
||
|
||
// 기본적으로 위로 올라가는 시간
|
||
for (int i = 0; i < 4; i++)
|
||
{
|
||
timeOfBefore += timeOfWaitFirst + timeOfChange;
|
||
}
|
||
|
||
for (int i = 0; i < lineCountQuestion + lineCountAnswer - 4; i++)
|
||
{
|
||
timeOfBefore += timeOfWait + timeOfChange;
|
||
}
|
||
}
|
||
else if (dispLines == 0 || dispLines == 1)
|
||
{
|
||
timeOfChange = 1;
|
||
|
||
string 답변자아이콘 = strs[13];
|
||
|
||
bool hasBeforeScene = false;
|
||
bool hasBeforeScene2 = false;
|
||
bool hasBeforeScene3 = false;
|
||
bool hasBeforeScene4 = false;
|
||
|
||
//기존 텍스트 존재 검사
|
||
if (!isNullArray(aliveLiveChatText4))
|
||
{
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
hasBeforeScene3 = true;
|
||
hasBeforeScene4 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText3))
|
||
{
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
hasBeforeScene3 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText2))
|
||
{
|
||
//존재한다 좆됐다!
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText))
|
||
{
|
||
//존재한다 좆됐다!
|
||
hasBeforeScene = true;
|
||
}
|
||
|
||
|
||
//말풍선 색상 변경
|
||
KAScene.GetObject("txtbox1").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox2").SetStyleColor(getColor(lbl_color_6));
|
||
if (hasBeforeScene)
|
||
{
|
||
KAScene.GetObject("txtbox3").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox4").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAScene.GetObject("txtbox5").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox6").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAScene.GetObject("txtbox7").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox8").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAScene.GetObject("txtbox9").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox10").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
|
||
//텍스트 값 변경 - 작성자
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
bool[] 답변자아이콘존재여부 = { false, false, false, false, false, false, false, false, false, false, false };
|
||
void 답변자아이콘설정(string 테그명, string 내용)
|
||
{
|
||
int index = Convert.ToInt32(테그명.Replace("name", ""));
|
||
|
||
if (내용.Contains("undefined") || 내용.Substring(내용.Length - 2).Equals("_"))
|
||
{
|
||
KAObject = KAScene.GetObject(테그명);
|
||
KAObject.SetPosition(-100, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject = KAScene.GetObject(테그명 + "Icon");
|
||
KAObject.SetVisible(0);
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject(테그명);
|
||
KAObject.SetPosition(-40, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
|
||
KAObject = KAScene.GetObject(테그명 + "Icon");
|
||
KAObject.SetValue(getIconPath(내용, true, true));
|
||
KAObject.SetImageOriginalSize();
|
||
KAObject.SetVisible(1);
|
||
답변자아이콘존재여부[index] = true;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
답변자아이콘설정("name2", 답변자아이콘);
|
||
|
||
if (hasBeforeScene)
|
||
{
|
||
KAObject = KAScene.GetObject("name3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject = KAScene.GetObject("name4");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText[4]);
|
||
답변자아이콘설정("name4", aliveLiveChatText[8]);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAObject = KAScene.GetObject("name5");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText2[0]);
|
||
KAObject = KAScene.GetObject("name6");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText2[4]);
|
||
답변자아이콘설정("name6", aliveLiveChatText2[8]);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAObject = KAScene.GetObject("name7");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText3[0]);
|
||
KAObject = KAScene.GetObject("name8");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText3[4]);
|
||
답변자아이콘설정("name8", aliveLiveChatText3[8]);
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAObject = KAScene.GetObject("name9");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText4[0]);
|
||
KAObject = KAScene.GetObject("name10");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText4[4]);
|
||
답변자아이콘설정("name10", aliveLiveChatText4[8]);
|
||
}
|
||
|
||
//기본 시간 계산
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
|
||
int[] 키프레임값 = new int[11];
|
||
int 현재키프레임 = 0;
|
||
키프레임값[0] = 0;
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
int 더할값 = i % 2 == 1 ? timeOfChange : timeOfWait;
|
||
키프레임값[i] = 키프레임값[i - 1] + 더할값;
|
||
}
|
||
|
||
|
||
|
||
//Animation 정렬 초기화
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = j == 0 ? KAScene.GetObject("boxs") : KAScene.GetObject("boxs2");
|
||
for (int i = 0; i < 11; i++) KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//설정된 프레임 시간 맞추기
|
||
for (int i = 10; i > -1; i--)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, 키프레임값[i], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
}
|
||
|
||
|
||
//이모지 정보 저장용
|
||
List<Emoji> emojis = new List<Emoji>();
|
||
//큰아이콘 정보 저장용
|
||
List<LargeIcon> largeIcons = new List<LargeIcon>();
|
||
//사진아이콘 정보 저장용
|
||
List<PhotoIcon> photoIcons = new List<PhotoIcon>();
|
||
|
||
List<Emoji> beforeEmojis = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis2 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons2 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons2 = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis3 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons3 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons3 = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis4 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons4 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons4 = new List<PhotoIcon>();
|
||
|
||
|
||
//표출 말풍선 정보
|
||
int QLines = strs[3].Trim() != "" ? 3 : strs[2].Trim() != "" ? 2 : 1;
|
||
int ALines = strs[7].Trim() != "" ? 3 : strs[6].Trim() != "" ? 2 : 1;
|
||
string txtQ = setTxt(new string[] { strs[1], strs[2], strs[3] }, true, 0);
|
||
string txtA = setTxt(new string[] { strs[5], strs[6], strs[7] }, false, 0);
|
||
if (txtQ.Replace(Environment.NewLine, "").Trim().Equals("")) QLines = 0;
|
||
if (txtA.Replace(Environment.NewLine, "").Trim().Equals("")) ALines = 0;
|
||
|
||
int beforeQLines = aliveLiveChatText[3].Trim() != "" ? 3 : aliveLiveChatText[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines = aliveLiveChatText[7].Trim() != "" ? 3 : aliveLiveChatText[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ = setTxt(new string[] { aliveLiveChatText[1], aliveLiveChatText[2], aliveLiveChatText[3] }, true, 1);
|
||
string beforetxtA = setTxt(new string[] { aliveLiveChatText[5], aliveLiveChatText[6], aliveLiveChatText[7] }, false, 1);
|
||
if (beforetxtQ.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines = 0;
|
||
if (beforetxtA.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines = 0;
|
||
|
||
int beforeQLines2 = aliveLiveChatText2[3].Trim() != "" ? 3 : aliveLiveChatText2[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines2 = aliveLiveChatText2[7].Trim() != "" ? 3 : aliveLiveChatText2[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ2 = setTxt(new string[] { aliveLiveChatText2[1], aliveLiveChatText2[2], aliveLiveChatText2[3] }, true, 2);
|
||
string beforetxtA2 = setTxt(new string[] { aliveLiveChatText2[5], aliveLiveChatText2[6], aliveLiveChatText2[7] }, false, 2);
|
||
if (beforetxtQ2.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines2 = 0;
|
||
if (beforetxtA2.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines2 = 0;
|
||
|
||
int beforeQLines3 = aliveLiveChatText3[3].Trim() != "" ? 3 : aliveLiveChatText3[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines3 = aliveLiveChatText3[7].Trim() != "" ? 3 : aliveLiveChatText3[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ3 = setTxt(new string[] { aliveLiveChatText3[1], aliveLiveChatText3[2], aliveLiveChatText3[3] }, true, 3);
|
||
string beforetxtA3 = setTxt(new string[] { aliveLiveChatText3[5], aliveLiveChatText3[6], aliveLiveChatText3[7] }, false, 3);
|
||
if (beforetxtQ3.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines3 = 0;
|
||
if (beforetxtA3.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines3 = 0;
|
||
|
||
int beforeQLines4 = aliveLiveChatText4[3].Trim() != "" ? 3 : aliveLiveChatText4[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines4 = aliveLiveChatText4[7].Trim() != "" ? 3 : aliveLiveChatText4[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ4 = setTxt(new string[] { aliveLiveChatText4[1], aliveLiveChatText4[2], aliveLiveChatText4[3] }, true, 4);
|
||
string beforetxtA4 = setTxt(new string[] { aliveLiveChatText4[5], aliveLiveChatText4[6], aliveLiveChatText4[7] }, false, 4);
|
||
if (beforetxtQ4.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines4 = 0;
|
||
if (beforetxtA4.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines4 = 0;
|
||
|
||
|
||
|
||
string setTxt(string[] inputs, bool isQuestion, int isBeFore)
|
||
{
|
||
//이모지존재 체크
|
||
for (int i = 0; i < 3; i++) inputs[i] = CheckEmoji(inputs[i], isQuestion, i + 1, isBeFore);
|
||
|
||
string txt = inputs[0];
|
||
if (inputs[1].Trim() != "") txt += Environment.NewLine + inputs[1];
|
||
if (inputs[2].Trim() != "") txt += Environment.NewLine + inputs[2];
|
||
|
||
return txt;
|
||
}
|
||
|
||
int calculGapOfX(string txt)
|
||
{
|
||
int posX = 0;
|
||
//영문 또는 숫자인 경우 절반만 적용하는 방식을 적용해 본다
|
||
foreach (char v in txt)
|
||
{
|
||
//length * 25
|
||
if ((0xAC00 <= v && v <= 0xD7A3) || (0x3131 <= v && v <= 0x318E)) posX += 25;
|
||
else if (Char.IsWhiteSpace(v)) posX += 5;
|
||
else posX += 15;
|
||
}
|
||
return posX;
|
||
}
|
||
|
||
string CheckEmoji(string str, bool isQuestion, int line, int isBefore)
|
||
{
|
||
while (str.Contains("[PH:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[PH:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
PhotoIcon photoIcon = new PhotoIcon(isQuestion, hasContents, false, ImgName);
|
||
|
||
if (isBefore == 4) beforePhotoIcons4.Add(photoIcon);
|
||
else if (isBefore == 3) beforePhotoIcons3.Add(photoIcon);
|
||
else if (isBefore == 2) beforePhotoIcons2.Add(photoIcon);
|
||
else if (isBefore == 1) beforePhotoIcons.Add(photoIcon);
|
||
else photoIcons.Add(photoIcon);
|
||
}
|
||
while (str.Contains("[LI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[LI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
LargeIcon largeIcon = new LargeIcon(isQuestion, hasContents, false, ImgName);
|
||
|
||
if (isBefore == 4) beforeLargeIcons4.Add(largeIcon);
|
||
else if (isBefore == 3) beforeLargeIcons3.Add(largeIcon);
|
||
else if (isBefore == 2) beforeLargeIcons2.Add(largeIcon);
|
||
else if (isBefore == 1) beforeLargeIcons.Add(largeIcon);
|
||
else largeIcons.Add(largeIcon);
|
||
}
|
||
while (str.Contains("[CI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[CI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
LargeIcon largeIcon = new LargeIcon(isQuestion, hasContents, true, ImgName);
|
||
|
||
if (isBefore == 4) beforeLargeIcons4.Add(largeIcon);
|
||
else if (isBefore == 3) beforeLargeIcons3.Add(largeIcon);
|
||
else if (isBefore == 2) beforeLargeIcons2.Add(largeIcon);
|
||
else if (isBefore == 1) beforeLargeIcons.Add(largeIcon);
|
||
else largeIcons.Add(largeIcon);
|
||
}
|
||
while (str.Contains("[SI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[SI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
|
||
if (isQuestion)
|
||
{
|
||
gapOfX = 155; //오른쪽
|
||
|
||
//gapOfX += -calculGapOfX(str.Substring(0, indexOfSI));
|
||
}
|
||
else
|
||
{
|
||
gapOfX = -125; //왼쪽
|
||
gapOfX += calculGapOfX(str.Substring(0, indexOfSI));
|
||
//최대값 넣어야함
|
||
if (gapOfX > 125) gapOfX = 125;
|
||
}
|
||
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
str = str.Insert(indexOfSI, " ");
|
||
|
||
Emoji emoji = new Emoji(isQuestion, line, gapOfX, ImgName);
|
||
|
||
if (isBefore == 4) beforeEmojis4.Add(emoji);
|
||
else if (isBefore == 3) beforeEmojis3.Add(emoji);
|
||
else if (isBefore == 2) beforeEmojis2.Add(emoji);
|
||
else if (isBefore == 1) beforeEmojis.Add(emoji);
|
||
else emojis.Add(emoji);
|
||
}
|
||
|
||
|
||
return str;
|
||
}
|
||
|
||
KAScene.GetObject("txt1").SetValue(txtQ);
|
||
KAScene.GetObject("txt2").SetValue(txtA);
|
||
if (hasBeforeScene)
|
||
{
|
||
KAScene.GetObject("txt3").SetValue(beforetxtQ);
|
||
KAScene.GetObject("txt4").SetValue(beforetxtA);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAScene.GetObject("txt5").SetValue(beforetxtQ2);
|
||
KAScene.GetObject("txt6").SetValue(beforetxtA2);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAScene.GetObject("txt7").SetValue(beforetxtQ3);
|
||
KAScene.GetObject("txt8").SetValue(beforetxtA3);
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAScene.GetObject("txt9").SetValue(beforetxtQ4);
|
||
KAScene.GetObject("txt10").SetValue(beforetxtA4);
|
||
}
|
||
|
||
//아이콘 Visible Setting
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
KAScene.GetObject("img" + i).SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_가로형").SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_정사각").SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_세로형").SetVisible(0);
|
||
|
||
for (int j = 1; j < 6; j++) KAScene.GetObject("emoji" + i + "_" + j).SetVisible(0);
|
||
}
|
||
|
||
//이모지 표출을 위치 계산
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
string getIconPath(string fileName, bool isEmoji, bool isCharecter)
|
||
{
|
||
var directory = Path.GetDirectoryName(path4_0);
|
||
var path = "";
|
||
if (isCharecter)
|
||
{
|
||
if (isEmoji) path = directory + @"\character\" + fileName + "_60.png";
|
||
else path = directory + @"\character\" + fileName + "_120.png";
|
||
}
|
||
else
|
||
{
|
||
if (isEmoji) path = directory + @"\icons_small\" + fileName + "_s.png";
|
||
else path = directory + @"\icons\" + fileName + ".png";
|
||
}
|
||
|
||
|
||
return path;
|
||
}
|
||
|
||
//임시 - X값 계산 수식을 다시 정해야함..
|
||
int emojiQ = 0;
|
||
int emojiA = 0;
|
||
foreach (var emoji in emojis)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji1_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji2_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -10, -40, -70 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
if (hasBeforeScene)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji3_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji4_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis2)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji5_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji6_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis3)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji7_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji8_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis3)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji9_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji10_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
//텍스트 라인 수에 따른 위치 조절
|
||
KAObject = KAScene.GetObject("boxs");
|
||
//시작값 -400
|
||
int keyIndex = 0;
|
||
int 애니메이션Y값 = -400;
|
||
int 박스Y값위치기본 = 620;
|
||
int 박스Y값위치 = 620;
|
||
int 채팅기본Y값 = Convert.ToInt32(textBox10.Text); //80;//75;
|
||
int 답변자케릭터추가값 = Convert.ToInt32(txt답변값.Text);
|
||
int 아이콘위치조절용 = Convert.ToInt32(textBox11.Text); // 35;
|
||
int 채팅1줄값 = Convert.ToInt32(textBox12.Text); // 30;
|
||
int 아이콘Y값 = Convert.ToInt32(textBox13.Text); //130;
|
||
int 사진Y값 = 330;
|
||
int 표출가능 = 500;
|
||
int 표출누적Y값 = 0;
|
||
bool 표출가능값초과여부 = false;
|
||
List<int> 누적표출값500초과 = new List<int>();
|
||
|
||
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
KAScene.GetObject("box" + i).SetVisible(0);
|
||
KAScene.GetObject("txtbox" + i).SetVisible(0);
|
||
}
|
||
|
||
void SetBox(string boxName, int Lines, bool areadyShown)
|
||
{
|
||
KAScene.GetObject("txt" + boxName).SetVisible(1);
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
int 답변체크용 = Convert.ToInt32(boxName.Replace("box", ""));
|
||
|
||
int 더할값 = 채팅기본Y값 + (채팅1줄값 * Lines); ;
|
||
|
||
//답변자아이콘 추가에 따른 값
|
||
if (답변체크용 % 2 == 0)
|
||
{
|
||
if (답변자아이콘존재여부[답변체크용])
|
||
{
|
||
//답변이 있는 경우
|
||
더할값 += 답변자케릭터추가값;
|
||
float 기본Y컨텐츠 = (float)-10.5 - 답변자케릭터추가값;
|
||
KAScene.GetObject("boxContents" + 답변체크용).SetPosition(0, 기본Y컨텐츠, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
//답변이 없는 경우
|
||
float 기본Y컨텐츠 = (float)-10.5;
|
||
KAScene.GetObject("boxContents" + 답변체크용).SetPosition(0, 기본Y컨텐츠, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
|
||
//box 측면에서 보이게 하는 값 설정 - 임시 이미 보이는 상태라면 바로 보이도록 변경해야함
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
//KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
//KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
|
||
}
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
|
||
|
||
//Console.WriteLine(boxName + " 표출누적Y값 : " + 표출누적Y값);
|
||
|
||
}
|
||
void SetLargeIcon(string boxName, int Lines, List<LargeIcon> icons, bool isQuestion, string imgName, bool areadyShown)
|
||
{
|
||
//아이콘 값이 있는지 확인
|
||
foreach (var largeIcon in icons)
|
||
{
|
||
if (largeIcon.isQuestion == isQuestion)
|
||
{
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
int iconYPos = 0;
|
||
|
||
|
||
int 더할값 = largeIcon.hasContents ? 아이콘Y값 : 아이콘Y값 + 55;
|
||
|
||
if (largeIcon.hasContents)
|
||
{
|
||
iconYPos += -(Lines * 채팅1줄값 + 100);
|
||
}
|
||
else
|
||
{
|
||
iconYPos += -55;
|
||
|
||
//컨텐츠가 없으므로, 박스가 나오는 시간을 정상화 시켜야 한다
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
}
|
||
|
||
string tag = imgName;
|
||
KAObject = KAScene.GetObject(tag);
|
||
|
||
//if (!isQuestion) iconYPos -= 답변자케릭터추가값;
|
||
iconYPos += 아이콘위치조절용;
|
||
KAObject.SetPosition(0, iconYPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetValue(getIconPath(largeIcon.value, false, largeIcon.isCharecter));
|
||
KAObject.SetImageOriginalSize();
|
||
KAObject.SetVisible(1);
|
||
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
if (isQuestion)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)115, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)115, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-38.15, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-38.15, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
//Console.WriteLine(boxName + " icon 표출누적Y값 : " + 표출누적Y값);
|
||
}
|
||
void SetPhotoIcon(string boxName, int Lines, List<PhotoIcon> icons, bool isQuestion, string imgName, bool areadyShown)
|
||
{
|
||
//아이콘 값이 있는지 확인
|
||
foreach (var photoIcon in icons)
|
||
{
|
||
if (photoIcon.isQuestion == isQuestion)
|
||
{
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
int iconYPos = 0;
|
||
string photoSize = photoIcon.value.Split(':')[1];
|
||
int 더할값 = photoIcon.hasContents ? 사진Y값 : 사진Y값 + 0;
|
||
|
||
if (photoIcon.hasContents)
|
||
{
|
||
iconYPos += -(Lines * 채팅1줄값 + 100);
|
||
if (photoSize.Equals("세로형"))
|
||
{
|
||
더할값 += 55;
|
||
}
|
||
else if (photoSize.Equals("가로형"))
|
||
{
|
||
더할값 += -95;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
iconYPos += -55;
|
||
더할값 += 80;
|
||
if (photoSize.Equals("세로형"))
|
||
{
|
||
더할값 += 55;
|
||
}
|
||
else if (photoSize.Equals("가로형"))
|
||
{
|
||
더할값 += -95;
|
||
}
|
||
|
||
//컨텐츠가 없으므로, 박스가 나오는 시간을 정상화 시켜야 한다
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
string tag = imgName;
|
||
KAObject = KAScene.GetObject(tag + "_" + photoSize);
|
||
|
||
//if (!isQuestion) iconYPos -= 답변자케릭터추가값;
|
||
iconYPos += 아이콘위치조절용;
|
||
|
||
//이미지이기 떄문에 변경
|
||
iconYPos += 65;
|
||
|
||
|
||
KAObject.SetPosition(0, iconYPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
//임시 VRV테스트용도
|
||
KAObject.SetValue(getPhotoIconPath(photoIcon.value));
|
||
//KAObject.SetVideoFrame(600 ,600);
|
||
KAObject.SetVisible(1);
|
||
//KAObject.SetVideoRepeatInfo(0, 10000, 1000, 1, 1);
|
||
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
if (isQuestion)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)17.42, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)17.42, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(0, (float)59.27, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)59.27, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
//Console.WriteLine(boxName + "Photo icon 표출누적Y값 : " + 표출누적Y값);
|
||
}
|
||
int 마지막값 = -400;
|
||
|
||
if (hasBeforeScene4)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치9 : " + 박스Y값위치);
|
||
if (beforeQLines4 > 0) SetBox("box9", beforeQLines4, true);
|
||
SetLargeIcon("box9", beforeQLines4, beforeLargeIcons4, true, "img9", true);
|
||
SetPhotoIcon("box9", beforeQLines4, beforePhotoIcons4, true, "img9", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치10 : " + 박스Y값위치);
|
||
if (beforeALines4 > 0) SetBox("box10", beforeALines4, true);
|
||
SetLargeIcon("box10", beforeALines4, beforeLargeIcons4, false, "img10", true);
|
||
SetPhotoIcon("box10", beforeALines4, beforePhotoIcons4, false, "img10", true);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치7 : " + 박스Y값위치);
|
||
if (beforeQLines3 > 0) SetBox("box7", beforeQLines3, true);
|
||
SetLargeIcon("box7", beforeQLines3, beforeLargeIcons3, true, "img7", true);
|
||
SetPhotoIcon("box7", beforeQLines3, beforePhotoIcons3, true, "img7", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치8 : " + 박스Y값위치);
|
||
if (beforeALines3 > 0) SetBox("box8", beforeALines3, true);
|
||
SetLargeIcon("box8", beforeALines3, beforeLargeIcons3, false, "img8", true);
|
||
SetPhotoIcon("box8", beforeALines3, beforePhotoIcons3, false, "img8", true);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치5 : " + 박스Y값위치);
|
||
if (beforeQLines2 > 0) SetBox("box5", beforeQLines2, true);
|
||
SetLargeIcon("box5", beforeQLines2, beforeLargeIcons2, true, "img5", true);
|
||
SetPhotoIcon("box5", beforeQLines2, beforePhotoIcons2, true, "img5", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치6 : " + 박스Y값위치);
|
||
if (beforeALines2 > 0) SetBox("box6", beforeALines2, true);
|
||
SetLargeIcon("box6", beforeALines2, beforeLargeIcons2, false, "img6", true);
|
||
SetPhotoIcon("box6", beforeALines2, beforePhotoIcons2, false, "img6", true);
|
||
}
|
||
if (hasBeforeScene)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치3 : " + 박스Y값위치);
|
||
if (beforeQLines > 0) SetBox("box3", beforeQLines, true);
|
||
SetLargeIcon("box3", beforeQLines, beforeLargeIcons, true, "img3", true);
|
||
SetPhotoIcon("box3", beforeQLines, beforePhotoIcons, true, "img3", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치4 : " + 박스Y값위치);
|
||
if (beforeALines > 0) SetBox("box4", beforeALines, true);
|
||
SetLargeIcon("box4", beforeALines, beforeLargeIcons, false, "img4", true);
|
||
SetPhotoIcon("box4", beforeALines, beforePhotoIcons, false, "img4", true);
|
||
}
|
||
|
||
if (표출누적Y값 > 500) 마지막값 = 마지막값 = -400 + 표출누적Y값 - 500;
|
||
|
||
//Console.WriteLine("송출전마지막값1 : " + 마지막값);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치1 : " + 박스Y값위치);
|
||
if (QLines > 0) SetBox("box1", QLines, false);
|
||
SetLargeIcon("box1", QLines, largeIcons, true, "img1", false);
|
||
SetPhotoIcon("box1", QLines, photoIcons, true, "img1", false);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치2 : " + 박스Y값위치);
|
||
if (ALines > 0) SetBox("box2", ALines, false);
|
||
SetLargeIcon("box2", ALines, largeIcons, false, "img2", false);
|
||
SetPhotoIcon("box2", ALines, photoIcons, false, "img2", false);
|
||
|
||
|
||
//현재 값 계산 - 끝
|
||
|
||
|
||
//Y값 애니메이션 위치 조절
|
||
KAObject = KAScene.GetObject("boxs");
|
||
|
||
for (int i = 0; i <= 현재키프레임; i++)
|
||
{
|
||
KAObject.SetPositionKey(i, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
현재키프레임++;
|
||
|
||
|
||
foreach (var v in 누적표출값500초과)
|
||
{
|
||
마지막값 = -400 + v - 표출가능;
|
||
KAObject.SetPositionKey(현재키프레임, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
현재키프레임++;
|
||
KAObject.SetPositionKey(현재키프레임, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
현재키프레임++;
|
||
|
||
//Console.WriteLine("송출전마지막값 누적표출초과 계산 후 : " + 마지막값);
|
||
}
|
||
|
||
timeOfBefore = 키프레임값[현재키프레임];
|
||
for (int i = 현재키프레임; i < 11; i++)
|
||
{
|
||
KAObject.SetPositionKey(i, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
//Console.WriteLine("마지막값 : " + 마지막값);
|
||
//현재 텍스트 저장
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText4[i] = aliveLiveChatText3[i];
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText3[i] = aliveLiveChatText2[i];
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText2[i] = aliveLiveChatText[i];
|
||
for (int i = 0; i < 8; i++) aliveLiveChatText[i] = strs[i];
|
||
aliveLiveChatText[8] = strs[13];
|
||
}
|
||
else if (dispLines == 5)
|
||
{
|
||
if (!isTopLeft) beforeNewGroups = new List<NewGroup>();
|
||
isTopLeft = true;
|
||
int 질문자시작순서 = 6;
|
||
int 질문자라인수 = 0;
|
||
for (int i = 1; i < 4; i++) if (!strs[i].Equals("")) 질문자라인수++;
|
||
int 답변자시작순서 = 6 + 질문자라인수;
|
||
int 답변자라인수 = 0;
|
||
for (int i = 5; i < 8; i++) if (!strs[i].Equals("")) 답변자라인수++;
|
||
int 송출라인수 = 질문자라인수 + 답변자라인수;
|
||
|
||
|
||
if (질문자라인수 > 0) beforeNewGroups.Add(new NewGroup(true, strs[0], strs[1], strs[2], strs[3], "", 질문자시작순서));
|
||
if (답변자라인수 > 0) beforeNewGroups.Add(new NewGroup(false, strs[4], strs[5], strs[6], strs[7], strs[13], 답변자시작순서));
|
||
|
||
#region Tornado2 값 변경 파트
|
||
for (int i = 1; i < 7; i++)
|
||
{
|
||
KAScene.GetObject("gq" + i).SetVisible(0);
|
||
KAScene.GetObject("ga" + i).SetVisible(0);
|
||
KAScene.GetObject("gb" + i).SetVisible(0);
|
||
}
|
||
|
||
int 질문자순서 = 1;
|
||
int 답변자순서 = 1;
|
||
int 답변자이미지순서 = 1;
|
||
float 질문자기본위치 = 370;
|
||
float 답변자기본위치 = 374;
|
||
|
||
while (beforeNewGroups.Count > 6)
|
||
{
|
||
beforeNewGroups.RemoveAt(0);
|
||
}
|
||
|
||
|
||
foreach (var b in beforeNewGroups)
|
||
{
|
||
string directory = Path.GetDirectoryName(path4_4);
|
||
string path = directory + @"\character\" + b.profilePath + "_50.png";
|
||
bool itHasImage = File.Exists(path);
|
||
|
||
|
||
int index = 질문자순서;
|
||
if (!b.isQuestion) index = itHasImage ? 답변자이미지순서 : 답변자순서;
|
||
string tag = "gq";
|
||
if (!b.isQuestion) tag = itHasImage ? "ga" : "gb";
|
||
tag = tag + index;
|
||
//Profile
|
||
if (!b.isQuestion && itHasImage) KAScene.GetObject(tag + "p").SetValue(path);
|
||
|
||
//Visible
|
||
KAScene.GetObject(tag).SetVisible(1);
|
||
KAScene.GetObject(tag + "l1").SetVisible(b.line1.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l2").SetVisible(b.line2.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l3").SetVisible(b.line3.Equals("") ? 0 : 1);
|
||
|
||
//FrameSetting
|
||
for (int i = 0; i < 12; i++)
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
for (int i = 11; i > -1; i--)
|
||
{
|
||
int time = 0;
|
||
for (int j = 1; j <= i; j++) time += j % 2 == 0 ? timeOfWait : timeOfChange;
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, time, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
//Position
|
||
float posY = b.isQuestion ? 질문자기본위치 : 답변자기본위치;
|
||
posY -= (51 * b.yPos);
|
||
float lastPos = 0;
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
if ((i + 1) / 2 <= 송출라인수) lastPos = posY + (((i + 1) / 2) * 51);
|
||
KAScene.GetObject(tag).SetPositionKey(i, 0, lastPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
//TextValue
|
||
KAScene.GetObject(tag + "w").SetValue(b.id);
|
||
if (b.isQuestion)
|
||
{
|
||
KAScene.GetObject(tag + "l1t").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l2t").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l3t").SetValue(b.line3);
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
/*
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
|
||
KAScene.GetObject(tag + "l2t").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l2t").SetVisible(1);
|
||
KAScene.GetObject(tag + "l2b").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3t").SetValue(b.line3);
|
||
KAScene.GetObject(tag + "l3t").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3b").SetVisible(1);
|
||
*/
|
||
|
||
if (Encoding.Default.GetByteCount(b.line1) < Encoding.Default.GetByteCount(b.line2))
|
||
{
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l1t2").SetVisible(1);
|
||
KAScene.GetObject(tag + "l2t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l2b").SetVisible(0);
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l2t").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l1t2").SetVisible(0);
|
||
KAScene.GetObject(tag + "l2t").SetVisible(1);
|
||
KAScene.GetObject(tag + "l2b").SetVisible(1);
|
||
KAScene.GetObject(tag + "l2").SetVisible(0);
|
||
if (b.line2.Equals("")) KAScene.GetObject(tag + "l2b").SetVisible(0);
|
||
}
|
||
|
||
if (Encoding.Default.GetByteCount(b.line1) < Encoding.Default.GetByteCount(b.line3))
|
||
{
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line3);
|
||
KAScene.GetObject(tag + "l1t3").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l3b").SetVisible(0);
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l3t").SetValue(b.line3);
|
||
KAScene.GetObject(tag + "l1t3").SetVisible(0);
|
||
KAScene.GetObject(tag + "l3t").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3b").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3").SetVisible(0);
|
||
if (b.line3.Equals("")) KAScene.GetObject(tag + "l3b").SetVisible(0);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
//Color
|
||
KAScene.GetObject(tag + "w").SetStyleColor(getColor(b.isQuestion ? lbl_color_1 : lbl_color_3));
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "t").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
KAScene.GetObject(tag + "l" + i + "t1").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
|
||
|
||
KAScene.GetObject(tag + "l" + i).SetStyleColor(getColor(b.isQuestion ? lbl_color_5 : lbl_color_6));
|
||
|
||
if (!b.isQuestion)
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "b").SetStyleColor(getColor(lbl_color_6));
|
||
KAScene.GetObject(tag + "l" + i).SetStyleColor(getColor(lbl_color_6));
|
||
KAScene.GetObject(tag + "l1t" + i).SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
}
|
||
|
||
|
||
|
||
if (b.isQuestion) 질문자순서++;
|
||
else
|
||
{
|
||
if (itHasImage) 답변자이미지순서++;
|
||
else 답변자순서++;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
//송출라인만큼 올려서 화면에 표출할 필요가 없으면 제거한다
|
||
foreach (var v in beforeNewGroups) v.setYPos(송출라인수);
|
||
|
||
beforeNewGroups = beforeNewGroups.FindAll(x => x.yPos > -2);
|
||
|
||
timeOfBefore = 송출라인수 * (timeOfWait + timeOfChange);
|
||
}
|
||
else if (dispLines == 6)
|
||
{
|
||
if (isTopLeft) beforeNewGroups = new List<NewGroup>();
|
||
isTopLeft = false;
|
||
int 질문자시작순서 = 6;
|
||
int 질문자라인수 = 0;
|
||
|
||
bool VRV여부 = false;
|
||
|
||
NewGroup 질문 = new NewGroup(true, strs[0], strs[1], strs[2], strs[3], "", 질문자시작순서);
|
||
if (!질문.line1.Equals("")) 질문자라인수++;
|
||
if (!질문.line2.Equals("")) 질문자라인수++;
|
||
if (!질문.line3.Equals("")) 질문자라인수++;
|
||
if (질문자라인수 > 0) beforeNewGroups.Add(질문);
|
||
int 답변자시작순서 = 6 + 질문자라인수;
|
||
int 답변자라인수 = 0;
|
||
NewGroup 답변 = new NewGroup(false, strs[4], strs[5], strs[6], strs[7], strs[13], 답변자시작순서);
|
||
if (답변.isHaveVrv)
|
||
{
|
||
답변.line1 = "";
|
||
답변.line2 = "";
|
||
답변.line3 = "";
|
||
}
|
||
|
||
|
||
if (!답변.line1.Equals("")) 답변자라인수++;
|
||
if (!답변.line2.Equals("")) 답변자라인수++;
|
||
if (!답변.line3.Equals("")) 답변자라인수++;
|
||
if (답변.isHaveImage) 답변자라인수 += 2;
|
||
else if (답변.isHaveIcon) 답변자라인수 += 2;
|
||
else if (답변.isHaveVrv)
|
||
{
|
||
답변자라인수 += 2;
|
||
VRV여부 = true;
|
||
}
|
||
int 송출라인수 = 질문자라인수 + 답변자라인수;
|
||
|
||
|
||
|
||
if (답변자라인수 > 0) beforeNewGroups.Add(답변);
|
||
|
||
#region Tornado2 값 변경 파트
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
KAScene.GetObject("gq" + i).SetVisible(0);
|
||
KAScene.GetObject("ga" + i).SetVisible(0);
|
||
KAScene.GetObject("gb" + i).SetVisible(0);
|
||
KAScene.GetObject("gc" + i).SetVisible(0);
|
||
KAScene.GetObject("gd" + i).SetVisible(0);
|
||
KAScene.GetObject("ge" + i).SetVisible(0);
|
||
}
|
||
|
||
int 질문자순서 = 1;
|
||
int 답변자순서 = 1;
|
||
int 답변자프로필순서 = 1;
|
||
int 답변자사진순서 = 1;
|
||
int 답변자아이콘순서 = 1;
|
||
int 답변자VRV순서 = 1;
|
||
float 기본위치 = -181;
|
||
|
||
while (beforeNewGroups.Count > 4)
|
||
{
|
||
beforeNewGroups.RemoveAt(0);
|
||
}
|
||
|
||
List<NewGroup> bufG = new List<NewGroup>();
|
||
for (int i = 0; i < beforeNewGroups.Count; i++)
|
||
bufG.Add(beforeNewGroups[beforeNewGroups.Count - 1 - i]);
|
||
|
||
//foreach (var b in beforeNewGroups)
|
||
|
||
int vrvCount = 0;
|
||
|
||
foreach (var b in bufG)
|
||
{
|
||
string directory = Path.GetDirectoryName(path4_5);
|
||
string path = directory + @"\character\" + b.profilePath + "_50.png";
|
||
bool itHasProfileImage = File.Exists(path);
|
||
|
||
if (b.isHaveVrv) vrvCount++;
|
||
|
||
int index = 질문자순서;
|
||
if (!b.isQuestion)
|
||
{
|
||
if (b.isHaveImage) index = 답변자사진순서;
|
||
else if (b.isHaveIcon) index = 답변자아이콘순서;
|
||
else index = itHasProfileImage ? 답변자프로필순서 : 답변자순서;
|
||
}
|
||
if (b.isHaveVrv)
|
||
{
|
||
if (!VRV여부) index = 2;
|
||
else
|
||
{
|
||
index = vrvCount;
|
||
}
|
||
}
|
||
|
||
string tag = "gq";
|
||
if (!b.isQuestion)
|
||
{
|
||
if (b.isHaveImage) tag = "gc";
|
||
else if (b.isHaveIcon) tag = "gd";
|
||
else if (b.isHaveVrv) tag = "ge";
|
||
else tag = itHasProfileImage ? "ga" : "gb";
|
||
}
|
||
tag = tag + index;
|
||
//Profile
|
||
if (!b.isQuestion && itHasProfileImage)
|
||
{
|
||
KAScene.GetObject(tag + "p").SetVisible(1);
|
||
KAScene.GetObject(tag + "p").SetValue(path);
|
||
}
|
||
else KAScene.GetObject(tag + "p").SetVisible(0);
|
||
|
||
//Visible
|
||
KAScene.GetObject(tag).SetVisible(1);
|
||
KAScene.GetObject(tag + "l1").SetVisible(b.line1.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l2").SetVisible(b.line2.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l3").SetVisible(b.line3.Equals("") ? 0 : 1);
|
||
|
||
//FrameSetting
|
||
for (int i = 0; i < 18; i++)
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
for (int i = 17; i > -1; i--)
|
||
{
|
||
int time = 0;
|
||
for (int j = 1; j <= i; j++) time += j % 2 == 0 ? timeOfWait : timeOfChange;
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, time, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
//Position
|
||
float posY = 기본위치;
|
||
posY -= (50 * b.yPos);
|
||
float lastPos = 0;
|
||
float firstPos = 0;
|
||
for (int i = 0; i < 18; i++)
|
||
{
|
||
//기존방식
|
||
/*
|
||
if ((i + 1) / 2 <= 송출라인수)
|
||
{
|
||
lastPos = posY + (((i + 1) / 2) * 50);
|
||
|
||
}
|
||
*/
|
||
//VRV가 있고 VRV가 적용되는 포지션에서는 한번 더 숫자를 더해준다.
|
||
if (VRV여부)
|
||
{
|
||
if ((i + 1) / 2 < 송출라인수)
|
||
{
|
||
lastPos = posY + (((i + 1) / 2) * 50);
|
||
if ((i + 1) / 2 >= (질문자라인수 + 1))
|
||
{
|
||
lastPos = posY + (((i + 1) / 2) * 50) + 50;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if ((i + 1) / 2 <= 송출라인수)
|
||
{
|
||
lastPos = posY + (((i + 1) / 2) * 50);
|
||
|
||
}
|
||
}
|
||
if (i > 0)
|
||
{
|
||
if ((VRV여부 && vrvCount > 1) || (!VRV여부 && vrvCount > 0))
|
||
{
|
||
lastPos = posY + (((i + 1) / 2) * 50) + 50;
|
||
}
|
||
}
|
||
|
||
KAScene.GetObject(tag).SetPositionKey(i, 0, lastPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (i == 0) firstPos = lastPos;
|
||
}
|
||
|
||
//이미지및 이모티콘 적용
|
||
if (b.isHaveImage)
|
||
{
|
||
KAScene.GetObject(tag + "photo").SetValue(getPhotoIconPath(b.imgName));
|
||
}
|
||
else if (b.isHaveIcon)
|
||
{
|
||
if (b.isHaveCIcon)
|
||
{
|
||
string path2 = directory + @"\character2\" + b.iconName + "_100.png";
|
||
KAScene.GetObject(tag + "i").SetValue(path2);
|
||
KAScene.GetObject(tag + "i").SetImageOriginalSize();
|
||
}
|
||
else
|
||
{
|
||
string path2 = directory + @"\icons2\" + b.iconName + ".png";
|
||
KAScene.GetObject(tag + "i").SetValue(path2);
|
||
}
|
||
}
|
||
|
||
KAScene.GetObject(tag + "1_tag").SetVisible(b.isHaveTag1 ? 1 : 0);
|
||
KAScene.GetObject(tag + "2_tag").SetVisible(b.isHaveTag2 ? 1 : 0);
|
||
KAScene.GetObject(tag + "3_tag").SetVisible(b.isHaveTag3 ? 1 : 0);
|
||
|
||
if (b.isHaveTag1)
|
||
{
|
||
string path2 = directory + @"\tag\" + b.tagName + ".vrv";
|
||
KAScene.GetObject(tag + "1_tag").SetValue(path2);
|
||
if (firstPos > -450) KAScene.GetObject(tag + "1_tag").SetVideoFrame(frameTAG, frameTAG);
|
||
}
|
||
if (b.isHaveTag2)
|
||
{
|
||
string path2 = directory + @"\tag\" + b.tagName + ".vrv";
|
||
KAScene.GetObject(tag + "2_tag").SetValue(path2);
|
||
if (firstPos > -450) KAScene.GetObject(tag + "2_tag").SetVideoFrame(frameTAG, frameTAG);
|
||
}
|
||
if (b.isHaveTag3)
|
||
{
|
||
string path2 = directory + @"\tag\" + b.tagName + ".vrv";
|
||
KAScene.GetObject(tag + "3_tag").SetValue(path2);
|
||
if (firstPos > -450) KAScene.GetObject(tag + "3_tag").SetVideoFrame(frameTAG, frameTAG);
|
||
}
|
||
|
||
|
||
|
||
if (b.isHaveVrv)
|
||
{
|
||
string path2 = directory + @"\vrv\" + b.vrvName + ".vrv";
|
||
KAScene.GetObject(tag + "v").SetValue(path2);
|
||
|
||
if (firstPos > -450) KAScene.GetObject(tag + "v").SetVideoFrame(frameVRV, frameVRV);
|
||
}
|
||
|
||
|
||
//TextValue
|
||
KAScene.GetObject(tag + "w").SetValue(b.id);
|
||
|
||
if (b.isQuestion)
|
||
{
|
||
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
if (i == 1) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line1);
|
||
else if (i == 2) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line2);
|
||
else if (i == 3) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line3);
|
||
|
||
|
||
KAScene.GetObject(tag + "l1t" + i).SetVisible(1);
|
||
KAScene.GetObject(tag + "l" + i + "t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l" + i + "b").SetVisible(0);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
|
||
|
||
if (b.isHaveIcon || b.isHaveImage)
|
||
{
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
if (i == 1) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line1);
|
||
else if (i == 2) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line2);
|
||
else if (i == 3) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line3);
|
||
|
||
|
||
KAScene.GetObject(tag + "l1t" + i).SetVisible(1);
|
||
KAScene.GetObject(tag + "l" + i + "t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l" + i + "b").SetVisible(0);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
if (i == 1) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line1);
|
||
else if (i == 2) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line2);
|
||
else if (i == 3) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line3);
|
||
|
||
|
||
KAScene.GetObject(tag + "l1t" + i).SetVisible(1);
|
||
KAScene.GetObject(tag + "l" + i + "t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l" + i + "b").SetVisible(0);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
|
||
|
||
//Color
|
||
KAScene.GetObject(tag + "w").SetStyleColor(getColor(b.isQuestion ? lbl_color_1 : lbl_color_3));
|
||
if (!b.isQuestion) KAScene.GetObject(tag + "wb").SetStyleColor(getColor(lbl_color_6));
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
|
||
|
||
KAScene.GetObject(tag + "l" + i + "t").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
KAScene.GetObject(tag + "l" + i + "t1").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
|
||
|
||
KAScene.GetObject(tag + "l" + i).SetStyleColor(getColor(b.isQuestion ? lbl_color_5 : lbl_color_6));
|
||
|
||
if (!b.isQuestion)
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "b").SetStyleColor(getColor(lbl_color_6));
|
||
KAScene.GetObject(tag + "l1t" + i).SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "b").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject(tag + "l1t" + i).SetStyleColor(getColor(lbl_color_2));
|
||
}
|
||
}
|
||
|
||
if (b.isQuestion) 질문자순서++;
|
||
else
|
||
{
|
||
if (b.isHaveImage) 답변자사진순서++;
|
||
else if (b.isHaveIcon) 답변자아이콘순서++;
|
||
else if (itHasProfileImage) 답변자프로필순서++;
|
||
else 답변자순서++;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
//송출라인만큼 올려서 화면에 표출할 필요가 없으면 제거한다
|
||
foreach (var v in beforeNewGroups) v.setYPos(송출라인수);
|
||
beforeNewGroups = beforeNewGroups.FindAll(x => x.yPos > -2);
|
||
timeOfBefore = 송출라인수 * (timeOfWait + timeOfChange);
|
||
|
||
|
||
#region legacy
|
||
/* 이전코드
|
||
if (isTopLeft) beforeNewGroups = new List<NewGroup>();
|
||
isTopLeft = false;
|
||
int 질문자시작순서 = 6;
|
||
int 질문자라인수 = 0;
|
||
|
||
NewGroup 질문 = new NewGroup(true, strs[0], strs[1], strs[2], strs[3], "", 질문자시작순서);
|
||
if (!질문.line1.Equals("")) 질문자라인수++;
|
||
if (!질문.line2.Equals("")) 질문자라인수++;
|
||
if (!질문.line3.Equals("")) 질문자라인수++;
|
||
if (질문자라인수 > 0) beforeNewGroups.Add(질문);
|
||
int 답변자시작순서 = 6 + 질문자라인수;
|
||
int 답변자라인수 = 0;
|
||
NewGroup 답변 = new NewGroup(false, strs[4], strs[5], strs[6], strs[7], strs[13], 답변자시작순서);
|
||
|
||
if (!답변.line1.Equals("")) 답변자라인수++;
|
||
if (!답변.line2.Equals("")) 답변자라인수++;
|
||
if (!답변.line3.Equals("")) 답변자라인수++;
|
||
if (답변.isHaveImage) 답변자라인수 += 3;
|
||
else if (답변.isHaveIcon) 답변자라인수 += 2;
|
||
int 송출라인수 = 질문자라인수 + 답변자라인수;
|
||
|
||
if (답변자라인수 > 0) beforeNewGroups.Add(답변);
|
||
|
||
#region Tornado2 값 변경 파트
|
||
for (int i = 1; i < 7; i++)
|
||
{
|
||
KAScene.GetObject("gq" + i).SetVisible(0);
|
||
KAScene.GetObject("ga" + i).SetVisible(0);
|
||
KAScene.GetObject("gb" + i).SetVisible(0);
|
||
KAScene.GetObject("gc" + i).SetVisible(0);
|
||
KAScene.GetObject("gd" + i).SetVisible(0);
|
||
}
|
||
|
||
int 질문자순서 = 1;
|
||
int 답변자순서 = 1;
|
||
int 답변자프로필순서 = 1;
|
||
int 답변자사진순서 = 1;
|
||
int 답변자아이콘순서 = 1;
|
||
float 기본위치 = -181;
|
||
|
||
while (beforeNewGroups.Count > 4)
|
||
{
|
||
beforeNewGroups.RemoveAt(0);
|
||
}
|
||
foreach (var b in beforeNewGroups)
|
||
{
|
||
string directory = Path.GetDirectoryName(path4_4);
|
||
string path = directory + @"\character\" + b.profilePath + "_50.png";
|
||
bool itHasProfileImage = File.Exists(path);
|
||
|
||
|
||
int index = 질문자순서;
|
||
if (!b.isQuestion)
|
||
{
|
||
if (b.isHaveImage) index = 답변자사진순서;
|
||
else if (b.isHaveIcon) index = 답변자아이콘순서;
|
||
else index = itHasProfileImage ? 답변자프로필순서 : 답변자순서;
|
||
}
|
||
string tag = "gq";
|
||
if (!b.isQuestion)
|
||
{
|
||
if (b.isHaveImage) tag = "gc";
|
||
else if (b.isHaveIcon) tag = "gd";
|
||
else tag = itHasProfileImage ? "ga" : "gb";
|
||
}
|
||
tag = tag + index;
|
||
//Profile
|
||
if (!b.isQuestion && itHasProfileImage)
|
||
{
|
||
KAScene.GetObject(tag + "p").SetVisible(1);
|
||
KAScene.GetObject(tag + "p").SetValue(path);
|
||
}
|
||
else KAScene.GetObject(tag + "p").SetVisible(0);
|
||
|
||
//Visible
|
||
KAScene.GetObject(tag).SetVisible(1);
|
||
KAScene.GetObject(tag + "l1").SetVisible(b.line1.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l2").SetVisible(b.line2.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l3").SetVisible(b.line3.Equals("") ? 0 : 1);
|
||
|
||
//FrameSetting
|
||
for (int i = 0; i < 18; i++)
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
for (int i = 17; i > -1; i--)
|
||
{
|
||
int time = 0;
|
||
for (int j = 1; j <= i; j++) time += j % 2 == 0 ? timeOfWait : timeOfChange;
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, time, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
//Position
|
||
float posY = 기본위치;
|
||
posY -= (50 * b.yPos);
|
||
float lastPos = 0;
|
||
for (int i = 0; i < 18; i++)
|
||
{
|
||
if ((i + 1) / 2 <= 송출라인수) lastPos = posY + (((i + 1) / 2) * 50);
|
||
KAScene.GetObject(tag).SetPositionKey(i, 0, lastPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
//이미지및 이모티콘 적용
|
||
if (b.isHaveImage)
|
||
{
|
||
KAScene.GetObject(tag + "photo").SetValue(getPhotoIconPath(b.imgName));
|
||
}
|
||
else if (b.isHaveIcon)
|
||
{
|
||
if (b.isHaveCIcon)
|
||
{
|
||
string path2 = directory + @"\character2\" + b.iconName + "_100.png";
|
||
KAScene.GetObject(tag + "i").SetValue(path2);
|
||
KAScene.GetObject(tag + "i").SetImageOriginalSize();
|
||
}
|
||
else
|
||
{
|
||
string path2 = directory + @"\icons2\" + b.iconName + ".png";
|
||
KAScene.GetObject(tag + "i").SetValue(path2);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
//TextValue
|
||
KAScene.GetObject(tag + "w").SetValue(b.id);
|
||
if (b.isQuestion)
|
||
{
|
||
KAScene.GetObject(tag + "l1t").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l2t").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l3t").SetValue(b.line3);
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
|
||
|
||
if (b.isHaveIcon || b.isHaveImage)
|
||
{
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
if (i == 1) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line1);
|
||
else if (i==2) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line2);
|
||
else if (i == 3) KAScene.GetObject(tag + "l1t" + i).SetValue(b.line3);
|
||
|
||
|
||
KAScene.GetObject(tag + "l1t" + i).SetVisible(1);
|
||
KAScene.GetObject(tag + "l" + i + "t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l" + i + "b").SetVisible(0);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l1t2").SetVisible(1);
|
||
KAScene.GetObject(tag + "l2t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l2b").SetVisible(1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line3);
|
||
KAScene.GetObject(tag + "l1t3").SetVisible(1);
|
||
KAScene.GetObject(tag + "l3t").SetVisible(0);
|
||
KAScene.GetObject(tag + "l3b").SetVisible(1);
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
//Color
|
||
KAScene.GetObject(tag + "w").SetStyleColor(getColor(b.isQuestion ? lbl_color_1 : lbl_color_3));
|
||
if (!b.isQuestion) KAScene.GetObject(tag + "wb").SetStyleColor(getColor(lbl_color_6));
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "t").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
KAScene.GetObject(tag + "l" + i + "t1").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
|
||
|
||
KAScene.GetObject(tag + "l" + i).SetStyleColor(getColor(b.isQuestion ? lbl_color_5 : lbl_color_6));
|
||
|
||
if (!b.isQuestion)
|
||
{
|
||
KAScene.GetObject(tag + "l" + i + "b").SetStyleColor(getColor(lbl_color_6));
|
||
KAScene.GetObject(tag + "l1t" + i).SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
}
|
||
|
||
|
||
|
||
if (b.isQuestion) 질문자순서++;
|
||
else
|
||
{
|
||
if (b.isHaveImage) 답변자사진순서++;
|
||
else if (b.isHaveIcon) 답변자아이콘순서++;
|
||
else if (itHasProfileImage) 답변자프로필순서++;
|
||
else 답변자순서++;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
//송출라인만큼 올려서 화면에 표출할 필요가 없으면 제거한다
|
||
foreach (var v in beforeNewGroups) v.setYPos(송출라인수);
|
||
beforeNewGroups = beforeNewGroups.FindAll(x => x.yPos > -2);
|
||
timeOfBefore = 송출라인수 * (timeOfWait + timeOfChange);
|
||
|
||
*/
|
||
#endregion
|
||
}
|
||
|
||
|
||
KAScene.SetChangeOut(eKChangeOutType.CHANGE_OUT_TYPE_CHANGE_OUT);
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer4, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer4);
|
||
|
||
|
||
|
||
|
||
if (isLoop == "true")
|
||
{
|
||
if (!timer2.Enabled)
|
||
{
|
||
timer2.Interval = (timeOfBefore + timeOfClear) * 34;
|
||
timer2.Start();
|
||
}
|
||
}
|
||
else if (isLoop == "clear")
|
||
{
|
||
if (!timer3.Enabled)
|
||
{
|
||
timer3.Interval = (timeOfBefore + timeOfClear) * 34;
|
||
timer3.Start();
|
||
}
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
|
||
}
|
||
isDisplay4 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay4)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer4, KAScene);
|
||
|
||
KAScenePlayer.Play(Layer4);
|
||
|
||
//KAEngine.UnloadAll();
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
|
||
for (int i = 0; i < aliveLiveChatText.Length; i++)
|
||
{
|
||
aliveLiveChatText[i] = "";
|
||
aliveLiveChatText2[i] = "";
|
||
aliveLiveChatText3[i] = "";
|
||
aliveLiveChatText4[i] = "";
|
||
}
|
||
|
||
beforeNewGroups = new List<NewGroup>();
|
||
|
||
if (timer1.Enabled) timer1.Stop();
|
||
if (timer2.Enabled) timer2.Stop();
|
||
if (timer3.Enabled) timer3.Stop();
|
||
|
||
isDisplay4 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 5)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay5)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/상품평/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["상품평"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
//송출부분
|
||
KAScene = KAEngine.LoadScene(path5, "상품평");
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
KAObject = KAScene.GetObject("name");
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
for(int i = 1; i < 11; i++)
|
||
{
|
||
KAObject = KAScene.GetObject("txt" + i);
|
||
KAObject.SetValue(strs[i]);
|
||
}
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer5, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer5);
|
||
}
|
||
isDisplay5 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay5)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer5, KAScene);
|
||
KAScenePlayer.Play(Layer5);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay5 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 6)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay6)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/QNA/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["QNA"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
//송출부분
|
||
KAScene = KAEngine.LoadScene(path6, "QNA");
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetValue(strs[0]);
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetValue(strs[4]);
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetValue(strs[7]);
|
||
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer6, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer6);
|
||
}
|
||
isDisplay6 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay6)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer6, KAScene);
|
||
KAScenePlayer.Play(Layer6);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay6 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 7)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay7)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/공지/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["공지"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
//송출부분
|
||
KAScene = KAEngine.LoadScene(path7, "공지");
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt");
|
||
KAObject.SetValue(dispStr);
|
||
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer7, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer7);
|
||
}
|
||
isDisplay7 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay7)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer7, KAScene);
|
||
KAScenePlayer.Play(Layer7);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay7 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 8)
|
||
{
|
||
if (showing)
|
||
{
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/채팅판/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["채팅판"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
|
||
|
||
if (isDisplay8 && strDisp8 != dispStr)
|
||
{
|
||
orderDisp4Index++;
|
||
string bufPath = path4_5.ToLower().Replace(".t2s", "_공지.t2s");
|
||
KAScene = KAEngine.LoadScene(bufPath, "채팅" + orderDisp4Index);
|
||
|
||
KAScene.GetObject("show").SetVisible(1);
|
||
KAScene.GetObject("start").SetVisible(0);
|
||
KAScene.GetObject("stay").SetVisible(1);
|
||
|
||
KAScene.GetObject("t1").SetValue(dispStr + " ");
|
||
KAScene.GetObject("t2").SetValue(dispStr + " ");
|
||
|
||
KAScene.SetChangeOut(eKChangeOutType.CHANGE_OUT_TYPE_CHANGE_OUT);
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer10, KAScene);
|
||
//Play
|
||
KAScenePlayer.Play(Layer10);
|
||
}
|
||
else if (!isDisplay8)
|
||
{
|
||
orderDisp4Index++;
|
||
string bufPath = path4_5.ToLower().Replace(".t2s", "_공지.t2s");
|
||
KAScene = KAEngine.LoadScene(bufPath, "채팅" + orderDisp4Index);
|
||
|
||
KAScene.GetObject("show").SetVisible(0);
|
||
KAScene.GetObject("start").SetVisible(1);
|
||
KAScene.GetObject("stay").SetVisible(0);
|
||
|
||
KAScene.SetChangeOut(eKChangeOutType.CHANGE_OUT_TYPE_CHANGE_OUT);
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer10, KAScene);
|
||
//Play
|
||
KAScenePlayer.Play(Layer10);
|
||
}
|
||
|
||
isDisplay8 = true;
|
||
strDisp8 = dispStr;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay8)
|
||
{
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer10, KAScene);
|
||
KAScenePlayer.Play(Layer10);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay8 = false;
|
||
}
|
||
}
|
||
else if (DisplayIndex == 9)
|
||
{
|
||
if (showing)
|
||
{
|
||
if (isDisplay9)
|
||
{
|
||
//이미 송출 중이므로 넘긴다
|
||
}
|
||
else
|
||
{
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/동영상/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["동영상"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
//송출부분
|
||
orderDisp9Index++;
|
||
if (strs[0] == "0")
|
||
{
|
||
KAScene = KAEngine.LoadScene(path9, "동영상" + orderDisp9Index);
|
||
}
|
||
else
|
||
{
|
||
string bufPath = path9.Replace(".t2s", "_상.t2s");
|
||
KAScene = KAEngine.LoadScene(bufPath, "동영상" + orderDisp9Index);
|
||
}
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
KAObject = KAScene.GetObject("video");
|
||
string path = Path.GetDirectoryName(path9) + "\\동영상\\" + strs[1];
|
||
KAObject.SetValue(path);
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer9, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer9);
|
||
|
||
//sendURL(getURL() + channel + "/자막상황/입력?동영상=N");
|
||
}
|
||
isDisplay9 = true;
|
||
}
|
||
else
|
||
{
|
||
if (isDisplay9)
|
||
{
|
||
//구경민 부장의 요청에 의해 자동 아웃이 이미 구현되어 있으므로 넘긴다
|
||
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
//송출 중 이므로 송출을 종료시킨다.
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer9, KAScene);
|
||
KAScenePlayer.Play(Layer9);
|
||
}
|
||
else
|
||
{
|
||
//미송출 중이므로 넘긴다.
|
||
}
|
||
isDisplay9 = false;
|
||
}
|
||
}
|
||
}
|
||
|
||
public void Disp1Worker()
|
||
{
|
||
while (isConnected && isDisplay1 )
|
||
{
|
||
try
|
||
{
|
||
//서버에서 정보를 읽어온다.
|
||
//실시간 수량 확인을 위한 진행
|
||
int orderCount = 0;
|
||
|
||
string requestURL = getURL() + channel + "/새데이터조회/상품수량?조회시작일=" + informationDisp1[1] +
|
||
"&방송일=" + informationDisp1[2] + "&PGM코드=" + informationDisp1[0] + "&보낸사람=Coder송출전확인";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
var list = obj["saleList"];
|
||
|
||
if (list.Count() > 0)
|
||
{
|
||
|
||
int index = 0;
|
||
foreach (var item in list)
|
||
{
|
||
index++;
|
||
//모든 수량의 합
|
||
if (orderDisp1Index == 0)
|
||
{
|
||
orderCount += Convert.ToInt32(item["totalQty"]);
|
||
} else if (orderDisp1Index == index)
|
||
{
|
||
orderCount = Convert.ToInt32(item["totalQty"]);
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
Console.WriteLine("Err : " + "수량데이터 없음");
|
||
}
|
||
}
|
||
|
||
KAScene = KAEngine.LoadScene(path1, "판매수량");
|
||
|
||
KAObject KAObject;
|
||
KAObject = KAScene.GetObject("txt");
|
||
KAObject.SetValue(disp1TxtStr);
|
||
KAObject = KAScene.GetObject("counter");
|
||
KAObject.SetCounterNumberKey(1, 0);
|
||
KAObject.SetCounterNumberKey(2, Convert.ToDouble(orderCount));
|
||
//KAObject.SetValue(strs[1]);
|
||
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer1, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer1);
|
||
|
||
if (lblExtraDisplay.BackColor == Color.DarkRed)
|
||
{
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
lblExtraDisplay.Text = "외부제어 송출 ON";
|
||
lblExtraDisplay.BackColor = Color.Green;
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
lblExtraDisplay.Text = "외부제어 송출 ON";
|
||
lblExtraDisplay.BackColor = Color.Green;
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("Time : " + DateTime.Now.ToString("hhmmss"));
|
||
Console.WriteLine("Err : " + ex.Message);
|
||
Console.WriteLine("Err : " + ex.StackTrace);
|
||
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
lblExtraDisplay.Text = "서버 응답 Error";
|
||
lblExtraDisplay.BackColor = Color.DarkRed;
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
lblExtraDisplay.Text = "서버 응답 Error";
|
||
lblExtraDisplay.BackColor = Color.DarkRed;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
for (int i = 0; i < termDisp1*10; i++)
|
||
{
|
||
Thread.Sleep(100);
|
||
if (!isConnected || !isDisplay1)
|
||
return;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
|
||
#endregion
|
||
|
||
|
||
#region Coder 관련
|
||
|
||
#region 판매수량
|
||
|
||
struct goos
|
||
{
|
||
public int index;
|
||
public string goosName;
|
||
public int sellCount;
|
||
}
|
||
|
||
List<goos> salesGoos = new List<goos>();
|
||
string nowpgmName = "";
|
||
|
||
private void btnSalesData_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
string date1 = dateTimePicker1.Value.ToString("yyyyMMdd");
|
||
string date2 = dateTimePicker2.Value.ToString("yyyyMMdd");
|
||
string requestURL = getURL() + channel + "/새데이터조회/상품수량?조회시작일=" + date1 + "&방송일=" + date2 + "&PGM코드=" + txtPGM.Text + "&보낸사람=Coder";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
var list = obj["saleList"];
|
||
|
||
if (list.Count() > 0)
|
||
{
|
||
salesGoos = new List<goos>();
|
||
cmbChoiceGoos.Items.Clear();
|
||
txtDispTxt1.Text = dateTimePicker1.Value.ToString("yy.MM.dd") + "~" + dateTimePicker2.Value.ToString("yy.MM.dd");
|
||
|
||
int index = 0;
|
||
foreach (var item in list)
|
||
{
|
||
//Console.WriteLine(string.Format("{0}: {1}", "상품명", item["pgmName"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "세부명", item["pgmGoosName"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "상품GoosCode?", item["pgmGoosCode"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "판매량", item["totalQty"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "코드", item["pgmCode"]));
|
||
|
||
if (index == 0)
|
||
{
|
||
nowpgmName = item["pgmName"].ToString();
|
||
//cmbChoiceGoos.Items.Add(nowpgmName);
|
||
cmbChoiceGoos.Items.Add("전체");
|
||
}
|
||
|
||
index++;
|
||
goos target = new goos();
|
||
target.index = index;
|
||
target.goosName = item["pgmGoosName"].ToString();
|
||
target.sellCount = Convert.ToInt32(item["totalQty"]);
|
||
salesGoos.Add(target);
|
||
|
||
cmbChoiceGoos.Items.Add(target.goosName);
|
||
}
|
||
|
||
cmbChoiceGoos.SelectedIndex = -1;
|
||
cmbChoiceGoos.SelectedIndex = 0;
|
||
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("조회된 데이터가 없습니다.", "확인");
|
||
}
|
||
}
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
MessageBox.Show("서버의 응답이 정상적이지 않습니다.", "데이터 서버 응답 오류");
|
||
}
|
||
|
||
}
|
||
|
||
private void cmbChoiceGoos_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (cmbChoiceGoos.SelectedIndex == -1)
|
||
{
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
bool isChecker = false;
|
||
int forCount = 0;
|
||
|
||
foreach (var c in salesGoos)
|
||
{
|
||
if (cmbChoiceGoos.SelectedItem.ToString().Equals(c.goosName))
|
||
{
|
||
isChecker = true;
|
||
txt_totalQty.Text = c.sellCount.ToString();
|
||
}
|
||
forCount += c.sellCount;
|
||
}
|
||
|
||
if (!isChecker)
|
||
{
|
||
txt_totalQty.Text = forCount.ToString();
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
private void btnDisp1_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected){
|
||
if (isDisplay1)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?상품=N");
|
||
}
|
||
else
|
||
{
|
||
try
|
||
{
|
||
double checkDbl = Convert.ToDouble(txt_totalQty.Text);
|
||
string txt = txtDispTxt1.Text + "|" + txt_totalQty.Text;
|
||
string date1 = dateTimePicker1.Value.ToString("yyyyMMdd");
|
||
string date2 = dateTimePicker2.Value.ToString("yyyyMMdd");
|
||
txt += "|" + txtPGM.Text + "|" + date1 + "|" + date2 + "|" + ((cmbDisplayTerm.SelectedIndex + 1)*5) + "|" + cmbChoiceGoos.SelectedIndex;
|
||
//순서 : 텍스트로 나갈 정보,판매수량, PGM, 시작일, 종료일, 주기, 순번의 형태로 저장
|
||
|
||
string requestURL = getURL() + channel + "/데이터입력/상품수량?텍스트=" + txt + "&보낸사람=코더";
|
||
sendURL(requestURL);
|
||
sendURL(getURL() + channel + "/자막상황/입력?상품=Y");
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
MessageBox.Show("정상적인 값이 입력되지 않았습니다.");
|
||
}
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void cmbDisplayTerm_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue("DisplayTerm", cmbDisplayTerm.SelectedIndex);
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 경품추첨
|
||
|
||
private void btnPrizeDraw_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
//listView 초기화
|
||
listView1.Items.Clear();
|
||
|
||
|
||
string requestURL = getURL() + channel + "/새데이터조회/경품프로모션?프로모션코드=" + txtPromotion.Text + "&보낸사람=Coder";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
var list = obj["prizeList"];
|
||
|
||
if (list.Count() > 0)
|
||
{
|
||
int index = 0;
|
||
foreach (var item in list)
|
||
{
|
||
//Console.WriteLine(string.Format("{0}: {1}", "promoName", item["promoName"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "endYn", item["endYn"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "defAddr", item["defAddr"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "confirmCnt", item["confirmCnt"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "custName", item["custName"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "doType", item["doType"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "defHp", item["defHp"]));
|
||
//Console.WriteLine(string.Format("{0}: {1}", "insertId", item["insertId"]));
|
||
|
||
|
||
listView1.Items.Add(item["custName"].ToString() + ", " + item["defAddr"].ToString() + ", " + item["defHp"].ToString());
|
||
index++;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("조회된 데이터가 없습니다.", "확인");
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MessageBox.Show("서버의 응답이 정상적이지 않습니다.", "데이터 서버 응답 오류");
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
private void btnDisp2_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay2)
|
||
{
|
||
//송출중인 상태 - 송출 아웃
|
||
sendURL(getURL() + channel + "/자막상황/입력?경품=N");
|
||
}
|
||
else
|
||
{
|
||
string txt = "";
|
||
|
||
foreach (ListViewItem i in listView1.Items)
|
||
{
|
||
string[] strs = i.Text.Replace(", ", "|").Split('|');
|
||
txt += strs[0] + "|" + strs[1] + "|" + strs[2] + "|";
|
||
}
|
||
|
||
if (txt.Equals(""))
|
||
{
|
||
MessageBox.Show("조회된 데이터가 없거나 정상적이지 않습니다.");
|
||
return;
|
||
}
|
||
|
||
string requestURL = getURL() + channel + "/데이터입력/경품프로모션?텍스트=" + txt + "&보낸사람=코더";
|
||
sendURL(requestURL);
|
||
sendURL(getURL() + channel + "/자막상황/입력?경품=Y");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MessageBox.Show("서버의 응답이 정상적이지 않습니다.", "데이터 서버 응답 오류");
|
||
}
|
||
}
|
||
|
||
#region ListView 디자인
|
||
|
||
void lv_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
|
||
{
|
||
//Console.WriteLine(e.ItemIndex);
|
||
|
||
e.DrawBackground();
|
||
|
||
if (listView1.SelectedItems.Count > 0)
|
||
if (e.ItemIndex == listView1.SelectedItems[0].Index)
|
||
{
|
||
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(150, 150, 150)), e.Bounds);
|
||
}
|
||
|
||
//e.DrawBackground();
|
||
e.DrawText();
|
||
|
||
}
|
||
|
||
void lv_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
|
||
{
|
||
using (var sf = new StringFormat())
|
||
{
|
||
sf.Alignment = StringAlignment.Center;
|
||
sf.LineAlignment = StringAlignment.Center;
|
||
|
||
using (var headerFont = new Font("Microsoft Sans Serif", 9, FontStyle.Bold))
|
||
{
|
||
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(100, 100, 100)), e.Bounds);
|
||
e.Graphics.DrawString(e.Header.Text, headerFont,
|
||
Brushes.White, e.Bounds, sf);
|
||
}
|
||
}
|
||
/*
|
||
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(100, 100, 100)), e.Bounds);
|
||
e.DrawText();
|
||
*/
|
||
}
|
||
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
#endregion
|
||
|
||
private void sendURL(string rURL)
|
||
{
|
||
try
|
||
{
|
||
WebRequest request = WebRequest.Create(rURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
request.GetResponse();
|
||
request.Abort();
|
||
}
|
||
catch(Exception e)
|
||
{
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
#region 셋팅 및 데이터 저장 로드 관련
|
||
|
||
string subKey = @"SOFTWARE\SSGCoder";
|
||
|
||
private void loadSettingData()
|
||
{
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
|
||
txt답변값.Text = key.GetValue("답변높이") != null ? key.GetValue("답변높이").ToString() : "40";
|
||
|
||
//디자인 경로 1
|
||
if (key.GetValue("path1") != null)
|
||
{
|
||
path1 = key.GetValue("path1").ToString();
|
||
path2 = key.GetValue("path2").ToString();
|
||
|
||
Layer1 = Convert.ToInt32(key.GetValue("layer1").ToString());
|
||
Layer2 = Convert.ToInt32(key.GetValue("layer2").ToString());
|
||
|
||
cmbDisplayTerm.SelectedIndex = Convert.ToInt32(key.GetValue("DisplayTerm").ToString());
|
||
|
||
path3_1 = key.GetValue("path3_1") != null ? key.GetValue("path3_1").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_1.t2s";
|
||
path3_2 = key.GetValue("path3_2") != null ? key.GetValue("path3_2").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_2.t2s";
|
||
path3_3 = key.GetValue("path3_3") != null ? key.GetValue("path3_3").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_3.t2s";
|
||
path3_4 = key.GetValue("path3_4") != null ? key.GetValue("path3_4").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_4.t2s";
|
||
path3_5 = key.GetValue("path3_5") != null ? key.GetValue("path3_5").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_5.t2s";
|
||
path3_6 = key.GetValue("path3_6") != null ? key.GetValue("path3_6").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_6.t2s";
|
||
path3_7 = key.GetValue("path3_7") != null ? key.GetValue("path3_7").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_7.t2s";
|
||
path3_8 = key.GetValue("path3_8") != null ? key.GetValue("path3_8").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_8.t2s";
|
||
path3_9 = key.GetValue("path3_9") != null ? key.GetValue("path3_9").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_9.t2s";
|
||
path3_10 = key.GetValue("path3_10") != null ? key.GetValue("path3_10").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_10.t2s";
|
||
|
||
path3_11 = key.GetValue("path3_11") != null ? key.GetValue("path3_11").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_11.t2s";
|
||
path3_12 = key.GetValue("path3_12") != null ? key.GetValue("path3_12").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_12.t2s";
|
||
path3_13 = key.GetValue("path3_13") != null ? key.GetValue("path3_13").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_13.t2s";
|
||
path3_14 = key.GetValue("path3_14") != null ? key.GetValue("path3_14").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_14.t2s";
|
||
path3_15 = key.GetValue("path3_15") != null ? key.GetValue("path3_15").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_15.t2s";
|
||
path3_16 = key.GetValue("path3_16") != null ? key.GetValue("path3_16").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_16.t2s";
|
||
path3_17 = key.GetValue("path3_17") != null ? key.GetValue("path3_17").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_17.t2s";
|
||
path3_18 = key.GetValue("path3_18") != null ? key.GetValue("path3_18").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_18.t2s";
|
||
path3_19 = key.GetValue("path3_19") != null ? key.GetValue("path3_19").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_19.t2s";
|
||
path3_20 = key.GetValue("path3_20") != null ? key.GetValue("path3_20").ToString() : CurrentDirectory + @"\Degisn\텍스트\텍스트_20.t2s";
|
||
|
||
|
||
dbIP = key.GetValue("dbIP") != null ? key.GetValue("dbIP").ToString() : "211.42.188.8";
|
||
Layer3 = key.GetValue("layer3") != null ? Convert.ToInt32(key.GetValue("layer3")) : 3;
|
||
|
||
Layer4 = key.GetValue("layer4") != null ? Convert.ToInt32(key.GetValue("layer4")) : 4;
|
||
Layer5 = key.GetValue("layer5") != null ? Convert.ToInt32(key.GetValue("layer5")) : 5;
|
||
Layer6 = key.GetValue("layer6") != null ? Convert.ToInt32(key.GetValue("layer6")) : 6;
|
||
Layer7 = key.GetValue("layer7") != null ? Convert.ToInt32(key.GetValue("layer7")) : 7;
|
||
Layer8 = key.GetValue("layer8") != null ? Convert.ToInt32(key.GetValue("layer8")) : 8;
|
||
Layer9 = key.GetValue("layer9") != null ? Convert.ToInt32(key.GetValue("layer9")) : 9;
|
||
Layer10 = key.GetValue("layer10") != null ? Convert.ToInt32(key.GetValue("layer10")) : 10;
|
||
Layer11 = key.GetValue("layer11") != null ? Convert.ToInt32(key.GetValue("layer11")) : 11;
|
||
Layer12 = key.GetValue("layer12") != null ? Convert.ToInt32(key.GetValue("layer12")) : 12;
|
||
Layer13 = key.GetValue("layer13") != null ? Convert.ToInt32(key.GetValue("layer13")) : 12;
|
||
Layer14 = key.GetValue("layer14") != null ? Convert.ToInt32(key.GetValue("layer14")) : 12;
|
||
Layer15 = key.GetValue("layer15") != null ? Convert.ToInt32(key.GetValue("layer15")) : 12;
|
||
|
||
fadeOutTime = key.GetValue("fadeOutTime") != null ? Convert.ToInt32(key.GetValue("fadeOutTime")) : 10;
|
||
|
||
frameVRV = key.GetValue("frameVRV") != null ? Convert.ToInt32(key.GetValue("frameVRV")) : 52;
|
||
frameTAG = key.GetValue("frameTAG") != null ? Convert.ToInt32(key.GetValue("frameTAG")) : 149;
|
||
|
||
path4 = key.GetValue("path4") != null ? key.GetValue("path4").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_0 = key.GetValue("path4_0") != null ? key.GetValue("path4_0").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_1 = key.GetValue("path4_1") != null ? key.GetValue("path4_1").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_2 = key.GetValue("path4_2") != null ? key.GetValue("path4_2").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_3 = key.GetValue("path4_3") != null ? key.GetValue("path4_3").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_4 = key.GetValue("path4_4") != null ? key.GetValue("path4_4").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
path4_5 = key.GetValue("path4_5") != null ? key.GetValue("path4_5").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s";
|
||
|
||
path5 = key.GetValue("path5") != null ? key.GetValue("path5").ToString() : CurrentDirectory + @"\Degisn\라이브톡\상품평.t2s";
|
||
path6 = key.GetValue("path6") != null ? key.GetValue("path6").ToString() : CurrentDirectory + @"\Degisn\라이브톡\QnA.t2s";
|
||
path7 = key.GetValue("path7") != null ? key.GetValue("path7").ToString() : CurrentDirectory + @"\Degisn\라이브톡\공지.t2s";
|
||
path8 = key.GetValue("path8") != null ? key.GetValue("path8").ToString() : CurrentDirectory + @"\Degisn\라이브톡\채팅백판.t2s";
|
||
path9 = key.GetValue("path9") != null ? key.GetValue("path9").ToString() : CurrentDirectory + @"\Degisn\라이브톡\동영상.t2s";
|
||
|
||
if (key.GetValue("Color1R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color1R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color1G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color1B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_1.BackColor = color;
|
||
}
|
||
if (key.GetValue("Color2R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color2R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color2G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color2B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_2.BackColor = color;
|
||
}
|
||
if (key.GetValue("Color3R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color3R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color3G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color3B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_3.BackColor = color;
|
||
}
|
||
if (key.GetValue("Color4R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color4R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color4G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color4B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_4.BackColor = color;
|
||
}
|
||
if (key.GetValue("Color5R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color5R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color5G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color5B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_5.BackColor = color;
|
||
}
|
||
if (key.GetValue("Color6R") != null)
|
||
{
|
||
int R = Convert.ToInt16(key.GetValue("Color6R").ToString());
|
||
int G = Convert.ToInt16(key.GetValue("Color6G").ToString());
|
||
int B = Convert.ToInt16(key.GetValue("Color6B").ToString());
|
||
Color color = Color.FromArgb(R, G, B);
|
||
lbl_color_6.BackColor = color;
|
||
}
|
||
|
||
if (key.GetValue("channel") != null)
|
||
{
|
||
toggleChannel.IsOn = Convert.ToBoolean(key.GetValue("channel"));
|
||
toggleChannel_Toggled(toggleChannel, new EventArgs());
|
||
}
|
||
else
|
||
{
|
||
key.SetValue("channel", toggleChannel.IsOn);
|
||
}
|
||
|
||
txtIP.Text = "211.42.188.8";
|
||
}
|
||
else //첫실행 이므로 해당 값들을 모두 디폴트로 저장시킨다.
|
||
{
|
||
key.SetValue("path1", CurrentDirectory + @"\Degisn\판매수량\판매수량.t2s");
|
||
key.SetValue("path2", CurrentDirectory + @"\Degisn\경품추첨\경품추첨.t2s");
|
||
key.SetValue("path3_1", CurrentDirectory + @"\Degisn\텍스트\텍스트_1.t2s");
|
||
key.SetValue("path3_2", CurrentDirectory + @"\Degisn\텍스트\텍스트_2.t2s");
|
||
key.SetValue("path3_3", CurrentDirectory + @"\Degisn\텍스트\텍스트_3.t2s");
|
||
key.SetValue("path3_4", CurrentDirectory + @"\Degisn\텍스트\텍스트_4.t2s");
|
||
key.SetValue("path3_5", CurrentDirectory + @"\Degisn\텍스트\텍스트_5.t2s");
|
||
|
||
key.SetValue("path3_6", CurrentDirectory + @"\Degisn\텍스트\텍스트_6.t2s");
|
||
key.SetValue("path3_7", CurrentDirectory + @"\Degisn\텍스트\텍스트_7.t2s");
|
||
key.SetValue("path3_8", CurrentDirectory + @"\Degisn\텍스트\텍스트_8.t2s");
|
||
key.SetValue("path3_9", CurrentDirectory + @"\Degisn\텍스트\텍스트_9.t2s");
|
||
key.SetValue("path3_10", CurrentDirectory + @"\Degisn\텍스트\텍스트_10.t2s");
|
||
|
||
key.SetValue("path4", CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s");
|
||
key.SetValue("path4_0", CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s");
|
||
key.SetValue("path4_1", CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s");
|
||
key.SetValue("path4_2", CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s");
|
||
key.SetValue("path4_3", CurrentDirectory + @"\Degisn\라이브톡\채팅.t2s");
|
||
key.SetValue("path5", CurrentDirectory + @"\Degisn\라이브톡\상품평.t2s");
|
||
key.SetValue("path6", CurrentDirectory + @"\Degisn\라이브톡\QnA.t2s");
|
||
key.SetValue("path7", CurrentDirectory + @"\Degisn\라이브톡\공지.t2s");
|
||
key.SetValue("path8", CurrentDirectory + @"\Degisn\라이브톡\채팅백판.t2s");
|
||
key.SetValue("path8", CurrentDirectory + @"\Degisn\라이브톡\동영상.t2s");
|
||
|
||
key.SetValue("layer1", 1);
|
||
key.SetValue("layer2", 2);
|
||
key.SetValue("layer3", 3);
|
||
key.SetValue("layer4", 4);
|
||
key.SetValue("layer5", 5);
|
||
key.SetValue("layer6", 6);
|
||
key.SetValue("layer7", 7);
|
||
key.SetValue("layer8", 8);
|
||
key.SetValue("fadeOutTime", 10);
|
||
|
||
key.SetValue("DisplayTerm", 2);
|
||
key.SetValue("channel", toggleChannel.IsOn);
|
||
key.SetValue("dbIP", "211.42.188.8");
|
||
cmbDisplayTerm.SelectedIndex = 2;
|
||
}
|
||
|
||
//해당 Control 값들 변경
|
||
txtDisplay1Path.Text = path1;
|
||
txtDisplay2Path.Text = path2;
|
||
|
||
|
||
if (cmbPushType.SelectedIndex == 0)
|
||
txtDisplay3Path.Text = path3_1;
|
||
else if (cmbPushType.SelectedIndex == 1)
|
||
txtDisplay3Path.Text = path3_2;
|
||
else if (cmbPushType.SelectedIndex == 2)
|
||
txtDisplay3Path.Text = path3_3;
|
||
else if (cmbPushType.SelectedIndex == 3)
|
||
txtDisplay3Path.Text = path3_4;
|
||
else if (cmbPushType.SelectedIndex == 4)
|
||
txtDisplay3Path.Text = path3_5;
|
||
else if (cmbPushType.SelectedIndex == 5)
|
||
txtDisplay3Path.Text = path3_6;
|
||
else if (cmbPushType.SelectedIndex == 6)
|
||
txtDisplay3Path.Text = path3_7;
|
||
else if (cmbPushType.SelectedIndex == 7)
|
||
txtDisplay3Path.Text = path3_8;
|
||
else if (cmbPushType.SelectedIndex == 8)
|
||
txtDisplay3Path.Text = path3_9;
|
||
else if (cmbPushType.SelectedIndex == 9)
|
||
txtDisplay3Path.Text = path3_10;
|
||
|
||
else if (cmbPushType.SelectedIndex == 10)
|
||
txtDisplay3Path.Text = path3_11;
|
||
else if (cmbPushType.SelectedIndex == 11)
|
||
txtDisplay3Path.Text = path3_12;
|
||
else if (cmbPushType.SelectedIndex == 12)
|
||
txtDisplay3Path.Text = path3_13;
|
||
else if (cmbPushType.SelectedIndex == 13)
|
||
txtDisplay3Path.Text = path3_14;
|
||
else if (cmbPushType.SelectedIndex == 14)
|
||
txtDisplay3Path.Text = path3_15;
|
||
else if (cmbPushType.SelectedIndex == 15)
|
||
txtDisplay3Path.Text = path3_16;
|
||
else if (cmbPushType.SelectedIndex == 16)
|
||
txtDisplay3Path.Text = path3_17;
|
||
else if (cmbPushType.SelectedIndex == 17)
|
||
txtDisplay3Path.Text = path3_18;
|
||
else if (cmbPushType.SelectedIndex == 18)
|
||
txtDisplay3Path.Text = path3_19;
|
||
else if (cmbPushType.SelectedIndex == 19)
|
||
txtDisplay3Path.Text = path3_20;
|
||
|
||
txtFrameTAG.Text = frameTAG.ToString();
|
||
txtFrameVRV.Text = frameVRV.ToString();
|
||
|
||
txtDisplay4Path.Text = path4;
|
||
txtDisplay4_0Path.Text = path4_0;
|
||
txtDisplay4_1Path.Text = path4_1;
|
||
txtDisplay4_2Path.Text = path4_2;
|
||
txtDisplay4_3Path.Text = path4_3;
|
||
txtDisplay4_4Path.Text = path4_4;
|
||
txtDisplay4_5Path.Text = path4_5;
|
||
|
||
txtonacd.Text = key.GetValue("txtonacd") != null ? key.GetValue("txtonacd").ToString() : "3";
|
||
txtonacd2.Text = key.GetValue("txtonacd2") != null ? key.GetValue("txtonacd2").ToString() : "10";
|
||
txtBarSec.Text = key.GetValue("txtBarSec") != null ? key.GetValue("txtBarSec").ToString() : "7";
|
||
txtCGSec.Text = key.GetValue("txtCGSec") != null ? key.GetValue("txtCGSec").ToString() : "30";
|
||
txtCallSec.Text = key.GetValue("txtCallSec") != null ? key.GetValue("txtCallSec").ToString() : "60";
|
||
txtCallSec2.Text = key.GetValue("txtCallSec2") != null ? key.GetValue("txtCallSec2").ToString() : "60";
|
||
txtNoCGStart.Text = key.GetValue("txtNoCGStart") != null ? key.GetValue("txtNoCGStart").ToString() : "60";
|
||
txtNoCGEnd.Text = key.GetValue("txtNoCGEnd") != null ? key.GetValue("txtNoCGEnd").ToString() : "60";
|
||
txtNoSellFocus.Text = key.GetValue("txtNoSellFocus") != null ? key.GetValue("txtNoSellFocus").ToString() : "60";
|
||
txtSellFocusTerm.Text = key.GetValue("txtSellFocusTerm") != null ? key.GetValue("txtSellFocusTerm").ToString() : "5";
|
||
|
||
txtNoDelivery.Text = key.GetValue("txtNoDelivery") != null ? key.GetValue("txtNoDelivery").ToString() : "60";
|
||
txtDeliveryTerm.Text = key.GetValue("txtDeliveryTerm") != null ? key.GetValue("txtDeliveryTerm").ToString() : "5";
|
||
|
||
txtNoVVIP.Text = key.GetValue("txtNoVVIP") != null ? key.GetValue("txtNoVVIP").ToString() : "60";
|
||
txtNoVVIP전면.Text = key.GetValue("txtNoVVIP전면") != null ? key.GetValue("txtNoVVIP전면").ToString() : "60";
|
||
txtVVIPTerm.Text = key.GetValue("txtVVIPTerm") != null ? key.GetValue("txtVVIPTerm").ToString() : "5";
|
||
txtVVIPTerm전면.Text = key.GetValue("txtVVIPTerm전면") != null ? key.GetValue("txtVVIPTerm전면").ToString() : "5";
|
||
|
||
txtDeliverySec.Text = key.GetValue("txtDeliverySec") != null ? key.GetValue("txtDeliverySec").ToString() : "7";
|
||
txtVVIPSec.Text = key.GetValue("txtVVIPSec") != null ? key.GetValue("txtVVIPSec").ToString() : "7";
|
||
txtVVIP전면Sec.Text = key.GetValue("txtVVIP전면Sec") != null ? key.GetValue("txtVVIP전면Sec").ToString() : "7";
|
||
|
||
|
||
void setToggle(ToggleSwitch target) => target.IsOn = key.GetValue(target.Name) != null ? Convert.ToBoolean(key.GetValue(target.Name).ToString()) : true;
|
||
setToggle(toggleSwitch매진);
|
||
setToggle(toggleSwitch매진예상);
|
||
setToggle(toggleSwitch매진팁);
|
||
setToggle(toggleSwitch자동주문);
|
||
setToggle(toggleSwitch전체매진);
|
||
setToggle(toggleSwitch주문집중);
|
||
setToggle(toggleSwitch주문콜전체);
|
||
setToggle(toggleSwitch카드프로모션);
|
||
setToggle(toggleSwitch배송정보);
|
||
setToggle(toggleSwitchVVIP);
|
||
setToggle(toggleSwitchVVIP전면);
|
||
|
||
|
||
|
||
txtDisplay5Path.Text = path5;
|
||
txtDisplay6Path.Text = path6;
|
||
txtDisplay7Path.Text = path7;
|
||
txtDisplay8Path.Text = path8;
|
||
txtDisplay9Path.Text = path9;
|
||
|
||
txtDisplay1Layer.Text = Layer1.ToString();
|
||
txtDisplay2Layer.Text = Layer2.ToString();
|
||
txtDisplay3Layer.Text = Layer3.ToString();
|
||
txtDisplay4Layer.Text = Layer4.ToString();
|
||
txtDisplay5Layer.Text = Layer5.ToString();
|
||
txtDisplay6Layer.Text = Layer6.ToString();
|
||
txtDisplay7Layer.Text = Layer7.ToString();
|
||
txtDisplay8Layer.Text = Layer8.ToString();
|
||
txtDisplay9Layer.Text = Layer9.ToString();
|
||
txtDisplay10Layer.Text = Layer10.ToString();
|
||
|
||
txtDisplay11Layer.Text = Layer11.ToString();
|
||
txtDisplay12Layer.Text = Layer12.ToString();
|
||
txtDisplay13Layer.Text = Layer13.ToString();
|
||
txtDisplay14Layer.Text = Layer14.ToString();
|
||
txtDisplay15Layer.Text = Layer15.ToString();
|
||
|
||
txtIP.Text = dbIP;
|
||
}
|
||
|
||
private void toggleChannel_Toggled(object sender, EventArgs e)
|
||
{
|
||
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
|
||
if (toggleChannel.IsOn)
|
||
{
|
||
channel = "채널2";
|
||
}
|
||
else
|
||
{
|
||
channel = "채널1";
|
||
}
|
||
|
||
key.SetValue("channel", toggleChannel.IsOn);
|
||
|
||
loadPushName();
|
||
}
|
||
|
||
private void btnChangeDB_Click(object sender, EventArgs e)
|
||
{
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
dbIP = txtIP.Text;
|
||
key.SetValue("dbIP", dbIP);
|
||
|
||
MessageBox.Show("DB 설정이 변경되었습니다.");
|
||
}
|
||
|
||
private void btnDisplayPathChange_Click(object sender, EventArgs e)
|
||
{
|
||
var targetName = ((Button)sender).Name;
|
||
|
||
|
||
//if (isDisplay1 || isDisplay2 || isDisplay3)
|
||
if (isConnected)
|
||
{
|
||
MessageBox.Show("연결 중 변경은 불가능 합니다." + NewLine + "Disconnection 후 변경해 주세요.");
|
||
return;
|
||
}
|
||
|
||
if (sender == btnDisplay8PathChange)
|
||
{
|
||
MessageBox.Show("송출 셋팅된 채팅 경로를 기반으로 설정됩니다." + Environment.NewLine +
|
||
@"기존경로t2s 파일명 + _back으로 자동설정" + Environment.NewLine +
|
||
@"예) 채팅 송출 => C:\디자인\채팅.t2s 인 경우" + Environment.NewLine +
|
||
@"채팅백판 송출 => C:\디자인\채팅_back.t2s 로 결정" + Environment.NewLine);
|
||
|
||
return;
|
||
|
||
}
|
||
|
||
|
||
int index = 1;
|
||
if (sender == btnDisplay2PathChange) index = 2;
|
||
if (sender == btnDisplay3PathChange) index = 3;
|
||
if (sender == btnDisplay4PathChange) index = 4;
|
||
if (sender == btnDisplay4_0PathChange) index = 40;
|
||
if (sender == btnDisplay4_1PathChange) index = 41;
|
||
if (sender == btnDisplay4_2PathChange) index = 42;
|
||
if (sender == btnDisplay4_3PathChange) index = 43;
|
||
if (sender == btnDisplay4_4PathChange) index = 44;
|
||
if (sender == btnDisplay4_5PathChange) index = 45;
|
||
if (sender == btnDisplay5PathChange) index = 5;
|
||
if (sender == btnDisplay6PathChange) index = 6;
|
||
if (sender == btnDisplay7PathChange) index = 7;
|
||
if (sender == btnDisplay8PathChange) index = 8;
|
||
if (sender == btnDisplay9PathChange) index = 9;
|
||
|
||
OpenFileDialog fileDialog = new OpenFileDialog();
|
||
fileDialog.Filter = "토네이도 file (*.t2s) | *.t2s";
|
||
fileDialog.Multiselect = false;
|
||
fileDialog.RestoreDirectory = true;
|
||
|
||
switch (index)
|
||
{
|
||
case 1:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path1);
|
||
fileDialog.FileName = path1;
|
||
break;
|
||
case 2:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path2);
|
||
fileDialog.FileName = path2;
|
||
break;
|
||
case 3:
|
||
string targetStr = "";
|
||
if (cmbPushType.SelectedIndex == 0) targetStr = path3_1;
|
||
else if (cmbPushType.SelectedIndex == 1) targetStr = path3_2;
|
||
else if (cmbPushType.SelectedIndex == 2) targetStr = path3_3;
|
||
else if (cmbPushType.SelectedIndex == 3) targetStr = path3_4;
|
||
else if (cmbPushType.SelectedIndex == 4) targetStr = path3_5;
|
||
else if (cmbPushType.SelectedIndex == 5) targetStr = path3_6;
|
||
else if (cmbPushType.SelectedIndex == 6) targetStr = path3_7;
|
||
else if (cmbPushType.SelectedIndex == 7) targetStr = path3_8;
|
||
else if (cmbPushType.SelectedIndex == 8) targetStr = path3_9;
|
||
else if (cmbPushType.SelectedIndex == 9) targetStr = path3_10;
|
||
|
||
else if (cmbPushType.SelectedIndex == 10) targetStr = path3_11;
|
||
else if (cmbPushType.SelectedIndex == 11) targetStr = path3_12;
|
||
else if (cmbPushType.SelectedIndex == 12) targetStr = path3_13;
|
||
else if (cmbPushType.SelectedIndex == 13) targetStr = path3_14;
|
||
else if (cmbPushType.SelectedIndex == 14) targetStr = path3_15;
|
||
else if (cmbPushType.SelectedIndex == 15) targetStr = path3_16;
|
||
else if (cmbPushType.SelectedIndex == 16) targetStr = path3_17;
|
||
else if (cmbPushType.SelectedIndex == 17) targetStr = path3_18;
|
||
else if (cmbPushType.SelectedIndex == 18) targetStr = path3_19;
|
||
else if (cmbPushType.SelectedIndex == 19) targetStr = path3_20;
|
||
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(targetStr);
|
||
fileDialog.FileName = targetStr;
|
||
|
||
break;
|
||
case 4:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4);
|
||
fileDialog.FileName = path4;
|
||
break;
|
||
case 40:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_0);
|
||
fileDialog.FileName = path4_0;
|
||
break;
|
||
case 41:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_1);
|
||
fileDialog.FileName = path4_1;
|
||
break;
|
||
case 42:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_2);
|
||
fileDialog.FileName = path4_2;
|
||
break;
|
||
case 43:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_3);
|
||
fileDialog.FileName = path4_3;
|
||
break;
|
||
case 44:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_4);
|
||
fileDialog.FileName = path4_4;
|
||
break;
|
||
case 45:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path4_5);
|
||
fileDialog.FileName = path4_5;
|
||
break;
|
||
case 5:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path5);
|
||
fileDialog.FileName = path5;
|
||
break;
|
||
case 6:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path6);
|
||
fileDialog.FileName = path6;
|
||
break;
|
||
case 7:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path7);
|
||
fileDialog.FileName = path7;
|
||
break;
|
||
case 8:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path8);
|
||
fileDialog.FileName = path8;
|
||
break;
|
||
case 9:
|
||
fileDialog.InitialDirectory = Path.GetDirectoryName(path9);
|
||
fileDialog.FileName = path9;
|
||
break;
|
||
}
|
||
|
||
|
||
|
||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
||
{
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
string selected = fileDialog.FileName;
|
||
|
||
|
||
switch (index)
|
||
{
|
||
case 1:
|
||
key.SetValue("path1", selected);
|
||
path1 = selected;
|
||
txtDisplay1Path.Text = selected;
|
||
break;
|
||
case 2:
|
||
key.SetValue("path2", selected);
|
||
path2 = selected;
|
||
txtDisplay2Path.Text = selected;
|
||
break;
|
||
case 3:
|
||
|
||
if (cmbPushType.SelectedIndex == 0) path3_1 = selected;
|
||
else if (cmbPushType.SelectedIndex == 1) path3_2 = selected;
|
||
else if (cmbPushType.SelectedIndex == 2) path3_3 = selected;
|
||
else if (cmbPushType.SelectedIndex == 3) path3_4 = selected;
|
||
else if (cmbPushType.SelectedIndex == 4) path3_5 = selected;
|
||
else if (cmbPushType.SelectedIndex == 5) path3_6 = selected;
|
||
else if (cmbPushType.SelectedIndex == 6) path3_7 = selected;
|
||
else if (cmbPushType.SelectedIndex == 7) path3_8 = selected;
|
||
else if (cmbPushType.SelectedIndex == 8) path3_9 = selected;
|
||
else if (cmbPushType.SelectedIndex == 9) path3_10 = selected;
|
||
|
||
else if (cmbPushType.SelectedIndex == 10) path3_11 = selected;
|
||
else if (cmbPushType.SelectedIndex == 11) path3_12 = selected;
|
||
else if (cmbPushType.SelectedIndex == 12) path3_13 = selected;
|
||
else if (cmbPushType.SelectedIndex == 13) path3_14 = selected;
|
||
else if (cmbPushType.SelectedIndex == 14) path3_15 = selected;
|
||
else if (cmbPushType.SelectedIndex == 15) path3_16 = selected;
|
||
else if (cmbPushType.SelectedIndex == 16) path3_17 = selected;
|
||
else if (cmbPushType.SelectedIndex == 17) path3_18 = selected;
|
||
else if (cmbPushType.SelectedIndex == 18) path3_19 = selected;
|
||
else if (cmbPushType.SelectedIndex == 19) path3_20 = selected;
|
||
|
||
key.SetValue("path3_" + (cmbPushType.SelectedIndex+1), selected);
|
||
txtDisplay3Path.Text = selected;
|
||
break;
|
||
case 4:
|
||
key.SetValue("path4", selected);
|
||
path4 = selected;
|
||
txtDisplay4Path.Text = selected;
|
||
break;
|
||
case 40:
|
||
key.SetValue("path4_0", selected);
|
||
path4_0 = selected;
|
||
txtDisplay4_0Path.Text = selected;
|
||
break;
|
||
case 41:
|
||
key.SetValue("path4_1", selected);
|
||
path4_1 = selected;
|
||
txtDisplay4_1Path.Text = selected;
|
||
break;
|
||
case 42:
|
||
key.SetValue("path4_2", selected);
|
||
path4_2 = selected;
|
||
txtDisplay4_2Path.Text = selected;
|
||
break;
|
||
case 43:
|
||
key.SetValue("path4_3", selected);
|
||
path4_3 = selected;
|
||
txtDisplay4_3Path.Text = selected;
|
||
break;
|
||
case 44:
|
||
key.SetValue("path4_4", selected);
|
||
path4_4 = selected;
|
||
txtDisplay4_4Path.Text = selected;
|
||
break;
|
||
case 45:
|
||
key.SetValue("path4_5", selected);
|
||
path4_5 = selected;
|
||
txtDisplay4_5Path.Text = selected;
|
||
break;
|
||
case 5:
|
||
key.SetValue("path5", selected);
|
||
path5 = selected;
|
||
txtDisplay5Path.Text = selected;
|
||
break;
|
||
case 6:
|
||
key.SetValue("path6", selected);
|
||
path6 = selected;
|
||
txtDisplay6Path.Text = selected;
|
||
break;
|
||
case 7:
|
||
key.SetValue("path7", selected);
|
||
path7 = selected;
|
||
txtDisplay7Path.Text = selected;
|
||
break;
|
||
case 8:
|
||
key.SetValue("path8", selected);
|
||
path8 = selected;
|
||
txtDisplay8Path.Text = selected;
|
||
break;
|
||
case 9:
|
||
key.SetValue("path9", selected);
|
||
path9 = selected;
|
||
txtDisplay9Path.Text = selected;
|
||
break;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
|
||
private void btnDisplay3TxtMaxChange_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
int pushIndex = cmbPushType.SelectedIndex + 1;
|
||
string saveStr = txtMaxText1.Text + "|" + txtMaxText2.Text + "|";
|
||
saveStr += txtMaxText3.Text + "|" + txtMaxText4.Text + "|" + txtMaxText5.Text;
|
||
string requestURL = getURL() + channel + "_" + pushIndex + "/씬이름/입력?씬이름=" + saveStr;
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
//저장 완료
|
||
}
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
Console.WriteLine("Err : " + ex.Message);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
private void btnDisplayLayer(object sender, EventArgs e)
|
||
{
|
||
if (isDisplay1 || isDisplay2 || isDisplay3 || isDisplay4 || isDisplay5 || isDisplay6 || isDisplay7 || isDisplay8 || isDisplay9)
|
||
{
|
||
MessageBox.Show("송출중 변경은 불가능 합니다.");
|
||
return;
|
||
}
|
||
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
|
||
|
||
void layerUpDown(ref int layer, bool isUp, TextBox layerTextBox, string keyName)
|
||
{
|
||
if ((isUp && layer != 15) || (!isUp && layer != 0))
|
||
{
|
||
if (isUp) layer++;
|
||
else layer--;
|
||
|
||
layerTextBox.Text = layer.ToString();
|
||
key.SetValue(keyName, layer);
|
||
}
|
||
}
|
||
|
||
if (sender == btnDisplay1LayerUp)
|
||
{
|
||
layerUpDown(ref Layer1, true, txtDisplay1Layer, "layer1");
|
||
}
|
||
else if (sender == btnDisplay1LayerDown)
|
||
{
|
||
layerUpDown(ref Layer1, false, txtDisplay1Layer, "layer1");
|
||
}
|
||
else if (sender == btnDisplay2LayerUp)
|
||
{
|
||
layerUpDown(ref Layer2, true, txtDisplay2Layer, "layer2");
|
||
}
|
||
else if (sender == btnDisplay2LayerDown)
|
||
{
|
||
layerUpDown(ref Layer2, false, txtDisplay2Layer, "layer2");
|
||
}
|
||
else if (sender == btnDisplay3LayerUp)
|
||
{
|
||
layerUpDown(ref Layer3, true, txtDisplay3Layer, "layer3");
|
||
}
|
||
else if (sender == btnDisplay3LayerDown)
|
||
{
|
||
layerUpDown(ref Layer3, false, txtDisplay3Layer, "layer3");
|
||
}
|
||
else if (sender == btnDisplay4LayerUp)
|
||
{
|
||
layerUpDown(ref Layer4, true, txtDisplay4Layer, "layer4");
|
||
}
|
||
else if (sender == btnDisplay4LayerDown)
|
||
{
|
||
layerUpDown(ref Layer4, false, txtDisplay4Layer, "layer4");
|
||
}
|
||
else if (sender == btnDisplay5LayerUp)
|
||
{
|
||
layerUpDown(ref Layer5, true, txtDisplay5Layer, "layer5");
|
||
}
|
||
else if (sender == btnDisplay5LayerDown)
|
||
{
|
||
layerUpDown(ref Layer5, false, txtDisplay5Layer, "layer5");
|
||
}
|
||
else if (sender == btnDisplay6LayerUp)
|
||
{
|
||
layerUpDown(ref Layer6, true, txtDisplay6Layer, "layer6");
|
||
}
|
||
else if (sender == btnDisplay6LayerDown)
|
||
{
|
||
layerUpDown(ref Layer6, false, txtDisplay6Layer, "layer6");
|
||
}
|
||
else if (sender == btnDisplay7LayerUp)
|
||
{
|
||
layerUpDown(ref Layer7, true, txtDisplay7Layer, "layer7");
|
||
}
|
||
else if (sender == btnDisplay7LayerDown)
|
||
{
|
||
layerUpDown(ref Layer7, false, txtDisplay7Layer, "layer7");
|
||
}
|
||
else if (sender == btnDisplay8LayerUp)
|
||
{
|
||
layerUpDown(ref Layer8, true, txtDisplay8Layer, "layer8");
|
||
}
|
||
else if (sender == btnDisplay8LayerDown)
|
||
{
|
||
layerUpDown(ref Layer8, false, txtDisplay8Layer, "layer8");
|
||
}
|
||
else if (sender == btnDisplay9LayerUp)
|
||
{
|
||
layerUpDown(ref Layer9, true, txtDisplay9Layer, "layer9");
|
||
}
|
||
else if (sender == btnDisplay9LayerDown)
|
||
{
|
||
layerUpDown(ref Layer9, false, txtDisplay9Layer, "layer9");
|
||
}
|
||
|
||
else if (sender == btnDisplay10LayerUp)
|
||
{
|
||
layerUpDown(ref Layer10, true, txtDisplay10Layer, "layer10");
|
||
}
|
||
else if (sender == btnDisplay10LayerDown)
|
||
{
|
||
layerUpDown(ref Layer10, false, txtDisplay10Layer, "layer10");
|
||
}
|
||
|
||
else if (sender == btnDisplay11LayerUp)
|
||
{
|
||
layerUpDown(ref Layer11, true, txtDisplay11Layer, "layer11");
|
||
}
|
||
else if (sender == btnDisplay11LayerDown)
|
||
{
|
||
layerUpDown(ref Layer11, false, txtDisplay11Layer, "layer11");
|
||
}
|
||
else if (sender == btnDisplay12LayerUp)
|
||
{
|
||
layerUpDown(ref Layer12, true, txtDisplay12Layer, "layer12");
|
||
}
|
||
else if (sender == btnDisplay12LayerDown)
|
||
{
|
||
layerUpDown(ref Layer12, false, txtDisplay12Layer, "layer12");
|
||
}
|
||
else if (sender == btnDisplay13LayerUp)
|
||
{
|
||
layerUpDown(ref Layer13, true, txtDisplay13Layer, "layer13");
|
||
}
|
||
else if (sender == btnDisplay13LayerDown)
|
||
{
|
||
layerUpDown(ref Layer13, false, txtDisplay13Layer, "layer13");
|
||
}
|
||
else if (sender == btnDisplay14LayerUp)
|
||
{
|
||
layerUpDown(ref Layer14, true, txtDisplay14Layer, "layer14");
|
||
}
|
||
else if (sender == btnDisplay14LayerDown)
|
||
{
|
||
layerUpDown(ref Layer14, false, txtDisplay14Layer, "layer14");
|
||
}
|
||
else if (sender == btnDisplay15LayerUp)
|
||
{
|
||
layerUpDown(ref Layer15, true, txtDisplay15Layer, "layer15");
|
||
}
|
||
else if (sender == btnDisplay15LayerDown)
|
||
{
|
||
layerUpDown(ref Layer15, false, txtDisplay15Layer, "layer15");
|
||
}
|
||
|
||
else if (sender == btnFadeOutUp)
|
||
{
|
||
fadeOutTime++;
|
||
txtFadeOut.Text = fadeOutTime.ToString();
|
||
key.SetValue("fadeOutTime", Layer8);
|
||
}
|
||
else if (sender == btnFadeOutDown)
|
||
{
|
||
fadeOutTime--;
|
||
txtFadeOut.Text = fadeOutTime.ToString();
|
||
key.SetValue("fadeOutTime", Layer8);
|
||
}
|
||
}
|
||
private void txtonacd_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
TextEdit target = ((TextEdit)sender);
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue(target.Name, target.Text);
|
||
}
|
||
|
||
private void toggleSwitch주문콜_Toggled(object sender, EventArgs e)
|
||
{
|
||
ToggleSwitch target = ((ToggleSwitch)sender);
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue(target.Name, target.EditValue);
|
||
|
||
|
||
if (target.IsOn == false)
|
||
{
|
||
if (target == toggleSwitch주문콜전체)
|
||
{
|
||
simpleButton2_Click(null, null);
|
||
simpleButton9_Click(null, null);
|
||
simpleButton10_Click(null, null);
|
||
simpleButton11_Click(null, null);
|
||
}
|
||
else if (target == toggleSwitch매진팁)
|
||
{
|
||
simpleButton9_Click(null, null);
|
||
}
|
||
else if (target == toggleSwitch카드프로모션)
|
||
{
|
||
simpleButton10_Click(null, null);
|
||
}
|
||
else if (target == toggleSwitch배송정보)
|
||
{
|
||
simpleButton11_Click(null, null);
|
||
}
|
||
else if (target == toggleSwitchVVIP || target == toggleSwitchVVIP전면)
|
||
{
|
||
if (!toggleSwitchVVIP.IsOn && !toggleSwitchVVIP전면.IsOn) simpleButton12_Click(null, null);
|
||
}
|
||
else
|
||
{
|
||
simpleButton2_Click(null, null);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (target == toggleSwitch매진팁)
|
||
{
|
||
timer5.Start();
|
||
}
|
||
else if (target == toggleSwitchVVIP)
|
||
{
|
||
매진정보.VVIP송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
}
|
||
else if (target == toggleSwitchVVIP전면)
|
||
{
|
||
매진정보.VVIP전면송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
}
|
||
else if (target == toggleSwitch배송정보)
|
||
{
|
||
매진정보.배송송출시각 = DateTime.Now - TimeSpan.FromDays(1);
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmbPushType_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
txtPushName.Text = cmbPushType.SelectedItem.ToString();
|
||
|
||
if (cmbPushType.SelectedIndex == 0) txtDisplay3Path.Text = path3_1;
|
||
else if (cmbPushType.SelectedIndex == 1) txtDisplay3Path.Text = path3_2;
|
||
else if (cmbPushType.SelectedIndex == 2) txtDisplay3Path.Text = path3_3;
|
||
else if (cmbPushType.SelectedIndex == 3) txtDisplay3Path.Text = path3_4;
|
||
else if (cmbPushType.SelectedIndex == 4) txtDisplay3Path.Text = path3_5;
|
||
else if (cmbPushType.SelectedIndex == 5) txtDisplay3Path.Text = path3_6;
|
||
else if (cmbPushType.SelectedIndex == 6) txtDisplay3Path.Text = path3_7;
|
||
else if (cmbPushType.SelectedIndex == 7) txtDisplay3Path.Text = path3_8;
|
||
else if (cmbPushType.SelectedIndex == 8) txtDisplay3Path.Text = path3_9;
|
||
else if (cmbPushType.SelectedIndex == 9) txtDisplay3Path.Text = path3_10;
|
||
|
||
else if (cmbPushType.SelectedIndex == 10) txtDisplay3Path.Text = path3_11;
|
||
else if (cmbPushType.SelectedIndex == 11) txtDisplay3Path.Text = path3_12;
|
||
else if (cmbPushType.SelectedIndex == 12) txtDisplay3Path.Text = path3_13;
|
||
else if (cmbPushType.SelectedIndex == 13) txtDisplay3Path.Text = path3_14;
|
||
else if (cmbPushType.SelectedIndex == 14) txtDisplay3Path.Text = path3_15;
|
||
else if (cmbPushType.SelectedIndex == 15) txtDisplay3Path.Text = path3_16;
|
||
else if (cmbPushType.SelectedIndex == 16) txtDisplay3Path.Text = path3_17;
|
||
else if (cmbPushType.SelectedIndex == 17) txtDisplay3Path.Text = path3_18;
|
||
else if (cmbPushType.SelectedIndex == 18) txtDisplay3Path.Text = path3_19;
|
||
else if (cmbPushType.SelectedIndex == 19) txtDisplay3Path.Text = path3_20;
|
||
|
||
//MaxText 입력..
|
||
txtMaxText1.Text = ""; txtMaxText2.Text = "";
|
||
txtMaxText3.Text = ""; txtMaxText4.Text = ""; txtMaxText5.Text = "";
|
||
|
||
try
|
||
{
|
||
//서버에서 정보를 읽어온다.
|
||
string requestURL = getURL() + channel + "_" + (cmbPushType.SelectedIndex + 1) + "/씬이름/조회";
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
string item = obj["씬이름"].ToString();
|
||
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
DoChangeMaxText(item);
|
||
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
DoChangeMaxText(item);
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("Err : " + ex.Message); ;
|
||
}
|
||
}
|
||
|
||
private void DoChangeMaxText(string item)
|
||
{
|
||
try
|
||
{
|
||
string[] items = item.Split('|');
|
||
|
||
for (int i = 0; i < items.Length; i++)
|
||
{
|
||
if (i == 0) txtMaxText1.Text = items[i];
|
||
else if (i == 1) txtMaxText2.Text = items[i];
|
||
else if (i == 2) txtMaxText3.Text = items[i];
|
||
else if (i == 3) txtMaxText4.Text = items[i];
|
||
else if (i == 4) txtMaxText5.Text = items[i];
|
||
|
||
}
|
||
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
Console.WriteLine(e.Message);
|
||
}
|
||
}
|
||
|
||
private void btnPushNameChange_Click(object sender, EventArgs e)
|
||
{
|
||
//선택된 인덱스를 현재 택스트로 변경하고 저장한다.
|
||
cmbPushType.Items[cmbPushType.SelectedIndex] = txtPushName.Text;
|
||
savePushName();
|
||
|
||
//송출명 서버에서 불러오기
|
||
loadPushName();
|
||
}
|
||
private void savePushName()
|
||
{
|
||
try
|
||
{
|
||
//서버에서 정보를 읽어온다.
|
||
string saveStr = "";
|
||
for (int i = 0; i < cmbPushType.Items.Count; i++)
|
||
{
|
||
if (i != 0) saveStr += "|";
|
||
saveStr += cmbPushType.Items[i].ToString();
|
||
}
|
||
|
||
string requestURL = getURL() + channel.Replace("채널", "") + "/씬이름/입력?씬이름=" + saveStr;
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
loadPushName();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("Err : " + ex.Message); ;
|
||
}
|
||
}
|
||
|
||
private void loadPushName()
|
||
{
|
||
try
|
||
{
|
||
//서버에서 정보를 읽어온다.
|
||
string requestURL = getURL() + channel.Replace("채널","") + "/씬이름/조회";
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
string item = obj["씬이름"].ToString();
|
||
|
||
if (this.InvokeRequired)
|
||
{
|
||
this.Invoke(new MethodInvoker(delegate ()
|
||
{
|
||
DoChangePush(item);
|
||
|
||
}));
|
||
}
|
||
else
|
||
{
|
||
DoChangePush(item);
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine("Err : " + ex.Message); ;
|
||
}
|
||
}
|
||
|
||
private void DoChangePush(string item)
|
||
{
|
||
try
|
||
{
|
||
string[] items = item.Split('|');
|
||
|
||
for (int i = 0; i < items.Length; i++)
|
||
{
|
||
cmbPushChoice.Items[i] = items[i];
|
||
cmbPushType.Items[i] = items[i];
|
||
}
|
||
|
||
}catch(Exception e)
|
||
{
|
||
Console.WriteLine(e.Message);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
private void btnTest_Click(object sender, EventArgs e)
|
||
{
|
||
txtPGM.Text = "016147";
|
||
dateTimePicker1.Value = new DateTime(2021, 12, 1);
|
||
dateTimePicker2.Value = new DateTime(2021, 12, 1);
|
||
txtPromotion.Text = "202111050001";
|
||
}
|
||
|
||
private void pictureEdit7_EditValueChanged(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void btndis_Click(object sender, EventArgs e)
|
||
{
|
||
System.Diagnostics.Process.Start(@"C:\Tornado2\Tornado2.exe");
|
||
}
|
||
|
||
|
||
private void btnDisp3_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay3)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?텍스트=N");
|
||
}
|
||
else
|
||
{
|
||
try
|
||
{
|
||
//순서 : PUSH, TXT1 ~ 5
|
||
string txt = (cmbPushChoice.SelectedIndex+1).ToString();
|
||
txt += "|" + txtDisp3T1.Text;
|
||
txt += "|" + txtDisp3T2.Text;
|
||
txt += "|" + txtDisp3T3.Text;
|
||
txt += "|" + txtDisp3T4.Text;
|
||
txt += "|" + txtDisp3T5.Text;
|
||
|
||
//특수 개행문자 처리
|
||
txt = utils.replaceSpecialStrReverse(txt);
|
||
|
||
string requestURL = getURL() + channel + "/텍스트/입력?보낸사람=코더&텍스트=" + txt ;
|
||
sendURL(requestURL);
|
||
sendURL(getURL() + channel + "/자막상황/입력?텍스트=Y");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MessageBox.Show("정상적인 값이 입력되지 않았습니다.");
|
||
}
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void cmbPushChoice_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
txtDisp3T1.Text = "";
|
||
txtDisp3T2.Text = "";
|
||
txtDisp3T3.Text = "";
|
||
txtDisp3T4.Text = "";
|
||
txtDisp3T5.Text = "";
|
||
}
|
||
|
||
|
||
private void btnDisp4_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay4)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?채팅=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("채팅 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void btnDisp5_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay5)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?상품평=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("상품평 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void btnDisp6_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay6)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?QNA=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("Q&A 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void btnDisp7_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay7)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?공지=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("공지 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void btnDisp8_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay8)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?채팅판=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("공지 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
private void btnDisp9_Click(object sender, EventArgs e)
|
||
{
|
||
if (isConnected)
|
||
{
|
||
if (isDisplay9)
|
||
{
|
||
sendURL(getURL() + channel + "/자막상황/입력?동영상=N");
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("동영상 송출은 웹 URL을 통해 사용해 주시기 바랍니다.");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("토네이도 연결이 필요합니다.");
|
||
}
|
||
}
|
||
|
||
//이전 송출 있는 경우를 위한 딜레이 타이머
|
||
private void timer1_Tick(object sender, EventArgs e)
|
||
{
|
||
KAScenePlayer.Play(Layer4);
|
||
}
|
||
|
||
//무한루프를 위한 타이머
|
||
private void timer2_Tick(object sender, EventArgs e)
|
||
{
|
||
if (!isDisplay4)
|
||
{
|
||
if (timer2.Enabled)
|
||
timer2.Stop();
|
||
return;
|
||
}
|
||
|
||
int dispLines = 0;
|
||
int timeOfChange = 15;
|
||
int timeOfWait = 60;
|
||
int timeOfBefore = 0;
|
||
int timeOfClear = 30;
|
||
string isLoop = "";
|
||
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
//송출을 위한 데이터를 읽어와서 송출한다.
|
||
|
||
//데이터 읽는 부분
|
||
//서버에서 정보를 읽어온다.
|
||
string dispStr = "";
|
||
string requestURL = getURL() + channel + "/채팅/조회";
|
||
|
||
WebRequest request = WebRequest.Create(requestURL);
|
||
request.Method = "GET";
|
||
request.ContentType = "application/json; charset=UTF-8;";
|
||
//request.ContentType = "charset=UTF-8";
|
||
|
||
using (WebResponse response = request.GetResponse())
|
||
using (Stream stream = response.GetResponseStream())
|
||
using (StreamReader reader = new StreamReader(stream))
|
||
{
|
||
string data = reader.ReadToEnd();
|
||
JObject obj = JObject.Parse(data);
|
||
|
||
dispStr = obj["채팅"].ToString();
|
||
|
||
}
|
||
//특수문자 처리를 위함
|
||
dispStr = utils.replaceSpecialStr(dispStr);
|
||
|
||
|
||
string[] strs = dispStr.Split('|');
|
||
|
||
if (strs[8].Equals("Y"))
|
||
isLoop = "true";
|
||
else if (strs[8].Equals("C"))
|
||
isLoop = "clear";
|
||
|
||
dispLines = Convert.ToInt16(strs[9]);
|
||
|
||
timeOfChange = Convert.ToInt32(strs[10]);
|
||
timeOfWait = Convert.ToInt32(strs[11]);
|
||
timeOfClear = Convert.ToInt32(strs[12]);
|
||
|
||
|
||
//색상리턴용 내부함수
|
||
sKStyleColor getColor(Label lbl)
|
||
{
|
||
sKStyleColor sKStyleColor = new sKStyleColor();
|
||
|
||
sKStyleColor.A = lbl.BackColor.A;
|
||
sKStyleColor.R = lbl.BackColor.R;
|
||
sKStyleColor.G = lbl.BackColor.G;
|
||
sKStyleColor.B = lbl.BackColor.B;
|
||
|
||
return sKStyleColor;
|
||
}
|
||
|
||
//송출부분
|
||
|
||
orderDisp4Index++;
|
||
if (dispLines == 2)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 1)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_1, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 3)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_2, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 4)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_3, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 5)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_4, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 6)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_5, "채팅" + orderDisp4Index);
|
||
}
|
||
else if (dispLines == 0)
|
||
{
|
||
KAScene = KAEngine.LoadScene(path4_0, "채팅" + orderDisp4Index);
|
||
}
|
||
|
||
KAObject KAObject;
|
||
|
||
|
||
if (dispLines == 2)
|
||
{
|
||
KAObject = KAScene.GetObject("name1");
|
||
|
||
//
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//5번의 위치만 변동될 수 있다
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//2번째 택스트가 1개인 경우
|
||
KAObject.SetPositionKey(5, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
//아래가 2줄 이상 올라오게 되면
|
||
KAObject.SetPositionKey(5, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 4; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//-432.38
|
||
KAObject.SetPositionKey(1, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -362.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_3 : lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_4 : lbl_color_2));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
//색상 설정의 경우의 수
|
||
// n1,t1,t2가 있는 경우 : 일반적인 상황
|
||
// n1 = color3, t1 = color4, t2 = color4
|
||
|
||
//n2가 존재하면
|
||
// n1,n2,t1,t2 다 있는 경우 : n2는 이때만 존재
|
||
// n1 = color1, t1 = color2, n2 = color3, t2 = color4
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
for (int i = 0; i < 10; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[2].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWait + timeOfChange + 6, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWait + timeOfChange + 5, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[3].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(1, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, 30f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(9, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
}
|
||
|
||
//시간 계산 변경
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
KAObject.SetPositionKey(4, 0, -0.3f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(4, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("txt2");
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[0];
|
||
if (strs[3] != "")
|
||
{
|
||
aliveLiveChatText[1] = strs[3];
|
||
}
|
||
else if (strs[2] != "")
|
||
{
|
||
aliveLiveChatText[1] = strs[2];
|
||
}
|
||
else
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
}
|
||
|
||
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[7].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[5];
|
||
aliveLiveChatText[2] = "";
|
||
aliveLiveChatText[3] = strs[6];
|
||
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetPositionKey(2, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[6];
|
||
aliveLiveChatText[2] = "";
|
||
aliveLiveChatText[3] = strs[7];
|
||
}
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
}
|
||
else if (dispLines == 11)
|
||
{
|
||
KAObject = KAScene.GetObject("name1");
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
//5번의 위치만 변동될 수 있다
|
||
KAObject.SetPositionKey(0, 0, -37f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -0.4f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 33f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 4; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//-432.38
|
||
KAObject.SetPositionKey(1, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -397.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -362.38f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
for (int i = 0; i < 10; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[2].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[3].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, -105.8f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -71.54f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, -36.18f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -2.31f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, 30f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
}
|
||
|
||
//시간 계산 변경
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, 0, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
aliveLiveChatText[0] = "";
|
||
aliveLiveChatText[1] = "";
|
||
aliveLiveChatText[2] = strs[4];
|
||
|
||
KAObject = KAScene.GetObject("txt2");
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (strs[6].Trim() == "")
|
||
{
|
||
//1줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + 4, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + 3, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait;
|
||
|
||
|
||
aliveLiveChatText[3] = strs[5];
|
||
}
|
||
else
|
||
{
|
||
|
||
if (strs[7].Trim() == "")
|
||
{
|
||
//2줄만 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 2, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[3] = strs[6];
|
||
|
||
}
|
||
else
|
||
{
|
||
//3줄다 기록된 경우
|
||
KAObject.SetPositionKey(1, 0, 0.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 35.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 70.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 105.5f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
aliveLiveChatText[3] = strs[7];
|
||
|
||
}
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
}
|
||
else if (dispLines == 3)
|
||
{
|
||
int lineCountQuestion = 3;
|
||
int lineCountAnswer = 3;
|
||
|
||
//이전 텍스트 처리
|
||
int countOfNames = 0;
|
||
|
||
if (aliveLiveChatText[0] != "") countOfNames++;
|
||
if (aliveLiveChatText[2] != "") countOfNames++;
|
||
if (aliveLiveChatText[4] != "") countOfNames++;
|
||
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
KAObject = KAScene.GetObject("txt0_" + i);
|
||
KAObject.SetValue("");
|
||
|
||
KAObject = KAScene.GetObject("name0_" + i);
|
||
KAObject.SetValue("");
|
||
}
|
||
|
||
if (countOfNames == 1)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("txt0_3");
|
||
KAObject.SetValue(aliveLiveChatText[5]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
else if (countOfNames == 2)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("txt0_1");
|
||
KAObject.SetValue(aliveLiveChatText[1]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[2]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_2");
|
||
KAObject.SetValue(aliveLiveChatText[3]);
|
||
KAObject.SetStyleColor(getColor(aliveLiveChatText[2] == "" ? lbl_color_2 : lbl_color_4));
|
||
|
||
KAObject = KAScene.GetObject("name0_3");
|
||
KAObject.SetValue(aliveLiveChatText[4]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
|
||
KAObject = KAScene.GetObject("txt0_3");
|
||
KAObject.SetValue(aliveLiveChatText[5]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
}
|
||
|
||
|
||
if (strs[2].Trim() == "") lineCountQuestion = 1;
|
||
else if (strs[3].Trim() == "") lineCountQuestion = 2;
|
||
|
||
if (strs[6].Trim() == "") lineCountAnswer = 1;
|
||
else if (strs[7].Trim() == "") lineCountAnswer = 2;
|
||
|
||
|
||
KAObject = KAScene.GetObject("txt0");
|
||
KAObject.SetPosition(0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 6; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
//이전에 상위 2줄을 쓰는 경우
|
||
bool isBeforeLine2 = true;
|
||
int timeOfAdded = 0;
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (i < 4)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() == "") isBeforeLine2 = false;
|
||
}
|
||
else
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") isBeforeLine2 = false;
|
||
}
|
||
}
|
||
|
||
if (isBeforeLine2) timeOfAdded = timeOfChange + timeOfWait;
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfAdded + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfAdded + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfAdded + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfAdded + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfAdded + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, timeOfAdded, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name1" : "txt1");
|
||
|
||
for (int i = 0; i < 12; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 11, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 10, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(7, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(8, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(9, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(10, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(11, 0, 140f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWait;
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
timeOfBefore = timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
}
|
||
|
||
//기준이 되는 수치를 집어넣고 변경되는 경우마다 처리한다
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
|
||
for (int i = 0; i < 7; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfBefore + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfBefore + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfBefore + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfBefore + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfBefore, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(1, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(2, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(3, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(4, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
if (lineCountAnswer == 1)
|
||
{
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetPositionKey(7, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
KAObject.SetPositionKey(6, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (lineCountQuestion == 2)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
for (int i = 9; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
KAObject.SetPositionKey(4, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(5, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetPositionKey(6, 0, -35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
|
||
timeOfBefore += lineCountQuestion == 1 ? 2 * (timeOfChange + timeOfWait) : timeOfChange + timeOfWait;
|
||
}
|
||
else if (lineCountAnswer == 2)
|
||
{
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name2" : "txt2");
|
||
|
||
KAObject.SetPositionKey(6, 0, 0f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
//name1과 txt1의 위치를 조절해야 한다.
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetPositionKey(7, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
KAObject = KAScene.GetObject("txt1");
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
for (int i = 7; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 35f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
for (int i = 9; i < 12; i++)
|
||
KAObject.SetPositionKey(i, 0, 70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
KAObject.SetPositionKey(11, 0, 105f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
|
||
}
|
||
else if (lineCountAnswer == 3)
|
||
{
|
||
|
||
//3줄다 기록된 경우
|
||
timeOfBefore += timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange + timeOfWait;
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfBefore - timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfBefore - timeOfWait - timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
}
|
||
|
||
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("txt1_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[1]);
|
||
KAObject = KAScene.GetObject("txt1_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[2]);
|
||
KAObject = KAScene.GetObject("txt1_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_2));
|
||
KAObject.SetValue(strs[3]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
KAObject = KAScene.GetObject("txt2_1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[5]);
|
||
KAObject = KAScene.GetObject("txt2_2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[6]);
|
||
KAObject = KAScene.GetObject("txt2_3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_4));
|
||
KAObject.SetValue(strs[7]);
|
||
|
||
//경우의 수를 통한 표출 텍스트 정보를 저장
|
||
for (int i = 0; i < aliveLiveChatText.Length; i++)
|
||
{
|
||
aliveLiveChatText[i] = "";
|
||
aliveLiveChatText2[i] = "";
|
||
}
|
||
|
||
if (lineCountAnswer == 3)
|
||
{
|
||
aliveLiveChatText[0] = strs[4];
|
||
aliveLiveChatText[1] = strs[5];
|
||
aliveLiveChatText[3] = strs[6];
|
||
aliveLiveChatText[5] = strs[7];
|
||
}
|
||
else if (lineCountAnswer == 2)
|
||
{
|
||
aliveLiveChatText[0] = strs[0];
|
||
aliveLiveChatText[1] = strs[lineCountQuestion];
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
aliveLiveChatText[5] = strs[6];
|
||
}
|
||
else if (lineCountAnswer == 1)
|
||
{
|
||
aliveLiveChatText[0] = strs[0];
|
||
|
||
if (lineCountQuestion == 1)
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
aliveLiveChatText[2] = strs[4];
|
||
aliveLiveChatText[3] = strs[5];
|
||
}
|
||
else if (lineCountQuestion == 2)
|
||
{
|
||
aliveLiveChatText[1] = strs[1];
|
||
aliveLiveChatText[3] = strs[2];
|
||
aliveLiveChatText[4] = strs[4];
|
||
aliveLiveChatText[5] = strs[5];
|
||
}
|
||
else if (lineCountQuestion == 3)
|
||
{
|
||
aliveLiveChatText[1] = strs[2];
|
||
aliveLiveChatText[3] = strs[3];
|
||
aliveLiveChatText[4] = strs[4];
|
||
aliveLiveChatText[5] = strs[5];
|
||
}
|
||
}
|
||
}
|
||
else if (dispLines == 4)
|
||
{
|
||
int lineCountQuestion = 3;
|
||
int lineCountAnswer = 3;
|
||
|
||
|
||
|
||
|
||
//텍스트 값 변경
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
List<string> txts = new List<string>();
|
||
lineCountQuestion = 0;
|
||
lineCountAnswer = 0;
|
||
for (int i = 1; i < 8; i++)
|
||
{
|
||
if (i != 4 && strs[i].Trim() != "")
|
||
{
|
||
if (i < 4)
|
||
{
|
||
lineCountQuestion++;
|
||
}
|
||
else
|
||
{
|
||
lineCountAnswer++;
|
||
}
|
||
txts.Add(strs[i]);
|
||
}
|
||
}
|
||
for (int i = 0; i < 6; i++)
|
||
{
|
||
if (i < txts.Count)
|
||
{
|
||
KAObject = KAScene.GetObject("txt1_" + (i + 1));
|
||
KAObject.SetStyleColor(getColor(i < lineCountQuestion ? lbl_color_2 : lbl_color_4));
|
||
KAObject.SetValue(txts[i]);
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject("txt1_" + (i + 1));
|
||
KAObject.SetValue("");
|
||
}
|
||
|
||
}
|
||
|
||
|
||
//기본 시간 계산
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
//Name,Text 위치 및 시간계산
|
||
for (int j = 0; j < 3; j++)
|
||
{
|
||
KAObject = KAScene.GetObject(j == 0 ? "name1" : j == 1 ? "txts" : "name2");
|
||
|
||
for (int i = 0; i < 12; i++)
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 11, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 10, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 9, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 8, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (j != 2)
|
||
{
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2)) - 85;
|
||
if (j == 0) yPos += 15; //name
|
||
else
|
||
{
|
||
if (lineCountAnswer + lineCountQuestion < 5 && i > 8)
|
||
{
|
||
yPos = 30 * 4 - 85;
|
||
}
|
||
else if (lineCountAnswer + lineCountQuestion == 5 && i > 9)
|
||
{
|
||
yPos = 30 * 5 - 85;
|
||
}
|
||
}
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
else //name2
|
||
{
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2)) - 70;
|
||
yPos += lineCountQuestion * -30;
|
||
|
||
//가장아래에 있는 경우
|
||
if (lineCountQuestion == 3 && lineCountAnswer == 1)
|
||
{
|
||
if (yPos > -40) yPos = -40;
|
||
}
|
||
else if ((lineCountQuestion == 2 && lineCountAnswer == 1) ||
|
||
(lineCountQuestion == 2 && lineCountAnswer == 2) ||
|
||
(lineCountQuestion == 3 && lineCountAnswer == 2))
|
||
{
|
||
if (yPos > -10) yPos = -10;
|
||
}
|
||
else
|
||
{
|
||
if (yPos > 20) yPos = 20;
|
||
}
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
}
|
||
|
||
//이전 텍스트 처리
|
||
bool isReply = false;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (i == 0)
|
||
{
|
||
KAObject = KAScene.GetObject("name0_1");
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue("");
|
||
}
|
||
else if (i % 2 == 0)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "")
|
||
{
|
||
isReply = true;
|
||
KAObject = KAScene.GetObject("name0_2");
|
||
KAObject.SetValue(aliveLiveChatText[i]);
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject("txt0_" + (i / 2 + 1));
|
||
KAObject.SetValue(aliveLiveChatText[i]);
|
||
KAObject.SetStyleColor(getColor(isReply ? lbl_color_4 : lbl_color_2));
|
||
}
|
||
}
|
||
|
||
int beforeTextReplayPos()
|
||
{
|
||
if (aliveLiveChatText[6].Trim() != "") return 4;
|
||
else if (aliveLiveChatText[4].Trim() != "") return 3;
|
||
else if (aliveLiveChatText[2].Trim() != "") return 2;
|
||
else return 0;
|
||
}
|
||
int beforeTextReplayCount()
|
||
{
|
||
if (aliveLiveChatText[6].Trim() != "") return 1;
|
||
else if (aliveLiveChatText[4].Trim() != "")
|
||
{
|
||
return aliveLiveChatText[7].Trim() == "" ? 1 : 2;
|
||
|
||
}
|
||
else if (aliveLiveChatText[2].Trim() != "")
|
||
{
|
||
if (aliveLiveChatText[7].Trim() != "") return 3;
|
||
else if (aliveLiveChatText[5].Trim() != "") return 2;
|
||
else return 1;
|
||
}
|
||
else return 0;
|
||
}
|
||
|
||
|
||
string[] keyNames = { "group0", "", "name0_1t", "name0_2t" };
|
||
foreach (var k in keyNames)
|
||
{
|
||
KAObject = KAScene.GetObject(k);
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
}
|
||
|
||
|
||
int blankCount = 0;
|
||
if (aliveLiveChatText[7] == "")
|
||
{
|
||
blankCount++;
|
||
if (aliveLiveChatText[5] == "") blankCount++;
|
||
}
|
||
int blankWait = 0;
|
||
for (int i = 0; i < blankCount; i++) blankWait += timeOfChange + timeOfWaitFirst;
|
||
|
||
foreach (var k in keyNames)
|
||
{
|
||
KAObject = KAScene.GetObject(k);
|
||
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 7, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 6, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 5, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 4, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 3, blankWait + timeOfChange + timeOfWaitFirst + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 2, blankWait + timeOfChange + timeOfWaitFirst, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 1, blankWait + timeOfChange, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, 0, blankWait, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("group0");
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
KAObject = KAScene.GetObject("name0_1t");
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
|
||
if (beforeTextReplayPos() == 2)
|
||
{ }
|
||
else if (beforeTextReplayPos() == 3)
|
||
{
|
||
yPos -= 30;
|
||
}
|
||
else if (beforeTextReplayPos() == 4)
|
||
{
|
||
yPos -= 60;
|
||
}
|
||
if (yPos < 0) yPos = 0;
|
||
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
KAObject = KAScene.GetObject("name0_2t");
|
||
int countOfZero = 0;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
float yPos = (30 * ((i + 1) / 2));
|
||
yPos -= (beforeTextReplayPos() - 1) * 30;
|
||
|
||
if (yPos > 0)
|
||
{
|
||
countOfZero++;
|
||
if (countOfZero <= (beforeTextReplayCount() - 1) * 2) yPos = 0;
|
||
|
||
if (yPos > 0) yPos = 30;
|
||
}
|
||
|
||
|
||
KAObject.SetPositionKey(i, 0, yPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
//보이는 값 저장하기
|
||
for (int i = 0; i < aliveLiveChatText.Length; i++)
|
||
{
|
||
aliveLiveChatText[i] = "";
|
||
}
|
||
txts.Reverse();
|
||
for (int i = 0; i < 4; i++)
|
||
{
|
||
if (txts.Count > i) aliveLiveChatText[7 - (i * 2)] = txts[i];
|
||
}
|
||
|
||
for (int i = 0; i < 2; i++)
|
||
{
|
||
if (aliveLiveChatText[1].Trim() == "")
|
||
{
|
||
aliveLiveChatText[1] = aliveLiveChatText[3];
|
||
aliveLiveChatText[3] = aliveLiveChatText[5];
|
||
aliveLiveChatText[5] = aliveLiveChatText[7];
|
||
aliveLiveChatText[7] = "";
|
||
}
|
||
}
|
||
|
||
|
||
aliveLiveChatText[0] = strs[0];
|
||
if (lineCountQuestion == 3 && lineCountAnswer == 1)
|
||
{
|
||
aliveLiveChatText[6] = strs[4];
|
||
}
|
||
else if ((lineCountQuestion == 2 && lineCountAnswer == 1) ||
|
||
(lineCountQuestion == 2 && lineCountAnswer == 2) ||
|
||
(lineCountQuestion == 3 && lineCountAnswer == 2))
|
||
{
|
||
aliveLiveChatText[4] = strs[4];
|
||
}
|
||
else
|
||
{
|
||
aliveLiveChatText[2] = strs[4];
|
||
}
|
||
|
||
// 기본적으로 위로 올라가는 시간
|
||
for (int i = 0; i < 4; i++)
|
||
{
|
||
timeOfBefore += timeOfWaitFirst + timeOfChange;
|
||
}
|
||
|
||
for (int i = 0; i < lineCountQuestion + lineCountAnswer - 4; i++)
|
||
{
|
||
timeOfBefore += timeOfWait + timeOfChange;
|
||
}
|
||
}
|
||
else if (dispLines == 0 || dispLines == 1)
|
||
{
|
||
string 답변자아이콘 = strs[13];
|
||
|
||
bool hasBeforeScene = false;
|
||
bool hasBeforeScene2 = false;
|
||
bool hasBeforeScene3 = false;
|
||
bool hasBeforeScene4 = false;
|
||
|
||
//기존 텍스트 존재 검사
|
||
if (!isNullArray(aliveLiveChatText4))
|
||
{
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
hasBeforeScene3 = true;
|
||
hasBeforeScene4 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText3))
|
||
{
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
hasBeforeScene3 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText2))
|
||
{
|
||
//존재한다 좆됐다!
|
||
hasBeforeScene = true;
|
||
hasBeforeScene2 = true;
|
||
}
|
||
else if (!isNullArray(aliveLiveChatText))
|
||
{
|
||
//존재한다 좆됐다!
|
||
hasBeforeScene = true;
|
||
}
|
||
|
||
|
||
//말풍선 색상 변경
|
||
KAScene.GetObject("txtbox1").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox2").SetStyleColor(getColor(lbl_color_6));
|
||
if (hasBeforeScene)
|
||
{
|
||
KAScene.GetObject("txtbox3").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox4").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAScene.GetObject("txtbox5").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox6").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAScene.GetObject("txtbox7").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox8").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAScene.GetObject("txtbox9").SetStyleColor(getColor(lbl_color_5));
|
||
KAScene.GetObject("txtbox10").SetStyleColor(getColor(lbl_color_6));
|
||
|
||
}
|
||
|
||
//텍스트 값 변경 - 작성자
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
|
||
KAObject = KAScene.GetObject("name2");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(strs[4]);
|
||
|
||
bool[] 답변자아이콘존재여부 = { false, false, false, false, false, false, false, false, false, false, false };
|
||
void 답변자아이콘설정(string 테그명, string 내용)
|
||
{
|
||
int index = Convert.ToInt32(테그명.Replace("name", ""));
|
||
|
||
if (내용.Contains("undefined") || 내용.Substring(내용.Length - 2).Equals("_"))
|
||
{
|
||
KAObject = KAScene.GetObject(테그명);
|
||
KAObject.SetPosition(-100, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject = KAScene.GetObject(테그명 + "Icon");
|
||
KAObject.SetVisible(0);
|
||
}
|
||
else
|
||
{
|
||
KAObject = KAScene.GetObject(테그명);
|
||
KAObject.SetPosition(-40, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
|
||
KAObject = KAScene.GetObject(테그명 + "Icon");
|
||
KAObject.SetValue(getIconPath(내용, true, true));
|
||
KAObject.SetImageOriginalSize();
|
||
KAObject.SetVisible(1);
|
||
답변자아이콘존재여부[index] = true;
|
||
}
|
||
|
||
}
|
||
|
||
답변자아이콘설정("name2", 답변자아이콘);
|
||
|
||
|
||
if (hasBeforeScene)
|
||
{
|
||
KAObject = KAScene.GetObject("name3");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText[0]);
|
||
KAObject = KAScene.GetObject("name4");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText[4]);
|
||
답변자아이콘설정("name4", aliveLiveChatText[8]);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAObject = KAScene.GetObject("name5");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText2[0]);
|
||
KAObject = KAScene.GetObject("name6");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText2[4]);
|
||
답변자아이콘설정("name6", aliveLiveChatText2[8]);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAObject = KAScene.GetObject("name7");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText3[0]);
|
||
KAObject = KAScene.GetObject("name8");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText3[4]);
|
||
답변자아이콘설정("name8", aliveLiveChatText3[8]);
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAObject = KAScene.GetObject("name9");
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(aliveLiveChatText4[0]);
|
||
KAObject = KAScene.GetObject("name10");
|
||
KAObject.SetStyleColor(getColor(lbl_color_3));
|
||
KAObject.SetValue(aliveLiveChatText4[4]);
|
||
답변자아이콘설정("name10", aliveLiveChatText4[8]);
|
||
}
|
||
|
||
//기본 시간 계산
|
||
int timeOfWaitFirst = 1;
|
||
bool FirstChecker = true;
|
||
for (int i = 0; i < 8; i++)
|
||
{
|
||
if (aliveLiveChatText[i].Trim() != "") FirstChecker = false;
|
||
}
|
||
if (!FirstChecker) timeOfWaitFirst = timeOfWait;
|
||
|
||
int[] 키프레임값 = new int[11];
|
||
int 현재키프레임 = 0;
|
||
키프레임값[0] = 0;
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
int 더할값 = i % 2 == 1 ? timeOfChange : timeOfWait;
|
||
키프레임값[i] = 키프레임값[i - 1] + 더할값;
|
||
}
|
||
|
||
|
||
|
||
//Animation 정렬 초기화
|
||
for (int j = 0; j < 2; j++)
|
||
{
|
||
KAObject = j == 0 ? KAScene.GetObject("boxs") : KAScene.GetObject("boxs2");
|
||
for (int i = 0; i < 11; i++) KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
//설정된 프레임 시간 맞추기
|
||
for (int i = 10; i > -1; i--)
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, 키프레임값[i], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
}
|
||
|
||
|
||
//이모지 정보 저장용
|
||
List<Emoji> emojis = new List<Emoji>();
|
||
//큰아이콘 정보 저장용
|
||
List<LargeIcon> largeIcons = new List<LargeIcon>();
|
||
//사진아이콘 정보 저장용
|
||
List<PhotoIcon> photoIcons = new List<PhotoIcon>();
|
||
|
||
List<Emoji> beforeEmojis = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis2 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons2 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons2 = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis3 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons3 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons3 = new List<PhotoIcon>();
|
||
List<Emoji> beforeEmojis4 = new List<Emoji>();
|
||
List<LargeIcon> beforeLargeIcons4 = new List<LargeIcon>();
|
||
List<PhotoIcon> beforePhotoIcons4 = new List<PhotoIcon>();
|
||
|
||
|
||
//표출 말풍선 정보
|
||
int QLines = strs[3].Trim() != "" ? 3 : strs[2].Trim() != "" ? 2 : 1;
|
||
int ALines = strs[7].Trim() != "" ? 3 : strs[6].Trim() != "" ? 2 : 1;
|
||
string txtQ = setTxt(new string[] { strs[1], strs[2], strs[3] }, true, 0);
|
||
string txtA = setTxt(new string[] { strs[5], strs[6], strs[7] }, false, 0);
|
||
if (txtQ.Replace(Environment.NewLine, "").Trim().Equals("")) QLines = 0;
|
||
if (txtA.Replace(Environment.NewLine, "").Trim().Equals("")) ALines = 0;
|
||
|
||
int beforeQLines = aliveLiveChatText[3].Trim() != "" ? 3 : aliveLiveChatText[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines = aliveLiveChatText[7].Trim() != "" ? 3 : aliveLiveChatText[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ = setTxt(new string[] { aliveLiveChatText[1], aliveLiveChatText[2], aliveLiveChatText[3] }, true, 1);
|
||
string beforetxtA = setTxt(new string[] { aliveLiveChatText[5], aliveLiveChatText[6], aliveLiveChatText[7] }, false, 1);
|
||
if (beforetxtQ.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines = 0;
|
||
if (beforetxtA.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines = 0;
|
||
|
||
int beforeQLines2 = aliveLiveChatText2[3].Trim() != "" ? 3 : aliveLiveChatText2[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines2 = aliveLiveChatText2[7].Trim() != "" ? 3 : aliveLiveChatText2[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ2 = setTxt(new string[] { aliveLiveChatText2[1], aliveLiveChatText2[2], aliveLiveChatText2[3] }, true, 2);
|
||
string beforetxtA2 = setTxt(new string[] { aliveLiveChatText2[5], aliveLiveChatText2[6], aliveLiveChatText2[7] }, false, 2);
|
||
if (beforetxtQ2.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines2 = 0;
|
||
if (beforetxtA2.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines2 = 0;
|
||
|
||
int beforeQLines3 = aliveLiveChatText3[3].Trim() != "" ? 3 : aliveLiveChatText3[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines3 = aliveLiveChatText3[7].Trim() != "" ? 3 : aliveLiveChatText3[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ3 = setTxt(new string[] { aliveLiveChatText3[1], aliveLiveChatText3[2], aliveLiveChatText3[3] }, true, 3);
|
||
string beforetxtA3 = setTxt(new string[] { aliveLiveChatText3[5], aliveLiveChatText3[6], aliveLiveChatText3[7] }, false, 3);
|
||
if (beforetxtQ3.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines3 = 0;
|
||
if (beforetxtA3.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines3 = 0;
|
||
|
||
int beforeQLines4 = aliveLiveChatText4[3].Trim() != "" ? 3 : aliveLiveChatText4[2].Trim() != "" ? 2 : 1;
|
||
int beforeALines4 = aliveLiveChatText4[7].Trim() != "" ? 3 : aliveLiveChatText4[6].Trim() != "" ? 2 : 1;
|
||
string beforetxtQ4 = setTxt(new string[] { aliveLiveChatText4[1], aliveLiveChatText4[2], aliveLiveChatText4[3] }, true, 4);
|
||
string beforetxtA4 = setTxt(new string[] { aliveLiveChatText4[5], aliveLiveChatText4[6], aliveLiveChatText4[7] }, false, 4);
|
||
if (beforetxtQ4.Replace(Environment.NewLine, "").Trim().Equals("")) beforeQLines4 = 0;
|
||
if (beforetxtA4.Replace(Environment.NewLine, "").Trim().Equals("")) beforeALines4 = 0;
|
||
|
||
|
||
|
||
string setTxt(string[] inputs, bool isQuestion, int isBeFore)
|
||
{
|
||
//이모지존재 체크
|
||
for (int i = 0; i < 3; i++) inputs[i] = CheckEmoji(inputs[i], isQuestion, i + 1, isBeFore);
|
||
|
||
string txt = inputs[0];
|
||
if (inputs[1].Trim() != "") txt += Environment.NewLine + inputs[1];
|
||
if (inputs[2].Trim() != "") txt += Environment.NewLine + inputs[2];
|
||
|
||
return txt;
|
||
}
|
||
|
||
int calculGapOfX(string txt)
|
||
{
|
||
int posX = 0;
|
||
//영문 또는 숫자인 경우 절반만 적용하는 방식을 적용해 본다
|
||
foreach (char v in txt)
|
||
{
|
||
//length * 25
|
||
if ((0xAC00 <= v && v <= 0xD7A3) || (0x3131 <= v && v <= 0x318E)) posX += 25;
|
||
else if (Char.IsWhiteSpace(v)) posX += 5;
|
||
else posX += 15;
|
||
}
|
||
return posX;
|
||
}
|
||
|
||
string CheckEmoji(string str, bool isQuestion, int line, int isBefore)
|
||
{
|
||
while (str.Contains("[PH:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[PH:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
PhotoIcon photoIcon = new PhotoIcon(isQuestion, hasContents, false, ImgName);
|
||
|
||
if (isBefore == 4) beforePhotoIcons4.Add(photoIcon);
|
||
else if (isBefore == 3) beforePhotoIcons3.Add(photoIcon);
|
||
else if (isBefore == 2) beforePhotoIcons2.Add(photoIcon);
|
||
else if (isBefore == 1) beforePhotoIcons.Add(photoIcon);
|
||
else photoIcons.Add(photoIcon);
|
||
}
|
||
while (str.Contains("[LI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[LI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
LargeIcon largeIcon = new LargeIcon(isQuestion, hasContents, false, ImgName);
|
||
|
||
if (isBefore == 4) beforeLargeIcons4.Add(largeIcon);
|
||
else if (isBefore == 3) beforeLargeIcons3.Add(largeIcon);
|
||
else if (isBefore == 2) beforeLargeIcons2.Add(largeIcon);
|
||
else if (isBefore == 1) beforeLargeIcons.Add(largeIcon);
|
||
else largeIcons.Add(largeIcon);
|
||
}
|
||
while (str.Contains("[CI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[CI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
bool hasContents = true;
|
||
if (line == 1) if (str.Trim().Equals("")) hasContents = false;
|
||
LargeIcon largeIcon = new LargeIcon(isQuestion, hasContents, true, ImgName);
|
||
|
||
if (isBefore == 4) beforeLargeIcons4.Add(largeIcon);
|
||
else if (isBefore == 3) beforeLargeIcons3.Add(largeIcon);
|
||
else if (isBefore == 2) beforeLargeIcons2.Add(largeIcon);
|
||
else if (isBefore == 1) beforeLargeIcons.Add(largeIcon);
|
||
else largeIcons.Add(largeIcon);
|
||
}
|
||
while (str.Contains("[SI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[SI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
int gapOfX = 0;
|
||
|
||
if (isQuestion)
|
||
{
|
||
gapOfX = 155; //오른쪽
|
||
|
||
//gapOfX += -calculGapOfX(str.Substring(0, indexOfSI));
|
||
}
|
||
else
|
||
{
|
||
gapOfX = -125; //왼쪽
|
||
gapOfX += calculGapOfX(str.Substring(0, indexOfSI));
|
||
//최대값 넣어야함
|
||
if (gapOfX > 125) gapOfX = 125;
|
||
}
|
||
|
||
string ImgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
str = str.Insert(indexOfSI, " ");
|
||
|
||
Emoji emoji = new Emoji(isQuestion, line, gapOfX, ImgName);
|
||
|
||
if (isBefore == 4) beforeEmojis4.Add(emoji);
|
||
else if (isBefore == 3) beforeEmojis3.Add(emoji);
|
||
else if (isBefore == 2) beforeEmojis2.Add(emoji);
|
||
else if (isBefore == 1) beforeEmojis.Add(emoji);
|
||
else emojis.Add(emoji);
|
||
}
|
||
|
||
|
||
return str;
|
||
}
|
||
|
||
KAScene.GetObject("txt1").SetValue(txtQ);
|
||
KAScene.GetObject("txt2").SetValue(txtA);
|
||
if (hasBeforeScene)
|
||
{
|
||
KAScene.GetObject("txt3").SetValue(beforetxtQ);
|
||
KAScene.GetObject("txt4").SetValue(beforetxtA);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
KAScene.GetObject("txt5").SetValue(beforetxtQ2);
|
||
KAScene.GetObject("txt6").SetValue(beforetxtA2);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
KAScene.GetObject("txt7").SetValue(beforetxtQ3);
|
||
KAScene.GetObject("txt8").SetValue(beforetxtA3);
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
KAScene.GetObject("txt9").SetValue(beforetxtQ4);
|
||
KAScene.GetObject("txt10").SetValue(beforetxtA4);
|
||
}
|
||
|
||
//아이콘 Visible Setting
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
KAScene.GetObject("img" + i).SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_가로형").SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_정사각").SetVisible(0);
|
||
KAScene.GetObject("img" + i + "_세로형").SetVisible(0);
|
||
|
||
for (int j = 1; j < 6; j++) KAScene.GetObject("emoji" + i + "_" + j).SetVisible(0);
|
||
}
|
||
|
||
//이모지 표출을 위치 계산
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
string getIconPath(string fileName, bool isEmoji, bool isCharecter)
|
||
{
|
||
var directory = Path.GetDirectoryName(path4_0);
|
||
var path = "";
|
||
if (isCharecter)
|
||
{
|
||
if (isEmoji) path = directory + @"\character\" + fileName + "_60.png";
|
||
else path = directory + @"\character\" + fileName + "_120.png";
|
||
}
|
||
else
|
||
{
|
||
if (isEmoji) path = directory + @"\icons_small\" + fileName + "_s.png";
|
||
else path = directory + @"\icons\" + fileName + ".png";
|
||
}
|
||
|
||
|
||
return path;
|
||
}
|
||
|
||
//임시 - X값 계산 수식을 다시 정해야함..
|
||
int emojiQ = 0;
|
||
int emojiA = 0;
|
||
foreach (var emoji in emojis)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji1_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji2_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -10, -40, -70 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
if (hasBeforeScene)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji3_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji4_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis2)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji5_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji6_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis3)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji7_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji8_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
if (hasBeforeScene4)
|
||
{
|
||
emojiQ = 0;
|
||
emojiA = 0;
|
||
|
||
foreach (var emoji in beforeEmojis3)
|
||
{
|
||
string tag = "";
|
||
if (emoji.isQuestion)
|
||
{
|
||
emojiQ++;
|
||
tag = "emoji9_" + emojiQ;
|
||
}
|
||
else
|
||
{
|
||
emojiA++;
|
||
tag = "emoji10_" + emojiA;
|
||
}
|
||
int[] Ypos = new int[] { 0, -12, -42, -72 };
|
||
KAObject = KAScene.GetObject(tag);
|
||
KAObject.SetPosition(emoji.gapOfX, Ypos[emoji.line], 0, eKVectorType.VECTOR_TYPE_XY);
|
||
//path4_0 의 경로 내부의 icon값을 토대로 정의한다
|
||
KAObject.SetValue(getIconPath(emoji.value, true, false));
|
||
KAObject.SetVisible(1);
|
||
}
|
||
}
|
||
//텍스트 라인 수에 따른 위치 조절
|
||
KAObject = KAScene.GetObject("boxs");
|
||
//시작값 -400
|
||
int keyIndex = 0;
|
||
int 애니메이션Y값 = -400;
|
||
int 박스Y값위치기본 = 620;
|
||
int 박스Y값위치 = 620;
|
||
int 채팅기본Y값 = Convert.ToInt32(textBox10.Text); //80;//75;
|
||
int 답변자케릭터추가값 = Convert.ToInt32(txt답변값.Text);
|
||
int 아이콘위치조절용 = Convert.ToInt32(textBox11.Text); // 35;
|
||
int 채팅1줄값 = Convert.ToInt32(textBox12.Text); // 30;
|
||
int 아이콘Y값 = Convert.ToInt32(textBox13.Text); //130;
|
||
int 사진Y값 = 330;
|
||
int 표출가능 = 500;
|
||
int 표출누적Y값 = 0;
|
||
bool 표출가능값초과여부 = false;
|
||
List<int> 누적표출값500초과 = new List<int>();
|
||
|
||
|
||
for (int i = 1; i < 11; i++)
|
||
{
|
||
KAScene.GetObject("box" + i).SetVisible(0);
|
||
KAScene.GetObject("txtbox" + i).SetVisible(0);
|
||
}
|
||
|
||
void SetBox(string boxName, int Lines, bool areadyShown)
|
||
{
|
||
KAScene.GetObject("txt" + boxName).SetVisible(1);
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
|
||
int 답변체크용 = Convert.ToInt32(boxName.Replace("box", ""));
|
||
|
||
int 더할값 = 채팅기본Y값 + (채팅1줄값 * Lines); ;
|
||
|
||
//답변자아이콘 추가에 따른 값
|
||
if (답변체크용 % 2 == 0)
|
||
{
|
||
if (답변자아이콘존재여부[답변체크용])
|
||
{
|
||
//답변이 있는 경우
|
||
더할값 += 답변자케릭터추가값;
|
||
float 기본Y컨텐츠 = (float)-10.5 - 답변자케릭터추가값;
|
||
KAScene.GetObject("boxContents" + 답변체크용).SetPosition(0, 기본Y컨텐츠, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
else
|
||
{
|
||
//답변이 없는 경우
|
||
float 기본Y컨텐츠 = (float)-10.5;
|
||
KAScene.GetObject("boxContents" + 답변체크용).SetPosition(0, 기본Y컨텐츠, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
}
|
||
|
||
//box 측면에서 보이게 하는 값 설정 - 임시 이미 보이는 상태라면 바로 보이도록 변경해야함
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
|
||
}
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
|
||
|
||
//Console.WriteLine(boxName + " 표출누적Y값 : " + 표출누적Y값);
|
||
|
||
}
|
||
void SetLargeIcon(string boxName, int Lines, List<LargeIcon> icons, bool isQuestion, string imgName, bool areadyShown)
|
||
{
|
||
//아이콘 값이 있는지 확인
|
||
foreach (var largeIcon in icons)
|
||
{
|
||
if (largeIcon.isQuestion == isQuestion)
|
||
{
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
int iconYPos = 0;
|
||
|
||
|
||
int 더할값 = largeIcon.hasContents ? 아이콘Y값 : 아이콘Y값 + 55;
|
||
|
||
if (largeIcon.hasContents)
|
||
{
|
||
iconYPos += -(Lines * 채팅1줄값 + 100);
|
||
}
|
||
else
|
||
{
|
||
iconYPos += -55;
|
||
|
||
//컨텐츠가 없으므로, 박스가 나오는 시간을 정상화 시켜야 한다
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
}
|
||
|
||
string tag = imgName;
|
||
KAObject = KAScene.GetObject(tag);
|
||
|
||
//if (!isQuestion) iconYPos -= 답변자케릭터추가값;
|
||
iconYPos += 아이콘위치조절용;
|
||
KAObject.SetPosition(0, iconYPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetValue(getIconPath(largeIcon.value, false, largeIcon.isCharecter));
|
||
KAObject.SetImageOriginalSize();
|
||
KAObject.SetVisible(1);
|
||
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
if (isQuestion)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)115, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)115, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-38.15, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-38.15, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
//Console.WriteLine(boxName + " icon 표출누적Y값 : " + 표출누적Y값);
|
||
}
|
||
void SetPhotoIcon(string boxName, int Lines, List<PhotoIcon> icons, bool isQuestion, string imgName, bool areadyShown)
|
||
{
|
||
//아이콘 값이 있는지 확인
|
||
foreach (var photoIcon in icons)
|
||
{
|
||
if (photoIcon.isQuestion == isQuestion)
|
||
{
|
||
KAObject = KAScene.GetObject(boxName);
|
||
KAObject.SetVisible(1);
|
||
KAObject.SetPosition(0, 박스Y값위치, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
int iconYPos = 0;
|
||
string photoSize = photoIcon.value.Split(':')[1];
|
||
int 더할값 = photoIcon.hasContents ? 사진Y값 : 사진Y값 + 0;
|
||
|
||
if (photoIcon.hasContents)
|
||
{
|
||
iconYPos += -(Lines * 채팅1줄값 + 100);
|
||
if (photoSize.Equals("세로형"))
|
||
{
|
||
더할값 += 55;
|
||
}
|
||
else if (photoSize.Equals("가로형"))
|
||
{
|
||
더할값 += -95;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
iconYPos += -55;
|
||
더할값 += 80;
|
||
if (photoSize.Equals("세로형"))
|
||
{
|
||
더할값 += 55;
|
||
}
|
||
else if (photoSize.Equals("가로형"))
|
||
{
|
||
더할값 += -95;
|
||
}
|
||
|
||
//컨텐츠가 없으므로, 박스가 나오는 시간을 정상화 시켜야 한다
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)-16.5, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
string tag = imgName;
|
||
KAObject = KAScene.GetObject(tag + "_" + photoSize);
|
||
|
||
//if (!isQuestion) iconYPos -= 답변자케릭터추가값;
|
||
iconYPos += 아이콘위치조절용;
|
||
|
||
//이미지이기 떄문에 변경
|
||
iconYPos += 65;
|
||
|
||
|
||
KAObject.SetPosition(0, iconYPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetValue(getPhotoIconPath(photoIcon.value));
|
||
KAObject.SetVisible(1);
|
||
|
||
if (areadyShown || 표출누적Y값 > 표출가능)
|
||
{
|
||
if (isQuestion)
|
||
{
|
||
KAObject.SetPositionKey(0, (float)17.42, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)17.42, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetPositionKey(0, (float)59.27, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
KAObject.SetPositionKey(1, (float)59.27, 0, 0, eKVectorType.VECTOR_TYPE_X);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 1, 키프레임값[현재키프레임] + 1, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_X, 0, 키프레임값[현재키프레임], eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
if (표출가능값초과여부 || (표출누적Y값 < 표출가능 && 표출누적Y값 + 더할값 < 표출가능))
|
||
{
|
||
현재키프레임++;
|
||
현재키프레임++;
|
||
}
|
||
}
|
||
|
||
|
||
표출누적Y값 += 더할값;
|
||
|
||
if (표출누적Y값 > 표출가능)
|
||
{
|
||
if (!areadyShown) 누적표출값500초과.Add(표출누적Y값);
|
||
표출가능값초과여부 = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
//Console.WriteLine(boxName + "Photo icon 표출누적Y값 : " + 표출누적Y값);
|
||
}
|
||
int 마지막값 = -400;
|
||
|
||
if (hasBeforeScene4)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치9 : " + 박스Y값위치);
|
||
if (beforeQLines4 > 0) SetBox("box9", beforeQLines4, true);
|
||
SetLargeIcon("box9", beforeQLines4, beforeLargeIcons4, true, "img9", true);
|
||
SetPhotoIcon("box9", beforeQLines4, beforePhotoIcons4, true, "img9", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치10 : " + 박스Y값위치);
|
||
if (beforeALines4 > 0) SetBox("box10", beforeALines4, true);
|
||
SetLargeIcon("box10", beforeALines4, beforeLargeIcons4, false, "img10", true);
|
||
SetPhotoIcon("box10", beforeALines4, beforePhotoIcons4, false, "img10", true);
|
||
}
|
||
if (hasBeforeScene3)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치7 : " + 박스Y값위치);
|
||
if (beforeQLines3 > 0) SetBox("box7", beforeQLines3, true);
|
||
SetLargeIcon("box7", beforeQLines3, beforeLargeIcons3, true, "img7", true);
|
||
SetPhotoIcon("box7", beforeQLines3, beforePhotoIcons3, true, "img7", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치8 : " + 박스Y값위치);
|
||
if (beforeALines3 > 0) SetBox("box8", beforeALines3, true);
|
||
SetLargeIcon("box8", beforeALines3, beforeLargeIcons3, false, "img8", true);
|
||
SetPhotoIcon("box8", beforeALines3, beforePhotoIcons3, false, "img8", true);
|
||
}
|
||
if (hasBeforeScene2)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치5 : " + 박스Y값위치);
|
||
if (beforeQLines2 > 0) SetBox("box5", beforeQLines2, true);
|
||
SetLargeIcon("box5", beforeQLines2, beforeLargeIcons2, true, "img5", true);
|
||
SetPhotoIcon("box5", beforeQLines2, beforePhotoIcons2, true, "img5", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치6 : " + 박스Y값위치);
|
||
if (beforeALines2 > 0) SetBox("box6", beforeALines2, true);
|
||
SetLargeIcon("box6", beforeALines2, beforeLargeIcons2, false, "img6", true);
|
||
SetPhotoIcon("box6", beforeALines2, beforePhotoIcons2, false, "img6", true);
|
||
}
|
||
if (hasBeforeScene)
|
||
{
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치3 : " + 박스Y값위치);
|
||
if (beforeQLines > 0) SetBox("box3", beforeQLines, true);
|
||
SetLargeIcon("box3", beforeQLines, beforeLargeIcons, true, "img3", true);
|
||
SetPhotoIcon("box3", beforeQLines, beforePhotoIcons, true, "img3", true);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치4 : " + 박스Y값위치);
|
||
if (beforeALines > 0) SetBox("box4", beforeALines, true);
|
||
SetLargeIcon("box4", beforeALines, beforeLargeIcons, false, "img4", true);
|
||
SetPhotoIcon("box4", beforeALines, beforePhotoIcons, false, "img4", true);
|
||
}
|
||
|
||
if (표출누적Y값 > 500) 마지막값 = 마지막값 = -400 + 표출누적Y값 - 500;
|
||
|
||
//Console.WriteLine("송출전마지막값1 : " + 마지막값);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치1 : " + 박스Y값위치);
|
||
if (QLines > 0) SetBox("box1", QLines, false);
|
||
SetLargeIcon("box1", QLines, largeIcons, true, "img1", false);
|
||
SetPhotoIcon("box1", QLines, photoIcons, true, "img1", false);
|
||
|
||
박스Y값위치 = 박스Y값위치기본 - 표출누적Y값;
|
||
//Console.WriteLine("박스Y값위치2 : " + 박스Y값위치);
|
||
if (ALines > 0) SetBox("box2", ALines, false);
|
||
SetLargeIcon("box2", ALines, largeIcons, false, "img2", false);
|
||
SetPhotoIcon("box2", ALines, photoIcons, false, "img2", false);
|
||
|
||
|
||
//현재 값 계산 - 끝
|
||
|
||
|
||
//Y값 애니메이션 위치 조절
|
||
KAObject = KAScene.GetObject("boxs");
|
||
|
||
for (int i = 0; i <= 현재키프레임; i++)
|
||
{
|
||
KAObject.SetPositionKey(i, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
현재키프레임++;
|
||
|
||
|
||
foreach (var v in 누적표출값500초과)
|
||
{
|
||
마지막값 = -400 + v - 표출가능;
|
||
KAObject.SetPositionKey(현재키프레임, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
현재키프레임++;
|
||
KAObject.SetPositionKey(현재키프레임, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
현재키프레임++;
|
||
|
||
//Console.WriteLine("송출전마지막값 누적표출초과 계산 후 : " + 마지막값);
|
||
}
|
||
|
||
timeOfBefore = 키프레임값[현재키프레임];
|
||
for (int i = 현재키프레임; i < 11; i++)
|
||
{
|
||
KAObject.SetPositionKey(i, 0, 마지막값, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
//Console.WriteLine("마지막값 : " + 마지막값);
|
||
//현재 텍스트 저장
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText4[i] = aliveLiveChatText3[i];
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText3[i] = aliveLiveChatText2[i];
|
||
for (int i = 0; i < 9; i++) aliveLiveChatText2[i] = aliveLiveChatText[i];
|
||
for (int i = 0; i < 8; i++) aliveLiveChatText[i] = strs[i];
|
||
aliveLiveChatText[8] = strs[13];
|
||
}
|
||
else if (dispLines == 5)
|
||
{
|
||
int 질문자시작순서 = 6;
|
||
int 질문자라인수 = 0;
|
||
for (int i = 1; i < 4; i++) if (!strs[i].Equals("")) 질문자라인수++;
|
||
int 답변자시작순서 = 6 + 질문자라인수;
|
||
int 답변자라인수 = 0;
|
||
for (int i = 5; i < 8; i++) if (!strs[i].Equals("")) 답변자라인수++;
|
||
int 송출라인수 = 질문자라인수 + 답변자라인수;
|
||
|
||
|
||
if (질문자라인수 > 0) beforeNewGroups.Add(new NewGroup(true, strs[0], strs[1], strs[2], strs[3], "", 질문자시작순서));
|
||
if (답변자라인수 > 0) beforeNewGroups.Add(new NewGroup(false, strs[4], strs[5], strs[6], strs[7], strs[13], 답변자시작순서));
|
||
|
||
#region Tornado2 값 변경 파트
|
||
for (int i = 1; i < 7; i++)
|
||
{
|
||
KAScene.GetObject("gq" + i).SetVisible(0);
|
||
KAScene.GetObject("ga" + i).SetVisible(0);
|
||
KAScene.GetObject("gb" + i).SetVisible(0);
|
||
}
|
||
|
||
int 질문자순서 = 1;
|
||
int 답변자순서 = 1;
|
||
int 답변자이미지순서 = 1;
|
||
float 질문자기본위치 = 370;
|
||
float 답변자기본위치 = 374;
|
||
|
||
foreach (var b in beforeNewGroups)
|
||
{
|
||
string directory = Path.GetDirectoryName(path4_4);
|
||
string path = directory + @"\character\" + b.profilePath + "_50.png";
|
||
bool itHasImage = File.Exists(path);
|
||
|
||
|
||
int index = 질문자순서;
|
||
if (!b.isQuestion) index = itHasImage ? 답변자이미지순서 : 답변자순서;
|
||
string tag = "gq";
|
||
if (!b.isQuestion) tag = itHasImage ? "ga" : "gb";
|
||
tag = tag + index;
|
||
//Profile
|
||
if (!b.isQuestion && itHasImage) KAScene.GetObject(tag + "p").SetValue(path);
|
||
|
||
//Visible
|
||
KAScene.GetObject(tag).SetVisible(1);
|
||
KAScene.GetObject(tag + "l2").SetVisible(b.line2.Equals("") ? 0 : 1);
|
||
KAScene.GetObject(tag + "l3").SetVisible(b.line3.Equals("") ? 0 : 1);
|
||
|
||
//FrameSetting
|
||
for (int i = 0; i < 12; i++)
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
|
||
for (int i = 11; i > -1; i--)
|
||
{
|
||
int time = 0;
|
||
for (int j = 1; j <= i; j++) time += j % 2 == 0 ? timeOfWait : timeOfChange;
|
||
KAScene.GetObject(tag).SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, time, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
}
|
||
|
||
//Position
|
||
float posY = b.isQuestion ? 질문자기본위치 : 답변자기본위치;
|
||
posY -= (51 * b.yPos);
|
||
float lastPos = 0;
|
||
for (int i = 0; i < 12; i++)
|
||
{
|
||
if ((i + 1) / 2 <= 송출라인수) lastPos = posY + (((i + 1) / 2) * 51);
|
||
KAScene.GetObject(tag).SetPositionKey(i, 0, lastPos, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
}
|
||
|
||
|
||
//TextValue
|
||
KAScene.GetObject(tag + "w").SetValue(b.id);
|
||
KAScene.GetObject(tag + "l1t1").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t2").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l1t3").SetValue(b.line1);
|
||
KAScene.GetObject(tag + "l2t").SetValue(b.line2);
|
||
KAScene.GetObject(tag + "l3t").SetValue(b.line3);
|
||
|
||
KAScene.GetObject(tag + "l1t2").SetVisible(0);
|
||
KAScene.GetObject(tag + "l1t3").SetVisible(0);
|
||
//Color
|
||
KAScene.GetObject(tag + "w").SetStyleColor(getColor(b.isQuestion ? lbl_color_1 : lbl_color_3));
|
||
for (int i = 1; i < 4; i++)
|
||
{
|
||
if (i == 1)
|
||
KAScene.GetObject(tag + "l" + i + "t1").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
else
|
||
KAScene.GetObject(tag + "l" + i + "t").SetStyleColor(getColor(b.isQuestion ? lbl_color_2 : lbl_color_4));
|
||
|
||
KAScene.GetObject(tag + "l" + i).SetStyleColor(getColor(b.isQuestion ? lbl_color_5 : lbl_color_6));
|
||
}
|
||
|
||
|
||
|
||
if (b.isQuestion) 질문자순서++;
|
||
else
|
||
{
|
||
if (itHasImage) 답변자이미지순서++;
|
||
else 답변자순서++;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
//송출라인만큼 올려서 화면에 표출할 필요가 없으면 제거한다
|
||
foreach (var v in beforeNewGroups) v.setYPos(송출라인수);
|
||
|
||
beforeNewGroups = beforeNewGroups.FindAll(x => x.yPos > -2);
|
||
|
||
timeOfBefore = 송출라인수 * (timeOfWait + timeOfChange);
|
||
}
|
||
|
||
|
||
KAScene.SetChangeOut(eKChangeOutType.CHANGE_OUT_TYPE_CHANGE_OUT);
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer4, KAScene);
|
||
|
||
//Play
|
||
KAScenePlayer.Play(Layer4);
|
||
|
||
//시간 재계산 버그 해결을 위한 추가
|
||
timer2.Stop();
|
||
timer2.Interval = (timeOfBefore + timeOfClear) * 34;
|
||
timer2.Start();
|
||
}
|
||
|
||
//자동 컷 아웃을 위한 타이머
|
||
private void timer3_Tick(object sender, EventArgs e)
|
||
{
|
||
if (!isDisplay4)
|
||
{
|
||
if (timer3.Enabled)
|
||
timer3.Stop();
|
||
return;
|
||
}
|
||
|
||
sendURL(getURL() + channel + "/자막상황/입력?채팅=N");
|
||
}
|
||
|
||
private void pic_logo_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
return;
|
||
string path = @"E:\김의연\신세계TV쇼핑\디자인\라이브톡\하단톡.t2s";
|
||
KAScene = KAEngine.LoadScene(path, "채팅" + orderDisp4Index);
|
||
|
||
KAObject KAObject;
|
||
|
||
/*
|
||
KAObject = KAScene.GetObject("name1");
|
||
KAObject.SetKeyFrame(eKObjectAttribute.ATTR_POSITION_Y, i, i, eKKeyFrameType.KEY_FRAME_TYPE_ABSOLUTE);
|
||
KAObject.SetPositionKey(0, 0, -70f, 0, eKVectorType.VECTOR_TYPE_Y);
|
||
KAObject.SetStyleColor(getColor(lbl_color_1));
|
||
KAObject.SetValue(strs[0]);
|
||
*/
|
||
KAScene.SetChangeOut(eKChangeOutType.CHANGE_OUT_TYPE_CHANGE_OUT);
|
||
|
||
//Prepare
|
||
KAScenePlayer.Prepare(Layer4, KAScene);
|
||
|
||
KAScenePlayer.Play(Layer4);
|
||
|
||
|
||
}
|
||
|
||
public Bitmap cropAtRect(Bitmap orgImg, Rectangle sRect)
|
||
{
|
||
Rectangle destRect = new Rectangle(Point.Empty, sRect.Size);
|
||
|
||
var cropImage = new Bitmap(destRect.Width, destRect.Height);
|
||
using (var graphics = Graphics.FromImage(cropImage))
|
||
{
|
||
graphics.DrawImage(orgImg, destRect, sRect, GraphicsUnit.Pixel);
|
||
}
|
||
return cropImage;
|
||
}
|
||
|
||
//모든 배열을 검사해서 True, False 로 반환한다.
|
||
bool isNullArray(string[] bufArray)
|
||
{
|
||
bool returnValue = true;
|
||
|
||
foreach (var v in bufArray) if (!v.Equals("")) returnValue = false;
|
||
|
||
return returnValue;
|
||
}
|
||
|
||
private void lbl_color_Click(object sender, EventArgs e)
|
||
{
|
||
Label label = (Label)sender;
|
||
|
||
|
||
colorDialog1.Color = label.BackColor;
|
||
|
||
colorDialog1.FullOpen = true;
|
||
|
||
if (colorDialog1.ShowDialog() == DialogResult.OK)
|
||
{
|
||
Color color = colorDialog1.Color;
|
||
label.BackColor = color;
|
||
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue("Color" + label.Name.Last() + "R", color.R);
|
||
key.SetValue("Color" + label.Name.Last() + "G", color.G);
|
||
key.SetValue("Color" + label.Name.Last() + "B", color.B);
|
||
key.Close();
|
||
}
|
||
}
|
||
|
||
|
||
|
||
struct Emoji
|
||
{
|
||
public Emoji(bool _isQ, int _line, int _gapOfX, string _v)
|
||
{
|
||
isQuestion = _isQ;
|
||
line = _line;
|
||
gapOfX = _gapOfX;
|
||
value = _v;
|
||
}
|
||
|
||
public bool isQuestion;
|
||
public int line;
|
||
public int gapOfX;
|
||
public string value;
|
||
}
|
||
|
||
struct LargeIcon
|
||
{
|
||
public LargeIcon(bool _isQuestion, bool _hasContents, bool _isCharecter ,string _value)
|
||
{
|
||
isQuestion = _isQuestion;
|
||
hasContents = _hasContents;
|
||
isCharecter = _isCharecter;
|
||
value = _value;
|
||
}
|
||
|
||
public bool isQuestion;
|
||
public bool hasContents;
|
||
public bool isCharecter;
|
||
public string value;
|
||
}
|
||
|
||
struct PhotoIcon
|
||
{
|
||
public PhotoIcon(bool _isQuestion, bool _hasContents, bool _isCharecter, string _value)
|
||
{
|
||
isQuestion = _isQuestion;
|
||
hasContents = _hasContents;
|
||
isCharecter = _isCharecter;
|
||
value = _value;
|
||
}
|
||
|
||
public bool isQuestion;
|
||
public bool hasContents;
|
||
public bool isCharecter;
|
||
public string value;
|
||
}
|
||
|
||
|
||
private void txt답변값_TextChanged(object sender, EventArgs e)
|
||
{
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue("답변높이", txt답변값.Text);
|
||
}
|
||
|
||
int OldFileChecker = 0;
|
||
|
||
private string getPhotoIconPath(string value)
|
||
{
|
||
string[] strs = value.Split(':');
|
||
string pos = strs[0];
|
||
string size = strs[1];
|
||
string fileName = strs[2];
|
||
string savePath = Environment.CurrentDirectory + @"\image\";
|
||
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
|
||
try
|
||
{
|
||
//이미지 다운로드
|
||
DownloadRemoteImageFile(getURL() + "파일다운로드/", savePath, fileName);
|
||
}
|
||
catch (Exception ex) { }
|
||
//이미지 크롭
|
||
ImageCrop(savePath, fileName, pos, size);
|
||
|
||
OldFileChecker++;
|
||
|
||
if (OldFileChecker > 100)
|
||
{
|
||
DirectoryInfo directory = new DirectoryInfo(savePath);
|
||
DateTime now = DateTime.Now;
|
||
foreach (FileInfo file in directory.GetFiles())
|
||
{
|
||
TimeSpan timeDiff = now - file.LastWriteTime;
|
||
|
||
if (timeDiff.TotalHours > 170) file.Delete();
|
||
}
|
||
|
||
OldFileChecker = 0;
|
||
}
|
||
|
||
return savePath + pos + size + fileName;
|
||
}
|
||
|
||
private void ImageCrop(string path, string fileName, string pos, string size)
|
||
{
|
||
if (fileName.ToUpper().Contains(".VRV"))
|
||
{
|
||
if (!File.Exists(path + pos + size + fileName)) File.Move(path + "원본" + fileName, path + pos + size + fileName);
|
||
|
||
return;
|
||
}
|
||
|
||
Bitmap sourceImage = new Bitmap(path + "원본" + fileName);
|
||
int x = sourceImage.Width;
|
||
int y = sourceImage.Height;
|
||
int width = 315;
|
||
int height = 0;
|
||
int type2 = 0;
|
||
|
||
//세로 정사각 가로 설정
|
||
if (size.Contains("세로")) height = 370;
|
||
else if (size.Contains("가로")) height = 220;
|
||
else height = 315;
|
||
//상중하 설정
|
||
if (pos.Contains("상")) type2 = 0;
|
||
else if (pos.Contains("중")) type2 = 1;
|
||
else type2 = 2;
|
||
|
||
|
||
int reWidth; int reHeight;
|
||
int startX = 0; int startY = 0;
|
||
if ((double)x / width > (double)y / height) //y축이 가득참
|
||
{
|
||
//세로를 315로 변경
|
||
reHeight = height;
|
||
reWidth = height * x / y;
|
||
|
||
if (type2 == 0) startX = 0;
|
||
else if (type2 == 1) startX = (reWidth - width) / 2;
|
||
else if (type2 == 2) startX = reWidth - width;
|
||
}
|
||
else //x축이 가득참
|
||
{
|
||
reWidth = width;
|
||
reHeight = width * y / x;
|
||
|
||
if (type2 == 0) startY = 0;
|
||
else if (type2 == 1) startY = (reHeight - height) / 2;
|
||
else if (type2 == 2) startY = reHeight - height;
|
||
}
|
||
|
||
Size resize = new Size(reWidth, reHeight);
|
||
Size saveSize = new Size(width, height);
|
||
Bitmap resizeImage = new Bitmap(sourceImage, resize);
|
||
|
||
Rectangle rect = new Rectangle(startX, startY, width, height);
|
||
Bitmap cropBitmap = cropAtRect(resizeImage, rect);
|
||
cropBitmap.Save(path + pos + size + fileName);
|
||
}
|
||
|
||
private void DownloadRemoteImageFile(string uri, string savePath, string fileName)
|
||
{
|
||
using (WebClient client = new WebClient())
|
||
{
|
||
client.DownloadFile(new Uri(uri + fileName), savePath + "원본" + fileName);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
private void btnSaveOptions_Click(object sender, EventArgs e)
|
||
{
|
||
saveFileDialog1.Filter = "Json file (*.json) | *.json";
|
||
//saveFileDialog1.RestoreDirectory = true;
|
||
|
||
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
|
||
{
|
||
JObject json = new JObject();
|
||
|
||
json.Add("path1", path1);
|
||
json.Add("path2", path2);
|
||
json.Add("path3_1", path3_1);
|
||
json.Add("path3_2", path3_2);
|
||
json.Add("path3_3", path3_3);
|
||
json.Add("path3_4", path3_4);
|
||
json.Add("path3_5", path3_5);
|
||
json.Add("path3_6", path3_6);
|
||
json.Add("path3_7", path3_7);
|
||
json.Add("path3_8", path3_8);
|
||
json.Add("path3_9", path3_9);
|
||
json.Add("path3_10", path3_10);
|
||
|
||
json.Add("path3_11", path3_11);
|
||
json.Add("path3_12", path3_12);
|
||
json.Add("path3_13", path3_13);
|
||
json.Add("path3_14", path3_14);
|
||
json.Add("path3_15", path3_15);
|
||
json.Add("path3_16", path3_16);
|
||
json.Add("path3_17", path3_17);
|
||
json.Add("path3_18", path3_18);
|
||
json.Add("path3_19", path3_19);
|
||
json.Add("path3_20", path3_20);
|
||
|
||
json.Add("path4", path4);
|
||
json.Add("path4_0", path4_0);
|
||
json.Add("path4_1", path4_1);
|
||
json.Add("path4_2", path4_2);
|
||
json.Add("path4_3", path4_3);
|
||
json.Add("path4_4", path4_4);
|
||
json.Add("path4_5", path4_5);
|
||
json.Add("path5", path5);
|
||
json.Add("path6", path6);
|
||
json.Add("path7", path7);
|
||
json.Add("path8", path8);
|
||
json.Add("path9", path9);
|
||
|
||
json.Add("layer1", Layer1);
|
||
json.Add("layer2", Layer2);
|
||
json.Add("layer3", Layer3);
|
||
json.Add("layer4", Layer4);
|
||
json.Add("layer5", Layer5);
|
||
json.Add("layer6", Layer6);
|
||
json.Add("layer7", Layer7);
|
||
json.Add("layer8", Layer8);
|
||
json.Add("layer9", Layer9);
|
||
json.Add("layer10", Layer10);
|
||
json.Add("layer11", Layer11);
|
||
json.Add("layer12", Layer12);
|
||
json.Add("layer13", Layer13);
|
||
json.Add("layer14", Layer14);
|
||
json.Add("layer15", Layer15);
|
||
|
||
json.Add("fadeOutTime", fadeOutTime);
|
||
json.Add("DisplayTerm", cmbDisplayTerm.SelectedIndex);
|
||
json.Add("channel", toggleChannel.IsOn);
|
||
json.Add("dbIP", dbIP);
|
||
|
||
json.Add("Color1", lbl_color_1.BackColor.ToArgb());
|
||
json.Add("Color2", lbl_color_2.BackColor.ToArgb());
|
||
json.Add("Color3", lbl_color_3.BackColor.ToArgb());
|
||
json.Add("Color4", lbl_color_4.BackColor.ToArgb());
|
||
json.Add("Color5", lbl_color_5.BackColor.ToArgb());
|
||
json.Add("Color6", lbl_color_6.BackColor.ToArgb());
|
||
|
||
File.WriteAllText(saveFileDialog1.FileName, json.ToString());
|
||
|
||
MessageBox.Show("저장완료");
|
||
}
|
||
|
||
}
|
||
|
||
private void btnLoadOptions_Click(object sender, EventArgs e)
|
||
{
|
||
openFileDialog1.Filter = "Json file (*.json) | *.json";
|
||
openFileDialog1.Multiselect = false;
|
||
|
||
//openFileDialog1.RestoreDirectory = true;
|
||
|
||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||
{
|
||
|
||
using (StreamReader file = new StreamReader(openFileDialog1.FileName))
|
||
{
|
||
using (JsonTextReader reader = new JsonTextReader(file))
|
||
{
|
||
JObject json = (JObject)JToken.ReadFrom(reader);
|
||
|
||
if (json["path1"] != null) path1 = json["path1"].ToString();
|
||
if (json["path2"] != null) path2 = json["path2"].ToString();
|
||
if (json["path3_1"] != null) path3_1 = json["path3_1"].ToString();
|
||
if (json["path3_2"] != null) path3_2 = json["path3_2"].ToString();
|
||
if (json["path3_3"] != null) path3_3 = json["path3_3"].ToString();
|
||
if (json["path3_4"] != null) path3_4 = json["path3_4"].ToString();
|
||
if (json["path3_5"] != null) path3_5 = json["path3_5"].ToString();
|
||
if (json["path3_6"] != null) path3_6 = json["path3_6"].ToString();
|
||
if (json["path3_7"] != null) path3_7 = json["path3_7"].ToString();
|
||
if (json["path3_8"] != null) path3_8 = json["path3_8"].ToString();
|
||
if (json["path3_9"] != null) path3_9 = json["path3_9"].ToString();
|
||
if (json["path3_10"] != null) path3_10 = json["path3_10"].ToString();
|
||
if (json["path3_11"] != null) path3_11 = json["path3_11"].ToString();
|
||
if (json["path3_12"] != null) path3_12 = json["path3_12"].ToString();
|
||
if (json["path3_13"] != null) path3_13 = json["path3_13"].ToString();
|
||
if (json["path3_14"] != null) path3_14 = json["path3_14"].ToString();
|
||
if (json["path3_15"] != null) path3_15 = json["path3_15"].ToString();
|
||
if (json["path3_16"] != null) path3_16 = json["path3_16"].ToString();
|
||
if (json["path3_17"] != null) path3_17 = json["path3_17"].ToString();
|
||
if (json["path3_18"] != null) path3_18 = json["path3_18"].ToString();
|
||
if (json["path3_19"] != null) path3_19 = json["path3_19"].ToString();
|
||
if (json["path3_20"] != null) path3_20 = json["path3_20"].ToString();
|
||
|
||
if (json["path4"] != null) path4 = json["path4"].ToString();
|
||
if (json["path4_0"] != null) path4_0 = json["path4_0"].ToString();
|
||
if (json["path4_1"] != null) path4_1 = json["path4_1"].ToString();
|
||
if (json["path4_2"] != null) path4_2 = json["path4_2"].ToString();
|
||
if (json["path4_3"] != null) path4_3 = json["path4_3"].ToString();
|
||
if (json["path4_4"] != null) path4_4 = json["path4_4"].ToString();
|
||
if (json["path4_5"] != null) path4_5 = json["path4_5"].ToString();
|
||
if (json["path5"] != null) path5 = json["path5"].ToString();
|
||
if (json["path6"] != null) path6 = json["path6"].ToString();
|
||
if (json["path7"] != null) path7 = json["path7"].ToString();
|
||
if (json["path8"] != null) path8 = json["path8"].ToString();
|
||
if (json["path9"] != null) path9 = json["path9"].ToString();
|
||
|
||
if (json["layer1"] != null) Layer1 = Convert.ToInt32(json["layer1"]);
|
||
if (json["layer2"] != null) Layer2 = Convert.ToInt32(json["layer2"]);
|
||
if (json["layer3"] != null) Layer3 = Convert.ToInt32(json["layer3"]);
|
||
if (json["layer4"] != null) Layer4 = Convert.ToInt32(json["layer4"]);
|
||
if (json["layer5"] != null) Layer5 = Convert.ToInt32(json["layer5"]);
|
||
if (json["layer6"] != null) Layer6 = Convert.ToInt32(json["layer6"]);
|
||
if (json["layer7"] != null) Layer7 = Convert.ToInt32(json["layer7"]);
|
||
if (json["layer8"] != null) Layer8 = Convert.ToInt32(json["layer8"]);
|
||
if (json["layer9"] != null) Layer9 = Convert.ToInt32(json["layer9"]);
|
||
if (json["layer10"] != null) Layer10 = Convert.ToInt32(json["layer10"]);
|
||
if (json["layer11"] != null) Layer11 = Convert.ToInt32(json["layer11"]);
|
||
if (json["layer12"] != null) Layer12 = Convert.ToInt32(json["layer12"]);
|
||
if (json["layer13"] != null) Layer13 = Convert.ToInt32(json["layer13"]);
|
||
if (json["layer14"] != null) Layer14 = Convert.ToInt32(json["layer14"]);
|
||
if (json["layer15"] != null) Layer15 = Convert.ToInt32(json["layer15"]);
|
||
|
||
if (json["fadeOutTime"] != null) fadeOutTime = Convert.ToInt32(json["fadeOutTime"]);
|
||
if (json["DisplayTerm"] != null) cmbDisplayTerm.SelectedIndex = Convert.ToInt32(json["DisplayTerm"]);
|
||
if (json["channel"] != null) toggleChannel.IsOn = Convert.ToBoolean(json["channel"]);
|
||
if (json["dbIP"] != null) dbIP = json["dbIP"].ToString();
|
||
|
||
if (json["Color1"] != null) lbl_color_1.BackColor = Color.FromArgb(Convert.ToInt32(json["Color1"]));
|
||
if (json["Color2"] != null) lbl_color_2.BackColor = Color.FromArgb(Convert.ToInt32(json["Color2"]));
|
||
if (json["Color3"] != null) lbl_color_3.BackColor = Color.FromArgb(Convert.ToInt32(json["Color3"]));
|
||
if (json["Color4"] != null) lbl_color_4.BackColor = Color.FromArgb(Convert.ToInt32(json["Color4"]));
|
||
if (json["Color5"] != null) lbl_color_5.BackColor = Color.FromArgb(Convert.ToInt32(json["Color5"]));
|
||
if (json["Color6"] != null) lbl_color_6.BackColor = Color.FromArgb(Convert.ToInt32(json["Color6"]));
|
||
|
||
/*
|
||
path1 = json["path1"].ToString();
|
||
path2 = json["path2"].ToString();
|
||
path3_1 = json["path3_1"].ToString();
|
||
path3_2 = json["path3_2"].ToString();
|
||
path3_3 = json["path3_3"].ToString();
|
||
path3_4 = json["path3_4"].ToString();
|
||
path3_5 = json["path3_5"].ToString();
|
||
path3_6 = json["path3_6"].ToString();
|
||
path3_7 = json["path3_7"].ToString();
|
||
path3_8 = json["path3_8"].ToString();
|
||
path3_9 = json["path3_9"].ToString();
|
||
path3_10 = json["path3_10"].ToString();
|
||
path3_11 = json["path3_11"].ToString();
|
||
path3_12 = json["path3_12"].ToString();
|
||
path3_13 = json["path3_13"].ToString();
|
||
path3_14 = json["path3_14"].ToString();
|
||
path3_15 = json["path3_15"].ToString();
|
||
path3_16 = json["path3_16"].ToString();
|
||
path3_17 = json["path3_17"].ToString();
|
||
path3_18 = json["path3_18"].ToString();
|
||
path3_19 = json["path3_19"].ToString();
|
||
if (json["path3_20"] != null) path3_20 = json["path3_20"].ToString();
|
||
|
||
path4 = json["path4"].ToString();
|
||
path4_0 = json["path4_0"].ToString();
|
||
path4_1 = json["path4_1"].ToString();
|
||
path4_2 = json["path4_2"].ToString();
|
||
path4_3 = json["path4_3"].ToString();
|
||
path4_4 = json["path4_4"].ToString();
|
||
path4_5 = json["path4_5"].ToString();
|
||
path5 = json["path5"].ToString();
|
||
path6 = json["path6"].ToString();
|
||
path7 = json["path7"].ToString();
|
||
path8 = json["path8"].ToString();
|
||
path9 = json["path9"].ToString();
|
||
|
||
Layer1 = Convert.ToInt32(json["layer1"]);
|
||
Layer2 = Convert.ToInt32(json["layer2"]);
|
||
Layer3 = Convert.ToInt32(json["layer3"]);
|
||
Layer4 = Convert.ToInt32(json["layer4"]);
|
||
Layer5 = Convert.ToInt32(json["layer5"]);
|
||
Layer6 = Convert.ToInt32(json["layer6"]);
|
||
Layer7 = Convert.ToInt32(json["layer7"]);
|
||
Layer8 = Convert.ToInt32(json["layer8"]);
|
||
Layer9 = Convert.ToInt32(json["layer9"]);
|
||
Layer10 = Convert.ToInt32(json["layer10"]);
|
||
Layer11 = Convert.ToInt32(json["layer11"]);
|
||
Layer12 = Convert.ToInt32(json["layer12"]);
|
||
Layer13 = Convert.ToInt32(json["layer13"]);
|
||
|
||
fadeOutTime = Convert.ToInt32(json["fadeOutTime"]);
|
||
cmbDisplayTerm.SelectedIndex = Convert.ToInt32(json["DisplayTerm"]);
|
||
toggleChannel.IsOn = Convert.ToBoolean(json["channel"]);
|
||
dbIP = json["dbIP"].ToString();
|
||
|
||
lbl_color_1.BackColor = Color.FromArgb( Convert.ToInt32(json["Color1"]));
|
||
lbl_color_2.BackColor = Color.FromArgb(Convert.ToInt32(json["Color2"]));
|
||
lbl_color_3.BackColor = Color.FromArgb(Convert.ToInt32(json["Color3"]));
|
||
lbl_color_4.BackColor = Color.FromArgb(Convert.ToInt32(json["Color4"]));
|
||
lbl_color_5.BackColor = Color.FromArgb(Convert.ToInt32(json["Color5"]));
|
||
lbl_color_6.BackColor = Color.FromArgb(Convert.ToInt32(json["Color6"]));
|
||
*/
|
||
|
||
//해당 Control 값들 변경
|
||
txtDisplay1Path.Text = path1;
|
||
txtDisplay2Path.Text = path2;
|
||
|
||
if (cmbPushType.SelectedIndex == 0)
|
||
txtDisplay3Path.Text = path3_1;
|
||
else if (cmbPushType.SelectedIndex == 1)
|
||
txtDisplay3Path.Text = path3_2;
|
||
else if (cmbPushType.SelectedIndex == 2)
|
||
txtDisplay3Path.Text = path3_3;
|
||
else if (cmbPushType.SelectedIndex == 3)
|
||
txtDisplay3Path.Text = path3_4;
|
||
else if (cmbPushType.SelectedIndex == 4)
|
||
txtDisplay3Path.Text = path3_5;
|
||
else if (cmbPushType.SelectedIndex == 5)
|
||
txtDisplay3Path.Text = path3_6;
|
||
else if (cmbPushType.SelectedIndex == 6)
|
||
txtDisplay3Path.Text = path3_7;
|
||
else if (cmbPushType.SelectedIndex == 7)
|
||
txtDisplay3Path.Text = path3_8;
|
||
else if (cmbPushType.SelectedIndex == 8)
|
||
txtDisplay3Path.Text = path3_9;
|
||
else if (cmbPushType.SelectedIndex == 9)
|
||
txtDisplay3Path.Text = path3_10;
|
||
|
||
else if (cmbPushType.SelectedIndex == 10)
|
||
txtDisplay3Path.Text = path3_11;
|
||
else if (cmbPushType.SelectedIndex == 11)
|
||
txtDisplay3Path.Text = path3_12;
|
||
else if (cmbPushType.SelectedIndex == 12)
|
||
txtDisplay3Path.Text = path3_13;
|
||
else if (cmbPushType.SelectedIndex == 13)
|
||
txtDisplay3Path.Text = path3_14;
|
||
else if (cmbPushType.SelectedIndex == 14)
|
||
txtDisplay3Path.Text = path3_15;
|
||
else if (cmbPushType.SelectedIndex == 15)
|
||
txtDisplay3Path.Text = path3_16;
|
||
else if (cmbPushType.SelectedIndex == 16)
|
||
txtDisplay3Path.Text = path3_17;
|
||
else if (cmbPushType.SelectedIndex == 17)
|
||
txtDisplay3Path.Text = path3_18;
|
||
else if (cmbPushType.SelectedIndex == 18)
|
||
txtDisplay3Path.Text = path3_19;
|
||
else if (cmbPushType.SelectedIndex == 19)
|
||
txtDisplay3Path.Text = path3_20;
|
||
|
||
txtDisplay4Path.Text = path4;
|
||
txtDisplay4_0Path.Text = path4_0;
|
||
txtDisplay4_1Path.Text = path4_1;
|
||
txtDisplay4_2Path.Text = path4_2;
|
||
txtDisplay4_3Path.Text = path4_3;
|
||
txtDisplay4_4Path.Text = path4_4;
|
||
txtDisplay4_5Path.Text = path4_5;
|
||
txtDisplay5Path.Text = path5;
|
||
txtDisplay6Path.Text = path6;
|
||
txtDisplay7Path.Text = path7;
|
||
txtDisplay8Path.Text = path8;
|
||
txtDisplay9Path.Text = path9;
|
||
|
||
txtDisplay1Layer.Text = Layer1.ToString();
|
||
txtDisplay2Layer.Text = Layer2.ToString();
|
||
txtDisplay3Layer.Text = Layer3.ToString();
|
||
txtDisplay4Layer.Text = Layer4.ToString();
|
||
txtDisplay5Layer.Text = Layer5.ToString();
|
||
txtDisplay6Layer.Text = Layer6.ToString();
|
||
txtDisplay7Layer.Text = Layer7.ToString();
|
||
txtDisplay8Layer.Text = Layer8.ToString();
|
||
txtDisplay9Layer.Text = Layer9.ToString();
|
||
txtDisplay10Layer.Text = Layer10.ToString();
|
||
txtDisplay11Layer.Text = Layer11.ToString();
|
||
txtDisplay12Layer.Text = Layer12.ToString();
|
||
txtDisplay13Layer.Text = Layer13.ToString();
|
||
txtDisplay14Layer.Text = Layer14.ToString();
|
||
txtDisplay15Layer.Text = Layer15.ToString();
|
||
|
||
txtIP.Text = dbIP;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
private void button2_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
frameVRV = Convert.ToInt32(txtFrameVRV.Text);
|
||
frameTAG = Convert.ToInt32(txtFrameTAG.Text);
|
||
|
||
RegistryKey key = Registry.CurrentUser.CreateSubKey(subKey);
|
||
key.SetValue("frameVRV", frameVRV);
|
||
key.SetValue("frameTAG", frameTAG);
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
MessageBox.Show("저장실패..");
|
||
}
|
||
|
||
}
|
||
int frameVRV = 52;
|
||
int frameTAG = 149;
|
||
|
||
private void simpleButton2_Click(object sender, EventArgs e)
|
||
{
|
||
if (label_connection.Text == "CONNECTED")
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
KAScenePlayer.Prepare(Layer11, KAScene);
|
||
KAScenePlayer.Play(Layer11);
|
||
timer4.Stop();
|
||
}
|
||
}
|
||
|
||
private void simpleButton9_Click(object sender, EventArgs e)
|
||
{
|
||
if (label_connection.Text == "CONNECTED")
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
KAScenePlayer.Prepare(Layer12, KAScene);
|
||
KAScenePlayer.Play(Layer12);
|
||
timer5.Stop();
|
||
}
|
||
|
||
}
|
||
|
||
private void simpleButton10_Click(object sender, EventArgs e)
|
||
{
|
||
if (label_connection.Text == "CONNECTED")
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
KAScenePlayer.Prepare(Layer13, KAScene);
|
||
KAScenePlayer.Play(Layer13);
|
||
매진정보.카드프로모션송출 = false;
|
||
}
|
||
}
|
||
|
||
private void simpleButton11_Click(object sender, EventArgs e)
|
||
{
|
||
if (label_connection.Text == "CONNECTED")
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
KAScenePlayer.Prepare(Layer14, KAScene);
|
||
KAScenePlayer.Play(Layer14);
|
||
매진정보.배송정보송출 = false;
|
||
timer6.Stop();
|
||
}
|
||
}
|
||
|
||
private void simpleButton12_Click(object sender, EventArgs e)
|
||
{
|
||
if (label_connection.Text == "CONNECTED")
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
매진정보.VVIP송출 = false;
|
||
매진정보.VVIP전면송출 = false;
|
||
timer7.Stop();
|
||
timer8.Stop();
|
||
}
|
||
}
|
||
|
||
private void MainForm_Shown(object sender, EventArgs e)
|
||
{
|
||
comboBox4.SelectedIndex = 0;
|
||
comboBox5.SelectedIndex = 0;
|
||
comboBox6.SelectedIndex = 0;
|
||
}
|
||
|
||
private void timer8_Tick(object sender, EventArgs e)
|
||
{
|
||
forVVIP전면아웃--;
|
||
|
||
if (forVVIP전면아웃 < 0)
|
||
{
|
||
eKSceneEffectType etype = eKSceneEffectType.SCENE_CHANGE_EFFECT_FADE;
|
||
|
||
KAScene = KAEngine.LoadScene(CurrentDirectory + @"\Degisn\Clear.t2s", "Clear");
|
||
KAScene.SetSceneEffectType(1, etype, fadeOutTime);
|
||
|
||
KAScenePlayer.Prepare(Layer15, KAScene);
|
||
KAScenePlayer.Play(Layer15);
|
||
매진정보.VVIP전면송출 = false;
|
||
timer8.Stop();
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
public class NewGroup
|
||
{
|
||
public NewGroup(bool _isQuestion, string _id, string _line1, string _line2, string _line3,string _profilePath, int _yPos)
|
||
{
|
||
isHaveImage = false;
|
||
isHaveIcon = false;
|
||
isHaveCIcon = false;
|
||
|
||
isHaveTag1 = false;
|
||
isHaveTag2 = false;
|
||
isHaveTag3 = false;
|
||
isHaveVrv = false;
|
||
|
||
imgName = "";
|
||
iconName = "";
|
||
vrvName = "";
|
||
tagName = "";
|
||
|
||
string checkImageIcon(string str, int lineIndex)
|
||
{
|
||
while (str.Contains("[LI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[LI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
iconName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
isHaveIcon = true;
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
}
|
||
while (str.Contains("[CI:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[CI:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
iconName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
isHaveIcon = true;
|
||
isHaveCIcon = true;
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
}
|
||
while (str.Contains("[PH:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[PH:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
imgName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
isHaveImage = true;
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
}
|
||
while (str.Contains("[VR:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[VR:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
vrvName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
isHaveVrv = true;
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
}
|
||
while (str.Contains("[TG:"))
|
||
{
|
||
int indexOfSI = str.IndexOf("[TG:");
|
||
int indexOfEOF = str.Substring(indexOfSI).IndexOf("]") + indexOfSI;
|
||
tagName = str.Substring(indexOfSI + 4, indexOfEOF - indexOfSI - 4);
|
||
|
||
if (lineIndex == 1) isHaveTag1 = true;
|
||
if (lineIndex == 2) isHaveTag2 = true;
|
||
if (lineIndex == 3) isHaveTag3 = true;
|
||
str = str.Remove(indexOfSI, indexOfEOF - indexOfSI + 1);
|
||
}
|
||
|
||
return str;
|
||
}
|
||
|
||
isQuestion = _isQuestion;
|
||
id = _id;
|
||
line1 = checkImageIcon(_line1, 1);
|
||
line2 = checkImageIcon(_line2, 2);
|
||
line3 = checkImageIcon(_line3, 3);
|
||
profilePath = _profilePath;
|
||
yPos = _yPos;
|
||
}
|
||
|
||
public bool isQuestion;
|
||
public int lines()
|
||
{
|
||
int returnValue = 0;
|
||
if (!line1.Equals("")) returnValue++;
|
||
if (!line2.Equals("")) returnValue++;
|
||
if (!line3.Equals("")) returnValue++;
|
||
return returnValue;
|
||
}
|
||
|
||
public void setYPos(int move) => yPos -= move;
|
||
|
||
|
||
public string profilePath;
|
||
public string id;
|
||
public string line1;
|
||
public string line2;
|
||
public string line3;
|
||
public int yPos;
|
||
|
||
public bool isHaveImage;
|
||
public bool isHaveIcon;
|
||
public bool isHaveCIcon;
|
||
|
||
public bool isHaveTag1;
|
||
public bool isHaveTag2;
|
||
public bool isHaveTag3;
|
||
|
||
public bool isHaveVrv;
|
||
|
||
public string imgName;
|
||
public string iconName;
|
||
|
||
public string tagName;
|
||
public string vrvName;
|
||
}
|
||
} |