- Drag&Drop a connection where source or target system is an Abyss system, should switch connection type to "abyss"
- fixed js bug in "route finder" module - fixed UI z-Index glitch where systems "overlap" context menu
This commit is contained in:
@@ -172,21 +172,30 @@ class ConnectionModel extends AbstractMapTrackingModel {
|
||||
|
||||
/**
|
||||
* set default connection type by search route between endpoints
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function setDefaultTypeData(){
|
||||
if(
|
||||
is_object($this->source) &&
|
||||
is_object($this->target)
|
||||
){
|
||||
$routeController = new Route();
|
||||
$route = $routeController->searchRoute($this->source->systemId, $this->target->systemId, 1);
|
||||
|
||||
if($route['routePossible']){
|
||||
$this->scope = 'stargate';
|
||||
$this->type = ['stargate'];
|
||||
if(
|
||||
$this->source->isAbyss() ||
|
||||
$this->target->isAbyss()
|
||||
){
|
||||
$this->scope = 'abyssal';
|
||||
$this->type = ['abyssal'];
|
||||
}else{
|
||||
$this->scope = 'wh';
|
||||
$this->type = ['wh_fresh'];
|
||||
$routeController = new Route();
|
||||
$route = $routeController->searchRoute($this->source->systemId, $this->target->systemId, 1);
|
||||
|
||||
if($route['routePossible']){
|
||||
$this->scope = 'stargate';
|
||||
$this->type = ['stargate'];
|
||||
}else{
|
||||
$this->scope = 'wh';
|
||||
$this->type = ['wh_fresh'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,18 +231,19 @@ class ConnectionModel extends AbstractMapTrackingModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Event "Hook" function
|
||||
* Event "Hook" function
|
||||
* can be overwritten
|
||||
* return false will stop any further action
|
||||
* @param ConnectionModel $self
|
||||
* @param BasicModel $self
|
||||
* @param $pkeys
|
||||
* @return bool
|
||||
* @throws \Exception\DatabaseException
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function beforeInsertEvent($self, $pkeys){
|
||||
// check for "default" connection type and add them if missing
|
||||
// -> get() with "true" returns RAW data! important for JSON table column check!
|
||||
$types = (array)json_decode( $this->get('type', true) );
|
||||
$types = (array)json_decode($this->get('type', true));
|
||||
if(
|
||||
!$this->scope ||
|
||||
empty($types)
|
||||
@@ -411,6 +421,7 @@ class ConnectionModel extends AbstractMapTrackingModel {
|
||||
* @param null $table
|
||||
* @param null $fields
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function setup($db=null, $table=null, $fields=null){
|
||||
$status = parent::setup($db,$table,$fields);
|
||||
|
||||
Reference in New Issue
Block a user