last changes

This commit is contained in:
2020-06-15 22:22:46 +03:00
parent 5f405ca403
commit 259f321df4
53 changed files with 3368 additions and 842 deletions

View File

@@ -19,7 +19,8 @@ SOURCES += main.cpp \
animationmodel.cpp \
animlabel.cpp \
../aliens.cpp \
../aditem.cpp
../aditem.cpp \
wavemodel.cpp
HEADERS += mainwindow.h \
../loader.h \
alienmodel.h \
@@ -34,7 +35,8 @@ HEADERS += mainwindow.h \
animationmodel.h \
animlabel.h \
../aliens.h \
../aditem.h
../aditem.h \
wavemodel.h
FORMS += mainwindow.ui
TRANSLATIONS += adeditor_ru.ts
RESOURCES += ADeditor.qrc
@@ -42,3 +44,5 @@ OTHER_FILES += ../schema.xml \
../data2.xml

View File

@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.2.84, 2011-08-27T23:06:35. -->
<!-- Written by QtCreator 3.2.1, 2016-03-31T12:05:55. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{948faa78-0b50-402e-a285-1bca3b08de64}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
@@ -11,66 +15,32 @@
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="bool" key="AlignAssignments">false</value>
<value type="QString" key="CurrentFallback">CppGlobal</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">false</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">false</value>
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">1</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="QString" key="EditorConfiguration.CurrentFallback">Global</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.SmartBackspace">false</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.Tab.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="bool" key="AutoIndent">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="QString" key="CurrentFallback">CppGlobal</value>
<value type="int" key="IndentSize">4</value>
<value type="int" key="PaddingMode">1</value>
<value type="bool" key="SmartBackspace">false</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabKeyBehavior">0</value>
<value type="int" key="TabSize">8</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.Tab.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="bool" key="AutoIndent">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="QString" key="CurrentFallback">QmlJSGlobal</value>
<value type="int" key="IndentSize">4</value>
<value type="int" key="PaddingMode">1</value>
<value type="bool" key="SmartBackspace">false</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabKeyBehavior">0</value>
<value type="int" key="TabSize">8</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.Tab.Count">2</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
@@ -81,19 +51,24 @@
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{3c749452-9483-442d-b011-933a1b5dac10}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:D:/Qt/qtcreator-2.2.84/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.D:/Qt/qtcreator-2.2.84/pythongdb/gdb-i686-pc-mingw32.exe</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/aliendefender/build-ADeditor-DesktopBuild-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
@@ -103,9 +78,11 @@
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
@@ -117,9 +94,11 @@
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
@@ -132,18 +111,17 @@
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qt Отладка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Отладка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/Andrey/Desktop/aliendefender/ADeditor</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">7</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:D:/Qt/qtcreator-2.2.84/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.D:/Qt/qtcreator-2.2.84/pythongdb/gdb-i686-pc-mingw32.exe</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/aliendefender/build-ADeditor-DesktopBuild-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
@@ -153,9 +131,11 @@
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
@@ -167,9 +147,11 @@
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
@@ -182,13 +164,11 @@
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qt Релиз</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Выпуск</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/Andrey/Desktop/aliendefender/ADeditor</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">7</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
@@ -199,39 +179,29 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Без установки</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Project.UseGlobal">true</value>
<value type="bool" key="Analyzer.Project.UseGlobal">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">3</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
@@ -250,37 +220,22 @@
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ADeditor</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/aliendefender/ADeditor/ADeditor.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ADeditor.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory">C:/Users/Andrey/Desktop/aliendefender</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
@@ -290,11 +245,11 @@
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{6c550070-c96c-41ad-865e-c5b9b5c3b79f}</value>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">16</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">10</value>
<variable>Version</variable>
<value type="int">16</value>
</data>
</qtcreator>

View File

@@ -9,7 +9,7 @@
<valuemap type="QVariantMap">
<value key="EditorConfiguration.AutoIndent" type="bool">true</value>
<value key="EditorConfiguration.AutoSpacesForTabs" type="bool">false</value>
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
<value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value>
<value key="EditorConfiguration.DoubleIndentBlocks" type="bool">false</value>
<value key="EditorConfiguration.IndentBraces" type="bool">false</value>
<value key="EditorConfiguration.IndentSize" type="int">4</value>
@@ -19,7 +19,7 @@
<value key="EditorConfiguration.SmartBackspace" type="bool">false</value>
<value key="EditorConfiguration.SpacesForTabs" type="bool">true</value>
<value key="EditorConfiguration.TabKeyBehavior" type="int">0</value>
<value key="EditorConfiguration.TabSize" type="int">8</value>
<value key="EditorConfiguration.TabSize" type="int">4</value>
<value key="EditorConfiguration.UseGlobal" type="bool">true</value>
<value key="EditorConfiguration.Utf8BomBehavior" type="int">1</value>
<value key="EditorConfiguration.addFinalNewLine" type="bool">true</value>
@@ -34,11 +34,11 @@
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">1</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Mingw:C:/Qt/qtcreator-2.2.0/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.C:/Qt/qtcreator-2.2.0/pythongdb/gdb-i686-pc-mingw32.exe</value>
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
@@ -78,63 +78,63 @@
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">4.6.3 (2) release Отладка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Dima/Desktop/aliendefender/ADeditor-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">5</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Mingw:C:/Qt/qtcreator-2.2.0/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.C:/Qt/qtcreator-2.2.0/pythongdb/gdb-i686-pc-mingw32.exe</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Mingw:C:/Qt/qtcreator-2.2.0/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.C:/Qt/qtcreator-2.2.0/pythongdb/gdb-i686-pc-mingw32.exe</value>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<value key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary" type="bool">false</value>
<value key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QString"></value>
<value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString"></value>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString">clean</value>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Очистка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">4.6.3 (2) release Релиз</value>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt в PATH Релиз</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/Users/Dima/Desktop/aliendefender/ADeditor-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">5</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Mingw:C:/Qt/qtcreator-2.2.0/mingw/bin/gcc.exe.x86-windows-msys-pe-32bit.C:/Qt/qtcreator-2.2.0/pythongdb/gdb-i686-pc-mingw32.exe</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/andrey/aliendefender/ADeditor</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<value key="ProjectExplorer.BuildCOnfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<value key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary" type="bool">false</value>
<value key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QString"></value>
<value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString"></value>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Сборка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<value key="Qt4ProjectManager.MakeStep.MakeArguments" type="QString">clean</value>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Очистка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt в PATH Отладка</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/andrey/aliendefender/ADeditor</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="QString">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
@@ -152,6 +152,29 @@
</valuemap>
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<valuelist key="Analyzer.Valgrind.AddedSupressionFiles" type="QVariantList"/>
<value key="Analyzer.Valgrind.FilterExternalIssues" type="bool">true</value>
<value key="Analyzer.Valgrind.NumCallers" type="int">25</value>
<valuelist key="Analyzer.Valgrind.RemovedSupressionFiles" type="QVariantList"/>
<value key="Analyzer.Valgrind.TrackOrigins" type="bool">true</value>
<value key="Analyzer.Valgrind.ValgrindExecutable" type="QString">valgrind</value>
<valuelist key="Analyzer.Valgrind.VisibleErrorKinds" type="QVariantList">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">ADeditor</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
@@ -161,7 +184,7 @@
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString">/home/andrey/aliendefender</value>
<value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
<value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
<value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
@@ -175,7 +198,7 @@
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{0f364aaa-5a2f-49c5-b7a5-6b296e2f6fd0}</value>
<value type="QString">{9fe7c56a-57b2-4b67-8b16-62cd8b54e5ea}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>

View File

@@ -29,7 +29,15 @@ QVariant AlienModel::data(const QModelIndex &index, int role) const
if (role == Qt::DisplayRole)
{
return aliens.at(index.row()).name;
return aliens.at(index.row()).name;
}
return QVariant();
if (role == Qt::DecorationRole)
{
return QIcon(":/icons/icons/list-add.png");
}
if (role == Qt::ToolTipRole)
{
return tr("id=%1").arg(aliens.at(index.row()).id);
}
return QVariant();
}

View File

@@ -2,6 +2,7 @@
#define ALIENMODEL_H
#include <QAbstractListModel>
#include <QIcon>
#include "../loader.h"
class AlienModel : public QAbstractListModel

View File

