handelRightClick method

List<RightClickOptions> handelRightClick()

Implementation

List<RightClickOptions> handelRightClick(){
  List<RightClickOptions> toShow = [
    RightClickOptions.addCollision,
    RightClickOptions.addObject,
  ];
  if(scene.objectTappedOn.isNotEmpty){
    if(scene.objectTappedOn.length == 1
      && (scene.levelInfo[scene.selectedLevel].objects[scene.objectTappedOn.first.objectLocation].type == SelectedType.atlas
      || scene.levelInfo[scene.selectedLevel].objects[scene.objectTappedOn.first.objectLocation].type == SelectedType.image)
    ){
      toShow += [RightClickOptions.flipHorizontal,RightClickOptions.flipVertical,RightClickOptions.editName];
    }
    if(scene.objectTappedOn.length == 1 && scene.levelInfo[scene.selectedLevel].objects[scene.objectTappedOn.first.objectLocation].type == SelectedType.object){
      toShow += [RightClickOptions.editName,RightClickOptions.changeColor];
    }
    toShow += [
      RightClickOptions.remove,
      RightClickOptions.bringToFront,
      RightClickOptions.sendToBack,
      RightClickOptions.copy,
      RightClickOptions.cut
    ];
    if(scene.objectsCopied.isNotEmpty){
      toShow.add(RightClickOptions.paste);
    }
  }
  else if(scene.objectsCopied.isNotEmpty){
    toShow = [
      RightClickOptions.addCollision,
      RightClickOptions.addObject,
      RightClickOptions.paste,
    ];
  }

  return toShow;
}