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::TextBox^ 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::ListBox^ ListaColori;
- private: System::Windows::Forms::RadioButton^ radioButton1;
- private: System::Windows::Forms::RadioButton^ radioButton2;
- private: System::Windows::Forms::ProgressBar^ Barra;
- private: System::Windows::Forms::Timer^ Timer;
- 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::TextBox());
- 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->ListaColori = (gcnew System::Windows::Forms::ListBox());
- this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
- this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
- this->Barra = (gcnew System::Windows::Forms::ProgressBar());
- this->Timer = (gcnew System::Windows::Forms::Timer(this->components));
- 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(12, 119);
- this->CHECK_CAR->Name = L"CHECK_CAR";
- this->CHECK_CAR->Size = System::Drawing::Size(159, 17);
- this->CHECK_CAR->TabIndex = 12;
- this->CHECK_CAR->Text = L"Also teleport player\'s 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, 241);
- this->RESULT_BOX->Multiline = true;
- 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;
- //
- // Bottone
- //
- this->Bottone->Location = System::Drawing::Point(12, 212);
- 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(9, 152);
- 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(73, 149);
- this->MESSAGE_BOX->Name = L"MESSAGE_BOX";
- this->MESSAGE_BOX->Size = System::Drawing::Size(97, 20);
- this->MESSAGE_BOX->TabIndex = 18;
- this->MESSAGE_BOX->Text = L"NO_MSG";
- //
- // ListaColori
- //
- this->ListaColori->FormattingEnabled = true;
- this->ListaColori->Items->AddRange(gcnew cli::array< System::Object^ >(8) {L"White (FFFFFF)", L"Red (FF0000)", L"Blue (0000FF)",
- L"Yellow (FFFF00)", L"Green (00FF00)", L"Orange (FFAA00)", L"Purple (AA00FF)", L"Pink (FF00FF)"});
- this->ListaColori->Location = System::Drawing::Point(179, 139);
- this->ListaColori->Name = L"ListaColori";
- this->ListaColori->ScrollAlwaysVisible = true;
- this->ListaColori->Size = System::Drawing::Size(120, 30);
- this->ListaColori->TabIndex = 19;
- this->ListaColori->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::ListaColori_SelectedIndexChanged);
- //
- // radioButton1
- //
- this->radioButton1->AutoSize = true;
- this->radioButton1->Checked = true;
- this->radioButton1->Location = System::Drawing::Point(15, 181);
- this->radioButton1->Name = L"radioButton1";
- this->radioButton1->Size = System::Drawing::Size(119, 17);
- this->radioButton1->TabIndex = 20;
- this->radioButton1->TabStop = true;
- this->radioButton1->Text = L"SendClientMessage";
- this->radioButton1->UseVisualStyleBackColor = true;
- //
- // radioButton2
- //
- this->radioButton2->AutoSize = true;
- this->radioButton2->Location = System::Drawing::Point(179, 181);
- this->radioButton2->Name = L"radioButton2";
- this->radioButton2->Size = System::Drawing::Size(118, 17);
- this->radioButton2->TabIndex = 21;
- this->radioButton2->Text = L"GameTextForPlayer";
- this->radioButton2->UseVisualStyleBackColor = true;
- //
- // Barra
- //
- this->Barra->Location = System::Drawing::Point(15, 481);
- this->Barra->Name = L"Barra";
- this->Barra->Size = System::Drawing::Size(285, 23);
- this->Barra->Step = 100;
- this->Barra->TabIndex = 22;
- //
- // Timer
- //
- this->Timer->Interval = 1000;
- this->Timer->Tick += gcnew System::EventHandler(this, &Form1::Timer_Tick);
- //
- // Form1
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->AutoSize = true;
- this->ClientSize = System::Drawing::Size(311, 507);
- this->Controls->Add(this->Barra);
- this->Controls->Add(this->radioButton2);
- this->Controls->Add(this->radioButton1);
- this->Controls->Add(this->ListaColori);
- 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 ^ Color;
- private: System::Void Bottone_Click(System::Object^ sender, System::EventArgs^ e)
- {
- Barra->PerformStep();
- RESULT_BOX->Text = L"Generating PAWN code...";
- this->Timer->Enabled = true;
- }
- private: System::Void ListaColori_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)
- {
- if(ListaColori->SelectedIndex == 0) Color = "0xFFFFFFFF";
- else if(ListaColori->SelectedIndex == 1) Color = "0xFF0000FF";
- else if(ListaColori->SelectedIndex == 2) Color = "0x0000FFFF";
- else if(ListaColori->SelectedIndex == 3) Color = "0xFFFF00FF";
- else if(ListaColori->SelectedIndex == 4) Color = "0x00FF00FF";
- else if(ListaColori->SelectedIndex == 5) Color = "0xFFAA00FF";
- else if(ListaColori->SelectedIndex == 6) Color = "0xAA00FFFF";
- else if(ListaColori->SelectedIndex == 7) Color = "0xFF00FFFF";
- else Color = "0xFFFFFFFF";
- }
- private: System::Void Timer_Tick(System::Object^ sender, System::EventArgs^ e)
- {
- Barra->Value = 0;
- this->Timer->Enabled = false;
- RESULT_BOX->Text = L"if(strcmp(cmdtext, \"/";
- RESULT_BOX->Text += COMMAND_BOX->Text;
- RESULT_BOX->Text += "\", true) == 0)\r\n{\r\n 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")
- {
- if(radioButton1->Checked)
- {
- RESULT_BOX->Text += " SendClientMessage(playerid, ";
- RESULT_BOX->Text += Color;
- RESULT_BOX->Text += ", \"";
- RESULT_BOX->Text += MESSAGE_BOX->Text;
- RESULT_BOX->Text += "\");\r\n";
- }
- else
- {
- RESULT_BOX->Text += " GameTextForPlayer(playerid, \"";
- RESULT_BOX->Text += MESSAGE_BOX->Text;
- RESULT_BOX->Text += "\", 2000, 5);\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";
- }
- RESULT_BOX->Text += " return 1;\r\n}";
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement