Skip to content

Commit

Permalink
Merge pull request #470 from kreghek/hot-fixes
Browse files Browse the repository at this point in the history
Hot fixes
  • Loading branch information
kreghek committed Aug 16, 2019
2 parents 989babe + 542c095 commit 963dc2d
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/Zilon.Client/Assets/db.bytes.meta
/Zilon.Client/Packages
/Zilon.Core/*.leu
/Builds/x64
/Builds/x86
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"SchemeSid": "highlander-helmet",
"Weight": 5
},

{
"SchemeSid": "wooden-shield",
"Weight": 10
},
{
"SchemeSid": null,
"Weight": 95
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
]
}
]
},
{
"SchemeSid": "wooden-shield",
"Weight": 20
},
{
"SchemeSid": "rush-sword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class GlobeWorldVM : MonoBehaviour

private async void Start()
{
//TODO Разобраться, почему остаются блоки от перемещения при использовании перехода
_commandBlockerService.DropBlockers();

if (_globeManager.Globe == null)
{
if (!_progressStorageService.LoadGlobe())
Expand Down
28 changes: 14 additions & 14 deletions Zilon.Client/Assets/Zilon/Scripts/Models/GlobeScene/GroupVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class GroupVM : MonoBehaviour
public bool IsSelected { get; private set; }
public bool IsMoving { get; set; }
public MapLocation CurrentLocation { get; set; }
public event EventHandler OnSelect;
//public event EventHandler OnSelect;

// Update is called once per frame
void Update()
Expand All @@ -20,19 +20,19 @@ void Update()
}
}

void OnMouseDown()
{
if (!IsSelected)
{
IsSelected = true;
OnSelect(this, new EventArgs());
}
}
//void OnMouseDown()
//{
// if (!IsSelected)
// {
// IsSelected = true;
// OnSelect.Invoke(this, new EventArgs());
// }
//}

public void SetSelectState(bool state)
{
Icon.color = state ? Color.white : Color.gray;
//public void SetSelectState(bool state)
//{
// Icon.color = state ? Color.white : Color.gray;

IsSelected = state;
}
// IsSelected = state;
//}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public async void Awake()
//}

_gameLoop.Updated += GameLoop_Updated;

//TODO Разобраться, почему остаются блоки от перемещения при использовании перехода
_commandBlockerService.DropBlockers();
}

private void GameLoop_Updated(object sender, EventArgs e)
Expand Down Expand Up @@ -506,6 +509,8 @@ private void Sector_HumanGroupExit(object sender, SectorExitEventArgs e)
_commandBlockerService.DropBlockers();
_humanActorTaskSource.CurrentActor.Person.Survival.Dead -= HumanPersonSurvival_Dead;
_playerState.ActiveActor = null;
_playerState.SelectedViewModel = null;
_playerState.HoverViewModel = null;
_humanActorTaskSource.SwitchActor(null);

if (_humanPlayer.GlobeNode == null)
Expand Down
14 changes: 12 additions & 2 deletions Zilon.Core/Zilon.Core/Commands/Sector/ActorCommandBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;

using JetBrains.Annotations;

using Zilon.Core.Client;
using Zilon.Core.Tactics;

Expand All @@ -22,8 +24,16 @@ public abstract class ActorCommandBase : TacticCommandBase
PlayerState = playerState;
}

public IActor Actor => PlayerState.ActiveActor.Actor;
/// <summary>
/// Текущий активный актёр.
/// </summary>
[CanBeNull]
public IActor CurrentActor => PlayerState.ActiveActor?.Actor;

public IActorViewModel ActorViewModel => PlayerState.ActiveActor;
/// <summary>
/// Модель представления текущего актёра.
/// </summary>
[CanBeNull]
public IActorViewModel CurrentActorViewModel => PlayerState.ActiveActor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public class SectorTransitionMoveCommand : ActorCommandBase
/// <returns> Возвращает true, если перемещение возможно. Иначе, false. </returns>
public override bool CanExecute()
{
var actorNode = Actor.Node;
if (CurrentActor == null)
{
return false;
}

var actorNode = CurrentActor.Node;
var map = SectorManager.CurrentSector.Map;

var humanActorNodes = _actorManager.Items.Where(x => x.Owner is HumanPlayer).Select(x => x.Node);
Expand All @@ -59,7 +64,7 @@ public override bool CanExecute()
/// </summary>
protected override void ExecuteTacticCommand()
{
var actorNode = Actor.Node;
var actorNode = CurrentActor.Node;
var map = SectorManager.CurrentSector.Map;

var humanActorNodes = _actorManager.Items.Where(x => x.Owner is HumanPlayer).Select(x => x.Node);
Expand Down

0 comments on commit 963dc2d

Please sign in to comment.