diff --git a/.gitignore b/.gitignore
index 1ee5385..259148f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,362 +1,32 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+# Prerequisites
+*.d
-# User-specific files
-*.rsuser
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Mono auto generated files
-mono_crash.*
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-[Ww][Ii][Nn]32/
-[Aa][Rr][Mm]/
-[Aa][Rr][Mm]64/
-bld/
-[Bb]in/
-[Oo]bj/
-[Ll]og/
-[Ll]ogs/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUnit
-*.VisualState.xml
-TestResult.xml
-nunit-*.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-
-# ASP.NET Scaffolding
-ScaffoldingReadMe.txt
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_h.h
-*.ilk
-*.meta
+# Compiled Object files
+*.slo
+*.lo
+*.o
*.obj
-*.iobj
+
+# Precompiled Headers
+*.gch
*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*_wpftmp.csproj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-# Chutzpah Test files
-_Chutzpah*
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
+# Fortran module files
+*.mod
+*.smod
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Coverlet is a free, cross platform Code Coverage Tool
-coverage*.json
-coverage*.xml
-coverage*.info
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# NuGet Symbol Packages
-*.snupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-*.appxbundle
-*.appxupload
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!?*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-*- [Bb]ackup.rdl
-*- [Bb]ackup ([0-9]).rdl
-*- [Bb]ackup ([0-9][0-9]).rdl
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# CodeRush personal settings
-.cr/personal
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-# Local History for Visual Studio
-.localhistory/
-
-# BeatPulse healthcheck temp database
-healthchecksdb
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-MigrationBackup/
-
-# Ionide (cross platform F# VS Code tools) working folder
-.ionide/
-
-# Fody - auto-generated XML schema
-FodyWeavers.xsd
+# Executables
+*.exe
+*.out
+*.app
diff --git a/How to use.docx b/How to use.docx
new file mode 100644
index 0000000..8f55f86
Binary files /dev/null and b/How to use.docx differ
diff --git a/README.md b/README.md
index 9303587..2dad5cf 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,5 @@
-# MultRedactor
-
-## Что это?
-_MultRedactor_ - удобный графический редактор мультфильмов. Вы создаёте персонажей, задаёте им параметры, а эта программка преобразует всё в исходный код C++, и, по нажатию соответствующей кнопки, скомпилирует его. Правда удобно?
-
-## Как использовать?
-1. Запустите приложение.
-2. В левой части окна, в поле ввода, напишите название мультфильма.
-3. Всё в той же левой части выберите фон.
-4. Нажмите кнопку "Добавить персонажа".
-5. Выберите вид движения, границы (```x,y``` начала и ```x,y``` конца), тайминг (в секундах) и картинку.
-6. Назовите своего персонажа (необязательно) и нажмите кнопку "Сохранить персонажа".
-7. Если нужно, добавьте ещё персонажей.
-8. Нажмите кнопку "Сохранить мульт", выберите расположение файлов и введите название главного файла. Естественно, нужно нажать "Сохранить".
-9. Через некоторое время появится сообщение "Готово!". Нажмите кнопку "Компилировать". В открывшемся окошечке всё и так понятно расписано, здесь пояснять ничего не буду.
-10. По окончанию компиляции появится сообщение "Готово!". Да, теперь точно готово. Перейдите в каталог с мультфильмом - там найдёте *.exe-файл. Это готовый мультик.
-
-## TODO
- - Написать нормальную инструкцию с картинками
- - Доделать код движения персонажей, т.к. сейчас это всё очень криво...
- - https://docs.google.com/spreadsheets/d/1ka-DjMCEskMYwHZOzJRvlgEZpGA5g-WNFh_pH3sF3y4/edit#gid=1972460334
+# MultRedactor
+Редактор мультиков
+
+Задачи
+https://docs.google.com/spreadsheets/d/1ka-DjMCEskMYwHZOzJRvlgEZpGA5g-WNFh_pH3sF3y4/edit#gid=1972460334
diff --git a/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo b/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo
deleted file mode 100644
index 7753833..0000000
Binary files a/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo and /dev/null differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo b/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo
new file mode 100644
index 0000000..af83503
Binary files /dev/null and b/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
index fa7c043..cd8fc1c 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
@@ -1,5 +1,9 @@
using System;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
@@ -7,43 +11,39 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(Environment.NewLine);
- sw.Write(" Person " + name + ";" + Environment.NewLine);
- sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\");" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".angle = 0;" + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\");" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".angle = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
}
public static void MovePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
- sw.Write(" " + name + ".angle = " + name + ".angle + 360 / 20 * " + p.circles + " / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- sw.Write(" " + name + ".x = (" + p.x1 + " + " + p.x2 + ")/2 + (" + p.x1 + " - " + p.x2 + ")/2 * cos (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
- sw.Write(" " + name + ".y = (" + p.y1 + " + " + p.y2 + ")/2 + (" + p.y1 + " - " + p.y2 + ")/2 * sin (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
- sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
- p.width + "/" + p.sprite + ", " +
- p.height + "," +
+ File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".angle = " + name + ".angle + 360 / 20 * " + p.circles + " / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x = (" + p.x1 + " + " + p.x2 + ")/2 + (" + p.x1 + " - " + p.x2 + ")/2 * cos (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y = (" + p.y1 + " + " + p.y2 + ")/2 + (" + p.y1 + " - " + p.y2 + ")/2 * sin (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
+ File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ p.width + "/" + p.sprite + ", " +
+ p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
- sw.Write(" {" + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
+ File.AppendAllText(filename, " {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs
deleted file mode 100644
index 1f0b23d..0000000
--- a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-namespace WindowsFormsApplication1
-{
- partial class CompileForm
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.button1 = new System.Windows.Forms.Button();
- this.linkLabel1 = new System.Windows.Forms.LinkLabel();
- this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
- this.button2 = new System.Windows.Forms.Button();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.label1.Location = new System.Drawing.Point(12, 9);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(196, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "Полный путь к каталогу MinGW";
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(12, 25);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(196, 20);
- this.textBox1.TabIndex = 1;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(214, 24);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(74, 22);
- this.button1.TabIndex = 2;
- this.button1.Text = "Обзор...";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // linkLabel1
- //
- this.linkLabel1.AutoSize = true;
- this.linkLabel1.Location = new System.Drawing.Point(12, 48);
- this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.Size = new System.Drawing.Size(257, 13);
- this.linkLabel1.TabIndex = 3;
- this.linkLabel1.TabStop = true;
- this.linkLabel1.Text = "У меня нет установленного компилятора MinGW";
- this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
- //
- // button2
- //
- this.button2.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.button2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.button2.Location = new System.Drawing.Point(0, 176);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(300, 28);
- this.button2.TabIndex = 4;
- this.button2.Text = "Старт!";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(12, 85);
- this.textBox2.Multiline = true;
- this.textBox2.Name = "textBox2";
- this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.textBox2.Size = new System.Drawing.Size(276, 82);
- this.textBox2.TabIndex = 5;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.label2.Location = new System.Drawing.Point(12, 69);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(127, 13);
- this.label2.TabIndex = 6;
- this.label2.Text = "Вывод компилятора";
- //
- // CompileForm
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(300, 204);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.textBox2);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.linkLabel1);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.textBox1);
- this.Controls.Add(this.label1);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "CompileForm";
- this.Text = "Компилировать";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.LinkLabel linkLabel1;
- private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.TextBox textBox2;
- private System.Windows.Forms.Label label2;
- }
-}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs
deleted file mode 100644
index 6d8f92c..0000000
--- a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.Windows.Forms;
-
-namespace WindowsFormsApplication1
-{
- public partial class CompileForm : Form
- {
- private string codeFilename = "";
- private string mingwDir = "";
- public CompileForm(string _codeFilename)
- {
- InitializeComponent();
- codeFilename = _codeFilename;
- }
-
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- if (MessageBox.Show("Для создания *.exe-файла мультфильма нужна специальная программа - компилятор.\n" +
- "Мы используем компилятор MinGW. Чтобы его скачать, нажмите OK в этом диалоге,\n" +
- "но учтите, что все нужные файлы весят ≈800МиБ!\n\n" +
- "После загрузки Вам нужно распаковать архив в удобное Вам место,\n" +
- "а затем, в этом окне, выбрать каталог mingw, который теперь лежит в \"удобном Вам месте\".",
- "Скачать MinGW", MessageBoxButtons.OKCancel, MessageBoxIcon.Information).ToString() == "OK")
- {
- Process.Start("https://is.gd/Krp8r4");
- }
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- if (folderBrowserDialog1.ShowDialog().ToString() == "OK")
- {
- mingwDir = folderBrowserDialog1.SelectedPath;
- }
- textBox1.Text = mingwDir;
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- if (mingwDir != "")
- {
- try
- {
- textBox2.Text += ("Компиляция " + codeFilename + " в " +
- Path.GetFileNameWithoutExtension(codeFilename) + ".exe с помощью " +
- mingwDir + "\\bin\\mingw32-g++.exe:" + Environment.NewLine + Environment.NewLine);
- new Thread(new ThreadStart(CompilingFunction)).Start();
- }
- catch (Exception ex)
- {
- _ = MessageBox.Show("Произошла ошибка!\n" + ex.Message);
- }
- }
- else
- {
- _ = MessageBox.Show("Сначала укажите каталог с MinGW!", "Ошибка",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
-
- private void CompilingFunction()
- {
- Process mingwp = new Process();
- mingwp.StartInfo = new ProcessStartInfo()
- {
- FileName = mingwDir + "\\bin\\mingw32-g++.exe",
- Arguments = codeFilename + " -o " + Path.GetDirectoryName(codeFilename) + "\\" +
- Path.GetFileNameWithoutExtension(codeFilename) + ".exe",
- UseShellExecute = false,
- WindowStyle = ProcessWindowStyle.Hidden,
- StandardOutputEncoding = Encoding.GetEncoding(866),
- StandardErrorEncoding = Encoding.GetEncoding(866),
- CreateNoWindow = true,
- RedirectStandardOutput = true,
- RedirectStandardError = true
- };
- mingwp.OutputDataReceived += new DataReceivedEventHandler(CompilerOutputHandler);
- mingwp.ErrorDataReceived += new DataReceivedEventHandler(CompilerOutputHandler);
- mingwp.Start();
- mingwp.BeginOutputReadLine();
- mingwp.BeginErrorReadLine();
- mingwp.WaitForExit(20000);
- textBox2.Invoke(new Action(() => { textBox2.AppendText("Готово!" + Environment.NewLine); }));
- }
-
- private void CompilerOutputHandler(object sendingProcess, DataReceivedEventArgs outputLine)
- {
- textBox2.Invoke(new Action(() => { textBox2.AppendText(outputLine.Data + Environment.NewLine); }));
- }
- }
-}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx
deleted file mode 100644
index c3f254d..0000000
--- a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
- 25
-
-
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
index fed4b5f..95271d1 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
@@ -1,5 +1,7 @@
using System;
+using System.Collections.Generic;
using System.IO;
+using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
@@ -9,81 +11,67 @@ namespace WindowsFormsApplication1
public static void CreateStruct(string filename)
{
File.WriteAllText(filename, "");
- StreamWriter sw = new StreamWriter(filename);
- sw.Write("#include \"TXLib.h\"" + Environment.NewLine);
- sw.Write( Environment.NewLine);
- sw.Write("struct Person" + Environment.NewLine);
- sw.Write("{" + Environment.NewLine);
- sw.Write(" double x;" + Environment.NewLine);
- sw.Write(" double x2;" + Environment.NewLine);
- sw.Write(" double y;" + Environment.NewLine);
- sw.Write(" double y2;" + Environment.NewLine);
- sw.Write(" double angle;" + Environment.NewLine);
- sw.Write(" double nomer_kadra;" + Environment.NewLine);
- sw.Write(" HDC texture;" + Environment.NewLine);
- sw.Write(" int MID_x;" + Environment.NewLine);
- sw.Write(" int MID_y;" + Environment.NewLine);
- sw.Write(" int rad;" + Environment.NewLine);
- sw.Write(" int skorost;" + Environment.NewLine);
- sw.Write(" int gr_dvigx;" + Environment.NewLine);
- sw.Write(" int gr_dvigy;" + Environment.NewLine);
- sw.Write(" int nach_dv;" + Environment.NewLine);
- sw.Write(" int ampl_y;" + Environment.NewLine);
- sw.Write(" int ampl_x;" + Environment.NewLine);
- sw.Write(" double BeginTime;" + Environment.NewLine);
- sw.Write(" double EndTime;" + Environment.NewLine);
- sw.Write(" double Time;" + Environment.NewLine);
- sw.Write("};" + Environment.NewLine);
- sw.Write( Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, "#include \"TXLib.h\"" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, "struct Person" + Environment.NewLine);
+ File.AppendAllText(filename, "{" + Environment.NewLine);
+ File.AppendAllText(filename, " double x;" + Environment.NewLine);
+ File.AppendAllText(filename, " double x2;" + Environment.NewLine);
+ File.AppendAllText(filename, " double y;" + Environment.NewLine);
+ File.AppendAllText(filename, " double y2;" + Environment.NewLine);
+ File.AppendAllText(filename, " double angle;" + Environment.NewLine);
+ File.AppendAllText(filename, " double nomer_kadra;" + Environment.NewLine);
+ File.AppendAllText(filename, " HDC texture;" + Environment.NewLine);
+ File.AppendAllText(filename, " int MID_x;" + Environment.NewLine);
+ File.AppendAllText(filename, " int MID_y;" + Environment.NewLine);
+ File.AppendAllText(filename, " int rad;" + Environment.NewLine);
+ File.AppendAllText(filename, " int skorost;" + Environment.NewLine);
+ File.AppendAllText(filename, " int gr_dvigx;" + Environment.NewLine);
+ File.AppendAllText(filename, " int gr_dvigy;" + Environment.NewLine);
+ File.AppendAllText(filename, " int nach_dv;" + Environment.NewLine);
+ File.AppendAllText(filename, " int ampl_y;" + Environment.NewLine);
+ File.AppendAllText(filename, " int ampl_x;" + Environment.NewLine);
+ File.AppendAllText(filename, " double BeginTime;" + Environment.NewLine);
+ File.AppendAllText(filename, " double EndTime;" + Environment.NewLine);
+ File.AppendAllText(filename, " double Time;" + Environment.NewLine);
+ File.AppendAllText(filename, "};" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
}
- public static void OpenMain(string filename, PictureBox PictureBoxBackground, String addressBackground)
+ public static void OpenMain(string filename, PictureBox PictureBoxBackground, String adressBackground)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write("int main()" + Environment.NewLine);
- sw.Write("{" + Environment.NewLine);
- sw.Write(" txCreateWindow(" +
+ File.AppendAllText(filename, "int main()" + Environment.NewLine);
+ File.AppendAllText(filename, "{" + Environment.NewLine);
+ File.AppendAllText(filename, " txCreateWindow(" +
PictureBoxBackground.Image.Width.ToString() + ", " +
PictureBoxBackground.Image.Height.ToString() + ");" + Environment.NewLine);
- sw.Write(" double myTime = 0;" + Environment.NewLine);
- sw.Write(" HDC texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(addressBackground) + "\");" +
- Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, " double myTime = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " HDC texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(adressBackground) + "\");" + Environment.NewLine);
}
public static void CloseWhile(string filename)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(Environment.NewLine);
- sw.Write(" myTime += 0.05;" + Environment.NewLine);
- sw.Write(" txSleep(50);" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " myTime += 0.05;" + Environment.NewLine);
+ File.AppendAllText(filename, " txSleep(50);" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
}
public static void OpenWhile(string filename, int maxTime)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(Environment.NewLine);
- sw.Write(" while (myTime <= " + maxTime + ")" + Environment.NewLine);
- sw.Write(" {" + Environment.NewLine);
- sw.Write(" txSetColor(TX_RED);" + Environment.NewLine);
- sw.Write(" txSetFillColor(TX_RED);" + Environment.NewLine);
- sw.Write(" txBitBlt(txDC(), 0, 0, txGetExtentX(), txGetExtentY(), texture, 0, 0);" +
- Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " while (myTime <= " + maxTime + ")" + Environment.NewLine);
+ File.AppendAllText(filename, " {" + Environment.NewLine);
+ File.AppendAllText(filename, " txSetColor(TX_RED);" + Environment.NewLine);
+ File.AppendAllText(filename, " txSetFillColor(TX_RED);" + Environment.NewLine);
+ File.AppendAllText(filename, " txBitBlt(txDC(), 0, 0, txGetExtentX(), txGetExtentY(), texture, 0, 0);" + Environment.NewLine);
}
- public static void Ending(string filename, bool autoexit = false)
+ public static void Ending(string filename)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(" txDeleteDC(texture);" + Environment.NewLine);
- if (autoexit)
- sw.Write(" txDisableAutoPause();");
- sw.Write(" return 0;" + Environment.NewLine);
- sw.Write("}" + Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, " txDeleteDC(texture);" + Environment.NewLine);
+ File.AppendAllText(filename, " return 0;" + Environment.NewLine);
+ File.AppendAllText(filename, "}" + Environment.NewLine);
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
index 7c13710..d769c27 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
@@ -1,5 +1,9 @@
using System;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
@@ -7,45 +11,36 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(Environment.NewLine);
- sw.Write(" Person " + name + ";" + Environment.NewLine);
- sw.Write(" " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0; " + Environment.NewLine);
- sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\"); " +
- Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
}
public static void MovePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" +
- Environment.NewLine);
- sw.Write(" " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" +
- p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- sw.Write(" " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" +
- p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
p.width + "/" + p.sprite + ", " +
p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" +
- Environment.NewLine);
- sw.Write(" {" + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
+ File.AppendAllText(filename, " {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
+ File.AppendAllText(filename, Environment.NewLine);
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
index af2c112..ed3620b 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
@@ -33,8 +33,6 @@ namespace WindowsFormsApplication1
this.LabelName = new System.Windows.Forms.Label();
this.nazvanieTextBox = new System.Windows.Forms.TextBox();
this.leftPanel = new System.Windows.Forms.Panel();
- this.button1 = new System.Windows.Forms.Button();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
this.Char_Stats = new System.Windows.Forms.Label();
this.Char_Info = new System.Windows.Forms.Label();
this.PictureBoxBackground = new System.Windows.Forms.PictureBox();
@@ -44,13 +42,13 @@ namespace WindowsFormsApplication1
this.rightPanel = new System.Windows.Forms.Panel();
this.SaveCharButton = new System.Windows.Forms.Button();
this.personPanel = new System.Windows.Forms.Panel();
- this.SpriteNumberTextBox = new System.Windows.Forms.NumericUpDown();
this.charNameBox = new System.Windows.Forms.TextBox();
this.circlesTextBox = new System.Windows.Forms.TextBox();
this.circlesLabel = new System.Windows.Forms.Label();
this.charNameLabel = new System.Windows.Forms.Label();
this.openSpace = new System.Windows.Forms.PictureBox();
this.SpriteNumberLabel = new System.Windows.Forms.Label();
+ this.SpriteNumberTextBox = new System.Windows.Forms.TextBox();
this.OpenButton = new System.Windows.Forms.Button();
this.LabelPic = new System.Windows.Forms.Label();
this.LabelTime = new System.Windows.Forms.Label();
@@ -71,7 +69,6 @@ namespace WindowsFormsApplication1
((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).BeginInit();
this.rightPanel.SuspendLayout();
this.personPanel.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.SpriteNumberTextBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).BeginInit();
this.SuspendLayout();
//
@@ -79,41 +76,43 @@ namespace WindowsFormsApplication1
//
this.LabelData.AutoSize = true;
this.LabelData.Font = new System.Drawing.Font("Arial Black", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.LabelData.Location = new System.Drawing.Point(3, 3);
+ this.LabelData.Location = new System.Drawing.Point(0, 11);
+ this.LabelData.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelData.Name = "LabelData";
- this.LabelData.Size = new System.Drawing.Size(234, 23);
+ this.LabelData.Size = new System.Drawing.Size(290, 28);
this.LabelData.TabIndex = 0;
this.LabelData.Text = "Данные о мультфильме:";
//
// LabelLengh
//
this.LabelLengh.AutoSize = true;
- this.LabelLengh.Location = new System.Drawing.Point(4, 32);
+ this.LabelLengh.Location = new System.Drawing.Point(19, 74);
+ this.LabelLengh.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelLengh.Name = "LabelLengh";
- this.LabelLengh.Size = new System.Drawing.Size(130, 13);
+ this.LabelLengh.Size = new System.Drawing.Size(167, 17);
this.LabelLengh.TabIndex = 1;
this.LabelLengh.Text = "Длительность: 0 секунд";
//
// LabelName
//
this.LabelName.AutoSize = true;
- this.LabelName.Location = new System.Drawing.Point(4, 58);
+ this.LabelName.Location = new System.Drawing.Point(19, 106);
+ this.LabelName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelName.Name = "LabelName";
- this.LabelName.Size = new System.Drawing.Size(60, 13);
+ this.LabelName.Size = new System.Drawing.Size(76, 17);
this.LabelName.TabIndex = 2;
this.LabelName.Text = "Название:";
//
// nazvanieTextBox
//
- this.nazvanieTextBox.Location = new System.Drawing.Point(86, 55);
+ this.nazvanieTextBox.Location = new System.Drawing.Point(107, 106);
+ this.nazvanieTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.nazvanieTextBox.Name = "nazvanieTextBox";
- this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20);
+ this.nazvanieTextBox.Size = new System.Drawing.Size(183, 22);
this.nazvanieTextBox.TabIndex = 3;
//
// leftPanel
//
- this.leftPanel.Controls.Add(this.button1);
- this.leftPanel.Controls.Add(this.checkBox1);
this.leftPanel.Controls.Add(this.Char_Stats);
this.leftPanel.Controls.Add(this.Char_Info);
this.leftPanel.Controls.Add(this.PictureBoxBackground);
@@ -125,56 +124,38 @@ namespace WindowsFormsApplication1
this.leftPanel.Controls.Add(this.LabelName);
this.leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
this.leftPanel.Location = new System.Drawing.Point(0, 0);
+ this.leftPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.leftPanel.Name = "leftPanel";
- this.leftPanel.Size = new System.Drawing.Size(297, 380);
+ this.leftPanel.Size = new System.Drawing.Size(396, 468);
this.leftPanel.TabIndex = 4;
//
- // button1
- //
- this.button1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.button1.Location = new System.Drawing.Point(0, 350);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(297, 30);
- this.button1.TabIndex = 26;
- this.button1.Text = "Компилировать";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(7, 193);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(245, 17);
- this.checkBox1.TabIndex = 25;
- this.checkBox1.Text = "Автозакрытие мультфильма по окончанию";
- this.checkBox1.UseVisualStyleBackColor = true;
- //
// Char_Stats
//
this.Char_Stats.AutoSize = true;
- this.Char_Stats.Location = new System.Drawing.Point(12, 240);
+ this.Char_Stats.Location = new System.Drawing.Point(19, 337);
+ this.Char_Stats.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Char_Stats.Name = "Char_Stats";
- this.Char_Stats.Size = new System.Drawing.Size(259, 13);
+ this.Char_Stats.Size = new System.Drawing.Size(344, 17);
this.Char_Stats.TabIndex = 24;
this.Char_Stats.Text = "number name state view delete";
//
// Char_Info
//
this.Char_Info.AutoSize = true;
- this.Char_Info.Location = new System.Drawing.Point(44, 226);
+ this.Char_Info.Location = new System.Drawing.Point(59, 286);
+ this.Char_Info.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Char_Info.Name = "Char_Info";
- this.Char_Info.Size = new System.Drawing.Size(180, 13);
+ this.Char_Info.Size = new System.Drawing.Size(229, 17);
this.Char_Info.TabIndex = 23;
this.Char_Info.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ";
this.Char_Info.Click += new System.EventHandler(this.Char_Info_Click);
//
// PictureBoxBackground
//
- this.PictureBoxBackground.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.PictureBoxBackground.Location = new System.Drawing.Point(84, 111);
+ this.PictureBoxBackground.Location = new System.Drawing.Point(21, 194);
+ this.PictureBoxBackground.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.PictureBoxBackground.Name = "PictureBoxBackground";
- this.PictureBoxBackground.Size = new System.Drawing.Size(117, 72);
+ this.PictureBoxBackground.Size = new System.Drawing.Size(156, 89);
this.PictureBoxBackground.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PictureBoxBackground.TabIndex = 12;
this.PictureBoxBackground.TabStop = false;
@@ -182,17 +163,19 @@ namespace WindowsFormsApplication1
// LabelBackground
//
this.LabelBackground.AutoSize = true;
- this.LabelBackground.Location = new System.Drawing.Point(4, 87);
+ this.LabelBackground.Location = new System.Drawing.Point(19, 140);
+ this.LabelBackground.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelBackground.Name = "LabelBackground";
- this.LabelBackground.Size = new System.Drawing.Size(77, 13);
+ this.LabelBackground.Size = new System.Drawing.Size(100, 17);
this.LabelBackground.TabIndex = 11;
this.LabelBackground.Text = "Выбрать фон:";
//
// dobavitFonButton
//
- this.dobavitFonButton.Location = new System.Drawing.Point(85, 81);
+ this.dobavitFonButton.Location = new System.Drawing.Point(23, 160);
+ this.dobavitFonButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.dobavitFonButton.Name = "dobavitFonButton";
- this.dobavitFonButton.Size = new System.Drawing.Size(116, 24);
+ this.dobavitFonButton.Size = new System.Drawing.Size(155, 30);
this.dobavitFonButton.TabIndex = 10;
this.dobavitFonButton.Text = "Добавить";
this.dobavitFonButton.UseVisualStyleBackColor = true;
@@ -200,9 +183,10 @@ namespace WindowsFormsApplication1
//
// splitter1
//
- this.splitter1.Location = new System.Drawing.Point(297, 0);
+ this.splitter1.Location = new System.Drawing.Point(396, 0);
+ this.splitter1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.splitter1.Name = "splitter1";
- this.splitter1.Size = new System.Drawing.Size(3, 380);
+ this.splitter1.Size = new System.Drawing.Size(4, 468);
this.splitter1.TabIndex = 5;
this.splitter1.TabStop = false;
//
@@ -213,17 +197,19 @@ namespace WindowsFormsApplication1
this.rightPanel.Controls.Add(this.SaveMultButton);
this.rightPanel.Controls.Add(this.ButtonAddChar);
this.rightPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.rightPanel.Location = new System.Drawing.Point(300, 0);
+ this.rightPanel.Location = new System.Drawing.Point(400, 0);
+ this.rightPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.rightPanel.Name = "rightPanel";
- this.rightPanel.Size = new System.Drawing.Size(377, 380);
+ this.rightPanel.Size = new System.Drawing.Size(503, 468);
this.rightPanel.TabIndex = 6;
//
// SaveCharButton
//
this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.SaveCharButton.Location = new System.Drawing.Point(0, 320);
+ this.SaveCharButton.Location = new System.Drawing.Point(0, 394);
+ this.SaveCharButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.SaveCharButton.Name = "SaveCharButton";
- this.SaveCharButton.Size = new System.Drawing.Size(377, 30);
+ this.SaveCharButton.Size = new System.Drawing.Size(503, 37);
this.SaveCharButton.TabIndex = 3;
this.SaveCharButton.Text = "Сохранить персонажа";
this.SaveCharButton.UseVisualStyleBackColor = true;
@@ -231,13 +217,13 @@ namespace WindowsFormsApplication1
//
// personPanel
//
- this.personPanel.Controls.Add(this.SpriteNumberTextBox);
this.personPanel.Controls.Add(this.charNameBox);
this.personPanel.Controls.Add(this.circlesTextBox);
this.personPanel.Controls.Add(this.circlesLabel);
this.personPanel.Controls.Add(this.charNameLabel);
this.personPanel.Controls.Add(this.openSpace);
this.personPanel.Controls.Add(this.SpriteNumberLabel);
+ this.personPanel.Controls.Add(this.SpriteNumberTextBox);
this.personPanel.Controls.Add(this.OpenButton);
this.personPanel.Controls.Add(this.LabelPic);
this.personPanel.Controls.Add(this.LabelTime);
@@ -251,62 +237,55 @@ namespace WindowsFormsApplication1
this.personPanel.Controls.Add(this.ComboBoxMove);
this.personPanel.Controls.Add(this.LabelMoveType);
this.personPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.personPanel.Location = new System.Drawing.Point(0, 26);
+ this.personPanel.Location = new System.Drawing.Point(0, 32);
+ this.personPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.personPanel.Name = "personPanel";
- this.personPanel.Size = new System.Drawing.Size(377, 324);
+ this.personPanel.Size = new System.Drawing.Size(503, 399);
this.personPanel.TabIndex = 2;
this.personPanel.Visible = false;
//
- // SpriteNumberTextBox
- //
- this.SpriteNumberTextBox.Location = new System.Drawing.Point(128, 136);
- this.SpriteNumberTextBox.Name = "SpriteNumberTextBox";
- this.SpriteNumberTextBox.Size = new System.Drawing.Size(43, 20);
- this.SpriteNumberTextBox.TabIndex = 22;
- this.SpriteNumberTextBox.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- //
// charNameBox
//
- this.charNameBox.Location = new System.Drawing.Point(115, 84);
+ this.charNameBox.Location = new System.Drawing.Point(113, 108);
+ this.charNameBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.charNameBox.Name = "charNameBox";
- this.charNameBox.Size = new System.Drawing.Size(138, 20);
+ this.charNameBox.Size = new System.Drawing.Size(183, 22);
this.charNameBox.TabIndex = 19;
//
// circlesTextBox
//
- this.circlesTextBox.Location = new System.Drawing.Point(115, 110);
+ this.circlesTextBox.Location = new System.Drawing.Point(113, 140);
+ this.circlesTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.circlesTextBox.Name = "circlesTextBox";
- this.circlesTextBox.Size = new System.Drawing.Size(138, 20);
+ this.circlesTextBox.Size = new System.Drawing.Size(183, 22);
this.circlesTextBox.TabIndex = 21;
//
// circlesLabel
//
this.circlesLabel.AutoSize = true;
- this.circlesLabel.Location = new System.Drawing.Point(3, 113);
+ this.circlesLabel.Location = new System.Drawing.Point(5, 140);
+ this.circlesLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.circlesLabel.Name = "circlesLabel";
- this.circlesLabel.Size = new System.Drawing.Size(81, 13);
+ this.circlesLabel.Size = new System.Drawing.Size(103, 17);
this.circlesLabel.TabIndex = 20;
this.circlesLabel.Text = "Кол-во кругов:";
//
// charNameLabel
//
this.charNameLabel.AutoSize = true;
- this.charNameLabel.Location = new System.Drawing.Point(3, 87);
+ this.charNameLabel.Location = new System.Drawing.Point(25, 108);
+ this.charNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.charNameLabel.Name = "charNameLabel";
- this.charNameLabel.Size = new System.Drawing.Size(60, 13);
+ this.charNameLabel.Size = new System.Drawing.Size(76, 17);
this.charNameLabel.TabIndex = 18;
this.charNameLabel.Text = "Название:";
//
// openSpace
//
- this.openSpace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.openSpace.Location = new System.Drawing.Point(72, 203);
+ this.openSpace.Location = new System.Drawing.Point(247, 238);
+ this.openSpace.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.openSpace.Name = "openSpace";
- this.openSpace.Size = new System.Drawing.Size(192, 72);
+ this.openSpace.Size = new System.Drawing.Size(248, 89);
this.openSpace.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.openSpace.TabIndex = 17;
this.openSpace.TabStop = false;
@@ -314,17 +293,27 @@ namespace WindowsFormsApplication1
// SpriteNumberLabel
//
this.SpriteNumberLabel.AutoSize = true;
- this.SpriteNumberLabel.Location = new System.Drawing.Point(3, 139);
+ this.SpriteNumberLabel.Location = new System.Drawing.Point(5, 193);
+ this.SpriteNumberLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.SpriteNumberLabel.Name = "SpriteNumberLabel";
- this.SpriteNumberLabel.Size = new System.Drawing.Size(119, 13);
+ this.SpriteNumberLabel.Size = new System.Drawing.Size(155, 17);
this.SpriteNumberLabel.TabIndex = 16;
this.SpriteNumberLabel.Text = "Количество спрайтов:";
//
+ // SpriteNumberTextBox
+ //
+ this.SpriteNumberTextBox.Location = new System.Drawing.Point(9, 213);
+ this.SpriteNumberTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.SpriteNumberTextBox.Name = "SpriteNumberTextBox";
+ this.SpriteNumberTextBox.Size = new System.Drawing.Size(109, 22);
+ this.SpriteNumberTextBox.TabIndex = 15;
+ //
// OpenButton
//
- this.OpenButton.Location = new System.Drawing.Point(72, 167);
+ this.OpenButton.Location = new System.Drawing.Point(247, 193);
+ this.OpenButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.OpenButton.Name = "OpenButton";
- this.OpenButton.Size = new System.Drawing.Size(192, 30);
+ this.OpenButton.Size = new System.Drawing.Size(256, 37);
this.OpenButton.TabIndex = 14;
this.OpenButton.Text = "Открыть персонажа";
this.OpenButton.UseVisualStyleBackColor = true;
@@ -333,108 +322,120 @@ namespace WindowsFormsApplication1
// LabelPic
//
this.LabelPic.AutoSize = true;
- this.LabelPic.Location = new System.Drawing.Point(3, 174);
+ this.LabelPic.Location = new System.Drawing.Point(168, 193);
+ this.LabelPic.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelPic.Name = "LabelPic";
- this.LabelPic.Size = new System.Drawing.Size(58, 13);
+ this.LabelPic.Size = new System.Drawing.Size(75, 17);
this.LabelPic.TabIndex = 12;
this.LabelPic.Text = "Картинка:";
//
// LabelTime
//
this.LabelTime.AutoSize = true;
- this.LabelTime.Location = new System.Drawing.Point(3, 61);
+ this.LabelTime.Location = new System.Drawing.Point(25, 79);
+ this.LabelTime.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelTime.Name = "LabelTime";
- this.LabelTime.Size = new System.Drawing.Size(54, 13);
+ this.LabelTime.Size = new System.Drawing.Size(67, 17);
this.LabelTime.TabIndex = 11;
this.LabelTime.Text = "Тайминг:";
//
// LabelDef2
//
this.LabelDef2.AutoSize = true;
- this.LabelDef2.Location = new System.Drawing.Point(223, 61);
+ this.LabelDef2.Location = new System.Drawing.Point(320, 79);
+ this.LabelDef2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelDef2.Name = "LabelDef2";
- this.LabelDef2.Size = new System.Drawing.Size(13, 13);
+ this.LabelDef2.Size = new System.Drawing.Size(18, 17);
this.LabelDef2.TabIndex = 10;
this.LabelDef2.Text = "--";
//
// LabelDef1
//
this.LabelDef1.AutoSize = true;
- this.LabelDef1.Location = new System.Drawing.Point(223, 36);
+ this.LabelDef1.Location = new System.Drawing.Point(320, 43);
+ this.LabelDef1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelDef1.Name = "LabelDef1";
- this.LabelDef1.Size = new System.Drawing.Size(13, 13);
+ this.LabelDef1.Size = new System.Drawing.Size(18, 17);
this.LabelDef1.TabIndex = 9;
this.LabelDef1.Text = "--";
//
// LabelWalls
//
this.LabelWalls.AutoSize = true;
- this.LabelWalls.Location = new System.Drawing.Point(3, 36);
+ this.LabelWalls.Location = new System.Drawing.Point(25, 43);
+ this.LabelWalls.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelWalls.Name = "LabelWalls";
- this.LabelWalls.Size = new System.Drawing.Size(107, 13);
+ this.LabelWalls.Size = new System.Drawing.Size(138, 17);
this.LabelWalls.TabIndex = 8;
this.LabelWalls.Text = "Границы движения:";
//
// TextBoxTime1
//
- this.TextBoxTime1.Location = new System.Drawing.Point(116, 59);
+ this.TextBoxTime1.Location = new System.Drawing.Point(176, 75);
+ this.TextBoxTime1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TextBoxTime1.Name = "TextBoxTime1";
- this.TextBoxTime1.Size = new System.Drawing.Size(100, 20);
+ this.TextBoxTime1.Size = new System.Drawing.Size(132, 22);
this.TextBoxTime1.TabIndex = 5;
//
// TextBoxTime2
//
- this.TextBoxTime2.Location = new System.Drawing.Point(243, 59);
+ this.TextBoxTime2.Location = new System.Drawing.Point(345, 75);
+ this.TextBoxTime2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TextBoxTime2.Name = "TextBoxTime2";
- this.TextBoxTime2.Size = new System.Drawing.Size(100, 20);
+ this.TextBoxTime2.Size = new System.Drawing.Size(132, 22);
this.TextBoxTime2.TabIndex = 4;
//
// TextBoxWall2
//
- this.TextBoxWall2.Location = new System.Drawing.Point(243, 33);
+ this.TextBoxWall2.Location = new System.Drawing.Point(345, 39);
+ this.TextBoxWall2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TextBoxWall2.Name = "TextBoxWall2";
- this.TextBoxWall2.Size = new System.Drawing.Size(100, 20);
+ this.TextBoxWall2.Size = new System.Drawing.Size(132, 22);
this.TextBoxWall2.TabIndex = 3;
this.TextBoxWall2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
//
// TextBoxWall1
//
- this.TextBoxWall1.Location = new System.Drawing.Point(116, 33);
+ this.TextBoxWall1.Location = new System.Drawing.Point(176, 39);
+ this.TextBoxWall1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TextBoxWall1.Name = "TextBoxWall1";
- this.TextBoxWall1.Size = new System.Drawing.Size(100, 20);
+ this.TextBoxWall1.Size = new System.Drawing.Size(132, 22);
this.TextBoxWall1.TabIndex = 2;
this.TextBoxWall1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
//
// ComboBoxMove
//
- this.ComboBoxMove.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ComboBoxMove.FormattingEnabled = true;
this.ComboBoxMove.Items.AddRange(new object[] {
"Прямо",
"Диагонально",
"Волнами",
"Кругами"});
- this.ComboBoxMove.Location = new System.Drawing.Point(115, 3);
+ this.ComboBoxMove.Location = new System.Drawing.Point(148, 4);
+ this.ComboBoxMove.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ComboBoxMove.Name = "ComboBoxMove";
- this.ComboBoxMove.Size = new System.Drawing.Size(121, 21);
+ this.ComboBoxMove.Size = new System.Drawing.Size(160, 24);
this.ComboBoxMove.TabIndex = 1;
+ this.ComboBoxMove.Text = "Прямо";
this.ComboBoxMove.SelectedIndexChanged += new System.EventHandler(this.ComboBoxMove_SelectedIndexChanged);
//
// LabelMoveType
//
this.LabelMoveType.AutoSize = true;
- this.LabelMoveType.Location = new System.Drawing.Point(3, 6);
+ this.LabelMoveType.Location = new System.Drawing.Point(31, 4);
+ this.LabelMoveType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LabelMoveType.Name = "LabelMoveType";
- this.LabelMoveType.Size = new System.Drawing.Size(82, 13);
+ this.LabelMoveType.Size = new System.Drawing.Size(105, 17);
this.LabelMoveType.TabIndex = 0;
this.LabelMoveType.Text = "Вид движения:";
//
// SaveMultButton
//
this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.SaveMultButton.Location = new System.Drawing.Point(0, 350);
+ this.SaveMultButton.Location = new System.Drawing.Point(0, 431);
+ this.SaveMultButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.SaveMultButton.Name = "SaveMultButton";
- this.SaveMultButton.Size = new System.Drawing.Size(377, 30);
+ this.SaveMultButton.Size = new System.Drawing.Size(503, 37);
this.SaveMultButton.TabIndex = 1;
this.SaveMultButton.Text = "Сохранить мульт";
this.SaveMultButton.UseVisualStyleBackColor = true;
@@ -444,8 +445,9 @@ namespace WindowsFormsApplication1
//
this.ButtonAddChar.Dock = System.Windows.Forms.DockStyle.Top;
this.ButtonAddChar.Location = new System.Drawing.Point(0, 0);
+ this.ButtonAddChar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ButtonAddChar.Name = "ButtonAddChar";
- this.ButtonAddChar.Size = new System.Drawing.Size(377, 26);
+ this.ButtonAddChar.Size = new System.Drawing.Size(503, 32);
this.ButtonAddChar.TabIndex = 0;
this.ButtonAddChar.Text = "Добавить персонажа";
this.ButtonAddChar.UseVisualStyleBackColor = true;
@@ -457,12 +459,13 @@ namespace WindowsFormsApplication1
//
// MainForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(677, 380);
+ this.ClientSize = new System.Drawing.Size(903, 468);
this.Controls.Add(this.rightPanel);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.leftPanel);
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "MainForm";
this.RightToLeftLayout = true;
this.Text = "Свойства персонажа";
@@ -473,7 +476,6 @@ namespace WindowsFormsApplication1
this.rightPanel.ResumeLayout(false);
this.personPanel.ResumeLayout(false);
this.personPanel.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.SpriteNumberTextBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).EndInit();
this.ResumeLayout(false);
@@ -507,6 +509,7 @@ namespace WindowsFormsApplication1
private System.Windows.Forms.Button OpenButton;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Label SpriteNumberLabel;
+ private System.Windows.Forms.TextBox SpriteNumberTextBox;
private System.Windows.Forms.Label LabelBackground;
private System.Windows.Forms.Button dobavitFonButton;
private System.Windows.Forms.PictureBox PictureBoxBackground;
@@ -517,8 +520,5 @@ namespace WindowsFormsApplication1
private System.Windows.Forms.Label charNameLabel;
private System.Windows.Forms.TextBox circlesTextBox;
private System.Windows.Forms.Label circlesLabel;
- private System.Windows.Forms.NumericUpDown SpriteNumberTextBox;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.CheckBox checkBox1;
}
}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
index 9039333..da5184d 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
@@ -1,27 +1,31 @@
using System;
-using System.IO;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
using System.Drawing;
+using System.IO;
+using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class MainForm : Form
{
- Person[] persons = new Person[8];
- int yPersa = 263;
+ Person[] persons = new Person[200];
+
+ int yPersa = 300;
int nomerPersa = 0;
int pNomer = 0;
int maxTime = 0;
- //PictureBox[] pic1 = new PictureBox[1000];
- String addressBackground = "";
- string mainFilename = "";
+ PictureBox[] pic1 = new PictureBox[1000];
+ String adressBackground = "";
public MainForm()
{
InitializeComponent();
- ComboBoxMove.SelectedIndex = 0;
- openFileDialog1.Filter = "Bitmap Pictures|*.bmp";
- saveFileDialog1.Filter = "C++ Code Files|*.cpp";
+
+ openFileDialog1.Filter = "Kartinki|*.bmp";
+ saveFileDialog1.Filter = "cpp files|*.cpp";
}
private void buttonAddCharClick(object sender, EventArgs e)
@@ -44,21 +48,126 @@ namespace WindowsFormsApplication1
{
if (personPanel.Visible == false)
{
- MessageBox.Show("Где параметры? Покажи мне, ткни меня в них!");
+ MessageBox.Show("Где параметры? Покажи мне, ткни мне в них!");
return;
}
personPanel.Visible = true;
if (pNomer == -120)
{
- persons[nomerPersa] = AddRowToPersList(persons[nomerPersa], false);
+ persons[nomerPersa].l1 = new Label();
+ persons[nomerPersa].l1.Top = yPersa;
+ persons[nomerPersa].l1.Left = 30;
+ persons[nomerPersa].l1.Width = 20;
+ persons[nomerPersa].l1.Visible = true;
+ persons[nomerPersa].l1.Text = (nomerPersa + 1).ToString();
+ this.leftPanel.Controls.Add(persons[nomerPersa].l1);
+
+ persons[nomerPersa].l2 = new Label();
+ persons[nomerPersa].l2.Top = yPersa;
+ persons[nomerPersa].l2.Left = 60;
+ persons[nomerPersa].l2.Width = 60;
+ persons[nomerPersa].l2.Visible = true;
+ persons[nomerPersa].l2.Text = "Перс" + (nomerPersa + 1).ToString();
+ this.leftPanel.Controls.Add(persons[nomerPersa].l2);
+
+ persons[nomerPersa].l3 = new Label();
+ persons[nomerPersa].l3.Top = yPersa;
+ persons[nomerPersa].l3.Left = 120;
+ persons[nomerPersa].l3.Width = 40;
+ persons[nomerPersa].l3.Visible = true;
+ persons[nomerPersa].l3.Text = "saved";
+ this.leftPanel.Controls.Add(persons[nomerPersa].l3);
+
+ persons[nomerPersa].b1 = new Button();
+ persons[nomerPersa].b1.Top = yPersa;
+ persons[nomerPersa].b1.Left = 170;
+ persons[nomerPersa].b1.Width = 50;
+ persons[nomerPersa].b1.Visible = true;
+ persons[nomerPersa].b1.Text = "Edit";
+ persons[nomerPersa].b1.MouseClick +=
+ new MouseEventHandler(this.Char_Creator_Button_Click);
+ this.leftPanel.Controls.Add(persons[nomerPersa].b1);
+
+ ToolTip tView = new ToolTip();
+ tView.IsBalloon = true;
+ tView.InitialDelay = 0;
+ tView.ShowAlways = true;
+ tView.AutoPopDelay = 2000;
+ tView.SetToolTip(persons[nomerPersa].b1, "View/edit person");
+
+ persons[nomerPersa].b2 = new Button();
+ persons[nomerPersa].b2.Top = yPersa;
+ persons[nomerPersa].b2.Left = 230;
+ persons[nomerPersa].b2.Width = 50;
+ persons[nomerPersa].b2.Visible = true;
+ persons[nomerPersa].b2.Text = "Del";
+ persons[nomerPersa].b2.Click +=
+ new System.EventHandler(this.Char_Info_Click);
+ this.leftPanel.Controls.Add(persons[nomerPersa].b2);
+
+ ToolTip tDelete = new ToolTip();
+ tDelete.IsBalloon = true;
+ tDelete.InitialDelay = 0;
+ tDelete.ShowAlways = true;
+ tDelete.AutoPopDelay = 2000;
+ tDelete.SetToolTip(persons[nomerPersa].b2, "Delete this person");
+
+ persons[nomerPersa].coord = TextBoxWall1.Text;
+ persons[nomerPersa].coord2 = TextBoxWall2.Text;
+ persons[nomerPersa].time1 = TextBoxTime1.Text;
+ persons[nomerPersa].time2 = TextBoxTime2.Text;
+ persons[nomerPersa].sprite = SpriteNumberTextBox.Text;
+ persons[nomerPersa].moveside = ComboBoxMove.Text;
+ persons[nomerPersa].nomer = nomerPersa;
+ persons[nomerPersa].charname = charNameBox.Text;
+ persons[nomerPersa].circles = circlesTextBox.Text;
+ persons[nomerPersa].l2.Text = charNameBox.Text;
+
+ String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyNachala.Length > 1)
+ {
+ persons[nomerPersa].x1 = coordinatyNachala[0];
+ persons[nomerPersa].y1 = coordinatyNachala[1];
+ }
+
+ String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyKonza.Length > 1)
+ {
+ persons[nomerPersa].x2 = coordinatyKonza[0];
+ persons[nomerPersa].y2 = coordinatyKonza[1];
+ }
+
nomerPersa++;
- yPersa += 30;
+ yPersa = yPersa + 30;
openSpace.Image = null;
}
else
{
- persons[pNomer] = AddRowToPersList(persons[pNomer], true);
+ persons[pNomer].coord = TextBoxWall1.Text;
+ persons[pNomer].coord2 = TextBoxWall2.Text;
+ persons[pNomer].time1 = TextBoxTime1.Text;
+ persons[pNomer].time2 = TextBoxTime2.Text;
+ persons[pNomer].sprite = SpriteNumberTextBox.Text;
+ persons[pNomer].moveside = ComboBoxMove.Text;
+ persons[pNomer].nomer = pNomer;
+
+ String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyNachala.Length > 1)
+ {
+ persons[pNomer].x1 = coordinatyNachala[0];
+ persons[pNomer].y1 = coordinatyNachala[1];
+ }
+ String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyKonza.Length > 1)
+ {
+ persons[pNomer].x2 = coordinatyKonza[0];
+ persons[pNomer].y2 = coordinatyKonza[1];
+ }
+
+ persons[pNomer].charname = charNameBox.Text;
+ persons[pNomer].circles = circlesTextBox.Text;
+ persons[pNomer].l2.Text = charNameBox.Text;
}
for (int nomer = 0; nomer < nomerPersa; nomer++)
@@ -72,97 +181,6 @@ namespace WindowsFormsApplication1
LabelLengh.Text = "Длительность: " + maxTime.ToString() + " секунд";
}
- private Person AddRowToPersList(Person p, bool use_pnumber = false)
- {
- if (!use_pnumber)
- {
- p.l1 = new Label();
- p.l1.Top = yPersa;
- p.l1.Left = 30;
- p.l1.Width = 20;
- p.l1.Visible = true;
- p.l1.Text = (nomerPersa + 1).ToString();
- leftPanel.Controls.Add(p.l1);
-
- p.l2 = new Label();
- p.l2.Top = yPersa;
- p.l2.Left = 60;
- p.l2.Width = 60;
- p.l2.Visible = true;
- p.l2.Text = "Перс" + (nomerPersa + 1).ToString();
- leftPanel.Controls.Add(p.l2);
-
- p.l3 = new Label();
- p.l3.Top = yPersa;
- p.l3.Left = 120;
- p.l3.Width = 40;
- p.l3.Visible = true;
- p.l3.Text = "saved";
- leftPanel.Controls.Add(p.l3);
-
- p.b1 = new Button();
- p.b1.Top = yPersa;
- p.b1.Left = 170;
- p.b1.Width = 50;
- p.b1.Visible = true;
- p.b1.Text = "Edit";
- p.b1.MouseClick +=
- new MouseEventHandler(Char_Creator_Button_Click);
- leftPanel.Controls.Add(p.b1);
-
- ToolTip tView = new ToolTip();
- tView.IsBalloon = true;
- tView.InitialDelay = 0;
- tView.ShowAlways = true;
- tView.AutoPopDelay = 2000;
- tView.SetToolTip(p.b1, "View/edit person");
-
- p.b2 = new Button();
- p.b2.Top = yPersa;
- p.b2.Left = 230;
- p.b2.Width = 50;
- p.b2.Visible = true;
- p.b2.Text = "Del";
- p.b2.Click +=
- new EventHandler(Char_Info_Click);
- leftPanel.Controls.Add(p.b2);
-
- ToolTip tDelete = new ToolTip();
- tDelete.IsBalloon = true;
- tDelete.InitialDelay = 0;
- tDelete.ShowAlways = true;
- tDelete.AutoPopDelay = 2000;
- tDelete.SetToolTip(p.b2, "Delete this person");
- }
-
- p.coord = TextBoxWall1.Text;
- p.coord2 = TextBoxWall2.Text;
- p.time1 = TextBoxTime1.Text;
- p.time2 = TextBoxTime2.Text;
- p.sprite = SpriteNumberTextBox.Text;
- p.moveside = ComboBoxMove.Text;
- p.nomer = (use_pnumber) ? pNomer : nomerPersa;
- p.charname = charNameBox.Text;
- p.circles = circlesTextBox.Text;
- p.l2.Text = charNameBox.Text;
-
- String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyNachala.Length > 1)
- {
- p.x1 = coordinatyNachala[0];
- p.y1 = coordinatyNachala[1];
- }
-
- String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyKonza.Length > 1)
- {
- p.x2 = coordinatyKonza[0];
- p.y2 = coordinatyKonza[1];
- }
-
- return p;
- }
-
private void OpenAddCharClick(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
@@ -170,13 +188,13 @@ namespace WindowsFormsApplication1
openSpace.Image = Image.FromFile(openFileDialog1.FileName);
if (pNomer == -120)
{
- persons[nomerPersa].address = openFileDialog1.FileName;
+ persons[nomerPersa].adress = openFileDialog1.FileName;
persons[nomerPersa].width = openSpace.Image.Width.ToString();
persons[nomerPersa].height = openSpace.Image.Height.ToString();
}
else
{
- persons[pNomer].address = openFileDialog1.FileName;
+ persons[pNomer].adress = openFileDialog1.FileName;
persons[pNomer].width = openSpace.Image.Width.ToString();
persons[pNomer].height = openSpace.Image.Height.ToString();
}
@@ -187,20 +205,20 @@ namespace WindowsFormsApplication1
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
return;
PictureBoxBackground.Image = Image.FromFile(openFileDialog1.FileName);
- addressBackground = openFileDialog1.FileName;
+ adressBackground = openFileDialog1.FileName;
}
private void SaveMultButton_Click(object sender, EventArgs e)
{
if (PictureBoxBackground.Image == null)
{
- MessageBox.Show("Что ты собрался выводить-то, поехавший (фон)?");
+ MessageBox.Show("Что ты собрался выводить то, поехавший (фон)?");
return;
}
for (int nomer = 0; nomer < nomerPersa; nomer++)
{
- if (String.IsNullOrEmpty(persons[nomer].address))
+ if (String.IsNullOrEmpty(persons[nomer].adress))
{
MessageBox.Show("Картинка №" + (nomer + 1).ToString() + " пустая");
return;
@@ -239,86 +257,78 @@ namespace WindowsFormsApplication1
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
- try
+ string filename = saveFileDialog1.FileName;
+
+ //Add TXLib and pics
+ File.Copy(Path.Combine(Application.StartupPath, "TXLib.h"), filename.Replace(Path.GetFileName(filename), "TXLib.h"), true);
+ string adres_papki = filename.Replace(Path.GetFileName(filename), "Pictures");
+ if (!Directory.Exists(adres_papki))
{
- mainFilename = saveFileDialog1.FileName;
-
- //Adding TXLibrary and pictures
- File.WriteAllText(Path.GetDirectoryName(mainFilename) + "\\TXLib.h", Properties.Resources.TXLib);
- string dir_path = Path.GetDirectoryName(mainFilename) + "\\Pictures";
- if (!Directory.Exists(dir_path))
- {
- Directory.CreateDirectory(dir_path);
- }
-
- if (addressBackground != dir_path + "\\" + Path.GetFileName(addressBackground))
- {
- File.Copy(addressBackground, dir_path + "\\" + Path.GetFileName(addressBackground), true);
- }
-
- Files.CreateStruct(mainFilename);
- Files.OpenMain(mainFilename, PictureBoxBackground, addressBackground);
-
- for (int nomer = 0; nomer < nomerPersa; nomer++)
- {
- File.Copy(persons[nomer].address, dir_path + "\\" + Path.GetFileName(persons[nomer].address), true);
-
- if (dir_path == dir_path + "\\" + Path.GetFileName(persons[nomer].address))
- {
- File.Copy(persons[nomer].address, dir_path + "\\" + Path.GetFileName(persons[nomer].address), true);
- }
-
- if (persons[nomer].moveside == "Прямо")
- {
- Line.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Волнами")
- {
- Sinus.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Кругами")
- {
- Circle.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Диагонально")
- {
- Line.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- }
-
- Files.OpenWhile(mainFilename, maxTime);
-
- for (int nomer = 0; nomer < nomerPersa; nomer++)
- {
- if (persons[nomer].moveside == "Прямо")
- {
- Line.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Волнами")
- {
- Sinus.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Кругами")
- {
- Circle.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Диагонально")
- {
- Line.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
- }
- }
-
- Files.CloseWhile(mainFilename);
- DeletePics(mainFilename, nomerPersa);
- Files.Ending(mainFilename, checkBox1.Checked);
-
- MessageBox.Show("Готово!");
+ Directory.CreateDirectory(adres_papki);
}
- catch (Exception ex)
+
+ if (adressBackground != adres_papki + "\\" + Path.GetFileName(adressBackground))
{
- _ = MessageBox.Show("Произошла ошибка!\n" + ex.Message, "Ошибка",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
+ File.Copy(adressBackground, adres_papki + "\\" + Path.GetFileName(adressBackground), true);
}
+
+ Files.CreateStruct(filename);
+ Files.OpenMain(filename, PictureBoxBackground, adressBackground);
+
+ for (int nomer = 0; nomer < nomerPersa; nomer++)
+ {
+ File.Copy(persons[nomer].adress, adres_papki + "\\" + Path.GetFileName(persons[nomer].adress), true);
+
+ if (adres_papki == adres_papki + "\\" + Path.GetFileName(persons[nomer].adress))
+ {
+ File.Copy(persons[nomer].adress, adres_papki + "\\" + Path.GetFileName(persons[nomer].adress), true);
+ }
+
+ if (persons[nomer].moveside == "Прямо")
+ {
+ Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Волнами")
+ {
+ Sinus.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Кругами")
+ {
+ Circle.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Диагонально")
+ {
+ Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ }
+
+ Files.OpenWhile(filename, maxTime);
+
+ for (int nomer = 0; nomer < nomerPersa; nomer++)
+ {
+ if (persons[nomer].moveside == "Прямо")
+ {
+ Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Волнами")
+ {
+ Sinus.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Кругами")
+ {
+ Circle.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Диагонально")
+ {
+ Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
+ }
+ }
+
+ Files.CloseWhile(filename);
+ DeletePics(filename, nomerPersa);
+ Files.Ending(filename);
+
+ MessageBox.Show("Successfully");
}
}
@@ -338,9 +348,9 @@ namespace WindowsFormsApplication1
charNameBox.Text = persons[nomer].charname;
circlesTextBox.Text = persons[nomer].circles;
- if (!String.IsNullOrEmpty(persons[nomer].address))
+ if (!String.IsNullOrEmpty(persons[nomer].adress))
{
- openSpace.Image = Image.FromFile(persons[nomer].address);
+ openSpace.Image = Image.FromFile(persons[nomer].adress);
}
else
{
@@ -352,13 +362,13 @@ namespace WindowsFormsApplication1
private void Char_Info_Click(object sender, EventArgs e)
{
- leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
- leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
- leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
- leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
- leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
+ this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
+ this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
+ this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
+ this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
+ this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
nomerPersa--;
- yPersa -= 30;
+ yPersa = yPersa - 30;
}
private void TextBoxWall1_KeyPress(object sender, KeyPressEventArgs e)
@@ -403,17 +413,5 @@ namespace WindowsFormsApplication1
circlesLabel.Visible = false;
}
}
-
- private void button1_Click(object sender, EventArgs e)
- {
- if (!String.IsNullOrEmpty(mainFilename))
- {
- new CompileForm(mainFilename).ShowDialog();
- }
- else
- {
- _ = MessageBox.Show("Сначала сохраните мультфильм!");
- }
- }
}
}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
index 642c454..d2d8b5c 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
@@ -124,6 +124,6 @@
153, 17
- 25
+ 39
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
index cb6612d..b646672 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
@@ -1,4 +1,8 @@
using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
@@ -14,12 +18,12 @@ namespace WindowsFormsApplication1
public int nomer;
public String coord;
public String coord2;
- // TODO: Add fields
+ //Dobavit polya
public String x1;
public String y1;
public String x2;
public String y2;
- public String address;
+ public String adress;
public String time1;
public String time2;
public String sprite;
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg b/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg
new file mode 100644
index 0000000..ae67eb7
Binary files /dev/null and b/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
index f44f974..bb5f151 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
@@ -19,7 +19,7 @@ namespace WindowsFormsApplication1.Properties {
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -59,20 +59,5 @@ namespace WindowsFormsApplication1.Properties {
resourceCulture = value;
}
}
-
- ///
- /// Ищет локализованную строку, похожую на //=================================================================================================================
- ///// [These sections are for folding control in Code::Blocks]
- /////{ [Best viewed with "Fold all on file open" option enabled] [best screen width is 115 chars]
- /////=================================================================================================================
- /////!
- /////! @file TXLib.h
- /////! @brief Библиотека Тупого Художника (The Dumb Artist Libr [остаток строки не уместился]";.
- ///
- internal static string TXLib {
- get {
- return ResourceManager.GetString("TXLib", resourceCulture);
- }
- }
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
index a688e92..ffecec8 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,7 +60,6 @@
: and then encoded with base64 encoding.
-->
-
@@ -69,10 +68,9 @@
-
+
-
@@ -87,10 +85,9 @@
-
+
-
@@ -112,13 +109,9 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- ..\TXLib.h;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251
-
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
index 0e63ea6..75061f0 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
@@ -1,5 +1,8 @@
using System;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Text;
namespace WindowsFormsApplication1
{
@@ -7,45 +10,37 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(Environment.NewLine);
- sw.Write(" Person " + name + ";" + Environment.NewLine);
- sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\"); " +
- Environment.NewLine);
- sw.Write(" " + name + ".x = " + p.x1 + ";" + Environment.NewLine);
- sw.Write(" " + name + ".y = " + p.y1 + ";" + Environment.NewLine);
- sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- sw.Write(" " + name + ".nach_dv = (" + p.y1 + "+" + p.y2 + ")/2;" + Environment.NewLine);
- sw.Write(" " + name + ".ampl_y = abs(" + p.y1 + "-" + name + ".nach_dv)/2;" + Environment.NewLine);
- sw.Write(" " + name + ".ampl_x = 10;" + Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x = " + p.x1 + ";" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y = " + p.y1 + ";" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nach_dv = (" + p.y1 + "+" + p.y2 + ")/2;" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".ampl_y = abs(" + p.y1 + "-" + name + ".nach_dv)/2;" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".ampl_x = 10;" + Environment.NewLine);
}
public static void MovePerson(string filename, string name, Person p)
{
- StreamWriter sw = new StreamWriter(filename, true);
- sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
- sw.Write(" " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" +
- p.time1 + ");" + Environment.NewLine);
- sw.Write(" " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" +
- p.time1 + ");" + Environment.NewLine);
- sw.Write(" " + name + ".y = " + name + ".nach_dv + " + name + ".ampl_y * sin(" + name +
- ".x / " + name + ".ampl_x);" + Environment.NewLine);
- sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".y = " + name + ".nach_dv + " + name + ".ampl_y * sin(" + name + ".x / " + name + ".ampl_x);" + Environment.NewLine);
+ File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
p.width + "/" + p.sprite + ", " +
p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- sw.Write(Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
- sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
- sw.Write(" {" + Environment.NewLine);
- sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Write(" }" + Environment.NewLine);
- sw.Close();
+ File.AppendAllText(filename, Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
+ File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
+ File.AppendAllText(filename, " {" + Environment.NewLine);
+ File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
+ File.AppendAllText(filename, " }" + Environment.NewLine);
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj b/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj
index c100748..455ac51 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj
@@ -49,12 +49,6 @@
-
- Form
-
-
- CompileForm.cs
-
@@ -67,9 +61,6 @@
-
- CompileForm.cs
-
MainForm.cs
@@ -94,9 +85,6 @@
True
-
-
-