├── .gitignore ├── Config ├── DefaultEditor.ini ├── DefaultEditorPerProjectUserSettings.ini ├── DefaultEngine.ini ├── DefaultGame.ini └── DefaultInput.ini ├── Content ├── FirstPerson │ ├── Animations │ │ ├── FirstPersonFire_Montage.uasset │ │ ├── FirstPerson_AnimBP.uasset │ │ ├── FirstPerson_Fire.uasset │ │ ├── FirstPerson_Idle.uasset │ │ ├── FirstPerson_JumpEnd.uasset │ │ ├── FirstPerson_JumpLoop.uasset │ │ ├── FirstPerson_JumpStart.uasset │ │ └── FirstPerson_Run.uasset │ ├── Audio │ │ └── FirstPersonTemplateWeaponFire02.uasset │ ├── Character │ │ ├── Materials │ │ │ ├── M_UE4Man_Body.uasset │ │ │ └── MaterialLayers │ │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ │ ├── SK_Mannequin_Arms.uasset │ │ │ ├── SK_Mannequin_Arms_PhysicsAsset.uasset │ │ │ └── SK_Mannequin_Arms_Skeleton.uasset │ │ └── Textures │ │ │ ├── UE4_LOGO_CARD.uasset │ │ │ ├── UE4_Mannequin_MAT_MASKA.uasset │ │ │ └── UE4_Mannequin__normals.uasset │ ├── FPWeapon │ │ ├── Materials │ │ │ ├── M_FPGun.uasset │ │ │ └── MaterialLayers │ │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ │ ├── ML_Screen.uasset │ │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ │ ├── T_ML_FineRubber.uasset │ │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ │ ├── SK_FPGun.uasset │ │ │ ├── SK_FPGun_PhysicsAsset.uasset │ │ │ └── SK_FPGun_Skeleton.uasset │ │ └── Textures │ │ │ ├── T_FPGun_M.uasset │ │ │ └── T_FPGun_N.uasset │ ├── Meshes │ │ ├── BaseMaterial.uasset │ │ ├── CubeMaterialOverride.uasset │ │ ├── FirstPersonProjectileMaterial.uasset │ │ └── FirstPersonProjectileMesh.uasset │ └── Textures │ │ ├── FirstPersonCrosshair.uasset │ │ └── Minimap_Diff.uasset ├── FirstPersonCPP │ ├── Blueprints │ │ ├── Character_BP.uasset │ │ ├── FirstPersonCharacter.uasset │ │ ├── FirstPersonProjectile.uasset │ │ ├── HUD_Widget.uasset │ │ └── PlayerHUD.uasset │ ├── FirstPersonOverview.uasset │ └── Maps │ │ └── FirstPersonExampleMap.umap └── Geometry │ └── Meshes │ ├── 1M_Cube.uasset │ ├── 1M_Cube_Chamfer.uasset │ ├── CubeMaterial.uasset │ └── TemplateFloor.uasset ├── FPGame.uproject ├── Plugins └── Minimap │ ├── Content │ ├── ActorWidget.uasset │ ├── Asset │ │ ├── Minimap_volume.uasset │ │ └── Waypoint.uasset │ ├── Minimap.uasset │ ├── Minimap_OnlyBP.uasset │ ├── Minimap_mat.uasset │ ├── Textures │ │ ├── DebugMap_diff.uasset │ │ ├── MinimapShape_circle.uasset │ │ ├── MinimapShape_default.uasset │ │ ├── Player_arrow.uasset │ │ ├── Waypoint_arrow.uasset │ │ └── Waypoint_icon.uasset │ └── WaypointWidget.uasset │ ├── Minimap.uplugin │ └── Source │ └── Minimap │ ├── Minimap.Build.cs │ ├── Private │ ├── Minimap.cpp │ ├── MinimapEdMode.cpp │ ├── MinimapEdModeToolkit.cpp │ ├── MinimapPrivatePCH.h │ └── MinimapWidget.cpp │ └── Public │ ├── Minimap.h │ ├── MinimapEdMode.h │ ├── MinimapEdModeToolkit.h │ └── MinimapWidget.h ├── README.md └── Source ├── FPGame.Target.cs ├── FPGame ├── FPGame.Build.cs ├── FPGame.cpp ├── FPGame.h ├── FPGameCharacter.cpp ├── FPGameCharacter.h ├── FPGameGameMode.cpp ├── FPGameGameMode.h ├── FPGameHUD.cpp ├── FPGameHUD.h ├── FPGameProjectile.cpp └── FPGameProjectile.h └── FPGameEditor.Target.cs /.gitignore: -------------------------------------------------------------------------------- 1 | Binaries/ 2 | Build/ 3 | DerivedDataCache/ 4 | Intermediate/ 5 | Saved/ 6 | *.sln 7 | *.vcxproj 8 | *.xcodeproj 9 | *.suo 10 | -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | [UnrealEd.SimpleMap] 2 | SimpleMapName=/Game/FirstPerson/Maps/FirstPersonExampleMap 3 | 4 | [EditoronlyBP] 5 | bAllowClassAndBlueprintPinMatching=true 6 | bReplaceBlueprintWithClass= true 7 | bDontLoadBlueprintOutsideEditor= true 8 | bBlueprintIsNotBlueprintType= true -------------------------------------------------------------------------------- /Config/DefaultEditorPerProjectUserSettings.ini: -------------------------------------------------------------------------------- 1 | [ContentBrowser] 2 | ContentBrowserTab1.SelectedPaths=/Game/FirstPerson 3 | 4 | [/Script/UnrealEd.EditorLoadingSavingSettings] 5 | LoadLevelAtStartup=ProjectDefault 6 | bForceCompilationAtStartup=False 7 | bRestoreOpenAssetTabsOnRestart=False 8 | bEnableSourceControlCompatabilityCheck=True 9 | bMonitorContentDirectories=True 10 | +AutoReimportDirectorySettings=(SourceDirectory="/Game/",MountPoint=,Wildcards=) 11 | AutoReimportThreshold=3.000000 12 | bAutoCreateAssets=True 13 | bAutoDeleteAssets=True 14 | bDetectChangesOnRestart=True 15 | bDeleteSourceFilesWithAssets=False 16 | bAutoReimportTextures=False 17 | bAutoReimportCSV=False 18 | bDirtyMigratedBlueprints=False 19 | bAutoSaveEnable=False 20 | bAutoSaveMaps=True 21 | bAutoSaveContent=True 22 | AutoSaveTimeMinutes=10 23 | AutoSaveWarningInSeconds=10 24 | bAutomaticallyCheckoutOnAssetModification=False 25 | bPromptForCheckoutOnAssetModification=True 26 | bSCCAutoAddNewFiles=True 27 | bSCCUseGlobalSettings=False 28 | TextDiffToolPath=(FilePath="p4merge.exe") 29 | 30 | 31 | -------------------------------------------------------------------------------- /Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | [/Script/Engine.CollisionProfile] 2 | +Profiles=(Name="Projectile",CollisionEnabled=QueryOnly,ObjectTypeName="Projectile",CustomResponses=,HelpMessage="Preset for projectiles",bCanModify=True) 3 | +DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,Name="Projectile",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False) 4 | +EditProfiles=(Name="Trigger",CustomResponses=((Channel=Projectile, Response=ECR_Ignore))) 5 | 6 | [/Script/EngineSettings.GameMapsSettings] 7 | EditorStartupMap=/Game/FirstPersonCPP/Maps/FirstPersonExampleMap 8 | LocalMapOptions= 9 | TransitionMap= 10 | bUseSplitscreen=True 11 | TwoPlayerSplitscreenLayout=Horizontal 12 | ThreePlayerSplitscreenLayout=FavorTop 13 | GameInstanceClass=/Script/Engine.GameInstance 14 | GameDefaultMap=/Game/FirstPersonCPP/Maps/FirstPersonExampleMap 15 | ServerDefaultMap=/Engine/Maps/Entry 16 | GlobalDefaultGameMode=/Script/FPGame.FPGameGameMode 17 | GlobalDefaultServerGameMode=None 18 | 19 | 20 | 21 | [/Script/Engine.Engine] 22 | +ActiveGameNameRedirects=(OldGameName="TP_FirstPerson",NewGameName="/Script/FPGame") 23 | +ActiveGameNameRedirects=(OldGameName="/Script/TP_FirstPerson",NewGameName="/Script/FPGame") 24 | +ActiveClassRedirects=(OldClassName="TP_FirstPersonProjectile",NewClassName="FPGameProjectile") 25 | +ActiveClassRedirects=(OldClassName="TP_FirstPersonHUD",NewClassName="FPGameHUD") 26 | +ActiveClassRedirects=(OldClassName="TP_FirstPersonGameMode",NewClassName="FPGameGameMode") 27 | +ActiveClassRedirects=(OldClassName="TP_FirstPersonCharacter",NewClassName="FPGameCharacter") 28 | 29 | [/Script/Engine.UserInterfaceSettings] 30 | RenderFocusRule=NavigationOnly 31 | DefaultCursor=None 32 | TextEditBeamCursor=None 33 | CrosshairsCursor=None 34 | GrabHandCursor=None 35 | GrabHandClosedCursor=None 36 | SlashedCircleCursor=None 37 | ApplicationScale=1.000000 38 | UIScaleRule=ShortestSide 39 | CustomScalingRuleClass=None 40 | UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000)),DefaultValue=340282346638528860000000000000000000000.000000),ExternalCurve=None) 41 | 42 | [/Script/Engine.RendererSettings] 43 | r.MobileHDR=True 44 | r.MobileNumDynamicPointLights=4 45 | r.MobileDynamicPointLightsUseStaticBranch=True 46 | r.AllowOcclusionQueries=True 47 | r.MinScreenRadiusForLights=0.030000 48 | r.MinScreenRadiusForDepthPrepass=0.030000 49 | r.PrecomputedVisibilityWarning=False 50 | r.TextureStreaming=True 51 | Compat.UseDXT5NormalMaps=False 52 | r.AllowStaticLighting=True 53 | r.NormalMapsForStaticLighting=False 54 | r.GenerateMeshDistanceFields=False 55 | r.GenerateLandscapeGIData=True 56 | r.TessellationAdaptivePixelsPerTriangle=48.000000 57 | r.SeparateTranslucency=True 58 | r.TranslucentSortPolicy=0 59 | TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000) 60 | r.CustomDepth=1 61 | r.DefaultFeature.Bloom=True 62 | r.DefaultFeature.AmbientOcclusion=True 63 | r.DefaultFeature.AmbientOcclusionStaticFraction=True 64 | r.DefaultFeature.AutoExposure=True 65 | r.DefaultFeature.MotionBlur=True 66 | r.DefaultFeature.LensFlare=True 67 | r.DefaultFeature.AntiAliasing=2 68 | r.EarlyZPass=3 69 | r.EarlyZPassMovable=False 70 | r.DBuffer=False 71 | r.ClearSceneMethod=1 72 | r.BasePassOutputsVelocity=False 73 | r.WireframeCullThreshold=5.000000 74 | UIScaleRule=ShortestSide 75 | UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=,DefaultValue=340282346638528860000000000000000000000.000000),ExternalCurve=None) 76 | 77 | [/Script/HardwareTargeting.HardwareTargetingSettings] 78 | TargetedHardwareClass=Desktop 79 | AppliedTargetedHardwareClass=Desktop 80 | DefaultGraphicsPerformance=Maximum 81 | AppliedDefaultGraphicsPerformance=Maximum 82 | 83 | 84 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | [ProjectSettings] 2 | ProjectID=(A=1823396784,B=1298598689,C=1743498150,D=-2048051708) 3 | ProjectName=First Person Template 4 | 5 | 6 | [/Script/EngineSettings.GeneralProjectSettings] 7 | ProjectID=D196E4D141D34DB1627DF6B3848A0CEA 8 | 9 | [/Script/UnrealEd.ProjectPackagingSettings] 10 | BuildConfiguration=PPBC_Development 11 | StagingDirectory=(Path=) 12 | FullRebuild=False 13 | ForDistribution=False 14 | IncludeDebugFiles=False 15 | UsePakFile=True 16 | bGenerateChunks=False 17 | bBuildHttpChunkInstallData=False 18 | HttpChunkInstallDataDirectory=(Path=) 19 | HttpChunkInstallDataVersion= 20 | IncludePrerequisites=True 21 | IncludeCrashReporter=True 22 | InternationalizationPreset=English 23 | -CulturesToStage=en 24 | +CulturesToStage=en 25 | DefaultCulture=en 26 | bCookAll=False 27 | bCookMapsOnly=False 28 | bCompressed=False 29 | +DirectoriesToAlwaysStageAsUFS=(Path="WwiseAudio") 30 | 31 | 32 | -------------------------------------------------------------------------------- /Config/DefaultInput.ini: -------------------------------------------------------------------------------- 1 | [/Script/Engine.InputSettings] 2 | +ActionMappings=(ActionName="Jump", Key=SpaceBar) 3 | +ActionMappings=(ActionName="Jump", Key=Gamepad_FaceButton_Bottom) 4 | 5 | +ActionMappings=(ActionName="Fire", Key=LeftMouseButton) 6 | +ActionMappings=(ActionName="Fire", Key=Gamepad_RightTrigger) 7 | 8 | +AxisMappings=(AxisName="MoveForward", Key=W, Scale=1.f) 9 | +AxisMappings=(AxisName="MoveForward", Key=S, Scale=-1.f) 10 | +AxisMappings=(AxisName="MoveForward", Key=Up, Scale=1.f) 11 | +AxisMappings=(AxisName="MoveForward", Key=Down, Scale=-1.f) 12 | +AxisMappings=(AxisName="MoveForward", Key=Gamepad_LeftY, Scale=1.f) 13 | 14 | +AxisMappings=(AxisName="MoveRight", Key=A, Scale=-1.f) 15 | +AxisMappings=(AxisName="MoveRight", Key=D, Scale=1.f) 16 | +AxisMappings=(AxisName="MoveRight", Key=Gamepad_LeftX, Scale=1.f) 17 | 18 | +AxisMappings=(AxisName="TurnRate", Key=Gamepad_RightX, Scale=1.f) 19 | +AxisMappings=(AxisName="TurnRate", Key=Left, Scale=-1.f) 20 | +AxisMappings=(AxisName="TurnRate", Key=Right, Scale=1.f) 21 | +AxisMappings=(AxisName="Turn", Key=MouseX, Scale=1.f) 22 | 23 | +AxisMappings=(AxisName="LookUpRate", Key=Gamepad_RightY, Scale=1.f) 24 | +AxisMappings=(AxisName="LookUp", Key=MouseY, Scale=-1.f) -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPersonFire_Montage.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPersonFire_Montage.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_AnimBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_AnimBP.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Fire.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_Fire.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Idle.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_Idle.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpEnd.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_JumpEnd.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpLoop.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_JumpLoop.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_JumpStart.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_JumpStart.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Animations/FirstPerson_Run.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Animations/FirstPerson_Run.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Audio/FirstPersonTemplateWeaponFire02.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/M_UE4Man_Body.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/M_UE4Man_Body.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_LOGO_CARD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Textures/UE4_LOGO_CARD.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Character/Textures/UE4_Mannequin__normals.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Character/Textures/UE4_Mannequin__normals.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/M_FPGun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/M_FPGun.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Screen.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_Screen.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_FineRubber.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_FineRubber.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Textures/T_FPGun_M.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Textures/T_FPGun_M.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/FPWeapon/Textures/T_FPGun_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/FPWeapon/Textures/T_FPGun_N.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Meshes/BaseMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Meshes/BaseMaterial.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Meshes/CubeMaterialOverride.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Meshes/CubeMaterialOverride.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Meshes/FirstPersonProjectileMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Meshes/FirstPersonProjectileMaterial.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Meshes/FirstPersonProjectileMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Meshes/FirstPersonProjectileMesh.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Textures/FirstPersonCrosshair.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Textures/FirstPersonCrosshair.uasset -------------------------------------------------------------------------------- /Content/FirstPerson/Textures/Minimap_Diff.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPerson/Textures/Minimap_Diff.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Blueprints/Character_BP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Blueprints/Character_BP.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Blueprints/FirstPersonCharacter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Blueprints/FirstPersonCharacter.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Blueprints/FirstPersonProjectile.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Blueprints/FirstPersonProjectile.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Blueprints/HUD_Widget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Blueprints/HUD_Widget.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Blueprints/PlayerHUD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Blueprints/PlayerHUD.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/FirstPersonOverview.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/FirstPersonOverview.uasset -------------------------------------------------------------------------------- /Content/FirstPersonCPP/Maps/FirstPersonExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/FirstPersonCPP/Maps/FirstPersonExampleMap.umap -------------------------------------------------------------------------------- /Content/Geometry/Meshes/1M_Cube.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/Geometry/Meshes/1M_Cube.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/1M_Cube_Chamfer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/CubeMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/Geometry/Meshes/CubeMaterial.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/TemplateFloor.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Content/Geometry/Meshes/TemplateFloor.uasset -------------------------------------------------------------------------------- /FPGame.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "{5CB12A8A-470C-B277-DF0C-359300531201}", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "FPGame", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /Plugins/Minimap/Content/ActorWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/ActorWidget.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Asset/Minimap_volume.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Asset/Minimap_volume.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Asset/Waypoint.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Asset/Waypoint.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Minimap.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Minimap.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Minimap_OnlyBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Minimap_OnlyBP.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Minimap_mat.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Minimap_mat.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/DebugMap_diff.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/DebugMap_diff.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/MinimapShape_circle.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/MinimapShape_circle.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/MinimapShape_default.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/MinimapShape_default.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/Player_arrow.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/Player_arrow.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/Waypoint_arrow.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/Waypoint_arrow.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/Textures/Waypoint_icon.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/Textures/Waypoint_icon.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Content/WaypointWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skrustev/ue4-minimap-img/2ce93ac60c0ae2fd8d12f4745cf288b64f6bc1de/Plugins/Minimap/Content/WaypointWidget.uasset -------------------------------------------------------------------------------- /Plugins/Minimap/Minimap.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "Minimap", 6 | "Description": "", 7 | "Category": "Other", 8 | "CreatedBy": "", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "EnabledByDefault": false, 14 | "CanContainContent": true, 15 | "IsBetaVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "Minimap", 20 | "Type": "Developer", 21 | "LoadingPhase": "PreDefault" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Minimap.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class Minimap : ModuleRules 6 | { 7 | public Minimap(TargetInfo Target) 8 | { 9 | 10 | PublicIncludePaths.AddRange( 11 | new string[] { 12 | "Minimap/Public" 13 | // ... add public include paths required here ... 14 | } 15 | ); 16 | 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | "Minimap/Private", 21 | // ... add other private include paths required here ... 22 | } 23 | ); 24 | 25 | 26 | PublicDependencyModuleNames.AddRange( 27 | new string[] 28 | { 29 | "Core", 30 | // ... add other public dependencies that you statically link with here ... 31 | } 32 | ); 33 | 34 | 35 | PrivateDependencyModuleNames.AddRange( 36 | new string[] 37 | { 38 | "CoreUObject", 39 | "Engine", 40 | "Slate", 41 | "SlateCore", 42 | "InputCore", 43 | "UnrealEd", 44 | "LevelEditor", 45 | "UMG" 46 | // ... add private dependencies that you statically link with here ... 47 | } 48 | ); 49 | 50 | 51 | DynamicallyLoadedModuleNames.AddRange( 52 | new string[] 53 | { 54 | // ... add any modules that your module loads dynamically here ... 55 | } 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Private/Minimap.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "MinimapPrivatePCH.h" 4 | #include "MinimapEdMode.h" 5 | 6 | #define LOCTEXT_NAMESPACE "FMinimapModule" 7 | 8 | void FMinimapModule::StartupModule() 9 | { 10 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 11 | FEditorModeRegistry::Get().RegisterMode(FMinimapEdMode::EM_MinimapEdModeId, LOCTEXT("MinimapEdModeName", "MinimapEdMode"), FSlateIcon(), true); 12 | } 13 | 14 | void FMinimapModule::ShutdownModule() 15 | { 16 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 17 | // we call this function before unloading the module. 18 | FEditorModeRegistry::Get().UnregisterMode(FMinimapEdMode::EM_MinimapEdModeId); 19 | } 20 | 21 | #undef LOCTEXT_NAMESPACE 22 | 23 | IMPLEMENT_MODULE(FMinimapModule, Minimap) -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Private/MinimapEdMode.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "MinimapPrivatePCH.h" 4 | #include "MinimapEdMode.h" 5 | #include "MinimapEdModeToolkit.h" 6 | #include "Toolkits/ToolkitManager.h" 7 | 8 | const FEditorModeID FMinimapEdMode::EM_MinimapEdModeId = TEXT("EM_MinimapEdMode"); 9 | 10 | FMinimapEdMode::FMinimapEdMode() 11 | { 12 | 13 | } 14 | 15 | FMinimapEdMode::~FMinimapEdMode() 16 | { 17 | 18 | } 19 | 20 | void FMinimapEdMode::Enter() 21 | { 22 | FEdMode::Enter(); 23 | 24 | if (!Toolkit.IsValid() && UsesToolkits()) 25 | { 26 | Toolkit = MakeShareable(new FMinimapEdModeToolkit); 27 | Toolkit->Init(Owner->GetToolkitHost()); 28 | } 29 | } 30 | 31 | void FMinimapEdMode::Exit() 32 | { 33 | if (Toolkit.IsValid()) 34 | { 35 | FToolkitManager::Get().CloseToolkit(Toolkit.ToSharedRef()); 36 | Toolkit.Reset(); 37 | } 38 | 39 | // Call base Exit method to ensure proper cleanup 40 | FEdMode::Exit(); 41 | } 42 | 43 | bool FMinimapEdMode::UsesToolkits() const 44 | { 45 | return true; 46 | } 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Private/MinimapEdModeToolkit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "MinimapPrivatePCH.h" 4 | #include "MinimapEdMode.h" 5 | #include "MinimapEdModeToolkit.h" 6 | 7 | #define LOCTEXT_NAMESPACE "FMinimapEdModeToolkit" 8 | 9 | FMinimapEdModeToolkit::FMinimapEdModeToolkit() 10 | { 11 | struct Locals 12 | { 13 | static bool IsWidgetEnabled() 14 | { 15 | return GEditor->GetSelectedActors()->Num() != 0; 16 | } 17 | 18 | static FReply OnButtonClick(FVector InOffset) 19 | { 20 | USelection* SelectedActors = GEditor->GetSelectedActors(); 21 | 22 | // Let editor know that we're about to do something that we want to undo/redo 23 | GEditor->BeginTransaction(LOCTEXT("MoveActorsTransactionName", "MoveActors")); 24 | 25 | // For each selected actor 26 | for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter) 27 | { 28 | if (AActor* LevelActor = Cast(*Iter)) 29 | { 30 | // Register actor in opened transaction (undo/redo) 31 | LevelActor->Modify(); 32 | // Move actor to given location 33 | LevelActor->TeleportTo(LevelActor->GetActorLocation() + InOffset, FRotator(0, 0, 0)); 34 | } 35 | } 36 | 37 | // We're done moving actors so close transaction 38 | GEditor->EndTransaction(); 39 | 40 | return FReply::Handled(); 41 | } 42 | 43 | static TSharedRef MakeButton(FText InLabel, const FVector InOffset) 44 | { 45 | return SNew(SButton) 46 | .Text(InLabel) 47 | .OnClicked_Static(&Locals::OnButtonClick, InOffset); 48 | } 49 | }; 50 | 51 | const float Factor = 256.0f; 52 | 53 | SAssignNew(ToolkitWidget, SBorder) 54 | .HAlign(HAlign_Center) 55 | .Padding(25) 56 | .IsEnabled_Static(&Locals::IsWidgetEnabled) 57 | [ 58 | SNew(SVerticalBox) 59 | + SVerticalBox::Slot() 60 | .AutoHeight() 61 | .HAlign(HAlign_Center) 62 | .Padding(50) 63 | [ 64 | SNew(STextBlock) 65 | .AutoWrapText(true) 66 | .Text(LOCTEXT("HelperLabel", "Select some actors and move them around using buttons below")) 67 | ] 68 | + SVerticalBox::Slot() 69 | .HAlign(HAlign_Center) 70 | .AutoHeight() 71 | [ 72 | Locals::MakeButton(LOCTEXT("UpButtonLabel", "Up"), FVector(0, 0, Factor)) 73 | ] 74 | + SVerticalBox::Slot() 75 | .HAlign(HAlign_Center) 76 | .AutoHeight() 77 | [ 78 | SNew(SHorizontalBox) 79 | + SHorizontalBox::Slot() 80 | .AutoWidth() 81 | [ 82 | Locals::MakeButton(LOCTEXT("LeftButtonLabel", "Left"), FVector(0, -Factor, 0)) 83 | ] 84 | + SHorizontalBox::Slot() 85 | .AutoWidth() 86 | [ 87 | Locals::MakeButton(LOCTEXT("RightButtonLabel", "Right"), FVector(0, Factor, 0)) 88 | ] 89 | ] 90 | + SVerticalBox::Slot() 91 | .HAlign(HAlign_Center) 92 | .AutoHeight() 93 | [ 94 | Locals::MakeButton(LOCTEXT("DownButtonLabel", "Down"), FVector(0, 0, -Factor)) 95 | ] 96 | 97 | ]; 98 | } 99 | 100 | FName FMinimapEdModeToolkit::GetToolkitFName() const 101 | { 102 | return FName("MinimapEdMode"); 103 | } 104 | 105 | FText FMinimapEdModeToolkit::GetBaseToolkitName() const 106 | { 107 | return NSLOCTEXT("MinimapEdModeToolkit", "DisplayName", "MinimapEdMode Tool"); 108 | } 109 | 110 | class FEdMode* FMinimapEdModeToolkit::GetEditorMode() const 111 | { 112 | return GLevelEditorModeTools().GetActiveMode(FMinimapEdMode::EM_MinimapEdModeId); 113 | } 114 | 115 | #undef LOCTEXT_NAMESPACE 116 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Private/MinimapPrivatePCH.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "Minimap.h" 4 | 5 | // You should place include statements to your module's private header files here. You only need to 6 | // add includes for headers that are used in most of your module's source files though. -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Private/MinimapWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MinimapPrivatePCH.h" 2 | #include "MinimapWidget.h" 3 | #include "CanvasPanel.h" 4 | #include "CanvasPanelSlot.h" 5 | #include "Image.h" 6 | #include "WidgetTree.h" 7 | 8 | UMinimapWidget::UMinimapWidget(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) 9 | { 10 | static ConstructorHelpers::FClassFinder ActorWidgetOb(TEXT("/Minimap/PlayerWidget")); 11 | ActorWidgetClass = ActorWidgetOb.Class; 12 | 13 | static ConstructorHelpers::FClassFinder WaypointWidgetOb(TEXT("/Minimap/WaypointWidget")); 14 | WaypointWidgetClass = WaypointWidgetOb.Class; 15 | 16 | Actors.Empty(); 17 | ActorsWidgets.Empty(); 18 | } 19 | 20 | UUserWidget* UMinimapWidget::CreateActorWidget(FLinearColor InColor, UPanelWidget* MinimapPanel, FName IconName) 21 | { 22 | UUserWidget* NewActorWidget = CreateWidget(GetOwningPlayer(), ActorWidgetClass); 23 | MinimapPanel->AddChild(NewActorWidget); 24 | 25 | UImage* ActorIcon = Cast(NewActorWidget->GetWidgetFromName(IconName)); 26 | if (ActorIcon) 27 | { 28 | //Set color of the icon 29 | FSlateBrush NewColor; 30 | NewColor.TintColor = FSlateColor(InColor); 31 | ActorIcon->SetBrush(NewColor); 32 | } 33 | else 34 | { 35 | GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Failed to find widget actor icon!!!"))); 36 | } 37 | 38 | UCanvasPanelSlot* ActorPanelSlot = Cast(NewActorWidget->Slot); 39 | if (ActorPanelSlot) 40 | { 41 | ActorPanelSlot->SetAnchors(FAnchors(0.5, 0.5, 0.5, 0.5)); 42 | ActorPanelSlot->SetAlignment(FVector2D(0.5, 0.5)); 43 | ActorPanelSlot->SetPosition(FVector2D(0, 0)); 44 | ActorPanelSlot->SetSize(FVector2D(0.5, 0.5)); 45 | } 46 | else 47 | { 48 | GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Failed to add actor!!!"))); 49 | } 50 | 51 | return NewActorWidget; 52 | } 53 | 54 | void UMinimapWidget::AddActors(TArray TargetActors, FLinearColor InColor, UPanelWidget* MinimapPanel, FName IconName) 55 | { 56 | if (Actors.Num() != ActorsWidgets.Num()) 57 | { 58 | Actors.Empty(); 59 | ActorsWidgets.Empty(); 60 | } 61 | else 62 | { 63 | for (int ActorIndex = 0; ActorIndex < TargetActors.Num(); ActorIndex++) 64 | { 65 | if (TargetActors[ActorIndex]) 66 | { 67 | UUserWidget* NewActorWidget = CreateActorWidget(InColor, MinimapPanel, IconName); 68 | if (NewActorWidget) 69 | { 70 | Actors.Add(TargetActors[ActorIndex]); 71 | ActorsWidgets.Add(NewActorWidget); 72 | } 73 | } 74 | } 75 | } 76 | } 77 | 78 | void UMinimapWidget::UpdateActor(UUserWidget* TargetActorWidget, APawn* TargetPawn, float DefaultRadius) 79 | { 80 | FVector DirVector = GetOwningPlayer()->GetPawn()->GetActorLocation() - TargetPawn->GetController()->GetPawn()->GetActorLocation(); 81 | FVector2D ScaledDir2D = FVector2D(DirVector.X / MapSize.X, DirVector.Y / MapSize.Y); 82 | ScaledDir2D = ScaledDir2D * 10.f * MinimapScale; 83 | 84 | FVector Relative3D = FVector(ScaledDir2D.X, ScaledDir2D.Y, 0.f); 85 | FRotator PlayerRotation = GetOwningPlayer()->GetControlRotation(); 86 | FRotator Rotator3D = FRotator(-PlayerRotation.Pitch, -(PlayerRotation.Yaw - 90.f), -PlayerRotation.Roll); 87 | Relative3D = Rotator3D.RotateVector(Relative3D); 88 | 89 | if (!bIsCircle) 90 | { 91 | TargetActorWidget->SetVisibility(ESlateVisibility::Visible); 92 | UCanvasPanelSlot* TargetActorSlot = Cast(TargetActorWidget->Slot); 93 | TargetActorSlot->SetPosition(FVector2D(Relative3D.X, Relative3D.Y)); 94 | } 95 | else 96 | { 97 | float SquaredXY = FMath::Pow(Relative3D.X, 2) + FMath::Pow(Relative3D.Y, 2); 98 | float SquaredRadius = FMath::Pow(DefaultRadius, 2); 99 | if (SquaredRadius > SquaredXY) 100 | { 101 | TargetActorWidget->SetVisibility(ESlateVisibility::Visible); 102 | UCanvasPanelSlot* TargetActorSlot = Cast(TargetActorWidget->Slot); 103 | TargetActorSlot->SetPosition(FVector2D(Relative3D.X, Relative3D.Y)); 104 | } 105 | else 106 | { 107 | TargetActorWidget->SetVisibility(ESlateVisibility::Hidden); 108 | } 109 | } 110 | } 111 | 112 | FVector2D UMinimapWidget::GetCircleClampedCoords(FVector2D InCoords, float InRadius) 113 | { 114 | /** 115 | * Based on the equations for line and circle we intersect them and that way we get the clamped coordinates 116 | * Line: y = m*x + c; 117 | * Circle: (x − p)^2 + (y − q)^2 = r^2 118 | * We take y and put it in the equation of the circle and we get: 119 | * (m^2 + 1)*x^2 + 2*(m*c − m*q − p)*x + (q^2 − r^2 + p^2 − 2*c*q + c^2) = 0 120 | * 121 | * Finally we only need to calculate: 122 | * m = y / x 123 | * A = m^2 + 1 124 | * C = - r^2 125 | */ 126 | float A, C, m; 127 | m = InCoords.Y / InCoords.X; 128 | A = m * m + 1; 129 | C = -(InRadius * InRadius); 130 | 131 | float outX = FMath::Sqrt(-4 * A * C) / (2 * A); 132 | float outY = m * outX; 133 | 134 | 135 | if (InCoords.X > 0) 136 | { 137 | return FVector2D(outX, outY); 138 | } 139 | else 140 | { 141 | return FVector2D(-outX, -outY); 142 | } 143 | } 144 | 145 | float UMinimapWidget::GetWaypointIconAngle(FVector2D NewPos) 146 | { 147 | float X = NewPos.X; 148 | float Y = NewPos.Y; 149 | float SinXHyp = X / FMath::Sqrt(X * X + Y * Y); 150 | float Angle = (180.f) / PI * FMath::Asin(SinXHyp); 151 | 152 | if (Y < 0.f) 153 | { 154 | //Above the center (because in UI Y is reversed) 155 | return Angle; 156 | } 157 | else 158 | { 159 | //Bellow the center 160 | return FMath::Sign(X) * 90.f + (FMath::Sign(X) * 90.f - Angle); 161 | } 162 | } 163 | 164 | void UMinimapWidget::SetWaypointIconOutside(UImage* WaypointIcon, UTexture2D* Texture, FVector2D NewPos) 165 | { 166 | //Set icon texture 167 | WaypointIcon->SetBrushFromTexture(Texture); 168 | 169 | //Set icon rotation 170 | float NewAngle = GetWaypointIconAngle(NewPos); 171 | WaypointIcon->SetRenderAngle(NewAngle); 172 | } 173 | 174 | void UMinimapWidget::SetWaypointIconInside(UImage* WaypointIcon, UTexture2D* Texture) 175 | { 176 | //Set icon texture 177 | WaypointIcon->SetBrushFromTexture(Texture); 178 | 179 | //Set icon rotation 180 | WaypointIcon->SetRenderAngle(0.f); 181 | } 182 | 183 | void UMinimapWidget::UpdateWaypointIcon(UUserWidget* TargetWidget, FName ChildIconName, FVector2D NewPos, UTexture2D* MainTexture, UTexture2D* ArrowTexture, float DefaultRadius) 184 | { 185 | float SquaredXY = NewPos.X * NewPos.X + NewPos.Y * NewPos.Y; 186 | UImage* WaypointIcon = Cast(TargetWidget->GetWidgetFromName(ChildIconName)); 187 | 188 | if (!WaypointIcon) 189 | { 190 | return; 191 | } 192 | 193 | if (bIsCircle) 194 | { 195 | if (SquaredXY >= (DefaultRadius - 0.1) * (DefaultRadius - 0.1)) 196 | { 197 | SetWaypointIconOutside(WaypointIcon, ArrowTexture, NewPos); 198 | } 199 | else 200 | { 201 | SetWaypointIconInside(WaypointIcon, MainTexture); 202 | } 203 | } 204 | else 205 | { 206 | if (NewPos.X == DefaultRadius || NewPos.X == -DefaultRadius || NewPos.Y == DefaultRadius || NewPos.Y == -DefaultRadius) 207 | { 208 | SetWaypointIconOutside(WaypointIcon, ArrowTexture, NewPos); 209 | } 210 | else 211 | { 212 | SetWaypointIconInside(WaypointIcon, MainTexture); 213 | } 214 | } 215 | } 216 | 217 | void UMinimapWidget::UpdateWaypoint(UUserWidget* TargetWidget, AActor* TargetWaypoint, FName ChildIconName, UTexture2D* MainTexture, UTexture2D* ArrowTexture, float DefaultRadius) 218 | { 219 | FVector WaypointLocation = TargetWaypoint->GetActorLocation(); 220 | FVector PlayerLocation = GetOwningPlayer()->GetPawn()->GetActorLocation(); 221 | FVector WaypointDirection = PlayerLocation - WaypointLocation; 222 | 223 | FVector2D ScaledDirection2D = FVector2D(WaypointDirection.X / MapSize.X, WaypointDirection.Y / MapSize.Y); 224 | ScaledDirection2D = ScaledDirection2D * 10.f * MinimapScale; 225 | FVector ScaledDirection3D = FVector(ScaledDirection2D.X, ScaledDirection2D.Y, 0.f); 226 | 227 | FRotator PlayerRotation = GetOwningPlayer()->GetControlRotation(); 228 | FRotator Rotator3D = FRotator(-PlayerRotation.Pitch, -(PlayerRotation.Yaw - 90.f), -PlayerRotation.Roll); 229 | ScaledDirection3D = Rotator3D.RotateVector(ScaledDirection3D); 230 | 231 | FVector2D ClampedDirection2D; 232 | if (bIsCircle) 233 | { 234 | float SquaredXY = ScaledDirection3D.X * ScaledDirection3D.X + ScaledDirection3D.Y * ScaledDirection3D.Y; 235 | if (SquaredXY > DefaultRadius * DefaultRadius) 236 | { 237 | ClampedDirection2D = GetCircleClampedCoords(FVector2D(ScaledDirection3D.X, ScaledDirection3D.Y), DefaultRadius); 238 | } 239 | else 240 | { 241 | //inside the circle 242 | ClampedDirection2D = FVector2D(ScaledDirection3D.X, ScaledDirection3D.Y); 243 | } 244 | } 245 | else 246 | { 247 | //square 248 | ClampedDirection2D = FVector2D(FMath::Clamp(ScaledDirection3D.X, -DefaultRadius, DefaultRadius), FMath::Clamp(ScaledDirection3D.Y, -DefaultRadius, DefaultRadius)); 249 | } 250 | 251 | UpdateWaypointIcon(TargetWidget, ChildIconName, ClampedDirection2D, MainTexture, ArrowTexture, DefaultRadius); 252 | UCanvasPanelSlot* TargetWidgetSlot = Cast(TargetWidget->Slot); 253 | TargetWidgetSlot->SetPosition(ClampedDirection2D); 254 | } 255 | 256 | UUserWidget* UMinimapWidget::CreateWaypointWidget(UPanelWidget* MinimapPanel, FName IconName) 257 | { 258 | UUserWidget* NewWaypointWidget = CreateWidget(GetOwningPlayer(), WaypointWidgetClass); 259 | MinimapPanel->AddChild(NewWaypointWidget); 260 | if (!NewWaypointWidget) 261 | { 262 | return NULL; 263 | } 264 | 265 | UCanvasPanelSlot* ActorPanelSlot = Cast(NewWaypointWidget->Slot); 266 | if (ActorPanelSlot) 267 | { 268 | ActorPanelSlot->SetAnchors(FAnchors(0.5, 0.5, 0.5, 0.5)); 269 | ActorPanelSlot->SetAlignment(FVector2D(0.5, 0.5)); 270 | ActorPanelSlot->SetPosition(FVector2D(0, 0)); 271 | ActorPanelSlot->SetSize(FVector2D(1, 1)); 272 | } 273 | else 274 | { 275 | GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Failed to add waypoint!!!"))); 276 | } 277 | 278 | return NewWaypointWidget; 279 | } 280 | 281 | void UMinimapWidget::AddWaypoints(TArray TargetWaypoints, UPanelWidget* MinimapPanel, FName IconName) 282 | { 283 | if (Waypoints.Num() != WaypointsWidgets.Num()) 284 | { 285 | Waypoints.Empty(); 286 | WaypointsWidgets.Empty(); 287 | } 288 | else 289 | { 290 | for (int ActorIndex = 0; ActorIndex < TargetWaypoints.Num(); ActorIndex++) 291 | { 292 | if (TargetWaypoints[ActorIndex]) 293 | { 294 | UUserWidget* NewActorWidget = CreateWaypointWidget(MinimapPanel, IconName); 295 | if (NewActorWidget) 296 | { 297 | Waypoints.Add(TargetWaypoints[ActorIndex]); 298 | WaypointsWidgets.Add(NewActorWidget); 299 | } 300 | } 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Public/Minimap.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "ModuleManager.h" 6 | 7 | class FMinimapModule : public IModuleInterface 8 | { 9 | public: 10 | 11 | /** IModuleInterface implementation */ 12 | virtual void StartupModule() override; 13 | virtual void ShutdownModule() override; 14 | }; -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Public/MinimapEdMode.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "UnrealEd.h" 6 | #include "Editor.h" 7 | 8 | class FMinimapEdMode : public FEdMode 9 | { 10 | public: 11 | const static FEditorModeID EM_MinimapEdModeId; 12 | public: 13 | FMinimapEdMode(); 14 | virtual ~FMinimapEdMode(); 15 | 16 | // FEdMode interface 17 | virtual void Enter() override; 18 | virtual void Exit() override; 19 | //virtual void Tick(FEditorViewportClient* ViewportClient, float DeltaTime) override; 20 | //virtual void Render(const FSceneView* View, FViewport* Viewport, FPrimitiveDrawInterface* PDI) override; 21 | //virtual void ActorSelectionChangeNotify() override; 22 | bool UsesToolkits() const override; 23 | // End of FEdMode interface 24 | }; 25 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Public/MinimapEdModeToolkit.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Editor/UnrealEd/Public/Toolkits/BaseToolkit.h" 6 | 7 | 8 | class FMinimapEdModeToolkit : public FModeToolkit 9 | { 10 | public: 11 | 12 | FMinimapEdModeToolkit(); 13 | 14 | /** IToolkit interface */ 15 | virtual FName GetToolkitFName() const override; 16 | virtual FText GetBaseToolkitName() const override; 17 | virtual class FEdMode* GetEditorMode() const override; 18 | virtual TSharedPtr GetInlineContent() const override { return ToolkitWidget; } 19 | 20 | private: 21 | 22 | TSharedPtr ToolkitWidget; 23 | }; 24 | -------------------------------------------------------------------------------- /Plugins/Minimap/Source/Minimap/Public/MinimapWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Blueprint/UserWidget.h" 4 | #include "MinimapWidget.generated.h" 5 | 6 | UCLASS(Abstract, editinlinenew, BlueprintType, Blueprintable, meta = (Category = "User Controls", DontUseGenericSpawnObject = "True")) 7 | class UMinimapWidget : public UUserWidget 8 | { 9 | GENERATED_UCLASS_BODY() 10 | 11 | protected: 12 | 13 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 14 | UUserWidget* CreateActorWidget(FLinearColor InColor, UPanelWidget* MinimapPanel, FName IconName); 15 | 16 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 17 | void UpdateActor(UUserWidget* TargetActorWidget, APawn* TargetPawn, float DefaultRadius); 18 | 19 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 20 | FVector2D GetCircleClampedCoords(FVector2D InCoords, float InRadius); 21 | 22 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 23 | float GetWaypointIconAngle(FVector2D NewPos); 24 | 25 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 26 | void SetWaypointIconOutside(UImage* WaypointIcon, UTexture2D* Texture, FVector2D NewPos); 27 | 28 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 29 | void SetWaypointIconInside(UImage* WaypointIcon, UTexture2D* Texture); 30 | 31 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 32 | void UpdateWaypointIcon(UUserWidget* TargetWidget, FName IconName, FVector2D NewPos, UTexture2D* MainTexture, UTexture2D* ArrowTexture, float Radius); 33 | 34 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 35 | void UpdateWaypoint(UUserWidget* TargetWidget, AActor* TargetWaypoint, FName ChildIconName, UTexture2D* MainTexture, UTexture2D* ArrowTexture, float DefaultRadius); 36 | 37 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 38 | UUserWidget* CreateWaypointWidget(UPanelWidget* MinimapPanel, FName IconName); 39 | 40 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 41 | void AddWaypoints(TArray TargetWaypoints, UPanelWidget* MinimapPanel, FName IconName); 42 | 43 | TSubclassOf ActorWidgetClass; 44 | 45 | TSubclassOf WaypointWidgetClass; 46 | 47 | public: 48 | 49 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Minimap Settings") 50 | FString MinimapWidgetName; 51 | 52 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Minimap Settings") 53 | UTexture2D* Texture; 54 | 55 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Minimap Settings") 56 | UTexture2D* CircleMask; 57 | 58 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Minimap Settings") 59 | float MinimapScale; 60 | 61 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Minimap Settings") 62 | bool bIsCircle; 63 | 64 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Widget") 65 | TArray Actors; 66 | 67 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Widget") 68 | TArray ActorsWidgets; 69 | 70 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Widget") 71 | TArray Waypoints; 72 | 73 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Widget") 74 | TArray WaypointsWidgets; 75 | 76 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Settings") 77 | FVector MapStartLocation; 78 | 79 | UPROPERTY(BlueprintReadWrite, Category = "Minimap Settings") 80 | FVector MapSize; 81 | 82 | UFUNCTION(BlueprintCallable, Category = "Minimap Widget") 83 | void AddActors(TArray TargetActors, FLinearColor InColor, UPanelWidget* MinimapPanel, FName IconName); 84 | }; 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Faster Better Stronger Minimap Plugin for Ultimate Engine 4 2 | ᕙ༼ຈل͜ຈ༽ᕗ Plugin for UE4 that takes an image and uses it as a minimap ᕙ༼ຈل͜ຈ༽ᕗ 3 | 4 | How to set up: 5 | 6 | 1. Drag and drop onto the level the Minimap_volume asset. 7 | 2. Set the boundries of the Minimap_volume that the minimap image covers. Set image there and other settings as desired. 8 | 3. In the HUD blueprint of your character add the Minimap widget. 9 | 4. Enjoy 10 | 11 | 12 | Supported features: 13 | * Setting custom minimap image 14 | * Setting player crosshair 15 | * Enemy and friendly players display image/arrow when out of bounds. 16 | * Waypoints with customizable display image/arrow when out of bounds. 17 | -------------------------------------------------------------------------------- /Source/FPGame.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class FPGameTarget : TargetRules 7 | { 8 | public FPGameTarget(TargetInfo Target) 9 | { 10 | Type = TargetType.Game; 11 | } 12 | 13 | // 14 | // TargetRules interface. 15 | // 16 | 17 | public override void SetupBinaries( 18 | TargetInfo Target, 19 | ref List OutBuildBinaryConfigurations, 20 | ref List OutExtraModuleNames 21 | ) 22 | { 23 | OutExtraModuleNames.Add("FPGame"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/FPGame/FPGame.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class FPGame : ModuleRules 6 | { 7 | public FPGame(TargetInfo Target) 8 | { 9 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/FPGame/FPGame.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "FPGame.h" 4 | 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, FPGame, "FPGame" ); 7 | -------------------------------------------------------------------------------- /Source/FPGame/FPGame.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #ifndef __FPGAME_H__ 4 | #define __FPGAME_H__ 5 | 6 | #include "EngineMinimal.h" 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameCharacter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "FPGame.h" 4 | #include "FPGameCharacter.h" 5 | #include "FPGameProjectile.h" 6 | #include "Animation/AnimInstance.h" 7 | #include "GameFramework/InputSettings.h" 8 | 9 | DEFINE_LOG_CATEGORY_STATIC(LogFPChar, Warning, All); 10 | 11 | ////////////////////////////////////////////////////////////////////////// 12 | // AFPGameCharacter 13 | 14 | AFPGameCharacter::AFPGameCharacter() 15 | { 16 | // Set size for collision capsule 17 | GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f); 18 | 19 | // set our turn rates for input 20 | BaseTurnRate = 45.f; 21 | BaseLookUpRate = 45.f; 22 | 23 | // Create a CameraComponent 24 | FirstPersonCameraComponent = CreateDefaultSubobject(TEXT("FirstPersonCamera")); 25 | FirstPersonCameraComponent->AttachParent = GetCapsuleComponent(); 26 | FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera 27 | FirstPersonCameraComponent->bUsePawnControlRotation = true; 28 | 29 | // Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn) 30 | Mesh1P = CreateDefaultSubobject(TEXT("CharacterMesh1P")); 31 | Mesh1P->SetOnlyOwnerSee(true); 32 | Mesh1P->AttachParent = FirstPersonCameraComponent; 33 | Mesh1P->bCastDynamicShadow = false; 34 | Mesh1P->CastShadow = false; 35 | 36 | // Create a gun mesh component 37 | FP_Gun = CreateDefaultSubobject(TEXT("FP_Gun")); 38 | FP_Gun->SetOnlyOwnerSee(true); // only the owning player will see this mesh 39 | FP_Gun->bCastDynamicShadow = false; 40 | FP_Gun->CastShadow = false; 41 | FP_Gun->AttachTo(Mesh1P, TEXT("GripPoint"), EAttachLocation::SnapToTargetIncludingScale, true); 42 | 43 | 44 | // Default offset from the character location for projectiles to spawn 45 | GunOffset = FVector(100.0f, 30.0f, 10.0f); 46 | 47 | // Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the 48 | // derived blueprint asset named MyCharacter (to avoid direct content references in C++) 49 | } 50 | 51 | ////////////////////////////////////////////////////////////////////////// 52 | // Input 53 | 54 | void AFPGameCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent) 55 | { 56 | // set up gameplay key bindings 57 | check(InputComponent); 58 | 59 | InputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); 60 | InputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping); 61 | 62 | //InputComponent->BindTouch(EInputEvent::IE_Pressed, this, &AFPGameCharacter::TouchStarted); 63 | if( EnableTouchscreenMovement(InputComponent) == false ) 64 | { 65 | InputComponent->BindAction("Fire", IE_Pressed, this, &AFPGameCharacter::OnFire); 66 | } 67 | 68 | InputComponent->BindAxis("MoveForward", this, &AFPGameCharacter::MoveForward); 69 | InputComponent->BindAxis("MoveRight", this, &AFPGameCharacter::MoveRight); 70 | 71 | // We have 2 versions of the rotation bindings to handle different kinds of devices differently 72 | // "turn" handles devices that provide an absolute delta, such as a mouse. 73 | // "turnrate" is for devices that we choose to treat as a rate of change, such as an analog joystick 74 | InputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput); 75 | InputComponent->BindAxis("TurnRate", this, &AFPGameCharacter::TurnAtRate); 76 | InputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput); 77 | InputComponent->BindAxis("LookUpRate", this, &AFPGameCharacter::LookUpAtRate); 78 | } 79 | 80 | void AFPGameCharacter::OnFire() 81 | { 82 | // try and fire a projectile 83 | if (ProjectileClass != NULL) 84 | { 85 | const FRotator SpawnRotation = GetControlRotation(); 86 | // MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position 87 | const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset); 88 | 89 | UWorld* const World = GetWorld(); 90 | if (World != NULL) 91 | { 92 | // spawn the projectile at the muzzle 93 | World->SpawnActor(ProjectileClass, SpawnLocation, SpawnRotation); 94 | } 95 | } 96 | 97 | // try and play the sound if specified 98 | if (FireSound != NULL) 99 | { 100 | UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation()); 101 | } 102 | 103 | // try and play a firing animation if specified 104 | if(FireAnimation != NULL) 105 | { 106 | // Get the animation object for the arms mesh 107 | UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance(); 108 | if(AnimInstance != NULL) 109 | { 110 | AnimInstance->Montage_Play(FireAnimation, 1.f); 111 | } 112 | } 113 | 114 | } 115 | 116 | void AFPGameCharacter::BeginTouch(const ETouchIndex::Type FingerIndex, const FVector Location) 117 | { 118 | if( TouchItem.bIsPressed == true ) 119 | { 120 | return; 121 | } 122 | TouchItem.bIsPressed = true; 123 | TouchItem.FingerIndex = FingerIndex; 124 | TouchItem.Location = Location; 125 | TouchItem.bMoved = false; 126 | } 127 | 128 | void AFPGameCharacter::EndTouch(const ETouchIndex::Type FingerIndex, const FVector Location) 129 | { 130 | if (TouchItem.bIsPressed == false) 131 | { 132 | return; 133 | } 134 | if( ( FingerIndex == TouchItem.FingerIndex ) && (TouchItem.bMoved == false) ) 135 | { 136 | OnFire(); 137 | } 138 | TouchItem.bIsPressed = false; 139 | } 140 | 141 | void AFPGameCharacter::TouchUpdate(const ETouchIndex::Type FingerIndex, const FVector Location) 142 | { 143 | if ((TouchItem.bIsPressed == true) && ( TouchItem.FingerIndex==FingerIndex)) 144 | { 145 | if (TouchItem.bIsPressed) 146 | { 147 | if (GetWorld() != nullptr) 148 | { 149 | UGameViewportClient* ViewportClient = GetWorld()->GetGameViewport(); 150 | if (ViewportClient != nullptr) 151 | { 152 | FVector MoveDelta = Location - TouchItem.Location; 153 | FVector2D ScreenSize; 154 | ViewportClient->GetViewportSize(ScreenSize); 155 | FVector2D ScaledDelta = FVector2D( MoveDelta.X, MoveDelta.Y) / ScreenSize; 156 | if (ScaledDelta.X != 0.0f) 157 | { 158 | TouchItem.bMoved = true; 159 | float Value = ScaledDelta.X * BaseTurnRate; 160 | AddControllerYawInput(Value); 161 | } 162 | if (ScaledDelta.Y != 0.0f) 163 | { 164 | TouchItem.bMoved = true; 165 | float Value = ScaledDelta.Y* BaseTurnRate; 166 | AddControllerPitchInput(Value); 167 | } 168 | TouchItem.Location = Location; 169 | } 170 | TouchItem.Location = Location; 171 | } 172 | } 173 | } 174 | } 175 | 176 | void AFPGameCharacter::MoveForward(float Value) 177 | { 178 | if (Value != 0.0f) 179 | { 180 | // add movement in that direction 181 | AddMovementInput(GetActorForwardVector(), Value); 182 | } 183 | } 184 | 185 | void AFPGameCharacter::MoveRight(float Value) 186 | { 187 | if (Value != 0.0f) 188 | { 189 | // add movement in that direction 190 | AddMovementInput(GetActorRightVector(), Value); 191 | } 192 | } 193 | 194 | void AFPGameCharacter::TurnAtRate(float Rate) 195 | { 196 | // calculate delta for this frame from the rate information 197 | AddControllerYawInput(Rate * BaseTurnRate * GetWorld()->GetDeltaSeconds()); 198 | } 199 | 200 | void AFPGameCharacter::LookUpAtRate(float Rate) 201 | { 202 | // calculate delta for this frame from the rate information 203 | AddControllerPitchInput(Rate * BaseLookUpRate * GetWorld()->GetDeltaSeconds()); 204 | } 205 | 206 | bool AFPGameCharacter::EnableTouchscreenMovement(class UInputComponent* InputComponent) 207 | { 208 | bool bResult = false; 209 | if(FPlatformMisc::GetUseVirtualJoysticks() || GetDefault()->bUseMouseForTouch ) 210 | { 211 | bResult = true; 212 | InputComponent->BindTouch(EInputEvent::IE_Pressed, this, &AFPGameCharacter::BeginTouch); 213 | InputComponent->BindTouch(EInputEvent::IE_Released, this, &AFPGameCharacter::EndTouch); 214 | InputComponent->BindTouch(EInputEvent::IE_Repeat, this, &AFPGameCharacter::TouchUpdate); 215 | } 216 | return bResult; 217 | } 218 | 219 | AHUD* AFPGameCharacter::GetHUD() const 220 | { 221 | APlayerController* Controller = Cast(GetController()); 222 | 223 | return Controller->GetHUD(); 224 | } 225 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameCharacter.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | #pragma once 3 | #include "GameFramework/Character.h" 4 | #include "FPGameCharacter.generated.h" 5 | 6 | class UInputComponent; 7 | 8 | UCLASS(config=Game) 9 | class AFPGameCharacter : public ACharacter 10 | { 11 | GENERATED_BODY() 12 | 13 | /** Pawn mesh: 1st person view (arms; seen only by self) */ 14 | UPROPERTY(VisibleDefaultsOnly, Category=Mesh) 15 | class USkeletalMeshComponent* Mesh1P; 16 | 17 | /** Gun mesh: 1st person view (seen only by self) */ 18 | UPROPERTY(VisibleDefaultsOnly, Category = Mesh) 19 | class USkeletalMeshComponent* FP_Gun; 20 | 21 | /** First person camera */ 22 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true")) 23 | class UCameraComponent* FirstPersonCameraComponent; 24 | public: 25 | AFPGameCharacter(); 26 | 27 | /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */ 28 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera) 29 | float BaseTurnRate; 30 | 31 | /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */ 32 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera) 33 | float BaseLookUpRate; 34 | 35 | /** Gun muzzle's offset from the characters location */ 36 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay) 37 | FVector GunOffset; 38 | 39 | /** Projectile class to spawn */ 40 | UPROPERTY(EditDefaultsOnly, Category=Projectile) 41 | TSubclassOf ProjectileClass; 42 | 43 | /** Sound to play each time we fire */ 44 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay) 45 | class USoundBase* FireSound; 46 | 47 | /** AnimMontage to play each time we fire */ 48 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay) 49 | class UAnimMontage* FireAnimation; 50 | 51 | protected: 52 | 53 | /** Fires a projectile. */ 54 | void OnFire(); 55 | 56 | /** Handles moving forward/backward */ 57 | void MoveForward(float Val); 58 | 59 | /** Handles stafing movement, left and right */ 60 | void MoveRight(float Val); 61 | 62 | /** 63 | * Called via input to turn at a given rate. 64 | * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate 65 | */ 66 | void TurnAtRate(float Rate); 67 | 68 | /** 69 | * Called via input to turn look up/down at a given rate. 70 | * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate 71 | */ 72 | void LookUpAtRate(float Rate); 73 | 74 | struct TouchData 75 | { 76 | TouchData() { bIsPressed = false;Location=FVector::ZeroVector;} 77 | bool bIsPressed; 78 | ETouchIndex::Type FingerIndex; 79 | FVector Location; 80 | bool bMoved; 81 | }; 82 | void BeginTouch(const ETouchIndex::Type FingerIndex, const FVector Location); 83 | void EndTouch(const ETouchIndex::Type FingerIndex, const FVector Location); 84 | void TouchUpdate(const ETouchIndex::Type FingerIndex, const FVector Location); 85 | TouchData TouchItem; 86 | 87 | protected: 88 | // APawn interface 89 | virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override; 90 | // End of APawn interface 91 | 92 | /* 93 | * Configures input for touchscreen devices if there is a valid touch interface for doing so 94 | * 95 | * @param InputComponent The input component pointer to bind controls to 96 | * @returns true if touch controls were enabled. 97 | */ 98 | bool EnableTouchscreenMovement(UInputComponent* InputComponent); 99 | 100 | public: 101 | /** Returns Mesh1P subobject **/ 102 | FORCEINLINE class USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; } 103 | /** Returns FirstPersonCameraComponent subobject **/ 104 | FORCEINLINE class UCameraComponent* GetFirstPersonCameraComponent() const { return FirstPersonCameraComponent; } 105 | 106 | UFUNCTION(BlueprintCallable, Category = "HUD") 107 | class AHUD* GetHUD() const; 108 | }; 109 | 110 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameGameMode.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "FPGame.h" 4 | #include "FPGameGameMode.h" 5 | #include "FPGameHUD.h" 6 | #include "FPGameCharacter.h" 7 | 8 | AFPGameGameMode::AFPGameGameMode() 9 | : Super() 10 | { 11 | // set default pawn class to our Blueprinted character 12 | static ConstructorHelpers::FClassFinder PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter")); 13 | DefaultPawnClass = PlayerPawnClassFinder.Class; 14 | 15 | // use our custom HUD class 16 | static ConstructorHelpers::FObjectFinder HUD(TEXT("/Game/FirstPersonCPP/Blueprints/PlayerHUD")); 17 | HUDClass = (UClass*)HUD.Object->GeneratedClass; 18 | } 19 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameGameMode.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | #pragma once 3 | #include "GameFramework/GameMode.h" 4 | #include "FPGameGameMode.generated.h" 5 | 6 | UCLASS(minimalapi) 7 | class AFPGameGameMode : public AGameMode 8 | { 9 | GENERATED_BODY() 10 | 11 | public: 12 | AFPGameGameMode(); 13 | }; 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameHUD.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "FPGame.h" 4 | #include "FPGameHUD.h" 5 | #include "Engine/Canvas.h" 6 | #include "TextureResource.h" 7 | #include "CanvasItem.h" 8 | 9 | AFPGameHUD::AFPGameHUD() 10 | { 11 | // Set the crosshair texture 12 | static ConstructorHelpers::FObjectFinder CrosshiarTexObj(TEXT("/Game/FirstPerson/Textures/FirstPersonCrosshair")); 13 | CrosshairTex = CrosshiarTexObj.Object; 14 | } 15 | 16 | 17 | void AFPGameHUD::DrawHUD() 18 | { 19 | Super::DrawHUD(); 20 | 21 | // Draw very simple crosshair 22 | 23 | // find center of the Canvas 24 | const FVector2D Center(Canvas->ClipX * 0.5f, Canvas->ClipY * 0.5f); 25 | 26 | // offset by half the texture's dimensions so that the center of the texture aligns with the center of the Canvas 27 | const FVector2D CrosshairDrawPosition( (Center.X - (CrosshairTex->GetSurfaceWidth() * 0.5)), 28 | (Center.Y - (CrosshairTex->GetSurfaceHeight() * 0.5f)) ); 29 | 30 | // draw the crosshair 31 | FCanvasTileItem TileItem( CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White); 32 | TileItem.BlendMode = SE_BLEND_Translucent; 33 | Canvas->DrawItem( TileItem ); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameHUD.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | #pragma once 3 | #include "GameFramework/HUD.h" 4 | #include "FPGameHUD.generated.h" 5 | 6 | UCLASS() 7 | class AFPGameHUD : public AHUD 8 | { 9 | GENERATED_BODY() 10 | 11 | public: 12 | AFPGameHUD(); 13 | 14 | /** Primary draw call for the HUD */ 15 | virtual void DrawHUD() override; 16 | 17 | private: 18 | /** Crosshair asset pointer */ 19 | class UTexture2D* CrosshairTex; 20 | 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /Source/FPGame/FPGameProjectile.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "FPGame.h" 4 | #include "FPGameProjectile.h" 5 | #include "GameFramework/ProjectileMovementComponent.h" 6 | 7 | AFPGameProjectile::AFPGameProjectile() 8 | { 9 | // Use a sphere as a simple collision representation 10 | CollisionComp = CreateDefaultSubobject(TEXT("SphereComp")); 11 | CollisionComp->InitSphereRadius(5.0f); 12 | CollisionComp->BodyInstance.SetCollisionProfileName("Projectile"); 13 | CollisionComp->OnComponentHit.AddDynamic(this, &AFPGameProjectile::OnHit); // set up a notification for when this component hits something blocking 14 | 15 | // Players can't walk on it 16 | CollisionComp->SetWalkableSlopeOverride(FWalkableSlopeOverride(WalkableSlope_Unwalkable, 0.f)); 17 | CollisionComp->CanCharacterStepUpOn = ECB_No; 18 | 19 | // Set as root component 20 | RootComponent = CollisionComp; 21 | 22 | // Use a ProjectileMovementComponent to govern this projectile's movement 23 | ProjectileMovement = CreateDefaultSubobject(TEXT("ProjectileComp")); 24 | ProjectileMovement->UpdatedComponent = CollisionComp; 25 | ProjectileMovement->InitialSpeed = 3000.f; 26 | ProjectileMovement->MaxSpeed = 3000.f; 27 | ProjectileMovement->bRotationFollowsVelocity = true; 28 | ProjectileMovement->bShouldBounce = true; 29 | 30 | // Die after 3 seconds by default 31 | InitialLifeSpan = 3.0f; 32 | } 33 | 34 | void AFPGameProjectile::OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) 35 | { 36 | // Only add impulse and destroy projectile if we hit a physics 37 | if ((OtherActor != NULL) && (OtherActor != this) && (OtherComp != NULL) && OtherComp->IsSimulatingPhysics()) 38 | { 39 | OtherComp->AddImpulseAtLocation(GetVelocity() * 100.0f, GetActorLocation()); 40 | 41 | Destroy(); 42 | } 43 | } -------------------------------------------------------------------------------- /Source/FPGame/FPGameProjectile.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | #pragma once 3 | #include "GameFramework/Actor.h" 4 | #include "FPGameProjectile.generated.h" 5 | 6 | UCLASS(config=Game) 7 | class AFPGameProjectile : public AActor 8 | { 9 | GENERATED_BODY() 10 | 11 | /** Sphere collision component */ 12 | UPROPERTY(VisibleDefaultsOnly, Category=Projectile) 13 | class USphereComponent* CollisionComp; 14 | 15 | /** Projectile movement component */ 16 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Movement, meta = (AllowPrivateAccess = "true")) 17 | class UProjectileMovementComponent* ProjectileMovement; 18 | 19 | public: 20 | AFPGameProjectile(); 21 | 22 | /** called when projectile hits something */ 23 | UFUNCTION() 24 | void OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit); 25 | 26 | /** Returns CollisionComp subobject **/ 27 | FORCEINLINE class USphereComponent* GetCollisionComp() const { return CollisionComp; } 28 | /** Returns ProjectileMovement subobject **/ 29 | FORCEINLINE class UProjectileMovementComponent* GetProjectileMovement() const { return ProjectileMovement; } 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /Source/FPGameEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class FPGameEditorTarget : TargetRules 7 | { 8 | public FPGameEditorTarget(TargetInfo Target) 9 | { 10 | Type = TargetType.Editor; 11 | } 12 | 13 | // 14 | // TargetRules interface. 15 | // 16 | 17 | public override void SetupBinaries( 18 | TargetInfo Target, 19 | ref List OutBuildBinaryConfigurations, 20 | ref List OutExtraModuleNames 21 | ) 22 | { 23 | OutExtraModuleNames.Add("FPGame"); 24 | } 25 | } 26 | --------------------------------------------------------------------------------