Browse Source

Garrison UI Rework

bolt_update
laurids 3 years ago
parent
commit
ed2e90dfda
16 changed files with 487 additions and 557 deletions
  1. +3
    -3
      Assets/GWConquest/Animations/PlanetIndicator.controller
  2. +143
    -0
      Assets/GWConquest/Animations/PlanetIndicatorIdle.anim
  3. +8
    -0
      Assets/GWConquest/Animations/PlanetIndicatorIdle.anim.meta
  4. +47
    -81
      Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab
  5. +2
    -2
      Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab
  6. +160
    -7
      Assets/GWConquest/Scenes/GalaxyMap.unity
  7. +1
    -1
      Assets/GWConquest/Scripts/UI/DistrictUI.cs
  8. +0
    -186
      Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs
  9. +0
    -11
      Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs.meta
  10. +55
    -183
      Assets/GWConquest/Scripts/UI/GarrisonUI.cs
  11. +3
    -3
      Assets/GWConquest/Scripts/UI/PlanetIndicatorUI.cs
  12. +4
    -0
      Assets/GWConquest/Scripts/UI/PlanetViewUI.cs
  13. +0
    -30
      Assets/GWConquest/Scripts/UI/RelocatePanelEntry.cs
  14. +0
    -11
      Assets/GWConquest/Scripts/UI/RelocatePanelEntry.cs.meta
  15. +60
    -38
      Assets/GWConquest/Scripts/UI/TransportUIElement.cs
  16. +1
    -1
      Assets/GWConquest/Scripts/UI/ZoneUI.cs

+ 3
- 3
Assets/GWConquest/Animations/PlanetIndicator.controller View File

@ -66,7 +66,7 @@ AnimatorController:
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
@ -94,7 +94,7 @@ AnimatorStateMachine:
m_Position: {x: 260, y: 80, z: 0} m_Position: {x: 260, y: 80, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 2989985220435069597} m_State: {fileID: 2989985220435069597}
m_Position: {x: 240, y: 190, z: 0}
m_Position: {x: 200, y: 180, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
@ -151,7 +151,7 @@ AnimatorState:
m_MirrorParameterActive: 0 m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0 m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0 m_TimeParameterActive: 0
m_Motion: {fileID: 0}
m_Motion: {fileID: 7400000, guid: c638c5dbdee6c2e46a340d2e3d66a16d, type: 2}
m_Tag: m_Tag:
m_SpeedParameter: m_SpeedParameter:
m_MirrorParameter: m_MirrorParameter:


+ 143
- 0
Assets/GWConquest/Animations/PlanetIndicatorIdle.anim View File

@ -0,0 +1,143 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PlanetIndicatorIdle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Image/BattleAura
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Image/BattleSwords
classID: 1
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 4293498787
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 3939035237
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Image/BattleAura
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Image/BattleSwords
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

+ 8
- 0
Assets/GWConquest/Animations/PlanetIndicatorIdle.anim.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c638c5dbdee6c2e46a340d2e3d66a16d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

+ 47
- 81
Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab View File

@ -477,43 +477,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c007a78ea4c9b9741a9a08e917508e9f, type: 3} m_Script: {fileID: 11500000, guid: c007a78ea4c9b9741a9a08e917508e9f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Content: {fileID: 1069889124}
IconOffset: 5
ArmyGroupOffset: 5
ArmyGroupOffsetX: 50
ArmyGroupPrefab: {fileID: 8873205197795550154, guid: 3da507d0addcecc4688100db8c4e4304,
ContentTransform: {fileID: 1069889124}
ElementPrefab: {fileID: 2673194344194583624, guid: f3a5c8bf38a7dfa408f601a424edb92d,
type: 3} type: 3}
UnitIconPrefab: {fileID: 7101981575647078767, guid: 826c1e93895e3e34399f95ec1d5acad8,
type: 3}
GreyedOutColor: {r: 1, g: 1, b: 1, a: 0.24705882}
--- !u!114 &5779445202336357724
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2443912949472084106}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 4
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1590972559}
m_MethodName: Deselect
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &5411513710314136447 --- !u!1 &5411513710314136447
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -662,120 +628,120 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalPosition.x
value: 0
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalPosition.y
value: 0
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalPosition.z
propertyPath: m_RootOrder
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalRotation.x
value: -0
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalRotation.y
value: -0
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalRotation.z
value: -0
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalRotation.w
value: 1
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_RootOrder
value: 0
propertyPath: m_SizeDelta.x
value: -4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
propertyPath: m_SizeDelta.y
value: -4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalEulerAnglesHint.y
propertyPath: m_LocalPosition.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_LocalEulerAnglesHint.z
propertyPath: m_LocalPosition.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x
value: -2
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.y
value: -2
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_SizeDelta.x
value: -4
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_SizeDelta.y
value: -4
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchorMin.x
value: 0
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchorMin.y
value: 0
propertyPath: m_AnchoredPosition.x
value: -2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
propertyPath: m_AnchoredPosition.y
value: -2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_Pivot.x
value: 0.5
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
propertyPath: m_Pivot.y
value: 0.5
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3}
--- !u!224 &9198647461551696382 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3}
m_PrefabInstance: {fileID: 1337701076232978347}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2443912949472084106 stripped --- !u!1 &2443912949472084106 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 3709556431398436641, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, m_CorrespondingSourceObject: {fileID: 3709556431398436641, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3} type: 3}
m_PrefabInstance: {fileID: 1337701076232978347} m_PrefabInstance: {fileID: 1337701076232978347}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!224 &9198647461551696382 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47,
type: 3}
m_PrefabInstance: {fileID: 1337701076232978347}
m_PrefabAsset: {fileID: 0}