@@ -6,8 +6,8 @@
#include <QSettings>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->pbSave->setIcon(QIcon::fromTheme("document-save", QIcon(":/icons/icons/document-save.png")));
@@ -24,6 +24,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->pbSlpDel->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/icons/list-remove.png")));
ui->pbAnimAdd->setIcon(QIcon::fromTheme("list-add", QIcon(":/icons/icons/list-add.png")));
ui->pbAnimDel->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/icons/list-remove.png")));
ui->pbWaveAdd->setIcon(QIcon::fromTheme("list-add", QIcon(":/icons/icons/list-add.png")));
ui->pbWaveDel->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/icons/list-remove.png")));
ui->pbImgAdd->setIcon(QIcon::fromTheme("list-add", QIcon(":/icons/icons/list-add.png")));
ui->pbImgDel->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/icons/list-remove.png")));
ui->pbTwSplashEdit->setIcon(QIcon::fromTheme("edit", QIcon(":/icons/icons/edit.png")));
@@ -31,6 +33,15 @@ MainWindow::MainWindow(QWidget *parent) :
adloader = new Loader();
adloader->load("data2.xml");
wavePartModel = new WavePartModel(adloader->waves);
waveModel = new WaveModel(adloader->waves);
// waveModel->setCurrentWave(0);
connect(waveModel,SIGNAL(needUpdateIndex()),wavePartModel,SLOT(updateIndex()));
ui->tableWaves->setModel((QAbstractItemModel * )waveModel);
ui->tableWaveParts->setModel((QAbstractItemModel * )wavePartModel);
connect(ui->tableWaves->selectionModel(),SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),wavePartModel,SLOT(setCurrentWave(QModelIndex,QModelIndex)));
connect(ui->tableWaveParts->selectionModel(),SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),this,SLOT(tbWavePartSelect(QModelIndex,QModelIndex)));
animModel = new AnimationModel(adloader->animations);
ui->lvAnimations->setModel((QAbstractItemModel * )animModel);
connect(ui->lvAnimations->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(lvAnimations_select(QModelIndex, QModelIndex)));
@@ -48,6 +59,7 @@ MainWindow::MainWindow(QWidget *parent) :
alModel = new AlienModel(adloader->aliens.values());
ui->lvAliens->setModel((QAbstractItemModel * )alModel);
ui->cbAlImage->setModel((QAbstractItemModel * )animModel);
ui->lvWaveAliens->setModel((QAbstractItemModel * )alModel);
connect(ui->lvAliens->selectionModel(),SIGNAL(currentChanged(QModelIndex, QModelIndex)),this,SLOT(lvAliens_select(QModelIndex, QModelIndex)));
ui->lvAliens->selectionModel()->setCurrentIndex(ui->lvAliens->model()->index(0,0),QItemSelectionModel::ClearAndSelect);
@@ -246,45 +258,46 @@ void MainWindow::lvSplashes_select(QModelIndex index, QModelIndex)
ui->leSplName->setText(spl.name);
ui->cbSplImage->setCurrentIndex(adloader->animations.keys().indexOf(spl.imgType));
ui->lbSplAnim->setAnimation(adloader->animations.value(spl.imgType).pathes);
ui->sbSplZValue->setValue(spl.ZValue);
switch (spl.compositionMode)
{
case QPainter::RasterOp_NotSource :
ui->cbSplCompisitionMode->setCurrentIndex(1);
break;
break;
case QPainter::CompositionMode_Plus :
ui->cbSplCompisitionMode->setCurrentIndex(2);
break;
break;
case QPainter::CompositionMode_Multiply :
ui->cbSplCompisitionMode->setCurrentIndex(3);
break;
break;
case QPainter::CompositionMode_Screen :
ui->cbSplCompisitionMode->setCurrentIndex(4);
break;
break;
case QPainter::CompositionMode_Darken :
ui->cbSplCompisitionMode->setCurrentIndex(5);
break;
break;
case QPainter::CompositionMode_Lighten :
ui->cbSplCompisitionMode->setCurrentIndex(6);
break;
break;
case QPainter::CompositionMode_ColorDodge :
ui->cbSplCompisitionMode->setCurrentIndex(7);
break;
break;
case QPainter::CompositionMode_ColorBurn :
ui->cbSplCompisitionMode->setCurrentIndex(8);
break;
break;
case QPainter::CompositionMode_HardLight :
ui->cbSplCompisitionMode->setCurrentIndex(9);
break;
break;
case QPainter::CompositionMode_SoftLight :
ui->cbSplCompisitionMode->setCurrentIndex(10);
break;
break;
case QPainter::CompositionMode_Difference :
ui->cbSplCompisitionMode->setCurrentIndex(11);
break;
break;
case QPainter::CompositionMode_SourceOver :
default:
ui->cbSplCompisitionMode->setCurrentIndex(0);
break;
break;
}
}
}
@@ -423,7 +436,7 @@ void MainWindow::on_pbReload_clicked()
twModel->refresh(adloader->towers.values());
splModel->refresh(adloader->splashes.values());
trigModel->refresh(adloader->triggers.values());
// animModel->refresh(adloader->animations.values());
// animModel->refresh(adloader->animations.values());
mapModel->refresh(adloader->maps.values());
ui->lvAnimations->reset();
ui->lvAnimations->selectionModel()->setCurrentIndex(ui->lvAnimations->model()->index(0,0),QItemSelectionModel::ClearAndSelect);
@@ -543,15 +556,18 @@ void MainWindow::on_pbAlDel_clicked()
if (adloader->aliens.size() < 2) return;
QMessageBox msgBox;
int id = adloader->aliens.keys().at(ui->lvAliens->currentIndex().row());
for (int i=0; i<adloader->waveParts.size(); i++)
for (int i=0; i<adloader->waves.size(); i++)
{
if (adloader->waveParts.values().at(i).alienId == id)
for (int j=0; j<adloader->waves[i].parts.size(); j++)
{
msgBox.setText(tr("You can not delete alien %1 id=%2").arg(adloader->aliens.value(id).name).arg(id));
msgBox.setInformativeText(tr("It used in wawe %1").arg(adloader->waveParts.values().at(i).waveId));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return;
if (adloader->waves[i].parts[j].alienId == id)
{
msgBox.setText(tr("You can not delete alien %1 id=%2").arg(adloader->aliens.value(id).name).arg(id));
msgBox.setInformativeText(tr("It used in wawe %1").arg(adloader->waves[i].id));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return;
}
}
}
msgBox.setText(tr("Delete alien %1 id=%2").arg(adloader->aliens.value(id).name).arg(id));
@@ -823,7 +839,7 @@ void MainWindow::on_pbSlpDel_clicked()
for (int i=0; i<adloader->chains.size(); i++)
{
if (adloader->chains.values().at(i).childSplashId == id
|| adloader->chains.values().at(i).parentSplashId == id)
|| adloader->chains.values().at(i).parentSplashId == id)
{
msgBox.setText(tr("You can not delete splash %1 id=%2").arg(adloader->splashes.value(id).name).arg(id));
msgBox.setInformativeText(tr("It used by chain in tower %1 id=%2").arg(adloader->towers.value(adloader->chains.values().at(i).towerId).name).arg(adloader->chains.values().at(i).towerId));
@@ -1091,13 +1107,13 @@ void MainWindow::on_pbImgAdd_clicked()
/*if (fd.exec())
{
strl = fd.selectedFiles();*/
for (int i=0; i<strl.size(); ++i)
{
strl[i] = dir.relativeFilePath(strl[i]);
}
adloader->animations[id].pathes.append(strl);
refresh_lwImages(adloader->animations.value(id).pathes);
isSaved = false;
for (int i=0; i<strl.size(); ++i)
{
strl[i] = dir.relativeFilePath(strl[i]);
}
adloader->animations[id].pathes.append(strl);
refresh_lwImages(adloader->animations.value(id).pathes);
isSaved = false;
//}
}
@@ -1133,7 +1149,7 @@ void MainWindow::on_pbAnimAdd_clicked()
anim.id = i;
adloader->animations.insert(anim.id,anim);
int index = adloader->animations.keys().indexOf(i);
// animModel->refresh(adloader->animations.values());
// animModel->refresh(adloader->animations.values());
ui->lvAnimations->reset();
ui->lvAnimations->selectionModel()->setCurrentIndex(ui->lvAnimations->model()->index(index,0),QItemSelectionModel::ClearAndSelect);
isSaved = false;
@@ -1227,7 +1243,7 @@ void MainWindow::on_pbAnimDel_clicked()
if (ret == QMessageBox::Ok)
{
adloader->animations.remove(id);
// animModel->refresh(adloader->animations.values());
// animModel->refresh(adloader->animations.values());
ui->lvAnimations->reset();
ui->lvAnimations->selectionModel()->setCurrentIndex(ui->lvAnimations->model()->index(0,0),QItemSelectionModel::ClearAndSelect);
isSaved = false;
@@ -1280,3 +1296,81 @@ void MainWindow::on_cbSplKeepOnAlien_toggled(bool checked)
adloader->splashes[id].keepOnAlien = checked;
if (lval != adloader->splashes[id].keepOnAlien) isSaved = false;
}
void MainWindow::on_btWaveAddAlien_clicked()
{
if (ui->lvWaveAliens->currentIndex().isValid())
wavePartModel->insertAlien(adloader->aliens.values().at(ui->lvWaveAliens->currentIndex().row()).id);
waveModel->refreshData();
}
void MainWindow::tbWavePartSelect(QModelIndex a, QModelIndex)
{
ui->btWaveRemoveAlien->setEnabled(a.isValid());
}
void MainWindow::on_btWaveRemoveAlien_clicked()
{
wavePartModel->removeAlien(ui->tableWaveParts->selectionModel()->currentIndex());
waveModel->refreshData();
}
void MainWindow::on_btWaveClear_clicked()
{
wavePartModel->clearAliens();
waveModel->refreshData();
}
void MainWindow::on_pbWaveAdd_clicked()
{
// wavePartModel->setCurrentWave(QModelIndex());
QModelIndex a = ui->tableWaves->selectionModel()->currentIndex();
waveModel->addWave(a);
wavePartModel->setCurrentWave(waveModel->index(a.row()+1,a.column()));
//wavePartModel->setCurrentWave(a);
// ui->tableWaves->selectionModel()->setCurrentIndex(waveModel->index(a.row()+1,a.column()),QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
void MainWindow::on_pbWaveDel_clicked()
{
// wavePartModel->setCurrentWave(QModelIndex());
QModelIndex a = ui->tableWaves->selectionModel()->currentIndex();
waveModel->removeWave(a);
wavePartModel->setCurrentWave(waveModel->index(a.row(),a.column()));
//wavePartModel->setCurrentWave(a);
//ui->tableWaves->selectionModel()->setCurrentIndex(waveModel->index(a.row(),a.column()),QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
void MainWindow::on_pbWaveCopy_clicked()
{
// wavePartModel->setCurrentWave(QModelIndex());
QModelIndex a = ui->tableWaves->selectionModel()->currentIndex();
waveModel->copyWave(a);
wavePartModel->setCurrentWave(waveModel->index(a.row()+1,a.column()));
// ui->tableWaves->selectionModel()->setCurrentIndex(waveModel->index(a.row()+1,a.column()),QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
void MainWindow::on_btWaveUp_clicked()
{
wavePartModel->setCurrentWave(QModelIndex());
QModelIndex a = ui->tableWaves->selectionModel()->currentIndex();
waveModel->upWave(a);
ui->tableWaves->selectionModel()->setCurrentIndex(waveModel->index(a.row()-1,a.column()),QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
void MainWindow::on_btWaveDown_clicked()
{
wavePartModel->setCurrentWave(QModelIndex());
QModelIndex a = ui->tableWaves->selectionModel()->currentIndex();
waveModel->downWave(a);
ui->tableWaves->selectionModel()->setCurrentIndex(waveModel->index(a.row()+1,a.column()),QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}

View File

@@ -14,6 +14,7 @@
#include "mapmodel.h"
#include "animationmodel.h"
#include "animlabel.h"
#include "wavemodel.h"
namespace Ui {
class MainWindow;
@@ -37,6 +38,8 @@ private:
TriggerModel* trigModel;
MapModel * mapModel;
AnimationModel * animModel;
WavePartModel * wavePartModel;
WaveModel * waveModel;
QGraphicsScene * mapScene;
//AnimLabel * alb;
@@ -109,12 +112,21 @@ private slots:
void lvSplashes_select(QModelIndex, QModelIndex);
void lvTriggers_select(QModelIndex, QModelIndex);
void lvMaps_select(QModelIndex, QModelIndex);
void tbWavePartSelect(QModelIndex, QModelIndex);
void on_cbAlRegeneration_toggled(bool checked);
void on_cbAlArmor_toggled(bool checked);
void on_cbSplCompisitionMode_currentIndexChanged(const QString &arg1);
void on_sbSplZValue_valueChanged(double arg1);
void on_sbSplAnimSpeed_valueChanged(double arg1);
void on_cbSplKeepOnAlien_toggled(bool checked);
void on_btWaveAddAlien_clicked();
void on_btWaveRemoveAlien_clicked();
void on_btWaveClear_clicked();
void on_pbWaveAdd_clicked();
void on_pbWaveDel_clicked();
void on_pbWaveCopy_clicked();
void on_btWaveUp_clicked();
void on_btWaveDown_clicked();
};
#endif // MAINWINDOW_H

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>497</height>
<width>1170</width>
<height>651</height>
</rect>
</property>
<property name="windowTitle">
@@ -47,7 +47,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>2</number>
<number>6</number>
</property>
<property name="movable">
<bool>true</bool>
@@ -1899,6 +1899,244 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabWaves">
<attribute name="title">
<string>Waves</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
<widget class="QSplitter" name="splitter_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_19">
<item>
<widget class="QTableView" name="tableWaves">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_49">
<property name="spacing">
<number>5</number>
</property>
<item>
<widget class="QPushButton" name="pbWaveAdd">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbWaveCopy">
<property name="text">
<string>Copy</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btWaveUp">
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="arrowType">
<enum>Qt::UpArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btWaveDown">
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="arrowType">
<enum>Qt::DownArrow</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pbWaveDel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QTableView" name="tableWaveParts">
<property name="dragDropMode">
<enum>QAbstractItemView::DropOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_20">
<item>
<widget class="QToolButton" name="btWaveAddAlien">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>add</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btWaveRemoveAlien">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>remove</string>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btWaveClear">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>clear</string>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QListView" name="lvWaveAliens">
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="movement">
<enum>QListView::Snap</enum>
</property>
<property name="isWrapping" stdset="0">
<bool>true</bool>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="layoutMode">
<enum>QListView::Batched</enum>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>

332
ADeditor/wavemodel.cpp Normal file
View File

@@ -0,0 +1,332 @@
#include "wavemodel.h"
WavePartModel::WavePartModel(QHash<int, tbWave> &mwaves, QObject *parent) :
QAbstractTableModel(parent), waves(mwaves)
{
curWave = -1;
// wavelist = waves.values();
}
int WavePartModel::rowCount(const QModelIndex &) const
{
if (curWave==-1) return 0;
return waves[curWave].parts.size();
}
QVariant WavePartModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole)) return QVariant();
if (curWave==-1) return QVariant();
if (index.row() >= waves[curWave].parts.size()) return QVariant();
if (index.column() == 0)
return QVariant(tr("alien %1").arg(waves[curWave].parts.at(index.row()).alienId));
if (index.column() == 1)
return QVariant(waves[curWave].parts.at(index.row()).count);
return QVariant();
}
bool WavePartModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (role != Qt::EditRole) return false;
if (curWave==-1) return false;
if (index.row() >= waves[curWave].parts.size()) return false;
if (index.column() == 1)
{
waves[curWave].parts[index.row()].count = value.toInt();
return true;
}
return false;
}
//bool WaveModel::insertRows(int row, int count, const QModelIndex &parent)
//{
// beginInsertRows(parent,row+1,row+count);
// waves[curWave].parts.insert(row,count,tbWavePart );
// endInsertRows();
// return true;
//}
bool WavePartModel::removeRows(int row, int count, const QModelIndex &parent)
{
beginRemoveRows(parent,row,row+count);
waves[curWave].parts.remove(row,count);
endRemoveRows();
return true;
}
void WavePartModel::insertAlien(int alId)
{
//qDebug() << curWave;
if (curWave == -1) return;
for (int i=0; i<waves[curWave].parts.size(); i++)
{
if (waves[curWave].parts.at(i).alienId == alId)
{
waves[curWave].parts[i].count++;
emit dataChanged(index(0,0),index(rowCount()-1,1));
return;
}
}
tbWavePart p;
p.alienId = alId;
p.count = 1;
beginInsertRows(QModelIndex(),rowCount(),rowCount());
waves[curWave].parts.append(p);
endInsertRows();
}
void WavePartModel::setCurrentWave(QModelIndex a, QModelIndex b)
{
//qDebug() << a << b;
if (!a.isValid())
{
if (rowCount()>0)
{
beginRemoveRows(QModelIndex(),0,rowCount()-1);
curWave = -1;
endRemoveRows();
return;
}
curWave = -1;
return;
}
int wave = a.row();
int id = waves.values().at(wave).id;
int lc = waves[id].parts.size();
if (lc > rowCount()) {
beginInsertRows(QModelIndex(),rowCount(),lc-1);
curWave = id;
endInsertRows();
emit dataChanged(index(0,0),index(rowCount()-1,1));
return;
}
if (lc < rowCount()) {
beginRemoveRows(QModelIndex(),lc,rowCount()-1);
curWave = id;
endRemoveRows();
emit dataChanged(index(0,0),index(rowCount()-1,1));
return;
}
curWave = id;
emit dataChanged(index(0,0),index(rowCount()-1,1));
}
//QStringList WavePartModel::waveList()
//{
// QStringList strwavelist;
// for(int i=0; i<wavelist.size(); i++)
// strwavelist.append(tr("wave %1").arg(wavelist.at(i).id));
// return strwavelist;
//}
QVariant WaveModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole)) return QVariant();
if (index.row() >= values.size()) return QVariant();
switch (index.column())
{
case 0:
return QVariant(tr("wave %1").arg(values.at(index.row()).id));
case 1:
return QVariant(values.at(index.row()).prise);
case 2:
return QVariant(values.at(index.row()).timeout);
case 3:
return QVariant(values.at(index.row()).parts.size());
default:
return QVariant();
}
return QVariant();
}
QVariant WaveModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Vertical || (role != Qt::DisplayRole && role != Qt::EditRole)) return QVariant();
switch (section)
{
case 0:
return QVariant(tr("#"));
case 1:
return QVariant(tr("prise"));
case 2:
return QVariant(tr("timeout"));
case 3:
return QVariant(tr("parts"));
default:
return QVariant();
}
return QVariant();
}
QVariant WavePartModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Vertical || (role != Qt::DisplayRole && role != Qt::EditRole)) return QVariant();
switch (section)
{
case 0:
return QVariant(tr("alien"));
case 1:
return QVariant(tr("count"));
default:
return QVariant();
}
return QVariant();
}
bool WaveModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (role != Qt::EditRole) return false;
if (index.row() >= values.size()) return false;
if (index.column() == 1)
{
waves[values.at(index.row()).id].prise = value.toInt();
refreshData();
return true;
}
if (index.column() == 2)
{
waves[values.at(index.row()).id].timeout = value.toInt();
refreshData();
return true;
}
return false;
}
void WaveModel::refreshData(bool inverse)
{
if (inverse)
{
emit needUpdateIndex();
waves.clear();
for (int i=0; i<values.size(); i++)
{
values[i].id = i+1;
waves.insert(values[i].id,values[i]);
}
} else {
values.clear();
values = waves.values();
}
emit dataChanged(index(0,0),index(rowCount()-1,columnCount()-1));
}
WaveModel::WaveModel(QHash<int, tbWave> &mwaves, QObject *parent) :
QAbstractTableModel(parent), waves(mwaves)
{
refreshData();
}
void WavePartModel::removeAlien(QModelIndex index)
{
if (!index.isValid()) return;
// for (int i=0; i<waves[curWave].parts.size(); i++)
// {
// if (waves[curWave].parts.at(i).alienId == alId)
// {
// waves[curWave].parts[i].count++;
// emit dataChanged(index(0,0),index(rowCount()-1,1));
// return;
// }
// }
int i = index.row();
beginRemoveRows(QModelIndex(),i,i);
waves[curWave].parts.remove(i);
endRemoveRows();
}
void WavePartModel::clearAliens()
{
if (rowCount() == 0) return;
beginRemoveRows(QModelIndex(),0,rowCount()-1);
waves[curWave].parts.clear();
endRemoveRows();
}
void WaveModel::addWave(QModelIndex a)
{
tbWave w;
w.id = 0;
w.prise = 0;
w.timeout = 10;
if (a.isValid())
{
beginInsertRows(QModelIndex(),a.row(),a.row());
values.insert(a.row()+1,w);
endInsertRows();
} else {
beginInsertRows(QModelIndex(),rowCount()-1,rowCount()-1);
values.append(w);
endInsertRows();
}
refreshData(true);
}
void WaveModel::copyWave(QModelIndex a)
{
if (a.isValid())
{
tbWave w = values.at(a.row());
beginInsertRows(QModelIndex(),a.row(),a.row());
values.insert(a.row()+1,w);
endInsertRows();
refreshData(true);
}
}
void WaveModel::removeWave(QModelIndex a)
{
if (a.isValid())
{
beginRemoveRows(QModelIndex(),a.row(),a.row());
values.removeAt(a.row());
endRemoveRows();
refreshData(true);
}
}
void WaveModel::upWave(QModelIndex a)
{
if (a.isValid())
{
if (a.row() == 0) return;
values.move(a.row(),a.row()-1);
refreshData(true);
}
}
void WaveModel::downWave(QModelIndex a)
{
if (a.isValid())
{
if (a.row() == rowCount()-1) return;
values.move(a.row(),a.row()+1);
refreshData(true);
}
}
void WavePartModel::updateIndex()
{
setCurrentWave(index(-1,-1));
}

78
ADeditor/wavemodel.h Normal file
View File

@@ -0,0 +1,78 @@
#ifndef WAVEMODEL_H
#define WAVEMODEL_H
#include <QAbstractTableModel>
#include <QMultiHash>
#include "../loader.h"
class WavePartModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit WavePartModel(QHash <int,tbWave> &waves, QObject *parent = 0);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent) const {return 2;}
//bool insertRows(int row, int count, const QModelIndex &parent);
bool removeRows(int row, int count, const QModelIndex &parent);
QVariant data(const QModelIndex &index, int role) const;
// void refresh(QList <tbAnimation> &anims);
Qt::ItemFlags flags(const QModelIndex &index) const {Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
if (index.column()==1) f = f | Qt::ItemIsEditable;
return f;}
bool setData(const QModelIndex &index, const QVariant &value, int role);
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
// QStringList waveList();
public slots:
//void setLevel(int level) {this->level = level; dataChanged(index(0,0),index(rowCount()-1,1));}
void setCurrentWave(QModelIndex = QModelIndex(), QModelIndex b = QModelIndex());
void insertAlien(int alId);
void removeAlien(QModelIndex index);
void clearAliens();
void addWave() {int i=0; while(waves.contains(i)) i++;
tbWave w; w.id=i; w.prise=0; w.timeout=10; waves.insert(w.id,w);
setCurrentWave(index(waves.size()-1,0));}
void updateIndex();
private:
QHash <int,tbWave> &waves;
int curWave;
//int level;
};
class WaveModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit WaveModel(QHash <int,tbWave> &waves, QObject *parent = 0);
int rowCount(const QModelIndex &parent = QModelIndex()) const {return waves.size();}
int columnCount(const QModelIndex &parent = QModelIndex()) const {return 4;}
//bool insertRows(int row, int count, const QModelIndex &parent);
//bool removeRows(int row, int count, const QModelIndex &parent);
QVariant data(const QModelIndex &index, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const {Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
if (index.column()==1||index.column()==2) f = f | Qt::ItemIsEditable;
return f;}
bool setData(const QModelIndex &index, const QVariant &value, int role);
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
public slots:
void addWave(QModelIndex a);
void copyWave(QModelIndex a);
void removeWave(QModelIndex a);
void upWave(QModelIndex a);
void downWave(QModelIndex a);
void refreshData(bool inverse = false);
private:
QHash <int,tbWave> &waves;
QList<tbWave> values;
signals:
void needUpdateIndex();
};
#endif // WAVEMODEL_H