Author Topic: "Please load a file or create a new Army" message  (Read 480 times)

0 Members and 1 Guest are viewing this topic.

Offline Mickey3D

  • Velites
  • **
  • Posts: 42
"Please load a file or create a new Army" message
« on: August 21, 2018, 02:33:02 PM »
A small detail but I think the message "Please load a file or create a new Army" when you open the editor should not be overwritable.



Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: "Please load a file or create a new Army" message
« Reply #1 on: August 21, 2018, 02:40:26 PM »
Well, it might be a problem : I'm able to save the file and if I open it the editor crashes.

Error in Windows event log:
Quote
Application : GSBPArmyEditor.exe
Version du Framework : v4.0.30319
Description : le processus a t arrt en raison d'une exception non gre.
Informations sur l'exception : System.ArgumentOutOfRangeException
    System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument, System.ExceptionResource)
    System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Item(Int32)
    ArmyEditor.MainWindowViewModel.LoadArmy(System.String)
    ArmyEditor.MainWindowViewModel.<get_OpenArmyCommand>b__40_0()

Informations sur l'exception : System.Reflection.TargetInvocationException
    System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
    System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
    GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
    GalaSoft.MvvmLight.CommandWpf.RelayCommand.Execute(System.Object)
    MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
    System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object)
    System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
    System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
    System.Windows.Threading.DispatcherOperation.InvokeImpl()
    MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
    System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
    MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
    System.Windows.Threading.DispatcherOperation.Invoke()
    System.Windows.Threading.Dispatcher.ProcessQueue()
    System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
    System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
    System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
    System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
    MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
    MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
    System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
    System.Windows.Application.RunDispatcher(System.Object)
    System.Windows.Application.RunInternal(System.Windows.Window)
    ArmyEditor.App.Main()


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: "Please load a file or create a new Army" message
« Reply #2 on: August 22, 2018, 03:49:29 AM »
Yes, if you just hit save then I think you'll get pretty much an empty file.
I'll think about this one a bit.
The potential to produce a file which'll error is the part which I think is particularly bad.

The easiest way is probably to start you off with a top level HQ there already.
If you hit save and re-load you wouldn't get an error.


OTOH I could disable save options if there are zero units added.
That still leaves hiding and showing some label.

Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: "Please load a file or create a new Army" message
« Reply #3 on: August 22, 2018, 01:43:40 PM »
Quote
The easiest way is probably to start you off with a top level HQ there already.
If you hit save and re-load you wouldn't get an error.

OTOH I could disable save options if there are zero units added.
That still leaves hiding and showing some label.

Both are valid options. With the first one then you should disable the deletion of the top node.
« Last Edit: August 22, 2018, 01:45:25 PM by Mickey3D »

Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: "Please load a file or create a new Army" message
« Reply #4 on: August 22, 2018, 02:19:19 PM »
Quote
With the first one then you should disable the deletion of the top node

I've just realized it is already the case  :-".

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: "Please load a file or create a new Army" message
« Reply #5 on: August 23, 2018, 03:12:54 AM »
Yes, you can't delete the general.

I've implemented the first option and you're straight into starting an army with a General when you start the app up.
I think this is better for the new user anyhow since an empty window is pretty intimidating when you first run something.