+ 2
- 2
Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab View File

@ -67,7 +67,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 34
m_FontSize: 24
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
m_MinSize: 1 m_MinSize: 1
@ -131,7 +131,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: 0} m_AnchoredPosition: {x: 10, y: 0}
m_SizeDelta: {x: 77, y: 53}
m_SizeDelta: {x: 53, y: 53}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!222 &6815987390155653558 --- !u!222 &6815987390155653558
CanvasRenderer: CanvasRenderer:


+ 160
- 7
Assets/GWConquest/Scenes/GalaxyMap.unity View File

@ -16587,10 +16587,10 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 30
m_FontSize: 24
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
m_MinSize: 3
m_MinSize: 2
m_MaxSize: 69 m_MaxSize: 69
m_Alignment: 1 m_Alignment: 1
m_AlignByGeometry: 0 m_AlignByGeometry: 0
@ -20568,7 +20568,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 71338309} m_TargetGraphic: {fileID: 71338309}
m_HandleRect: {fileID: 71338308} m_HandleRect: {fileID: 71338308}
m_Direction: 2 m_Direction: 2
m_Value: 1
m_Value: 0
m_Size: 1 m_Size: 1
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
@ -41942,6 +41942,154 @@ Transform:
type: 3} type: 3}
m_PrefabInstance: {fileID: 691306218} m_PrefabInstance: {fileID: 691306218}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &692008056
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 692008057}
- component: {fileID: 692008061}
- component: {fileID: 692008060}
- component: {fileID: 692008059}
- component: {fileID: 692008058}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &692008057
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 692008056}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1420890672}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 30.34}
m_SizeDelta: {x: 199.47, y: 30.675964}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &692008058
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 692008056}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 692008060}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1590972559}
m_MethodName: OpenTransportUI
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &692008059
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 692008056}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 342dd2fd557feed438ce05e1625dee09, type: 3}
m_Name:
m_EditorClassIdentifier:
smoothTime: 0.1
scaleFactor: 1.05
--- !u!114 &692008060
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 692008056}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.936, g: 0.936, b: 0.936, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 18
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 7
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Open Logistics Menu
--- !u!222 &692008061
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 692008056}
m_CullTransparentMesh: 0
--- !u!1 &692392196 --- !u!1 &692392196
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -71200,10 +71348,10 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 30
m_FontSize: 24
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
m_MinSize: 3
m_MinSize: 2
m_MaxSize: 69 m_MaxSize: 69
m_Alignment: 1 m_Alignment: 1
m_AlignByGeometry: 0 m_AlignByGeometry: 0
@ -127477,7 +127625,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 47
m_FontSize: 43
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
m_MinSize: 3 m_MinSize: 3
@ -130450,7 +130598,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000030517578} m_AnchoredPosition: {x: 0, y: -0.000030517578}
m_SizeDelta: {x: 0, y: 168}
m_SizeDelta: {x: 0, y: 209}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &2089647853 --- !u!114 &2089647853
MonoBehaviour: MonoBehaviour:
@ -134394,6 +134542,11 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: GarrisonPanel value: GarrisonPanel
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5411513710314136447, guid: f8bffe0306e53cb4b958afe65a7c7b2c,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7616586528241184281, guid: f8bffe0306e53cb4b958afe65a7c7b2c, - target: {fileID: 7616586528241184281, guid: f8bffe0306e53cb4b958afe65a7c7b2c,
type: 3} type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive


+ 1
- 1
Assets/GWConquest/Scripts/UI/DistrictUI.cs View File

@ -48,7 +48,7 @@ namespace GWConquest
{ {
if(district != null) if(district != null)
{ {
GarrisonUI.Rebuild();
//GarrisonUI.Rebuild();
} }
} }


+ 0
- 186
Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs View File

@ -1,186 +0,0 @@
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace GWConquest
{
public class GarrisonArmyGroupUI : DragDropElement
{
public RectTransform ArrowTransform;
public GameObject ButtonsSmall;
public GameObject ButtonsLarge;
public GameObject Corners;
public GameObject RelocatePanel;
public GameObject RelocateEntryPrefab;
public float RelocateEntryOffset;
public GameObject MovingIcon;
private Formation formation;
private bool relocatePanelShowing;
private float relocateEntryHeight;
private bool isSelected;
private GarrisonUI garrisonUI;
public void Init(Formation f)
{
garrisonUI = GetComponentInParent<GarrisonUI>();
formation = f;
if (formation.IsExpandedInMenu)
{
ArrowTransform.localEulerAngles = Vector3.zero;
}
else
{
ArrowTransform.localEulerAngles = new Vector3(0f, 0f, 90f);
}
relocateEntryHeight = RelocateEntryPrefab.GetComponent<RectTransform>().rect.height;
}
public void ToggleExpand()
{
BoltLog.Info("Toggling expand");
formation.IsExpandedInMenu = !formation.IsExpandedInMenu;
if (formation.IsExpandedInMenu)
{
ArrowTransform.localEulerAngles = Vector3.zero;
}
else
{
ArrowTransform.localEulerAngles = new Vector3(0f, 0f, 90f);
}
GetComponentInParent<GarrisonUI>().Rebuild();
}
public void SetSelected(bool sel)
{
isSelected = sel;
UpdateButtons();
}
public void UpdateButtons()
{
if (isSelected)
{
Corners.SetActive(true);
ButtonsSmall.SetActive(true);
ButtonsLarge.SetActive(formation.IsExpandedInMenu);
}
else
{
Corners.SetActive(false);
ButtonsSmall.SetActive(false);
ButtonsLarge.SetActive(false);
RelocatePanel.SetActive(false);
}
}
public void SelectFormation()
{
garrisonUI.SelectFormation(formation, null);
}
public void ToggleRelocatePanel()
{
relocatePanelShowing = !relocatePanelShowing;
RelocatePanel.SetActive(relocatePanelShowing);
ButtonsLarge.SetActive(!relocatePanelShowing && formation.IsExpandedInMenu);
Corners.SetActive(!relocatePanelShowing);
garrisonUI.ToggleRelocatePanel(relocatePanelShowing, formation);
if (relocatePanelShowing)
{
foreach (var e in RelocatePanel.GetComponentsInChildren<RelocatePanelEntry>())
{
Destroy(e.gameObject);
}
var relocatePanelRT = RelocatePanel.GetComponent<RectTransform>();
if (formation.currentZone != null)
{
var pathfinding = formation.currentZone.planet.pathfindingGraph;
var allPaths = pathfinding.FindAllPaths(formation, formation.currentZone);
var zones = allPaths.Keys;
float entryY = RelocateEntryOffset;
foreach (Zone z in zones)
{
Debug.LogFormat("Path to zone {0}: {1}", z, allPaths[z]);
var entryGO = Instantiate(RelocateEntryPrefab);
var entryRT = entryGO.GetComponent<RectTransform>();
entryRT.SetParent(relocatePanelRT);
entryRT.anchoredPosition = new Vector2(0, -entryY);
entryRT.sizeDelta = new Vector2(0, relocateEntryHeight);
entryRT.rotation = Quaternion.identity;
entryRT.localScale = Vector3.one;
var entryUI = entryRT.GetComponent<RelocatePanelEntry>();
entryUI.Init(z);
entryY += relocateEntryHeight;
}
Vector2 relocatePanelSize = relocatePanelRT.sizeDelta;
relocatePanelSize.y = entryY;
relocatePanelRT.sizeDelta = relocatePanelSize;
}
}
}
public void RelocateFormation(Zone z)
{
garrisonUI.Deselect();
//formation.MoveToZone(z, GameManager.Instance.GroundTransitionLengthFactor);
var pathfinding = formation.currentZone.planet.pathfindingGraph;
var shortestPath = pathfinding.FindShortestPath(formation, formation.currentZone, z);
if(shortestPath != null)
{
formation.StartMovingOnPath(shortestPath.zones);
}
}
public override void OnDragBegin()
{
foreach(Graphic g in GetComponentsInChildren<Graphic>())
{
g.enabled = false;
}
MovingIcon.SetActive(true);
Vector3 mousePos = Input.mousePosition;
MovingIcon.GetComponent<RectTransform>().position = mousePos;
}
public override bool OnDragFinished()
{
foreach(DistrictIcon di in FindObjectsOfType<DistrictIcon>())
{
RectTransform diRT = di.GetComponent<RectTransform>();
Vector3 mousePos = Input.mousePosition;
if(RectTransformUtility.RectangleContainsScreenPoint(diRT, mousePos))
{
RelocateFormation(di.district.Zone);
break;
}
}
MovingIcon.SetActive(false);
foreach (Graphic g in GetComponentsInChildren<Graphic>())
{
g.enabled = true;
}
return true;
}
}
}

+ 0
- 11
Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs.meta View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e7bf2d966c11fc24290820bb140379d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 55
- 183
Assets/GWConquest/Scripts/UI/GarrisonUI.cs View File

@ -7,220 +7,92 @@ namespace GWConquest
{ {
public class GarrisonUI : MonoBehaviour public class GarrisonUI : MonoBehaviour
{ {
public RectTransform Content;
public float IconOffset;
public float ArmyGroupOffset;
public float ArmyGroupOffsetX;
public RectTransform ContentTransform;
public GameObject ArmyGroupPrefab;
public GameObject UnitIconPrefab;
public GameObject ElementPrefab;
public Color GreyedOutColor;
[System.NonSerialized]
public List<TransportUIElement> SubElementList = new List<TransportUIElement>();
private Zone zone;
private Zone CurrentZone;
private Dictionary<Formation, RectTransform> ArmyGroupMap = new Dictionary<Formation, RectTransform>();
private Dictionary<IIconObject, UnitMapEntry> UnitIconMap = new Dictionary<IIconObject, UnitMapEntry>();
private float unitWidth;
public void Init(Zone z)
{
CurrentZone = z;
private Formation selectedFormation;
private IIconObject selectedUnit;
RebuildPanel();
FixedUpdate();
}
public class UnitMapEntry
public void Update()
{ {
public RectTransform unitRT;
public int indexX;
public int indexY;
GWLayout.UpdateLayout(ContentTransform);
} }
public void Init(Zone _zone)
public void RebuildPanel()
{ {
zone = _zone;
selectedFormation = null;
selectedUnit = null;
unitWidth = UnitIconPrefab.GetComponent<RectTransform>().rect.width;
Rebuild();
Util.DestroyAllChildren(ContentTransform);
SubElementList.Clear();
} }
public void Populate()
public void FixedUpdate()
{ {
var formations = zone.Formations.Where(f => f.Player == Player.CurrentPlayer);
float armyGroupY = ArmyGroupOffset;
foreach(Formation f in formations)
{
GameObject armyGroupGO = Instantiate(ArmyGroupPrefab);
RectTransform armyGroupRT = armyGroupGO.GetComponent<RectTransform>();
armyGroupRT.SetParent(Content);
armyGroupRT.anchoredPosition = new Vector2(0, -armyGroupY);
armyGroupRT.localRotation = Quaternion.identity;
armyGroupRT.localScale = Vector3.one;
ArmyGroupMap[f] = armyGroupRT;
var objects = CurrentZone.Formations.Where(f => f.Player == Player.CurrentPlayer && f.ZoneType == CurrentZone.zoneType).Cast<object>();
GWLayout.UpdateGameObjects(SubElementList, objects.ToList(), obj => {
var elementComp = AddElement(ContentTransform);
Text armyGroupTitle = armyGroupGO.GetComponentInChildren<Text>();
armyGroupTitle.text = f.FormationName;
var armyGroupUI = armyGroupGO.GetComponent<GarrisonArmyGroupUI>();
armyGroupUI.Init(f);
float rowY = armyGroupTitle.GetComponent<RectTransform>().rect.height;
if (f.IsExpandedInMenu)
if(obj is District)
{ {
float armyGroupWidth = Content.rect.width - ArmyGroupOffsetX;
var icons = new List<IIconObject>();
icons.AddRange(f.Units);
//icons.AddRange(f.AllItems);
int unitsPerRow = Mathf.FloorToInt(armyGroupWidth / (unitWidth + IconOffset));
int rowCount = Mathf.CeilToInt((float)icons.Count / unitsPerRow);
Debug.LogFormat("Unit count: {0}, Units per row: {1}, Row count: {2} Army Group Rect: {3}", icons.Count, unitsPerRow, rowCount, armyGroupWidth);
for (int i = 0; i < rowCount; i++)
{
int maxInd = Mathf.Min(icons.Count - i * unitsPerRow, unitsPerRow);
float iconX = IconOffset;
for (int j = 0; j < maxInd; j++)
{
IIconObject u = icons[j + i * unitsPerRow];
GameObject unitGO = Instantiate(UnitIconPrefab);
RectTransform unitRT = unitGO.GetComponent<RectTransform>();
unitRT.SetParent(armyGroupRT);
unitRT.anchoredPosition = new Vector2(iconX, -rowY);
unitRT.localRotation = Quaternion.identity;
unitRT.localScale = Vector3.one;
unitGO.GetComponentInChildren<Image>().sprite = u.Icon;
unitGO.GetComponent<Button>().onClick.AddListener(() =>
{
SelectFormation(f, u);
});
UnitIconMap[u] = new UnitMapEntry() { unitRT = unitRT, indexX = j, indexY = i };
iconX += (unitWidth + IconOffset);
}
rowY += (unitWidth + IconOffset);
}
elementComp.Type = TransportUIElement.ObjectType.District;
elementComp.District = obj as District;
} }
armyGroupRT.sizeDelta = new Vector2(-ArmyGroupOffsetX, rowY + IconOffset);
armyGroupY += armyGroupRT.sizeDelta.y + ArmyGroupOffset;
}
Vector2 contentSize = Content.sizeDelta;
contentSize.y = armyGroupY;
Content.sizeDelta = contentSize;
UpdateSelectedIcons();
}
public void Rebuild()
{
foreach(RectTransform rt in ArmyGroupMap.Values)
{
Destroy(rt.gameObject);
}
ArmyGroupMap.Clear();
UnitIconMap.Clear();
Populate();
}
public void SelectFormation(Formation f, IIconObject u)
{
if(selectedFormation != null)
{
if(selectedUnit != null)
else if(obj is Formation)
{
elementComp.Type = TransportUIElement.ObjectType.Formation;
elementComp.Formation = obj as Formation;
}
else if(obj is Planet)
{ {
foreach(Unit unit in selectedFormation.Units)
{
if(UnitIconMap.ContainsKey(unit))
{
UnitIconMap[unit].unitRT.GetComponentInChildren<Image>().color = Color.white;
}
}
elementComp.Type = TransportUIElement.ObjectType.Planet;
elementComp.Planet = obj as Planet;
}
else {
BoltLog.Error("Displayed object is neither District or Formation: {0}", obj);
} }
GarrisonArmyGroupUI ui = ArmyGroupMap[selectedFormation].GetComponent<GarrisonArmyGroupUI>();
ui.SetSelected(false);
}
selectedFormation = f;
selectedUnit = u;
elementComp.Rebuild();
UpdateSelectedIcons();
return elementComp;
});
} }
private void UpdateSelectedIcons()
{
if (selectedFormation != null && ArmyGroupMap.ContainsKey(selectedFormation))
{
GarrisonArmyGroupUI ui = ArmyGroupMap[selectedFormation].GetComponent<GarrisonArmyGroupUI>();
ui.SetSelected(true);
private TransportUIElement AddElement(RectTransform parent) {
var elementGO = Instantiate(ElementPrefab);
if (selectedUnit != null)
{
foreach (Unit unit in selectedFormation.Units)
{
if (unit != (object)selectedUnit && UnitIconMap.ContainsKey(unit))
{
UnitIconMap[unit].unitRT.GetComponentInChildren<Image>().color = GreyedOutColor;
}
}
}
}
}
var elementRT = elementGO.GetComponent<RectTransform>();
public void Deselect()
{
SelectFormation(null, null);
}
elementRT.SetParent(parent);
elementRT.anchoredPosition = Vector2.zero;
var size = elementRT.sizeDelta;
size.x = 0f;
elementRT.sizeDelta = size;
elementRT.localScale = Vector3.one;
public void ToggleRelocatePanel(bool showing, Formation f)
{
if(!showing)
{
foreach(var rt in ArmyGroupMap.Values)
{
rt.gameObject.SetActive(true);
}
foreach(Unit u in f.Units)
{
UnitIconMap.GetDefault(u)?.unitRT.gameObject.SetActive(true);
}
}
else
{
foreach(var key in ArmyGroupMap.Keys)
{
if(key != f)
{
ArmyGroupMap.GetDefault(key)?.gameObject.SetActive(false);
}
}
foreach (Unit u in f.Units)
{
UnitIconMap.GetDefault(u)?.unitRT.gameObject.SetActive(false);
}
}
var elementComp = elementGO.GetComponent<TransportUIElement>();
return elementComp;
} }
public void OpenTransportUI() public void OpenTransportUI()
{ {
GetComponentInParent<PlanetViewUI>().ShowTransportUI(); GetComponentInParent<PlanetViewUI>().ShowTransportUI();
} }
} }
} }

+ 3
- 3
Assets/GWConquest/Scripts/UI/PlanetIndicatorUI.cs View File

@ -79,9 +79,7 @@ namespace GWConquest
EnemyIndicator.SetActive(false); EnemyIndicator.SetActive(false);
PlayerIndicatorGround.SetActive(false); PlayerIndicatorGround.SetActive(false);
EnemyIndicatorGround.SetActive(false); EnemyIndicatorGround.SetActive(false);
}
GetComponent<Animator>().SetBool("Battle", Planet.HasBattle);
}
} }
private void FixedUpdate() { private void FixedUpdate() {
@ -102,6 +100,8 @@ namespace GWConquest
PlanetNameText.color = Util.UpdateColorRGB(PlanetNameText.color, Color.white); PlanetNameText.color = Util.UpdateColorRGB(PlanetNameText.color, Color.white);
} }
GetComponent<Animator>().SetBool("Battle", Planet.HasBattle);
} }
} }


+ 4
- 0
Assets/GWConquest/Scripts/UI/PlanetViewUI.cs View File

@ -283,6 +283,7 @@ namespace GWConquest
SpaceIndicatorPanel.SetActive(false); SpaceIndicatorPanel.SetActive(false);
FleetIcons.gameObject.SetActive(false); FleetIcons.gameObject.SetActive(false);
GroundPanel.gameObject.SetActive(true); GroundPanel.gameObject.SetActive(true);
LogisticsButton.SetActive(false);
GroundPanel.SelectDistrict(selectedZone.GetComponent<District>()); GroundPanel.SelectDistrict(selectedZone.GetComponent<District>());
var spaceIcon = DistrictIconList.FirstOrDefault(i => i.district.Zone.zoneType == ZoneType.Space); var spaceIcon = DistrictIconList.FirstOrDefault(i => i.district.Zone.zoneType == ZoneType.Space);
@ -389,6 +390,7 @@ namespace GWConquest
{ {
//GroundIndicatorPanel.SetActive(false); //GroundIndicatorPanel.SetActive(false);
ZonePanel.gameObject.SetActive(true); ZonePanel.gameObject.SetActive(true);
LogisticsButton.SetActive(false);
ZonePanel.SelectDistrict(selectedZone); ZonePanel.SelectDistrict(selectedZone);
} }
@ -399,6 +401,7 @@ namespace GWConquest
SpaceIndicatorPanel.SetActive(true); SpaceIndicatorPanel.SetActive(true);
FleetIcons.gameObject.SetActive(true); FleetIcons.gameObject.SetActive(true);
GroundPanel.gameObject.SetActive(false); GroundPanel.gameObject.SetActive(false);
LogisticsButton.SetActive(true);
var spaceIcon = DistrictIconList.FirstOrDefault(i => i.district.Zone.zoneType == ZoneType.Space); var spaceIcon = DistrictIconList.FirstOrDefault(i => i.district.Zone.zoneType == ZoneType.Space);
if(spaceIcon != null) if(spaceIcon != null)
@ -413,6 +416,7 @@ namespace GWConquest
{ {
GroundIndicatorPanel.SetActive(true); GroundIndicatorPanel.SetActive(true);
ZonePanel.gameObject.SetActive(false); ZonePanel.gameObject.SetActive(false);
LogisticsButton.SetActive(true);
//UpdateSpaceIndicator(); //UpdateSpaceIndicator();
} }


+ 0
- 30
Assets/GWConquest/Scripts/UI/RelocatePanelEntry.cs View File

@ -1,30 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace GWConquest
{
public class RelocatePanelEntry : MonoBehaviour
{
public Text ZoneName;
public Image ZoneImage;
private Zone zone;
public void Init(Zone z)
{
zone = z;
District d = zone.GetComponent<District>();
if(d != null)
{
ZoneName.text = d.GetDistrictName();
ZoneImage.sprite = d.GetCurrentSprite();
}
}
public void Click()
{
GetComponentInParent<GarrisonArmyGroupUI>().RelocateFormation(zone);
}
}
}

+ 0
- 11
Assets/GWConquest/Scripts/UI/RelocatePanelEntry.cs.meta View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ad2c0d0508db4f14681b41163e9fe965
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 60
- 38
Assets/GWConquest/Scripts/UI/TransportUIElement.cs View File

@ -268,55 +268,77 @@ namespace GWConquest
NameText.gameObject.SetActive(false); NameText.gameObject.SetActive(false);
} }
public override bool OnDragFinished()
private void HandleTransition(ObjectType targetType, Zone targetZone = null, Formation targetFormation = null)
{ {
var mousePos = Input.mousePosition;
foreach(var ui in FindObjectsOfType<TransportUIElement>())
if (Formation.ZoneType == ZoneType.Ground)
{ {
if (RectTransformUtility.RectangleContainsScreenPoint(ui.GetComponent<RectTransform>(), mousePos))
if (targetType == ObjectType.District && targetZone.zoneType == ZoneType.Ground)
{ {
if(Formation.ZoneType == ZoneType.Ground)
if (!Formation.IsEmbarked)
{ {
if (ui.Type == ObjectType.District && ui.District.Zone.zoneType == ZoneType.Ground)
// Transition Boden -> Boden
var pathfinding = Formation.currentZone.planet.pathfindingGraph;
var shortestPath = pathfinding.FindShortestPath(Formation, Formation.currentZone, targetZone);
if (shortestPath != null)
{ {
if(!Formation.IsEmbarked)
{
// Transition Boden -> Boden
var goalZone = ui.District.Zone;
var pathfinding = Formation.currentZone.planet.pathfindingGraph;
var shortestPath = pathfinding.FindShortestPath(Formation, Formation.currentZone, goalZone);
if (shortestPath != null)
{
Formation.StartMovingOnPath(shortestPath.zones);
}
}
else {
// Transition Weltall -> Boden
var goalZone = ui.District.Zone;
var path = new List<Zone>() {Formation.currentZone, goalZone};
Formation.StartMovingOnPath(path);
}
Formation.StartMovingOnPath(shortestPath.zones);
} }
else if (ui.Type == ObjectType.Formation && ui.Formation.ZoneType == ZoneType.Space)
}
else
{
// Transition Weltall -> Boden
var path = new List<Zone>() { Formation.currentZone, targetZone };
Formation.StartMovingOnPath(path);
}
}
else if (targetType == ObjectType.Formation && targetFormation.ZoneType == ZoneType.Space)
{
if (targetFormation.CanCarry(Formation))
{
if (!Formation.IsEmbarked)
{
// Transition Boden -> Weltall
var goalZone = targetFormation.currentZone;
var path = new List<Zone>() { Formation.currentZone, goalZone };
Formation.StartMovingOnPath(path, targetFormation: targetFormation);
}
else
{ {
if(ui.Formation.CanCarry(Formation))
{
if(!Formation.IsEmbarked)
{
// Transition Boden -> Weltall
var goalZone = ui.Formation.currentZone;
var path = new List<Zone>() {Formation.currentZone, goalZone};
Formation.StartMovingOnPath(path, targetFormation: ui.Formation);
}
else {
// Transition Weltall -> Weltall (Flottenwechsel)
// TODO
}
}
// Transition Weltall -> Weltall (Flottenwechsel)
// TODO
} }
} }
} }
} }
}
public override bool OnDragFinished()
{
var mousePos = Input.mousePosition;
bool hasTransitioned = false;
foreach(var ui in FindObjectsOfType<TransportUIElement>())
{
if (ui != this && RectTransformUtility.RectangleContainsScreenPoint(ui.GetComponent<RectTransform>(), mousePos))
{
HandleTransition(ui.Type, ui.District?.Zone, ui.Formation);
hasTransitioned = true;
break;
}
}
if(!hasTransitioned)
{
foreach(DistrictIcon di in FindObjectsOfType<DistrictIcon>())
{
if (RectTransformUtility.RectangleContainsScreenPoint(di.GetComponent<RectTransform>(), mousePos))
{
HandleTransition(ObjectType.District, di.district.Zone);
break;
}
}
}
ChildrenTransform.gameObject.SetActive(true); ChildrenTransform.gameObject.SetActive(true);
Arrow.gameObject.SetActive(true); Arrow.gameObject.SetActive(true);


+ 1
- 1
Assets/GWConquest/Scripts/UI/ZoneUI.cs View File

@ -22,7 +22,7 @@ namespace GWConquest
{ {
if (zone != null) if (zone != null)
{ {
GarrisonUI.Rebuild();
//GarrisonUI.Rebuild();
} }
} }
} }

Loading…
Cancel
Save