Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- namespace TeleportMaker {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- /// <summary>
- /// Riepilogo per Form1
- /// </summary>
- public ref class Form1 : public System::Windows::Forms::Form
- {
- public:
- Form1(void)
- {
- InitializeComponent();
- //
- //TODO: aggiungere qui il codice del costruttore.
- //
- }
- protected:
- /// <summary>
- /// Liberare le risorse in uso.
- /// </summary>
- ~Form1()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::TextBox^ X_BOX;
- protected:
- protected:
- private: System::Windows::Forms::Label^ label1;
- private: System::Windows::Forms::Label^ label2;
- private: System::Windows::Forms::TextBox^ Y_BOX;
- private: System::Windows::Forms::Label^ label3;
- private: System::Windows::Forms::TextBox^ Z_BOX;
- private: System::Windows::Forms::TextBox^ COMMAND_BOX;
- private: System::Windows::Forms::Label^ label4;
- private: System::Windows::Forms::Label^ label5;
- private: System::Windows::Forms::TextBox^ INTERIOR_BOX;
- private: System::Windows::Forms::Label^ label6;
- private: System::Windows::Forms::TextBox^ WORLD_BOX;
- private: System::Windows::Forms::CheckBox^ CHECK_CAR;
- private: System::Windows::Forms::Label^ label7;
- private: System::Windows::Forms::TextBox^ SOUND_BOX;
- private: System::Windows::Forms::RichTextBox^ RESULT_BOX;
- private: System::Windows::Forms::Button^ Bottone;
- private: System::Windows::Forms::Label^ label8;
- private: System::Windows::Forms::TextBox^ MESSAGE_BOX;
- private: System::Windows::Forms::ColorDialog^ colorDialog1;
- private: System::Windows::Forms::ProgressBar^ Barra;
- private: System::Windows::Forms::Timer^ Timer;
- private: System::Windows::Forms::RadioButton^ radioStrcmp;
- private: System::Windows::Forms::RadioButton^ radioDcmd;
- private: System::Windows::Forms::RadioButton^ radioZcmd;
- private: System::Windows::Forms::RadioButton^ radioYcmd;
- private: System::Windows::Forms::TextBox^ colorBox;
- private: System::Windows::Forms::Label^ label9;
- private: System::ComponentModel::IContainer^ components;
- private:
- /// <summary>
- /// Variabile di progettazione necessaria.
- /// </summary>
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Metodo necessario per il supporto della finestra di progettazione. Non modificare
- /// il contenuto del metodo con l'editor di codice.
- /// </summary>
- void InitializeComponent(void)
- {
- this->components = (gcnew System::ComponentModel::Container());
- this->X_BOX = (gcnew System::Windows::Forms::TextBox());
- this->label1 = (gcnew System::Windows::Forms::Label());
- this->label2 = (gcnew System::Windows::Forms::Label());
- this->Y_BOX = (gcnew System::Windows::Forms::TextBox());
- this->label3 = (gcnew System::Windows::Forms::Label());
- this->Z_BOX = (gcnew System::Windows::Forms::TextBox());
- this->COMMAND_BOX = (gcnew System::Windows::Forms::TextBox());
- this->label4 = (gcnew System::Windows::Forms::Label());
- this->label5 = (gcnew System::Windows::Forms::Label());
- this->INTERIOR_BOX = (gcnew System::Windows::Forms::TextBox());
- this->label6 = (gcnew System::Windows::Forms::Label());
- this->WORLD_BOX = (gcnew System::Windows::Forms::TextBox());
- this->CHECK_CAR = (gcnew System::Windows::Forms::CheckBox());
- this->label7 = (gcnew System::Windows::Forms::Label());
- this->SOUND_BOX = (gcnew System::Windows::Forms::TextBox());
- this->RESULT_BOX = (gcnew System::Windows::Forms::RichTextBox());
- this->Bottone = (gcnew System::Windows::Forms::Button());
- this->label8 = (gcnew System::Windows::Forms::Label());
- this->MESSAGE_BOX = (gcnew System::Windows::Forms::TextBox());
- this->colorDialog1 = (gcnew System::Windows::Forms::ColorDialog());
- this->Barra = (gcnew System::Windows::Forms::ProgressBar());
- this->Timer = (gcnew System::Windows::Forms::Timer(this->components));
- this->radioStrcmp = (gcnew System::Windows::Forms::RadioButton());
- this->radioDcmd = (gcnew System::Windows::Forms::RadioButton());
- this->radioZcmd = (gcnew System::Windows::Forms::RadioButton());
- this->radioYcmd = (gcnew System::Windows::Forms::RadioButton());
- this->colorBox = (gcnew System::Windows::Forms::TextBox());
- this->label9 = (gcnew System::Windows::Forms::Label());
- this->SuspendLayout();
- //
- // X_BOX
- //
- this->X_BOX->Location = System::Drawing::Point(32, 46);
- this->X_BOX->Name = L"X_BOX";
- this->X_BOX->Size = System::Drawing::Size(60, 20);
- this->X_BOX->TabIndex = 0;
- this->X_BOX->Text = L"0.0000";
- //
- // label1
- //
- this->label1->AutoSize = true;
- this->label1->Location = System::Drawing::Point(12, 49);
- this->label1->Name = L"label1";
- this->label1->Size = System::Drawing::Size(14, 13);
- this->label1->TabIndex = 1;
- this->label1->Text = L"X";
- //
- // label2
- //
- this->label2->AutoSize = true;
- this->label2->Location = System::Drawing::Point(115, 49);
- this->label2->Name = L"label2";
- this->label2->Size = System::Drawing::Size(14, 13);
- this->label2->TabIndex = 2;
- this->label2->Text = L"Y";
- //
- // Y_BOX
- //
- this->Y_BOX->Location = System::Drawing::Point(135, 46);
- this->Y_BOX->Name = L"Y_BOX";
- this->Y_BOX->Size = System::Drawing::Size(60, 20);
- this->Y_BOX->TabIndex = 3;
- this->Y_BOX->Text = L"0.0000";
- //
- // label3
- //
- this->label3->AutoSize = true;
- this->label3->Location = System::Drawing::Point(219, 49);
- this->label3->Name = L"label3";
- this->label3->Size = System::Drawing::Size(14, 13);
- this->label3->TabIndex = 4;
- this->label3->Text = L"Z";
- //
- // Z_BOX
- //
- this->Z_BOX->Location = System::Drawing::Point(239, 46);
- this->Z_BOX->Name = L"Z_BOX";
- this->Z_BOX->Size = System::Drawing::Size(60, 20);
- this->Z_BOX->TabIndex = 5;
- this->Z_BOX->Text = L"0.0000";
- //
- // COMMAND_BOX
- //
- this->COMMAND_BOX->Location = System::Drawing::Point(145, 10);
- this->COMMAND_BOX->Name = L"COMMAND_BOX";
- this->COMMAND_BOX->Size = System::Drawing::Size(77, 20);
- this->COMMAND_BOX->TabIndex = 6;
- this->COMMAND_BOX->Text = L"commandname";
- //
- // label4
- //
- this->label4->AutoSize = true;
- this->label4->Location = System::Drawing::Point(9, 13);
- this->label4->Name = L"label4";
- this->label4->Size = System::Drawing::Size(132, 13);
- this->label4->TabIndex = 7;
- this->label4->Text = L"Command text (With no \'/\')";
- //
- // label5
- //
- this->label5->AutoSize = true;
- this->label5->Location = System::Drawing::Point(12, 84);
- this->label5->Name = L"label5";
- this->label5->Size = System::Drawing::Size(39, 13);
- this->label5->TabIndex = 8;
- this->label5->Text = L"Interior";
- //
- // INTERIOR_BOX
- //
- this->INTERIOR_BOX->Location = System::Drawing::Point(57, 81);
- this->INTERIOR_BOX->Name = L"INTERIOR_BOX";
- this->INTERIOR_BOX->Size = System::Drawing::Size(35, 20);
- this->INTERIOR_BOX->TabIndex = 9;
- this->INTERIOR_BOX->Text = L"0";
- //
- // label6
- //
- this->label6->AutoSize = true;
- this->label6->Location = System::Drawing::Point(106, 84);
- this->label6->Name = L"label6";
- this->label6->Size = System::Drawing::Size(67, 13);
- this->label6->TabIndex = 10;
- this->label6->Text = L"Virtual World";
- //
- // WORLD_BOX
- //
- this->WORLD_BOX->Location = System::Drawing::Point(179, 81);
- this->WORLD_BOX->Name = L"WORLD_BOX";
- this->WORLD_BOX->Size = System::Drawing::Size(35, 20);
- this->WORLD_BOX->TabIndex = 11;
- this->WORLD_BOX->Text = L"0";
- //
- // CHECK_CAR
- //
- this->CHECK_CAR->AutoSize = true;
- this->CHECK_CAR->Checked = true;
- this->CHECK_CAR->CheckState = System::Windows::Forms::CheckState::Checked;
- this->CHECK_CAR->Location = System::Drawing::Point(15, 107);
- this->CHECK_CAR->Name = L"CHECK_CAR";
- this->CHECK_CAR->Size = System::Drawing::Size(114, 17);
- this->CHECK_CAR->TabIndex = 12;
- this->CHECK_CAR->Text = L"Player with vehicle";
- this->CHECK_CAR->UseVisualStyleBackColor = true;
- //
- // label7
- //
- this->label7->AutoSize = true;
- this->label7->Location = System::Drawing::Point(220, 84);
- this->label7->Name = L"label7";
- this->label7->Size = System::Drawing::Size(38, 13);
- this->label7->TabIndex = 13;
- this->label7->Text = L"Sound";
- //
- // SOUND_BOX
- //
- this->SOUND_BOX->Location = System::Drawing::Point(264, 81);
- this->SOUND_BOX->Name = L"SOUND_BOX";
- this->SOUND_BOX->Size = System::Drawing::Size(35, 20);
- this->SOUND_BOX->TabIndex = 14;
- this->SOUND_BOX->Text = L"-1";
- //
- // RESULT_BOX
- //
- this->RESULT_BOX->BackColor = System::Drawing::SystemColors::ButtonHighlight;
- this->RESULT_BOX->Location = System::Drawing::Point(12, 251);
- this->RESULT_BOX->Name = L"RESULT_BOX";
- this->RESULT_BOX->ReadOnly = true;
- this->RESULT_BOX->Size = System::Drawing::Size(287, 234);
- this->RESULT_BOX->TabIndex = 15;
- this->RESULT_BOX->Text = L"";
- //
- // Bottone
- //
- this->Bottone->Location = System::Drawing::Point(12, 222);
- this->Bottone->Name = L"Bottone";
- this->Bottone->Size = System::Drawing::Size(287, 23);
- this->Bottone->TabIndex = 16;
- this->Bottone->Text = L"Generate!";
- this->Bottone->UseVisualStyleBackColor = true;
- this->Bottone->Click += gcnew System::EventHandler(this, &Form1::Bottone_Click);
- //
- // label8
- //
- this->label8->AutoSize = true;
- this->label8->Location = System::Drawing::Point(12, 195);
- this->label8->Name = L"label8";
- this->label8->Size = System::Drawing::Size(50, 13);
- this->label8->TabIndex = 17;
- this->label8->Text = L"Message";
- //
- // MESSAGE_BOX
- //
- this->MESSAGE_BOX->Location = System::Drawing::Point(68, 192);
- this->MESSAGE_BOX->Name = L"MESSAGE_BOX";
- this->MESSAGE_BOX->Size = System::Drawing::Size(121, 20);
- this->MESSAGE_BOX->TabIndex = 18;
- this->MESSAGE_BOX->Text = L"NO_MSG";
- //
- // Barra
- //
- this->Barra->Location = System::Drawing::Point(12, 491);
- this->Barra->Name = L"Barra";
- this->Barra->Size = System::Drawing::Size(288, 23);
- this->Barra->Step = 100;
- this->Barra->TabIndex = 22;
- //
- // Timer
- //
- this->Timer->Interval = 1000;
- this->Timer->Tick += gcnew System::EventHandler(this, &Form1::Timer_Tick);
- //
- // radioStrcmp
- //
- this->radioStrcmp->AutoSize = true;
- this->radioStrcmp->Checked = true;
- this->radioStrcmp->Cursor = System::Windows::Forms::Cursors::Default;
- this->radioStrcmp->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->radioStrcmp->Location = System::Drawing::Point(12, 146);
- this->radioStrcmp->Name = L"radioStrcmp";
- this->radioStrcmp->Size = System::Drawing::Size(137, 17);
- this->radioStrcmp->TabIndex = 23;
- this->radioStrcmp->TabStop = true;
- this->radioStrcmp->Text = L"String Compare - strcmp";
- this->radioStrcmp->UseVisualStyleBackColor = true;
- //
- // radioDcmd
- //
- this->radioDcmd->AutoSize = true;
- this->radioDcmd->ForeColor = System::Drawing::Color::Blue;
- this->radioDcmd->Location = System::Drawing::Point(12, 169);
- this->radioDcmd->Name = L"radioDcmd";
- this->radioDcmd->Size = System::Drawing::Size(163, 17);
- this->radioDcmd->TabIndex = 24;
- this->radioDcmd->Text = L"Dracoblue commands - dcmd";
- this->radioDcmd->UseVisualStyleBackColor = true;
- //
- // radioZcmd
- //
- this->radioZcmd->AutoSize = true;
- this->radioZcmd->ForeColor = System::Drawing::Color::Red;
- this->radioZcmd->Location = System::Drawing::Point(162, 146);
- this->radioZcmd->Name = L"radioZcmd";
- this->radioZcmd->Size = System::Drawing::Size(137, 17);
- this->radioZcmd->TabIndex = 25;
- this->radioZcmd->Text = L"Zeex commands - zcmd";
- this->radioZcmd->UseVisualStyleBackColor = true;
- //
- // radioYcmd
- //
- this->radioYcmd->AutoSize = true;
- this->radioYcmd->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(128)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->radioYcmd->Location = System::Drawing::Point(176, 169);
- this->radioYcmd->Name = L"radioYcmd";
- this->radioYcmd->Size = System::Drawing::Size(123, 17);
- this->radioYcmd->TabIndex = 26;
- this->radioYcmd->Text = L"Y_commands - ycmd";
- this->radioYcmd->UseVisualStyleBackColor = true;
- //
- // colorBox
- //
- this->colorBox->BackColor = System::Drawing::Color::Black;
- this->colorBox->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->colorBox->ForeColor = System::Drawing::Color::White;
- this->colorBox->Location = System::Drawing::Point(202, 192);
- this->colorBox->Name = L"colorBox";
- this->colorBox->Size = System::Drawing::Size(97, 20);
- this->colorBox->TabIndex = 27;
- this->colorBox->Text = L"Color Picker";
- this->colorBox->MouseClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::colorBox_MouseClick);
- //
- // label9
- //
- this->label9->AutoSize = true;
- this->label9->Location = System::Drawing::Point(78, 130);
- this->label9->Name = L"label9";
- this->label9->Size = System::Drawing::Size(147, 13);
- this->label9->TabIndex = 28;
- this->label9->Text = L"Select a command processor:";
- //
- // Form1
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->AutoSize = true;
- this->ClientSize = System::Drawing::Size(311, 526);
- this->Controls->Add(this->label9);
- this->Controls->Add(this->colorBox);
- this->Controls->Add(this->radioYcmd);
- this->Controls->Add(this->radioZcmd);
- this->Controls->Add(this->radioDcmd);
- this->Controls->Add(this->radioStrcmp);
- this->Controls->Add(this->Barra);
- this->Controls->Add(this->MESSAGE_BOX);
- this->Controls->Add(this->label8);
- this->Controls->Add(this->Bottone);
- this->Controls->Add(this->RESULT_BOX);
- this->Controls->Add(this->SOUND_BOX);
- this->Controls->Add(this->label7);
- this->Controls->Add(this->CHECK_CAR);
- this->Controls->Add(this->WORLD_BOX);
- this->Controls->Add(this->label6);
- this->Controls->Add(this->INTERIOR_BOX);
- this->Controls->Add(this->label5);
- this->Controls->Add(this->label4);
- this->Controls->Add(this->COMMAND_BOX);
- this->Controls->Add(this->Z_BOX);
- this->Controls->Add(this->label3);
- this->Controls->Add(this->Y_BOX);
- this->Controls->Add(this->label2);
- this->Controls->Add(this->label1);
- this->Controls->Add(this->X_BOX);
- this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
- this->Name = L"Form1";
- this->Text = L"Sasino\'s Teleport Maker";
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- System::String ^ Colore;
- private: static System::String ^ HexConverter(System::Drawing::Color c)
- {
- return "0x" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2") + "FF";
- }
- private: System::Void colorBox_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
- {
- if (colorDialog1->ShowDialog() == ::System::Windows::Forms::DialogResult::OK )
- {
- colorBox->BackColor = colorDialog1->Color;
- colorBox->Text = HexConverter(colorDialog1->Color);
- Colore = HexConverter(colorDialog1->Color);
- }
- }
- private: System::Void Bottone_Click(System::Object^ sender, System::EventArgs^ e)
- {
- Barra->PerformStep();
- RESULT_BOX->Text = L"Generating PAWN code...";
- Timer->Enabled = true;
- }
- private: System::Void Timer_Tick(System::Object^ sender, System::EventArgs^ e)
- {
- Barra->Value = 0;
- Timer->Enabled = false;
- if(radioStrcmp->Checked)
- {
- RESULT_BOX->Text = L"if(strcmp(cmdtext, \"/";
- RESULT_BOX->Text += COMMAND_BOX->Text;
- RESULT_BOX->Text += "\", true) == 0)\r\n{\r\n ";
- }
- else if(radioDcmd->Checked)
- {
- RESULT_BOX->Text = L"dcmd_";
- RESULT_BOX->Text += COMMAND_BOX->Text;
- RESULT_BOX->Text += "(playerid, params[])\r\n{\r\n ";
- }
- else if(radioZcmd->Checked)
- {
- RESULT_BOX->Text = L"CMD:";
- RESULT_BOX->Text += COMMAND_BOX->Text;
- RESULT_BOX->Text += "(playerid, params[])\r\n{\r\n ";
- }
- else if(radioYcmd->Checked)
- {
- RESULT_BOX->Text = L"ycmd_";
- RESULT_BOX->Text += COMMAND_BOX->Text;
- RESULT_BOX->Text += "(playerid, params[], help)\r\n{\r\n ";
- }
- RESULT_BOX->Text += "SetPlayerPos(playerid, ";
- RESULT_BOX->Text += X_BOX->Text;
- RESULT_BOX->Text += ", ";
- RESULT_BOX->Text += Y_BOX->Text;
- RESULT_BOX->Text += ", ";
- RESULT_BOX->Text += Z_BOX->Text;
- RESULT_BOX->Text += ");\r\n SetPlayerInterior(playerid, ";
- RESULT_BOX->Text += INTERIOR_BOX->Text;
- RESULT_BOX->Text += ");\r\n SetPlayerVirtualWorld(playerid, ";
- RESULT_BOX->Text += WORLD_BOX->Text;
- RESULT_BOX->Text += ");\r\n";
- if(SOUND_BOX->Text != "-1")
- {
- RESULT_BOX->Text += " new Float:X, Float:Y, Float:Z;\r\n PlayerPlaySound(playerid, ";
- RESULT_BOX->Text += SOUND_BOX->Text;
- RESULT_BOX->Text += ", X, Y, Z);\r\n";
- }
- if(MESSAGE_BOX->Text != "NO_MSG")
- {
- RESULT_BOX->Text += " SendClientMessage(playerid, ";
- RESULT_BOX->Text += Colore;
- RESULT_BOX->Text += ", \"";
- RESULT_BOX->Text += MESSAGE_BOX->Text;
- RESULT_BOX->Text += "\");\r\n";
- }
- if(CHECK_CAR->Checked)
- {
- RESULT_BOX->Text += " if(IsPlayerInAnyVehicle(playerid))\r\n {\r\n new vehicleid = GetPlayerVehicleID(playerid);\r\n SetVehiclePos(vehicleid, ";
- RESULT_BOX->Text += X_BOX->Text;
- RESULT_BOX->Text += ", ";
- RESULT_BOX->Text += Y_BOX->Text;
- RESULT_BOX->Text += ", ";
- RESULT_BOX->Text += Z_BOX->Text;
- RESULT_BOX->Text += ");\r\n LinkVehicleToInterior(vehicleid, ";
- RESULT_BOX->Text += INTERIOR_BOX->Text;
- RESULT_BOX->Text += ");\r\n SetVehicleVirtualWorld(vehicleid, ";
- RESULT_BOX->Text += WORLD_BOX->Text;
- RESULT_BOX->Text += ");\r\n PutPlayerInVehicle(playerid, vehicleid, 0);\r\n }\r\n";
- }
- if(!radioStrcmp->Checked) RESULT_BOX->Text += " #pragma unused params\r\n";
- RESULT_BOX->Text += " return 1;\r\n}";
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement