Compare commits
13 commits
4b4738430e
...
a91200153e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a91200153e | ||
![]() |
aa3cf04cc6 | ||
bd73824cb4 | |||
![]() |
9cd3930731 | ||
![]() |
178a05079a | ||
![]() |
04ebde50ff | ||
![]() |
448f80afd8 | ||
![]() |
ffff0fb299 | ||
![]() |
1be2ca09c5 | ||
![]() |
0ae47df396 | ||
![]() |
00a7cd7c7b | ||
![]() |
9795136310 | ||
![]() |
250118d51c |
36
AnimatorFileCreatorAdvanced/.config/dotnet-tools.json
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-mgcb": {
|
||||||
|
"version": "3.8.1.303",
|
||||||
|
"commands": [
|
||||||
|
"mgcb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dotnet-mgcb-editor": {
|
||||||
|
"version": "3.8.1.303",
|
||||||
|
"commands": [
|
||||||
|
"mgcb-editor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dotnet-mgcb-editor-linux": {
|
||||||
|
"version": "3.8.1.303",
|
||||||
|
"commands": [
|
||||||
|
"mgcb-editor-linux"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dotnet-mgcb-editor-windows": {
|
||||||
|
"version": "3.8.1.303",
|
||||||
|
"commands": [
|
||||||
|
"mgcb-editor-windows"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dotnet-mgcb-editor-mac": {
|
||||||
|
"version": "3.8.1.303",
|
||||||
|
"commands": [
|
||||||
|
"mgcb-editor-mac"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<RollForward>Major</RollForward>
|
||||||
|
<PublishReadyToRun>false</PublishReadyToRun>
|
||||||
|
<TieredCompilation>false</TieredCompilation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Icon.ico" />
|
||||||
|
<None Remove="Icon.bmp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Icon.ico" />
|
||||||
|
<EmbeddedResource Include="Icon.bmp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
|
||||||
|
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
|
||||||
|
<PackageReference Include="NativeFileDialogSharp" Version="0.5.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MonogameLibrary\MonogameLibrary.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
|
||||||
|
<Message Text="Restoring dotnet tools" Importance="High" />
|
||||||
|
<Exec Command="dotnet tool restore" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
271
AnimatorFileCreatorAdvanced/Content/Content.mgcb
Normal file
|
@ -0,0 +1,271 @@
|
||||||
|
|
||||||
|
#----------------------------- Global Properties ----------------------------#
|
||||||
|
|
||||||
|
/outputDir:bin/$(Platform)
|
||||||
|
/intermediateDir:obj/$(Platform)
|
||||||
|
/platform:DesktopGL
|
||||||
|
/config:
|
||||||
|
/profile:Reach
|
||||||
|
/compress:False
|
||||||
|
|
||||||
|
#-------------------------------- References --------------------------------#
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------- Content ---------------------------------#
|
||||||
|
|
||||||
|
#begin Fonts/CarltineRegular-K7z5l.ttf
|
||||||
|
/copy:Fonts/CarltineRegular-K7z5l.ttf
|
||||||
|
|
||||||
|
#begin Fonts/Debrosee-ALPnL.ttf
|
||||||
|
/copy:Fonts/Debrosee-ALPnL.ttf
|
||||||
|
|
||||||
|
#begin Fonts/Font.spritefont
|
||||||
|
/importer:FontDescriptionImporter
|
||||||
|
/processor:FontDescriptionProcessor
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:TextureFormat=Compressed
|
||||||
|
/build:Fonts/Font.spritefont
|
||||||
|
|
||||||
|
#begin Fonts/Font2.spritefont
|
||||||
|
/importer:FontDescriptionImporter
|
||||||
|
/processor:FontDescriptionProcessor
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:TextureFormat=Compressed
|
||||||
|
/build:Fonts/Font2.spritefont
|
||||||
|
|
||||||
|
#begin Fonts/Font3.spritefont
|
||||||
|
/importer:FontDescriptionImporter
|
||||||
|
/processor:FontDescriptionProcessor
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:TextureFormat=Compressed
|
||||||
|
/build:Fonts/Font3.spritefont
|
||||||
|
|
||||||
|
#begin Fonts/Font4.spritefont
|
||||||
|
/importer:FontDescriptionImporter
|
||||||
|
/processor:FontDescriptionProcessor
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:TextureFormat=Compressed
|
||||||
|
/build:Fonts/Font4.spritefont
|
||||||
|
|
||||||
|
#begin Fonts/MouldyCheeseRegular-WyMWG.ttf
|
||||||
|
/copy:Fonts/MouldyCheeseRegular-WyMWG.ttf
|
||||||
|
|
||||||
|
#begin Fonts/Troubleside-lgjxX.ttf
|
||||||
|
/copy:Fonts/Troubleside-lgjxX.ttf
|
||||||
|
|
||||||
|
#begin GUI/back.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/back.png
|
||||||
|
|
||||||
|
#begin GUI/background/base.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/base.png
|
||||||
|
|
||||||
|
#begin GUI/background/endGame.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/endGame.png
|
||||||
|
|
||||||
|
#begin GUI/background/join.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/join.png
|
||||||
|
|
||||||
|
#begin GUI/background/mainMenu.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/mainMenu.png
|
||||||
|
|
||||||
|
#begin GUI/background/options.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/options.png
|
||||||
|
|
||||||
|
#begin GUI/background/selectMode.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/selectMode.png
|
||||||
|
|
||||||
|
#begin GUI/background/waiting.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/background/waiting.png
|
||||||
|
|
||||||
|
#begin GUI/Button.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/Button.png
|
||||||
|
|
||||||
|
#begin GUI/Button2.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/Button2.png
|
||||||
|
|
||||||
|
#begin GUI/ButtonI.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/ButtonI.png
|
||||||
|
|
||||||
|
#begin GUI/checkboxs_off-on.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/checkboxs_off-on.png
|
||||||
|
|
||||||
|
#begin GUI/checkboxs_off.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/checkboxs_off.png
|
||||||
|
|
||||||
|
#begin GUI/checkboxs_on.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/checkboxs_on.png
|
||||||
|
|
||||||
|
#begin GUI/MenuBackground.jpg
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/MenuBackground.jpg
|
||||||
|
|
||||||
|
#begin GUI/mouse.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/mouse.png
|
||||||
|
|
||||||
|
#begin GUI/Switch_backgrownd.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/Switch_backgrownd.png
|
||||||
|
|
||||||
|
#begin GUI/switch.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/switch.png
|
||||||
|
|
BIN
AnimatorFileCreatorAdvanced/Content/Fonts/Debrosee-ALPnL.ttf
Normal file
60
AnimatorFileCreatorAdvanced/Content/Fonts/Font.spritefont
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file contains an xml description of a font, and will be read by the XNA
|
||||||
|
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||||
|
of the font in your game, and to change the characters which are available to draw
|
||||||
|
with.
|
||||||
|
-->
|
||||||
|
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||||
|
<Asset Type="Graphics:FontDescription">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Modify this string to change the font that will be imported.
|
||||||
|
-->
|
||||||
|
<FontName>Debrosee-ALPnL.ttf</FontName>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Size is a float value, measured in points. Modify this value to change
|
||||||
|
the size of the font.
|
||||||
|
-->
|
||||||
|
<Size>100</Size>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spacing is a float value, measured in pixels. Modify this value to change
|
||||||
|
the amount of spacing in between characters.
|
||||||
|
-->
|
||||||
|
<Spacing>0</Spacing>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
UseKerning controls the layout of the font. If this value is true, kerning information
|
||||||
|
will be used when placing characters.
|
||||||
|
-->
|
||||||
|
<UseKerning>true</UseKerning>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
|
||||||
|
and "Bold, Italic", and are case sensitive.
|
||||||
|
-->
|
||||||
|
<Style>Regular</Style>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If you uncomment this line, the default character will be substituted if you draw
|
||||||
|
or measure text that contains characters which were not included in the font.
|
||||||
|
-->
|
||||||
|
<!-- <DefaultCharacter>*</DefaultCharacter> -->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
CharacterRegions control what letters are available in the font. Every
|
||||||
|
character from Start to End will be built and made available for drawing. The
|
||||||
|
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||||
|
character set. The characters are ordered according to the Unicode standard.
|
||||||
|
See the documentation for more information.
|
||||||
|
-->
|
||||||
|
<CharacterRegions>
|
||||||
|
<CharacterRegion>
|
||||||
|
<Start> </Start>
|
||||||
|
<End>~</End>
|
||||||
|
</CharacterRegion>
|
||||||
|
</CharacterRegions>
|
||||||
|
</Asset>
|
||||||
|
</XnaContent>
|
60
AnimatorFileCreatorAdvanced/Content/Fonts/Font2.spritefont
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file contains an xml description of a font, and will be read by the XNA
|
||||||
|
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||||
|
of the font in your game, and to change the characters which are available to draw
|
||||||
|
with.
|
||||||
|
-->
|
||||||
|
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||||
|
<Asset Type="Graphics:FontDescription">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Modify this string to change the font that will be imported.
|
||||||
|
-->
|
||||||
|
<FontName>CarltineRegular-K7z5l.ttf</FontName>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Size is a float value, measured in points. Modify this value to change
|
||||||
|
the size of the font.
|
||||||
|
-->
|
||||||
|
<Size>15</Size>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spacing is a float value, measured in pixels. Modify this value to change
|
||||||
|
the amount of spacing in between characters.
|
||||||
|
-->
|
||||||
|
<Spacing>0</Spacing>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
UseKerning controls the layout of the font. If this value is true, kerning information
|
||||||
|
will be used when placing characters.
|
||||||
|
-->
|
||||||
|
<UseKerning>true</UseKerning>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
|
||||||
|
and "Bold, Italic", and are case sensitive.
|
||||||
|
-->
|
||||||
|
<Style>Regular</Style>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If you uncomment this line, the default character will be substituted if you draw
|
||||||
|
or measure text that contains characters which were not included in the font.
|
||||||
|
-->
|
||||||
|
<!-- <DefaultCharacter>*</DefaultCharacter> -->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
CharacterRegions control what letters are available in the font. Every
|
||||||
|
character from Start to End will be built and made available for drawing. The
|
||||||
|
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||||
|
character set. The characters are ordered according to the Unicode standard.
|
||||||
|
See the documentation for more information.
|
||||||
|
-->
|
||||||
|
<CharacterRegions>
|
||||||
|
<CharacterRegion>
|
||||||
|
<Start> </Start>
|
||||||
|
<End>~</End>
|
||||||
|
</CharacterRegion>
|
||||||
|
</CharacterRegions>
|
||||||
|
</Asset>
|
||||||
|
</XnaContent>
|
60
AnimatorFileCreatorAdvanced/Content/Fonts/Font3.spritefont
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file contains an xml description of a font, and will be read by the XNA
|
||||||
|
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||||
|
of the font in your game, and to change the characters which are available to draw
|
||||||
|
with.
|
||||||
|
-->
|
||||||
|
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||||
|
<Asset Type="Graphics:FontDescription">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Modify this string to change the font that will be imported.
|
||||||
|
-->
|
||||||
|
<FontName>MouldyCheeseRegular-WyMWG.ttf</FontName>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Size is a float value, measured in points. Modify this value to change
|
||||||
|
the size of the font.
|
||||||
|
-->
|
||||||
|
<Size>50</Size>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spacing is a float value, measured in pixels. Modify this value to change
|
||||||
|
the amount of spacing in between characters.
|
||||||
|
-->
|
||||||
|
<Spacing>0</Spacing>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
UseKerning controls the layout of the font. If this value is true, kerning information
|
||||||
|
will be used when placing characters.
|
||||||
|
-->
|
||||||
|
<UseKerning>true</UseKerning>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
|
||||||
|
and "Bold, Italic", and are case sensitive.
|
||||||
|
-->
|
||||||
|
<Style>Regular</Style>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If you uncomment this line, the default character will be substituted if you draw
|
||||||
|
or measure text that contains characters which were not included in the font.
|
||||||
|
-->
|
||||||
|
<!-- <DefaultCharacter>*</DefaultCharacter> -->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
CharacterRegions control what letters are available in the font. Every
|
||||||
|
character from Start to End will be built and made available for drawing. The
|
||||||
|
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||||
|
character set. The characters are ordered according to the Unicode standard.
|
||||||
|
See the documentation for more information.
|
||||||
|
-->
|
||||||
|
<CharacterRegions>
|
||||||
|
<CharacterRegion>
|
||||||
|
<Start> </Start>
|
||||||
|
<End>~</End>
|
||||||
|
</CharacterRegion>
|
||||||
|
</CharacterRegions>
|
||||||
|
</Asset>
|
||||||
|
</XnaContent>
|
64
AnimatorFileCreatorAdvanced/Content/Fonts/Font4.spritefont
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file contains an xml description of a font, and will be read by the XNA
|
||||||
|
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||||
|
of the font in your game, and to change the characters which are available to draw
|
||||||
|
with.
|
||||||
|
-->
|
||||||
|
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||||
|
<Asset Type="Graphics:FontDescription">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Modify this string to change the font that will be imported.
|
||||||
|
-->
|
||||||
|
<FontName>Troubleside-lgjxX.ttf</FontName>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Size is a float value, measured in points. Modify this value to change
|
||||||
|
the size of the font.
|
||||||
|
-->
|
||||||
|
<Size>50</Size>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spacing is a float value, measured in pixels. Modify this value to change
|
||||||
|
the amount of spacing in between characters.
|
||||||
|
-->
|
||||||
|
<Spacing>0</Spacing>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
UseKerning controls the layout of the font. If this value is true, kerning information
|
||||||
|
will be used when placing characters.
|
||||||
|
-->
|
||||||
|
<UseKerning>true</UseKerning>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
|
||||||
|
and "Bold, Italic", and are case sensitive.
|
||||||
|
-->
|
||||||
|
<Style>Regular</Style>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If you uncomment this line, the default character will be substituted if you draw
|
||||||
|
or measure text that contains characters which were not included in the font.
|
||||||
|
-->
|
||||||
|
<!-- <DefaultCharacter>*</DefaultCharacter> -->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
CharacterRegions control what letters are available in the font. Every
|
||||||
|
character from Start to End will be built and made available for drawing. The
|
||||||
|
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||||
|
character set. The characters are ordered according to the Unicode standard.
|
||||||
|
See the documentation for more information.
|
||||||
|
-->
|
||||||
|
<CharacterRegions>
|
||||||
|
<CharacterRegion>
|
||||||
|
<Start>32</Start>
|
||||||
|
<End>127</End>
|
||||||
|
</CharacterRegion>
|
||||||
|
<CharacterRegion>
|
||||||
|
<Start>А</Start>
|
||||||
|
<End>ј</End>
|
||||||
|
</CharacterRegion>
|
||||||
|
</CharacterRegions>
|
||||||
|
</Asset>
|
||||||
|
</XnaContent>
|
BIN
AnimatorFileCreatorAdvanced/Content/Fonts/Troubleside-lgjxX.ttf
Normal file
BIN
AnimatorFileCreatorAdvanced/Content/GUI/Button.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/Button2.png
Normal file
After Width: | Height: | Size: 885 B |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/ButtonI.png
Normal file
After Width: | Height: | Size: 931 B |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/MenuBackground.jpg
Normal file
After Width: | Height: | Size: 592 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/Switch_backgrownd.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/back.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/base.png
Normal file
After Width: | Height: | Size: 9.2 MiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/endGame.png
Normal file
After Width: | Height: | Size: 3.8 MiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/join.png
Normal file
After Width: | Height: | Size: 5.7 MiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/mainMenu.png
Normal file
After Width: | Height: | Size: 7.1 MiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/options.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 5.8 MiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/background/waiting.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/checkboxs_off-on.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/checkboxs_off.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/checkboxs_on.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/mouse.png
Normal file
After Width: | Height: | Size: 234 KiB |
BIN
AnimatorFileCreatorAdvanced/Content/GUI/switch.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
82
AnimatorFileCreatorAdvanced/Core/AppManager.cs
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection.Metadata;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using AnimatorFileCreatorAdvanced.Core.GUI;
|
||||||
|
|
||||||
|
namespace AnimatorFileCreatorAdvanced.Core
|
||||||
|
{
|
||||||
|
|
||||||
|
public class AppManager : Game
|
||||||
|
{
|
||||||
|
private GraphicsDeviceManager _graphics;
|
||||||
|
private SpriteBatch _spriteBatch;
|
||||||
|
|
||||||
|
public Point CurentScreenResolution = new Point(1000, 600);
|
||||||
|
AbstractGUI GUI;
|
||||||
|
public static AppManager Instance { get; private set; }
|
||||||
|
public AppManager()
|
||||||
|
{
|
||||||
|
_graphics = new GraphicsDeviceManager(this);
|
||||||
|
Content.RootDirectory = "Content";
|
||||||
|
IsMouseVisible = true;
|
||||||
|
|
||||||
|
SetResolution(CurentScreenResolution.X, CurentScreenResolution.Y);
|
||||||
|
|
||||||
|
Instance = this;
|
||||||
|
GUI = new CreatingAnimationGUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialize()
|
||||||
|
{
|
||||||
|
// TODO: Add your initialization logic here
|
||||||
|
|
||||||
|
base.Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadContent()
|
||||||
|
{
|
||||||
|
_spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||||
|
|
||||||
|
GUI.Initialize();
|
||||||
|
GUI.LoadContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update(GameTime gameTime)
|
||||||
|
{
|
||||||
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
|
||||||
|
Exit();
|
||||||
|
|
||||||
|
GUI.Update(gameTime);
|
||||||
|
// TODO: Add your update logic here
|
||||||
|
|
||||||
|
base.Update(gameTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Draw(GameTime gameTime)
|
||||||
|
{
|
||||||
|
GraphicsDevice.Clear(Color.Gray);
|
||||||
|
|
||||||
|
// TODO: Add your drawing code here
|
||||||
|
|
||||||
|
GUI.Draw(_spriteBatch);
|
||||||
|
|
||||||
|
base.Draw(gameTime);
|
||||||
|
}
|
||||||
|
public void SetResolution(int x, int y)
|
||||||
|
{
|
||||||
|
_graphics.PreferredBackBufferWidth = x;
|
||||||
|
_graphics.PreferredBackBufferHeight = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FulscrreenSwitch()
|
||||||
|
{
|
||||||
|
_graphics.IsFullScreen = !_graphics.IsFullScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
AnimatorFileCreatorAdvanced/Core/GUI/AbstractGUI.cs
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MonogameLibrary.UI.Base;
|
||||||
|
|
||||||
|
namespace AnimatorFileCreatorAdvanced.Core.GUI
|
||||||
|
{
|
||||||
|
|
||||||
|
public abstract class AbstractGUI
|
||||||
|
{
|
||||||
|
protected UIManager Manager = new();
|
||||||
|
protected List<DrawableUIElement> Elements = new();
|
||||||
|
private List<DrawableUIElement> ActiveElements;
|
||||||
|
protected DrawableUIElement SelectedElement;
|
||||||
|
private bool isStartedPrint = false;
|
||||||
|
private bool isPressed = false;
|
||||||
|
private Texture2D mouse;
|
||||||
|
private MouseState mouseState;
|
||||||
|
|
||||||
|
public AbstractGUI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void CreateUI();
|
||||||
|
private GraphicsDevice graphicsDevice;
|
||||||
|
public virtual void Initialize()
|
||||||
|
{
|
||||||
|
Manager.Initialize(AppManager.Instance.GraphicsDevice);
|
||||||
|
CreateUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void LoadContent()
|
||||||
|
{
|
||||||
|
Manager.LoadContent(AppManager.Instance.Content, "Fonts/Font");
|
||||||
|
mouse = AppManager.Instance.Content.Load<Texture2D>("GUI/mouse");
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Update(GameTime gameTime)
|
||||||
|
{
|
||||||
|
Manager.Update(gameTime);
|
||||||
|
mouseState = Mouse.GetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Draw(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
Manager.Draw(spriteBatch);
|
||||||
|
spriteBatch.Begin();
|
||||||
|
spriteBatch.Draw(mouse, new Rectangle(mouseState.Position.X, mouseState.Position.Y, 20, 40), Color.White);
|
||||||
|
spriteBatch.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
250
AnimatorFileCreatorAdvanced/Core/GUI/CreatingAnimationGUI.cs
Normal file
|
@ -0,0 +1,250 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using MonogameLibrary.UI.Elements;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NativeFileDialogSharp;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
|
||||||
|
namespace AnimatorFileCreatorAdvanced.Core.GUI
|
||||||
|
{
|
||||||
|
internal class CreatingAnimationGUI : AbstractGUI
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
protected override void CreateUI()
|
||||||
|
{
|
||||||
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
|
|
||||||
|
Label FileNameLabel = new Label(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0, 0.2f, 0, 0.1f),
|
||||||
|
|
||||||
|
text = "TEXT",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
Label AnimationPath = new Label(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0f, 0.2f, 0.1f, 0.1f),
|
||||||
|
|
||||||
|
text = "AnimationFileFolder/Path",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
Label AnimationTexturePath = new Label(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.2f, 0.2f, 0.1f, 0.1f),
|
||||||
|
|
||||||
|
text = "AnimationTextureFolder/Path",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Button openFileButton = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.4f, 0.2f, 0, 0.1f),
|
||||||
|
text = "Open File",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
openFileButton.LeftButtonPressed += () =>
|
||||||
|
{
|
||||||
|
DialogResult result = Dialog.FileOpen();
|
||||||
|
var temp = result.Path.Split('\\');
|
||||||
|
string textureName = temp[temp.Length - 2] + "/" + temp[temp.Length - 1];
|
||||||
|
textureName = textureName.Split('.')[0];
|
||||||
|
|
||||||
|
|
||||||
|
FileNameLabel.text = textureName;
|
||||||
|
AppLogic.LoadFile(result.Path);
|
||||||
|
SetAnimationSample();
|
||||||
|
};
|
||||||
|
Elements.Add(openFileButton);
|
||||||
|
|
||||||
|
|
||||||
|
Button AutoBuildButton = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.6f, 0.1f, 0, 0.1f),
|
||||||
|
text = "AutoBuild",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
Button RunButton = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.7f, 0.1f, 0, 0.1f),
|
||||||
|
text = "Run",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
Button Save = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.8f, 0.1f, 0, 0.1f),
|
||||||
|
text = "Save",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
Button AddToMGCB = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = GetRelativeRectangle_SettingSizes(0.9f, 0.1f, 0, 0.1f),
|
||||||
|
text = "Add To MGCB",
|
||||||
|
scale = 0.1f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts\\Font",
|
||||||
|
textureName = "GUI/Button"
|
||||||
|
};
|
||||||
|
|
||||||
|
AddToMGCB.LeftButtonPressed += () =>
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
add this to mgcb
|
||||||
|
|
||||||
|
|
||||||
|
#begin Textures/Animations/explosion_1.animation
|
||||||
|
/copy:Textures/Animations/explosion_1.animation
|
||||||
|
|
||||||
|
#begin GUI/checkboxs_off.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:GUI/checkboxs_off.png
|
||||||
|
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Texture2D BlackTexture;
|
||||||
|
Texture2D LoadedSample;
|
||||||
|
Rectangle SampleRectangle;
|
||||||
|
Rectangle ExampleAnimation;
|
||||||
|
|
||||||
|
Rectangle AnimationSampleRectangle;
|
||||||
|
public override void LoadContent()
|
||||||
|
{
|
||||||
|
BlackTexture = new Texture2D(AppManager.Instance.GraphicsDevice, 1, 1);
|
||||||
|
BlackTexture.SetData(new Color[] { Color.Black });
|
||||||
|
SampleRectangle = GetRelativeRectangle(0.01f, 0.31f, 0.1f, 0.01f);
|
||||||
|
ExampleAnimation = GetRelativeRectangle(0.7f, 0.01f, 0.1f, 0.01f);
|
||||||
|
|
||||||
|
base.LoadContent();
|
||||||
|
}
|
||||||
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
spriteBatch.Begin();
|
||||||
|
spriteBatch.Draw(BlackTexture, SampleRectangle, Color.White);
|
||||||
|
spriteBatch.Draw(BlackTexture, ExampleAnimation, Color.White);
|
||||||
|
|
||||||
|
if (LoadedSample != null)
|
||||||
|
{
|
||||||
|
spriteBatch.Draw(LoadedSample, AnimationSampleRectangle, Color.White);
|
||||||
|
|
||||||
|
}
|
||||||
|
spriteBatch.End();
|
||||||
|
base.Draw(spriteBatch);
|
||||||
|
}
|
||||||
|
float margin_left = 0.01f;
|
||||||
|
float margin_right = 0.01f;
|
||||||
|
float margin_top = 0.01f;
|
||||||
|
float margin_bottom = 0.01f;
|
||||||
|
public Rectangle GetRelativeRectangle_SettingSizes(float marginPercentFromLeft, float relativeXSize, float marginPercentFromTop, float relativeYSize, Rectangle? area = null)
|
||||||
|
=> GetRelativeRectangle(marginPercentFromLeft, 1 - marginPercentFromLeft - relativeXSize, marginPercentFromTop, 1 - marginPercentFromTop- relativeYSize, area);
|
||||||
|
|
||||||
|
public Rectangle GetRelativeRectangle(float marginPercentFromLeft, float marginPercentFromRight, float marginPercentFromTop, float marginPercentFromBottom, Rectangle? area = null)
|
||||||
|
{
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
if (area is null)
|
||||||
|
{
|
||||||
|
width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
|
height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
width = area.Value.Width;
|
||||||
|
height = area.Value.Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
float left = width * (marginPercentFromLeft + margin_left);
|
||||||
|
float right = width * (1 - marginPercentFromRight - margin_right);
|
||||||
|
float top = height * (marginPercentFromTop + margin_top);
|
||||||
|
float bottom = height * (1 - marginPercentFromBottom - margin_bottom);
|
||||||
|
|
||||||
|
return new Rectangle((int)left, (int)top, (int)(right - left), (int)(bottom - top));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAnimationSample()
|
||||||
|
{
|
||||||
|
Texture2D texture = AppLogic.fileTexture;
|
||||||
|
if (texture is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LoadedSample = texture;
|
||||||
|
if (texture.Width / (float)texture.Height > SampleRectangle.Width / (float)SampleRectangle.Height)
|
||||||
|
{
|
||||||
|
//not full height
|
||||||
|
AnimationSampleRectangle = new Rectangle(SampleRectangle.X,
|
||||||
|
SampleRectangle.Y + (SampleRectangle.Height -
|
||||||
|
(int)(SampleRectangle.Width * (texture.Height / (float)texture.Width))
|
||||||
|
) / 2,
|
||||||
|
SampleRectangle.Width,
|
||||||
|
(int)(SampleRectangle.Width * (texture.Height / (float)texture.Width))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
AnimationSampleRectangle = new Rectangle(SampleRectangle.X,
|
||||||
|
SampleRectangle.Y + (SampleRectangle.Height -
|
||||||
|
(int)(SampleRectangle.Width * (texture.Height / (float)texture.Width))
|
||||||
|
) / 2,
|
||||||
|
SampleRectangle.Width,
|
||||||
|
(int)(SampleRectangle.Width * (texture.Height / (float)texture.Width))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static class AppLogic
|
||||||
|
{
|
||||||
|
public static Texture2D fileTexture;
|
||||||
|
public static void LoadFile(string filePath)
|
||||||
|
{
|
||||||
|
fileTexture = Texture2D.FromFile(AppManager.Instance.GraphicsDevice, filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
AnimatorFileCreatorAdvanced/Icon.bmp
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
AnimatorFileCreatorAdvanced/Icon.ico
Normal file
After Width: | Height: | Size: 144 KiB |
3
AnimatorFileCreatorAdvanced/Program.cs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
using var game = new AnimatorFileCreatorAdvanced.Core.AppManager();
|
||||||
|
game.Run();
|
43
AnimatorFileCreatorAdvanced/app.manifest
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="AnimatorFileCreatorAdvanced"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- A list of the Windows versions that this application has been tested on and is
|
||||||
|
is designed to work with. Uncomment the appropriate elements and Windows will
|
||||||
|
automatically selected the most compatible environment. -->
|
||||||
|
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
||||||
|
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
|
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
|
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
|
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</assembly>
|
8
ZoFo.sln
|
@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZoFo", "ZoFo\ZoFo.csproj",
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonogameLibrary", "MonogameLibrary\MonogameLibrary.csproj", "{40880E68-4B3A-417B-A39B-95DE46AA2E7E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonogameLibrary", "MonogameLibrary\MonogameLibrary.csproj", "{40880E68-4B3A-417B-A39B-95DE46AA2E7E}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimationsFileCreator", "AnimationsFileCreator\AnimationsFileCreator.csproj", "{7B143D5C-5198-4ADE-9291-ECC924B78633}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnimationsFileCreator", "AnimationsFileCreator\AnimationsFileCreator.csproj", "{7B143D5C-5198-4ADE-9291-ECC924B78633}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimatorFileCreatorAdvanced", "AnimatorFileCreatorAdvanced\AnimatorFileCreatorAdvanced.csproj", "{AAEC2150-3BBF-4B59-A22F-47B30CA6B34B}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -27,6 +29,10 @@ Global
|
||||||
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7B143D5C-5198-4ADE-9291-ECC924B78633}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{AAEC2150-3BBF-4B59-A22F-47B30CA6B34B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{AAEC2150-3BBF-4B59-A22F-47B30CA6B34B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{AAEC2150-3BBF-4B59-A22F-47B30CA6B34B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{AAEC2150-3BBF-4B59-A22F-47B30CA6B34B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
#begin MapData/TileMaps/main.tmj
|
#begin MapData/TileMaps/main.tmj
|
||||||
/copy:MapData/TileMaps/main.tmj
|
/copy:MapData/TileMaps/main.tmj
|
||||||
|
|
||||||
|
#begin MapData/TileSets/bonfire.tsj
|
||||||
|
/copy:MapData/TileSets/bonfire.tsj
|
||||||
|
|
||||||
#begin MapData/TileSets/IconSet.tsj
|
#begin MapData/TileSets/IconSet.tsj
|
||||||
/copy:MapData/TileSets/IconSet.tsj
|
/copy:MapData/TileSets/IconSet.tsj
|
||||||
|
|
||||||
|
@ -92,30 +95,12 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Loot.wav
|
/build:sounds/Loot.wav
|
||||||
|
|
||||||
#begin sounds/Loot.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Loot.wav
|
|
||||||
|
|
||||||
#begin sounds/Odevanie odezdi.wav
|
#begin sounds/Odevanie odezdi.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
/processor:SoundEffectProcessor
|
/processor:SoundEffectProcessor
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Odevanie odezdi.wav
|
/build:sounds/Odevanie odezdi.wav
|
||||||
|
|
||||||
#begin sounds/Odevanie odezdi.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Odevanie odezdi.wav
|
|
||||||
|
|
||||||
#begin sounds/Pieot wodichky.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Pieot wodichky.wav
|
|
||||||
|
|
||||||
#begin sounds/Pieot wodichky.wav
|
#begin sounds/Pieot wodichky.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
/processor:SoundEffectProcessor
|
/processor:SoundEffectProcessor
|
||||||
|
@ -128,18 +113,6 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Sshetchik geigera.wav
|
/build:sounds/Sshetchik geigera.wav
|
||||||
|
|
||||||
#begin sounds/Sshetchik geigera.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Sshetchik geigera.wav
|
|
||||||
|
|
||||||
#begin sounds/Tabletki 2.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Tabletki 2.wav
|
|
||||||
|
|
||||||
#begin sounds/Tabletki 2.wav
|
#begin sounds/Tabletki 2.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
/processor:SoundEffectProcessor
|
/processor:SoundEffectProcessor
|
||||||
|
@ -152,18 +125,6 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Zombi napal.wav
|
/build:sounds/Zombi napal.wav
|
||||||
|
|
||||||
#begin sounds/Zombi napal.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Zombi napal.wav
|
|
||||||
|
|
||||||
#begin sounds/Zombi stoit.wav
|
|
||||||
/importer:WavImporter
|
|
||||||
/processor:SoundEffectProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Zombi stoit.wav
|
|
||||||
|
|
||||||
#begin sounds/Zombi stoit.wav
|
#begin sounds/Zombi stoit.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
/processor:SoundEffectProcessor
|
/processor:SoundEffectProcessor
|
||||||
|
@ -182,14 +143,8 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/zombie sound.wav
|
/build:sounds/zombie sound.wav
|
||||||
|
|
||||||
#begin Textures/Animations/player_down_idle.animation
|
#begin Textures/Animations/explosion_1.animation
|
||||||
/copy:Textures/Animations/player_down_idle.animation
|
/copy:Textures/Animations/explosion_1.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_down-left_idle.animation
|
|
||||||
/copy:Textures/Animations/player_down-left_idle.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_down-right_idle.animation
|
|
||||||
/copy:Textures/Animations/player_down-right_idle.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_idle_down_mining.animation
|
#begin Textures/Animations/player_idle_down_mining.animation
|
||||||
/copy:Textures/Animations/player_idle_down_mining.animation
|
/copy:Textures/Animations/player_idle_down_mining.animation
|
||||||
|
@ -215,77 +170,65 @@
|
||||||
#begin Textures/Animations/player_idle_top-rights_mining.animation
|
#begin Textures/Animations/player_idle_top-rights_mining.animation
|
||||||
/copy:Textures/Animations/player_idle_top-rights_mining.animation
|
/copy:Textures/Animations/player_idle_top-rights_mining.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_left_idle.animation
|
#begin Textures/Animations/player_look_down_weapon.animation
|
||||||
/copy:Textures/Animations/player_left_idle.animation
|
/copy:Textures/Animations/player_look_down_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_down.animation
|
#begin Textures/Animations/player_look_down.animation
|
||||||
/copy:Textures/Animations/player_look_down.animation
|
/copy:Textures/Animations/player_look_down.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_down_weapon.animation
|
#begin Textures/Animations/player_look_left_down_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_down_weapon.animation
|
/copy:Textures/Animations/player_look_left_down_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left.animation
|
|
||||||
/copy:Textures/Animations/player_look_left.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left_down.animation
|
#begin Textures/Animations/player_look_left_down.animation
|
||||||
/copy:Textures/Animations/player_look_left_down.animation
|
/copy:Textures/Animations/player_look_left_down.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left_down_weapon.animation
|
#begin Textures/Animations/player_look_left_up_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_left_down_weapon.animation
|
/copy:Textures/Animations/player_look_left_up_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left_up.animation
|
#begin Textures/Animations/player_look_left_up.animation
|
||||||
/copy:Textures/Animations/player_look_left_up.animation
|
/copy:Textures/Animations/player_look_left_up.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left_up_weapon.animation
|
|
||||||
/copy:Textures/Animations/player_look_left_up_weapon.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_left_weapon.animation
|
#begin Textures/Animations/player_look_left_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_left_weapon.animation
|
/copy:Textures/Animations/player_look_left_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right.animation
|
#begin Textures/Animations/player_look_left.animation
|
||||||
/copy:Textures/Animations/player_look_right.animation
|
/copy:Textures/Animations/player_look_left.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right_down.animation
|
|
||||||
/copy:Textures/Animations/player_look_right_down.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right_down_weapon.animation
|
#begin Textures/Animations/player_look_right_down_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_right_down_weapon.animation
|
/copy:Textures/Animations/player_look_right_down_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right_up.animation
|
#begin Textures/Animations/player_look_right_down.animation
|
||||||
/copy:Textures/Animations/player_look_right_up.animation
|
/copy:Textures/Animations/player_look_right_down.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right_up_weapon.animation
|
#begin Textures/Animations/player_look_right_up_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_right_up_weapon.animation
|
/copy:Textures/Animations/player_look_right_up_weapon.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_look_right_up.animation
|
||||||
|
/copy:Textures/Animations/player_look_right_up.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_right_weapon.animation
|
#begin Textures/Animations/player_look_right_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_right_weapon.animation
|
/copy:Textures/Animations/player_look_right_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_up.animation
|
#begin Textures/Animations/player_look_right.animation
|
||||||
/copy:Textures/Animations/player_look_up.animation
|
/copy:Textures/Animations/player_look_right.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_look_up_weapon.animation
|
#begin Textures/Animations/player_look_up_weapon.animation
|
||||||
/copy:Textures/Animations/player_look_up_weapon.animation
|
/copy:Textures/Animations/player_look_up_weapon.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_right_idle.animation
|
#begin Textures/Animations/player_look_up.animation
|
||||||
/copy:Textures/Animations/player_right_idle.animation
|
/copy:Textures/Animations/player_look_up.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_down.animation
|
#begin Textures/Animations/player_run_down.animation
|
||||||
/copy:Textures/Animations/player_run_down.animation
|
/copy:Textures/Animations/player_run_down.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_left.animation
|
|
||||||
/copy:Textures/Animations/player_run_left.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_left_down.animation
|
#begin Textures/Animations/player_run_left_down.animation
|
||||||
/copy:Textures/Animations/player_run_left_down.animation
|
/copy:Textures/Animations/player_run_left_down.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_left_up.animation
|
#begin Textures/Animations/player_run_left_up.animation
|
||||||
/copy:Textures/Animations/player_run_left_up.animation
|
/copy:Textures/Animations/player_run_left_up.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_right.animation
|
#begin Textures/Animations/player_run_left.animation
|
||||||
/copy:Textures/Animations/player_run_right.animation
|
/copy:Textures/Animations/player_run_left.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_right.zip
|
|
||||||
/copy:Textures/Animations/player_run_right.zip
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_right_down.animation
|
#begin Textures/Animations/player_run_right_down.animation
|
||||||
/copy:Textures/Animations/player_run_right_down.animation
|
/copy:Textures/Animations/player_run_right_down.animation
|
||||||
|
@ -293,6 +236,12 @@
|
||||||
#begin Textures/Animations/player_run_right_up.animation
|
#begin Textures/Animations/player_run_right_up.animation
|
||||||
/copy:Textures/Animations/player_run_right_up.animation
|
/copy:Textures/Animations/player_run_right_up.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_run_right.animation
|
||||||
|
/copy:Textures/Animations/player_run_right.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_run_right.zip
|
||||||
|
/copy:Textures/Animations/player_run_right.zip
|
||||||
|
|
||||||
#begin Textures/Animations/player_run_up.animation
|
#begin Textures/Animations/player_run_up.animation
|
||||||
/copy:Textures/Animations/player_run_up.animation
|
/copy:Textures/Animations/player_run_up.animation
|
||||||
|
|
||||||
|
@ -302,15 +251,30 @@
|
||||||
#begin Textures/Animations/player_top_mining.animation
|
#begin Textures/Animations/player_top_mining.animation
|
||||||
/copy:Textures/Animations/player_top_mining.animation
|
/copy:Textures/Animations/player_top_mining.animation
|
||||||
|
|
||||||
#begin Textures/Animations/player_top-left_idle.animation
|
|
||||||
/copy:Textures/Animations/player_top-left_idle.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/player_top-right_idle.animation
|
|
||||||
/copy:Textures/Animations/player_top-right_idle.animation
|
|
||||||
|
|
||||||
#begin Textures/Animations/running_top.animation
|
#begin Textures/Animations/running_top.animation
|
||||||
/copy:Textures/Animations/running_top.animation
|
/copy:Textures/Animations/running_top.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_down_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_down_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_down-left_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_down-left_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_down-right_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_down-right_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_left_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_left_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_right_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_right_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_top-left_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_top-left_idle.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/Simple Idles/player_top-right_idle.animation
|
||||||
|
/copy:Textures/Animations/Simple Idles/player_top-right_idle.animation
|
||||||
|
|
||||||
#begin Textures/Animations/testAnimation.animation
|
#begin Textures/Animations/testAnimation.animation
|
||||||
/copy:Textures/Animations/testAnimation.animation
|
/copy:Textures/Animations/testAnimation.animation
|
||||||
|
|
||||||
|
@ -332,18 +296,6 @@
|
||||||
#begin Textures/Animations/zombie_walk.animation
|
#begin Textures/Animations/zombie_walk.animation
|
||||||
/copy:Textures/Animations/zombie_walk.animation
|
/copy:Textures/Animations/zombie_walk.animation
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/Character/hr-level1_idle.png
|
|
||||||
/importer:TextureImporter
|
|
||||||
/processor:TextureProcessor
|
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
|
||||||
/processorParam:ColorKeyEnabled=True
|
|
||||||
/processorParam:GenerateMipmaps=False
|
|
||||||
/processorParam:PremultiplyAlpha=True
|
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
|
||||||
/processorParam:MakeSquare=False
|
|
||||||
/processorParam:TextureFormat=Color
|
|
||||||
/build:Textures/AnimationTextures/Character/hr-level1_idle.png
|
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/Character/hr-level1_idle_gun.png
|
#begin Textures/AnimationTextures/Character/hr-level1_idle_gun.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -356,6 +308,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/AnimationTextures/Character/hr-level1_idle_gun.png
|
/build:Textures/AnimationTextures/Character/hr-level1_idle_gun.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_idle.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:Textures/AnimationTextures/Character/hr-level1_idle.png
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-1.png
|
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-1.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -380,18 +344,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/AnimationTextures/Character/hr-level1_mining_tool-2.png
|
/build:Textures/AnimationTextures/Character/hr-level1_mining_tool-2.png
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/Character/hr-level1_running.png
|
|
||||||
/importer:TextureImporter
|
|
||||||
/processor:TextureProcessor
|
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
|
||||||
/processorParam:ColorKeyEnabled=True
|
|
||||||
/processorParam:GenerateMipmaps=False
|
|
||||||
/processorParam:PremultiplyAlpha=True
|
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
|
||||||
/processorParam:MakeSquare=False
|
|
||||||
/processorParam:TextureFormat=Color
|
|
||||||
/build:Textures/AnimationTextures/Character/hr-level1_running.png
|
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/Character/hr-level1_running_gun.png
|
#begin Textures/AnimationTextures/Character/hr-level1_running_gun.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -404,6 +356,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/AnimationTextures/Character/hr-level1_running_gun.png
|
/build:Textures/AnimationTextures/Character/hr-level1_running_gun.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_running.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:Textures/AnimationTextures/Character/hr-level1_running.png
|
||||||
|
|
||||||
#begin Textures/AnimationTextures/unicorn.png
|
#begin Textures/AnimationTextures/unicorn.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -440,7 +404,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png
|
/build:Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png
|
||||||
|
|
||||||
|
|
||||||
#begin Textures/Effects/explosion.png
|
#begin Textures/Effects/explosion.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -585,18 +548,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/ButtonI.png
|
/build:Textures/GUI/ButtonI.png
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_off.png
|
|
||||||
/importer:TextureImporter
|
|
||||||
/processor:TextureProcessor
|
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
|
||||||
/processorParam:ColorKeyEnabled=True
|
|
||||||
/processorParam:GenerateMipmaps=False
|
|
||||||
/processorParam:PremultiplyAlpha=True
|
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
|
||||||
/processorParam:MakeSquare=False
|
|
||||||
/processorParam:TextureFormat=Color
|
|
||||||
/build:Textures/GUI/checkboxs_off.png
|
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_off-on.png
|
#begin Textures/GUI/checkboxs_off-on.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -609,6 +560,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/checkboxs_off-on.png
|
/build:Textures/GUI/checkboxs_off-on.png
|
||||||
|
|
||||||
|
#begin Textures/GUI/checkboxs_off.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:Textures/GUI/checkboxs_off.png
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_on.png
|
#begin Textures/GUI/checkboxs_on.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -645,18 +608,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/mouse.png
|
/build:Textures/GUI/mouse.png
|
||||||
|
|
||||||
#begin Textures/GUI/switch.png
|
|
||||||
/importer:TextureImporter
|
|
||||||
/processor:TextureProcessor
|
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
|
||||||
/processorParam:ColorKeyEnabled=True
|
|
||||||
/processorParam:GenerateMipmaps=False
|
|
||||||
/processorParam:PremultiplyAlpha=True
|
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
|
||||||
/processorParam:MakeSquare=False
|
|
||||||
/processorParam:TextureFormat=Color
|
|
||||||
/build:Textures/GUI/switch.png
|
|
||||||
|
|
||||||
#begin Textures/GUI/Switch_backgrownd.png
|
#begin Textures/GUI/Switch_backgrownd.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -669,6 +620,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/Switch_backgrownd.png
|
/build:Textures/GUI/Switch_backgrownd.png
|
||||||
|
|
||||||
|
#begin Textures/GUI/switch.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:Textures/GUI/switch.png
|
||||||
|
|
||||||
#begin Textures/icons/12.png
|
#begin Textures/icons/12.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -885,18 +848,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/icons/ExitZone.png
|
/build:Textures/icons/ExitZone.png
|
||||||
|
|
||||||
#begin Textures/icons/ExitZone.png
|
|
||||||
/importer:TextureImporter
|
|
||||||
/processor:TextureProcessor
|
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
|
||||||
/processorParam:ColorKeyEnabled=True
|
|
||||||
/processorParam:GenerateMipmaps=False
|
|
||||||
/processorParam:PremultiplyAlpha=True
|
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
|
||||||
/processorParam:MakeSquare=False
|
|
||||||
/processorParam:TextureFormat=Color
|
|
||||||
/build:Textures/icons/ExitZone.png
|
|
||||||
|
|
||||||
#begin Textures/icons/Material/Fabric.png
|
#begin Textures/icons/Material/Fabric.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
|
|
@ -60,11 +60,17 @@ namespace ZoFo.GameCore
|
||||||
};
|
};
|
||||||
AppManager.Instance.InputManager.OnInteract += () =>
|
AppManager.Instance.InputManager.OnInteract += () =>
|
||||||
{
|
{
|
||||||
networkManager.AddData(new UpdateInputInteraction() {PlayerId = AppManager.Instance.client.networkManager.PlayerId });
|
if (AppManager.Instance.client.networkManager.PlayerId > 0)
|
||||||
|
{
|
||||||
|
networkManager.AddData(new UpdateInputInteraction() { PlayerId = AppManager.Instance.client.networkManager.PlayerId });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
AppManager.Instance.InputManager.ShootEvent += () =>
|
AppManager.Instance.InputManager.ShootEvent += () =>
|
||||||
{
|
{
|
||||||
networkManager.AddData(new UpdateInputShoot() { PlayerId = AppManager.Instance.client.networkManager.PlayerId });
|
if (AppManager.Instance.client.networkManager.PlayerId > 0)
|
||||||
|
{
|
||||||
|
networkManager.AddData(new UpdateInputShoot() { PlayerId = AppManager.Instance.client.networkManager.PlayerId });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +113,7 @@ namespace ZoFo.GameCore
|
||||||
float shakeEffect = 0;
|
float shakeEffect = 0;
|
||||||
public void AddShaking(float power)
|
public void AddShaking(float power)
|
||||||
{
|
{
|
||||||
shakeEffect += power;
|
shakeEffect += power*3;
|
||||||
}
|
}
|
||||||
public void UpdateShaking()
|
public void UpdateShaking()
|
||||||
{
|
{
|
||||||
|
@ -253,11 +259,11 @@ namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
GameEnd();
|
GameEnd();
|
||||||
}
|
}
|
||||||
else if (update is UpdatePlayerParametrs && update.IdEntity == myPlayer.Id) //aaa
|
else if (update is UpdatePlayerParametrs && myPlayer !=null && update.IdEntity == myPlayer.Id) //aaa
|
||||||
{
|
{
|
||||||
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
||||||
}
|
}
|
||||||
else if (update is UpdateLoot && update.IdEntity == myPlayer.Id)//aaa
|
else if (update is UpdateLoot && myPlayer != null && update.IdEntity == myPlayer.Id)//aaa
|
||||||
{
|
{
|
||||||
if ((update as UpdateLoot).quantity == 0)
|
if ((update as UpdateLoot).quantity == 0)
|
||||||
{
|
{
|
||||||
|
@ -316,10 +322,11 @@ namespace ZoFo.GameCore
|
||||||
(ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin;
|
(ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool changeGUI = false;
|
||||||
public void GameEnd()
|
public void GameEnd()
|
||||||
{
|
{
|
||||||
AppManager.Instance.SetGUI(new FinishingGUI());
|
|
||||||
|
changeGUI = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Entity FindEntityById(int id)
|
public Entity FindEntityById(int id)
|
||||||
|
|
|
@ -31,6 +31,7 @@ public class DebugHUD
|
||||||
|
|
||||||
public void Draw(SpriteBatch spriteBatch)
|
public void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
|
//return;//TODO delete
|
||||||
var keysString = Join("\n", _text.Select(el => el.Key + ": " + el.Value).ToList());
|
var keysString = Join("\n", _text.Select(el => el.Key + ": " + el.Value).ToList());
|
||||||
spriteBatch.Begin();
|
spriteBatch.Begin();
|
||||||
spriteBatch.DrawString(
|
spriteBatch.DrawString(
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class WaitingForPlayersGUI : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/Waiting" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/waiting" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
// string pcIp =
|
// string pcIp =
|
||||||
|
|
|
@ -127,13 +127,20 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (client != null)
|
||||||
|
{
|
||||||
|
if (client.changeGUI)
|
||||||
|
{
|
||||||
|
SetGUI(new FinishingGUI());
|
||||||
|
client.changeGUI = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
base.Update(gameTime);
|
base.Update(gameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Draw(GameTime gameTime)
|
protected override void Draw(GameTime gameTime)
|
||||||
{
|
{
|
||||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
GraphicsDevice.Clear(Color.Black);
|
||||||
|
|
||||||
|
|
||||||
// Pointwrap
|
// Pointwrap
|
||||||
|
|
|
@ -168,7 +168,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Обработка взаимодействия с collectable(например лутом). Вызывает событие OnInteract
|
#region Обработка взаимодействия с collectable(например лутом). Вызывает событие OnInteract
|
||||||
if (keyBoardState.IsKeyDown(Keys.E) && !isInteract)
|
if ((keyBoardState.IsKeyDown(Keys.E) || mouseState.LeftButton == ButtonState.Pressed) && !isInteract)
|
||||||
{
|
{
|
||||||
OnInteract?.Invoke();
|
OnInteract?.Invoke();
|
||||||
Debug.WriteLine("взаимодействие с Collectable");
|
Debug.WriteLine("взаимодействие с Collectable");
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace ZoFo.GameCore.GameManagers.ItemManager
|
||||||
//методы
|
//методы
|
||||||
public ItemInfo GetItemInfo(string tag)
|
public ItemInfo GetItemInfo(string tag)
|
||||||
{
|
{
|
||||||
|
if (tag == "peeble")
|
||||||
|
return tagItemPairs["pebble"];
|
||||||
return tagItemPairs[tag];
|
return tagItemPairs[tag];
|
||||||
}
|
}
|
||||||
public void LoadItemTextures()
|
public void LoadItemTextures()
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||||
using System.Data.SqlTypes;
|
using System.Data.SqlTypes;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -20,7 +21,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
{
|
{
|
||||||
public class ClientNetworkManager
|
public class ClientNetworkManager
|
||||||
{
|
{
|
||||||
public int PlayerId;
|
public int PlayerId = 0;
|
||||||
private IPEndPoint endPoint;
|
private IPEndPoint endPoint;
|
||||||
private IPEndPoint sendingEP;
|
private IPEndPoint sendingEP;
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
|
@ -242,19 +243,18 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
#endregion
|
#endregion
|
||||||
public static IPAddress GetIp()
|
public static IPAddress GetIp()
|
||||||
{
|
{
|
||||||
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
var ips = NetworkInterface.GetAllNetworkInterfaces()
|
||||||
var ipList = Dns.GetHostEntry(hostName).AddressList;
|
.Where(x => x.OperationalStatus == OperationalStatus.Up)
|
||||||
var ipV4List = new List<IPAddress>();
|
.Where(x => x.NetworkInterfaceType is NetworkInterfaceType.Wireless80211
|
||||||
foreach (var ip in ipList)
|
or NetworkInterfaceType.Ethernet)
|
||||||
|
.SelectMany(x => x.GetIPProperties().UnicastAddresses)
|
||||||
|
.Where(x => x.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||||
|
.Select(x => x.Address)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (ips.Count > 0)
|
||||||
{
|
{
|
||||||
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
return ips[^1];
|
||||||
{
|
|
||||||
ipV4List.Add(ip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ipV4List.Count>0)
|
|
||||||
{
|
|
||||||
return ipV4List[ipV4List.Count - 1];
|
|
||||||
}
|
}
|
||||||
return IPAddress.Loopback;
|
return IPAddress.Loopback;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
@ -66,20 +67,18 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IPAddress GetIp()
|
public static IPAddress GetIp()
|
||||||
{
|
{
|
||||||
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
var ips = NetworkInterface.GetAllNetworkInterfaces()
|
||||||
var ipList = Dns.GetHostEntry(hostName).AddressList;
|
.Where(x => x.OperationalStatus == OperationalStatus.Up)
|
||||||
|
.Where(x => x.NetworkInterfaceType is NetworkInterfaceType.Wireless80211
|
||||||
|
or NetworkInterfaceType.Ethernet)
|
||||||
|
.SelectMany(x => x.GetIPProperties().UnicastAddresses)
|
||||||
|
.Where(x => x.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||||
|
.Select(x => x.Address)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
var ipV4List = new List<IPAddress>();
|
if (ips.Count > 0)
|
||||||
foreach (var ip in ipList)
|
|
||||||
{
|
{
|
||||||
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
return ips[^1];
|
||||||
{
|
|
||||||
ipV4List.Add(ip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ipV4List.Count > 0)
|
|
||||||
{
|
|
||||||
return ipV4List[ipV4List.Count - 1];
|
|
||||||
}
|
}
|
||||||
return IPAddress.Loopback;
|
return IPAddress.Loopback;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +135,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
|
|
||||||
if (sendedData.Count != 0)
|
if (sendedData.Count != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < clientsEP.Count; i++)
|
for (int i = 0; i < clientsEP.Count; i++)
|
||||||
{
|
{
|
||||||
foreach (Datagramm Dgramm in sendedData.Where(x => x.PlayerId == i+1))
|
foreach (Datagramm Dgramm in sendedData.Where(x => x.PlayerId == i+1))
|
||||||
|
|
|
@ -10,7 +10,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
public class UpdateCreatePlayer : UpdateData
|
public class UpdateCreatePlayer : UpdateData
|
||||||
{
|
{
|
||||||
public int PlayerId { get; set; }
|
public int PlayerId { get; set; }
|
||||||
public SerializableVector2 position { get; set; }
|
|
||||||
public UpdateCreatePlayer()
|
public UpdateCreatePlayer()
|
||||||
{
|
{
|
||||||
isImportant = true;
|
isImportant = true;
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace ZoFo.GameCore.GameObjects
|
||||||
{
|
{
|
||||||
public class Peeble:Collectable
|
public class Peeble:Collectable
|
||||||
{
|
{
|
||||||
public override StaticGraphicsComponent graphicsComponent { get; } = new(_path + "Peeble");
|
public override StaticGraphicsComponent graphicsComponent { get; } = new(_path + "Pebble");
|
||||||
|
|
||||||
public Peeble(Vector2 position) : base(position) { }
|
public Peeble(Vector2 position) : base(position) { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace ZoFo.GameCore.GameObjects
|
||||||
public Zombie(Vector2 position) : base(position)
|
public Zombie(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
health = 5;
|
health = 5;
|
||||||
speed = 0.5f;
|
speed = 7.5f;
|
||||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
|
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
|
||||||
collisionComponent.stopRectangle = new Rectangle(10, 20, 10, 10);
|
collisionComponent.stopRectangle = new Rectangle(10, 20, 10, 10);
|
||||||
isAttacking = false;
|
isAttacking = false;
|
||||||
|
@ -98,7 +98,7 @@ namespace ZoFo.GameCore.GameObjects
|
||||||
//TODO ДАМАЖИТЬ ИГРОКОВ В ЗОНЕ
|
//TODO ДАМАЖИТЬ ИГРОКОВ В ЗОНЕ
|
||||||
if (damagedPlayers.Length>0) { DebugHUD.DebugLog("End of" + a);
|
if (damagedPlayers.Length>0) { DebugHUD.DebugLog("End of" + a);
|
||||||
foreach (var item in damagedPlayers)
|
foreach (var item in damagedPlayers)
|
||||||
item.TakeDamage(1);
|
item.TakeDamage(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class Player : LivingEntity
|
||||||
lootData.loots = new Dictionary<string, int>();
|
lootData.loots = new Dictionary<string, int>();
|
||||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
|
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
|
||||||
collisionComponent.stopRectangle = new Rectangle(10, 15, 10, 15);
|
collisionComponent.stopRectangle = new Rectangle(10, 15, 10, 15);
|
||||||
speed = 5;
|
speed = 7;
|
||||||
|
|
||||||
StartAnimation("player_look_down");
|
StartAnimation("player_look_down");
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@ public abstract class GameObject
|
||||||
}
|
}
|
||||||
public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null)
|
public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
if (color is null) color = new Color(1, 0, 0, 0.1f);
|
if (color is null) color = new Color(1, 0, 0, 0.1f);
|
||||||
if (color.Value.A == 255) color = new Color(color.Value, 0.25f);
|
if (color.Value.A == 255) color = new Color(color.Value, 0.25f);
|
||||||
spriteBatch.Draw(debugTexture,
|
spriteBatch.Draw(debugTexture,
|
||||||
|
|
|
@ -71,7 +71,10 @@ namespace ZoFo.GameCore
|
||||||
if (players.Count > 0)
|
if (players.Count > 0)
|
||||||
{
|
{
|
||||||
UpdateInput data = updateData as UpdateInput;
|
UpdateInput data = updateData as UpdateInput;
|
||||||
players[data.PlayerId - 1].HandleNewInput(data);
|
if (data.PlayerId > 0)
|
||||||
|
{
|
||||||
|
players[data.PlayerId - 1].HandleNewInput(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//TODO id instead of 0
|
//TODO id instead of 0
|
||||||
else
|
else
|
||||||
|
@ -138,7 +141,7 @@ namespace ZoFo.GameCore
|
||||||
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
|
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
|
||||||
for (int i = 0; i < networkManager.clientsEP.Count; i++)
|
for (int i = 0; i < networkManager.clientsEP.Count; i++)
|
||||||
{
|
{
|
||||||
Player player = new Player(new Vector2(760 - 30 * i, 140));
|
Player player = new Player(new Vector2(-800 - 30 * i, 750));
|
||||||
RegisterGameObject(player);
|
RegisterGameObject(player);
|
||||||
networkManager.AddData(new UpdateCreatePlayer() { PlayerId = i+1, IdEntity=player.Id});
|
networkManager.AddData(new UpdateCreatePlayer() { PlayerId = i+1, IdEntity=player.Id});
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
|
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
|
||||||
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
|
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
|
||||||
|
<PackageReference Include="MonoGame.Templates.CSharp" Version="3.8.1.1-kniEngine" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|