コード例 #1
0
        public static void generateChatUI(int width, int height)
        {
            // ファイルパスを指定
            String filePath = getInstallPath() + @"\data\UI_nori\ChatUI.ucf";

            /*
             * ; 表示枠サイズ
             * iViewDimX	= iStatViewDimX + 2
             * iViewDimY	= 22(固定値/不変)
             *
             * ; 通常モード時の文字入力枠
             * iEditBoxDimX	= iStatViewDimX + 74
             * iEditBoxDimY	= 18(固定値/不変)
             * iEditBoxCoordX	= 58(固定値/不変/左辺を0としてみた時の横の位置)
             * iEditBoxCoordY	= 3(固定値/不変/底辺を0としてみた時の高さの位置)
             *
             * ; whisperモード時の文字入力枠
             * iEditBoxMinDimX	= iStatViewDimX - iEditBoxMinCoordX - 16
             * iEditBoxMinDimY	= 18(固定値/不変)
             * iEditBoxMinCoordX	= ((iStatViewDimX - (iComboBoxDimX + iComboBoxCoordX + 2)) - iStatViewDimX) * -1(/左辺を0としてみた時の横の位置/右下の点)
             * iEditBoxMinCoordY	= 3(固定値/不変/底辺を0としてみた時の高さの位置/右下の点)
             *
             * ; whisperモード時のコンボボックスサイズ
             * iComboBoxDimX	= コンボボックスサイズの横幅(最低116)
             * iComboBoxDimY	= 18(固定値/不変)
             * iComboBoxCoordX	= 58(固定値/不変)
             * iComboBoxCoordY	= 3(固定値/不変)
             *
             * ; エモボタンの位置
             * iEmoticonBtnCoordX	= 5(固定値/不変)
             * iEmoticonBtnCoordY	= 5(固定値/不変)
             * ; メモボタンの位置
             * iMemoBtnCoordX		= 22(固定値/不変)
             * iMemoBtnCoordY		= 5(固定値/不変)
             * ; 囁きボタンの位置
             * iWhisperBtnCoordX	= 40(固定値/不変)
             * iWhisperBtnCoordY	= 5(固定値/不変)
             * ; 閉じるボタンの位置
             * iCloseBtnCoordX		= iStatViewDimX - 15
             * iCloseBtnCoordY		= 6(固定値/不変)
             *
             * iStatViewDimX	= チャット履歴表示の横幅
             * iStatViewDimY	= 78(固定値/不変)
             *
             * iStatViewMaxDimX	= iStatViewDimX
             * iStatViewMaxDimY	= チャット履歴表示の高さ
             *
             * iModeButtonDimX	= 65(固定値/不変)
             * iModeButtonDimY	= 18(固定値/不変)
             *
             * iDummyModeButtonDimX	= iStatViewDimX - (iModeButtonDimX * 4)
             * iDummyModeButtonDimY	= 18(固定値/不変)
             */

            ChatUI chat = new ChatUI(width, height);


            StringBuilder builder = new StringBuilder();

            builder.AppendLine("iViewDimX = " + chat.iViewDimX);
            builder.AppendLine("iViewDimY = " + chat.iViewDimY);
            builder.AppendLine();
            builder.AppendLine("iEditBoxDimX = " + chat.iEditBoxDimX);
            builder.AppendLine("iEditBoxDimY = " + chat.iEditBoxDimY);
            builder.AppendLine("iEditBoxCoordX = " + chat.iEditBoxCoordX);
            builder.AppendLine("iEditBoxCoordY = " + chat.iEditBoxCoordY);
            builder.AppendLine("iEditBoxMinDimX = " + chat.iEditBoxMinDimX);
            builder.AppendLine("iEditBoxMinDimY = " + chat.iEditBoxMinDimY);
            builder.AppendLine("iEditBoxMinCoordX = " + chat.iEditBoxMinCoordX);
            builder.AppendLine("iEditBoxMinCoordY = " + chat.iEditBoxMinCoordY);
            builder.AppendLine();
            builder.AppendLine("iComboBoxDimX = " + chat.iComboBoxDimX);
            builder.AppendLine("iComboBoxDimY = " + chat.iComboBoxDimY);
            builder.AppendLine("iComboBoxCoordX = " + chat.iComboBoxCoordX);
            builder.AppendLine("iComboBoxCoordY = " + chat.iComboBoxCoordY);
            builder.AppendLine();
            builder.AppendLine("iEmoticonBtnCoordX = " + chat.iEmoticonBtnCoordX);
            builder.AppendLine("iEmoticonBtnCoordY = " + chat.iEmoticonBtnCoordY);
            builder.AppendLine("iMemoBtnCoordX  = " + chat.iMemoBtnCoordX);
            builder.AppendLine("iMemoBtnCoordY  = " + chat.iMemoBtnCoordY);
            builder.AppendLine("iWhisperBtnCoordX = " + chat.iWhisperBtnCoordX);
            builder.AppendLine("iWhisperBtnCoordY = " + chat.iWhisperBtnCoordY);
            builder.AppendLine("iCloseBtnCoordX  = " + chat.iCloseBtnCoordX);
            builder.AppendLine("iCloseBtnCoordY  = " + chat.iCloseBtnCoordY);
            builder.AppendLine();
            builder.AppendLine("iStatViewDimX = " + chat.iStatViewDimX);
            builder.AppendLine("iStatViewDimY = " + chat.iStatViewDimY);
            builder.AppendLine();
            builder.AppendLine("iStatViewMaxDimX = " + chat.iStatViewMaxDimX);
            builder.AppendLine("iStatViewMaxDimY = " + chat.iStatViewMaxDimY);
            builder.AppendLine();
            builder.AppendLine("iModeButtonDimX = " + chat.iModeButtonDimX);
            builder.AppendLine("iModeButtonDimY = " + chat.iModeButtonDimY);
            builder.AppendLine();
            builder.AppendLine("iDummyModeButtonDimX = " + chat.iDummyModeButtonDimX);
            builder.AppendLine("iDummyModeButtonDimY = " + chat.iDummyModeButtonDimY);


            SimpleLogger.WriteLine(builder.ToString());
            try
            {
                StreamWriter fst = new StreamWriter(filePath, false, Encoding.Default);
                fst.Write(builder.ToString());
                fst.Close();
            }
            catch (IOException ioe)
            {
                MessageBox.Show("設定ファイルの書き込みに失敗しました。", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (UnauthorizedAccessException uae)
            {
                MessageBox.Show("設定ファイルへの書き込み権限がありません。設定は保存されていません。", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Security.SecurityException se)
            {
                MessageBox.Show("セキュリティ設定により設定ファイルへのアクセスが行えませんでした。設定は保存されていません。", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
ファイル: UIEdit.cs プロジェクト: anon5r/TSLoginManager
        public static void generateChatUI(int width, int height)
        {
            // �t�@�C���p�X��w��
            String filePath = getInstallPath() + @"\data\UI_nori\ChatUI.ucf";

            /*
             * ; �\���g�T�C�Y
             * iViewDimX	= iStatViewDimX + 2
             * iViewDimY	= 22�i�Œ�l/�s�ρj
             *
             * ; �ʏ탂�[�h���̕������͘g
             * iEditBoxDimX	= iStatViewDimX + 74
             * iEditBoxDimY	= 18�i�Œ�l/�s�ρj
             * iEditBoxCoordX	= 58�i�Œ�l/�s��/���ӂ�0�Ƃ��Ă݂����̉��̈ʒu�j
             * iEditBoxCoordY	= 3�i�Œ�l/�s��/��ӂ�0�Ƃ��Ă݂����̍����̈ʒu�j
             *
             * ; whisper���[�h���̕������͘g
             * iEditBoxMinDimX	= iStatViewDimX - iEditBoxMinCoordX - 16
             * iEditBoxMinDimY	= 18�i�Œ�l/�s�ρj
             * iEditBoxMinCoordX	= ((iStatViewDimX - (iComboBoxDimX + iComboBoxCoordX + 2)) - iStatViewDimX) * -1�i/���ӂ�0�Ƃ��Ă݂����̉��̈ʒu/�E���̓_�j
             * iEditBoxMinCoordY	= 3�i�Œ�l/�s��/��ӂ�0�Ƃ��Ă݂����̍����̈ʒu/�E���̓_�j
             *
             * ; whisper���[�h���̃R���{�{�b�N�X�T�C�Y
             * iComboBoxDimX	= �R���{�{�b�N�X�T�C�Y�̉����i�Œ�116�j
             * iComboBoxDimY	= 18�i�Œ�l/�s�ρj
             * iComboBoxCoordX	= 58�i�Œ�l/�s�ρj
             * iComboBoxCoordY	= 3�i�Œ�l/�s�ρj
             *
             * ; �G���{�^���̈ʒu
             * iEmoticonBtnCoordX	= 5�i�Œ�l/�s�ρj
             * iEmoticonBtnCoordY	= 5�i�Œ�l/�s�ρj
             * ; �����{�^���̈ʒu
             * iMemoBtnCoordX		= 22�i�Œ�l/�s�ρj
             * iMemoBtnCoordY		= 5�i�Œ�l/�s�ρj
             * ; �����{�^���̈ʒu
             * iWhisperBtnCoordX	= 40�i�Œ�l/�s�ρj
             * iWhisperBtnCoordY	= 5�i�Œ�l/�s�ρj
             * ; �‚���{�^���̈ʒu
             * iCloseBtnCoordX		= iStatViewDimX - 15
             * iCloseBtnCoordY		= 6�i�Œ�l/�s�ρj
             *
             * iStatViewDimX	= �`���b�g����\���̉���
             * iStatViewDimY	= 78�i�Œ�l/�s�ρj
             *
             * iStatViewMaxDimX	= iStatViewDimX
             * iStatViewMaxDimY	= �`���b�g����\���̍���
             *
             * iModeButtonDimX	= 65�i�Œ�l/�s�ρj
             * iModeButtonDimY	= 18�i�Œ�l/�s�ρj
             *
             * iDummyModeButtonDimX	= iStatViewDimX - (iModeButtonDimX * 4)
             * iDummyModeButtonDimY	= 18�i�Œ�l/�s�ρj
             */

            ChatUI chat = new ChatUI(width, height);

            StringBuilder builder = new StringBuilder();
            builder.AppendLine("iViewDimX = " + chat.iViewDimX);
            builder.AppendLine("iViewDimY = " + chat.iViewDimY);
            builder.AppendLine();
            builder.AppendLine("iEditBoxDimX = " + chat.iEditBoxDimX);
            builder.AppendLine("iEditBoxDimY = " + chat.iEditBoxDimY);
            builder.AppendLine("iEditBoxCoordX = " + chat.iEditBoxCoordX);
            builder.AppendLine("iEditBoxCoordY = " + chat.iEditBoxCoordY);
            builder.AppendLine("iEditBoxMinDimX = " + chat.iEditBoxMinDimX);
            builder.AppendLine("iEditBoxMinDimY = " + chat.iEditBoxMinDimY);
            builder.AppendLine("iEditBoxMinCoordX = " + chat.iEditBoxMinCoordX);
            builder.AppendLine("iEditBoxMinCoordY = " + chat.iEditBoxMinCoordY);
            builder.AppendLine();
            builder.AppendLine("iComboBoxDimX = " + chat.iComboBoxDimX);
            builder.AppendLine("iComboBoxDimY = " + chat.iComboBoxDimY);
            builder.AppendLine("iComboBoxCoordX = " + chat.iComboBoxCoordX);
            builder.AppendLine("iComboBoxCoordY = " + chat.iComboBoxCoordY);
            builder.AppendLine();
            builder.AppendLine("iEmoticonBtnCoordX = " + chat.iEmoticonBtnCoordX);
            builder.AppendLine("iEmoticonBtnCoordY = " + chat.iEmoticonBtnCoordY);
            builder.AppendLine("iMemoBtnCoordX  = " + chat.iMemoBtnCoordX);
            builder.AppendLine("iMemoBtnCoordY  = " + chat.iMemoBtnCoordY);
            builder.AppendLine("iWhisperBtnCoordX = " + chat.iWhisperBtnCoordX);
            builder.AppendLine("iWhisperBtnCoordY = " + chat.iWhisperBtnCoordY);
            builder.AppendLine("iCloseBtnCoordX  = " + chat.iCloseBtnCoordX);
            builder.AppendLine("iCloseBtnCoordY  = " + chat.iCloseBtnCoordY);
            builder.AppendLine();
            builder.AppendLine("iStatViewDimX = " + chat.iStatViewDimX);
            builder.AppendLine("iStatViewDimY = " + chat.iStatViewDimY);
            builder.AppendLine();
            builder.AppendLine("iStatViewMaxDimX = " + chat.iStatViewMaxDimX);
            builder.AppendLine("iStatViewMaxDimY = " + chat.iStatViewMaxDimY);
            builder.AppendLine();
            builder.AppendLine("iModeButtonDimX = " + chat.iModeButtonDimX);
            builder.AppendLine("iModeButtonDimY = " + chat.iModeButtonDimY);
            builder.AppendLine();
            builder.AppendLine("iDummyModeButtonDimX = " + chat.iDummyModeButtonDimX);
            builder.AppendLine("iDummyModeButtonDimY = " + chat.iDummyModeButtonDimY);

            SimpleLogger.WriteLine(builder.ToString());
            try
            {
                StreamWriter fst = new StreamWriter(filePath, false, Encoding.Default);
                fst.Write(builder.ToString());
                fst.Close();
            }
            catch (IOException ioe)
            {
                MessageBox.Show("�ݒ�t�@�C���̏������݂Ɏ��s���܂����B", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (UnauthorizedAccessException uae)
            {
                MessageBox.Show("�ݒ�t�@�C���ւ̏������݌���������܂���B�ݒ�͕ۑ�����Ă��܂���B", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Security.SecurityException se)
            {
                MessageBox.Show("�Z�L�����e�B�ݒ�ɂ��ݒ�t�@�C���ւ̃A�N�Z�X���s���܂���ł����B�ݒ�͕ۑ�����Ă��܂���B", "UIEditor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }