V 2.22 - BETA Build 56 - short update

- fix - try again to fix Win10 scaling issues for some PCs (hidden assignment area)
- improvement - actions with a profile modifier attached will show underlined in the action tree
- improvement - less offensive gamepad color mark ...
- some internal stuff
pull/104/head
bm98 8 years ago
parent 68d72cab6b
commit 513007de83

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.21.0.55" )]
[assembly: AssemblyFileVersion( "2.21.0.55" )]
[assembly: AssemblyVersion( "2.22.0.56" )]
[assembly: AssemblyFileVersion( "2.22.0.56" )]

@ -198,6 +198,19 @@ namespace SCJMapper_V2
}
/// <summary>
/// cTor: create one with a default and an attached one
/// </summary>
/// <param name="defaultMode">The default ActivationMode</param>
/// <param name="attachedMode">The attached ActivationMode</param>
public ActivationModes( ActivationMode defaultMode, ActivationMode attachedMode )
{
this.Clear( );
this.Add( defaultMode );
this.Add( attachedMode );
}
/// <summary>
/// Returns the multitap number for an item
/// </summary>

@ -15,9 +15,19 @@ namespace SCJMapper_V2
String retVal = "";
// detect what we would like to find..
if ( inLine.Contains( "Log Started" ) ) return String.Format("\t{0}\n", inLine);
if ( inLine.Contains( "ProductVersion" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "Log Started" ) ) return String.Format("\t{0}\n", inLine);
if ( inLine.StartsWith( "Executable:" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "ProductVersion" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "Windows:" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "Current display mode" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.Contains( "physical memory" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "--- Dedicated video memory" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.StartsWith( "- Final rating" ) ) return String.Format( "\t{0}\n", inLine );
if ( inLine.Contains( "> Creating" ) ) return String.Format( "\t{0}\n", inLine );
return retVal;
}

@ -26,8 +26,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>55</ApplicationRevision>
<ApplicationVersion>2.21.0.%2a</ApplicationVersion>
<ApplicationRevision>56</ApplicationRevision>
<ApplicationVersion>2.22.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>

@ -16,6 +16,13 @@ namespace SCJMapper_V2
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
// static fonts to be used instead of newly allocated ones each time (init when the Ctrl is assigned)
static public Font FontActionmap = null;
static public Font FontAction = null;
static public Font FontActionActivated = null;
public ActionMapsCls ActionMaps { get; set; } // the Action Maps and Actions
private TreeView m_MasterTree = new TreeView( ); // the master TreeView (mem only)
@ -27,8 +34,13 @@ namespace SCJMapper_V2
{
m_ctrl = value;
// copy props needed
m_MasterTree.Font = m_ctrl.Font;
m_MasterTree.Font = m_ctrl.Font; // assign font to master tree as well
m_MasterTree.ImageList = m_ctrl.ImageList;
// define some const fonts for further use
FontActionmap = new Font( m_ctrl.Font, FontStyle.Bold );
FontAction = new Font( m_ctrl.Font, FontStyle.Regular );
FontActionActivated = new Font( m_ctrl.Font, FontStyle.Underline );
}
}
@ -180,8 +192,8 @@ namespace SCJMapper_V2
FilterTree( );
FindAndSelectCtrlByName( matn.Name );
// jump to the latest
if ( m_ctrl.SelectedNode.LastNode != null ) {
m_ctrl.SelectedNode = m_ctrl.SelectedNode.LastNode;
if ( Ctrl.SelectedNode.LastNode != null ) {
Ctrl.SelectedNode = Ctrl.SelectedNode.LastNode;
}
}
@ -468,8 +480,14 @@ namespace SCJMapper_V2
String device = ActionCls.DeviceClassFromTag( devID );
// visual item for the action
cn = new ActionTreeNode( "UNDEF" ); cn.Name = elem[ei]; cn.Action = action; cn.BackColor = Color.White; // name with the key it to find it..
cn = new ActionTreeNode( "UNDEF" ); cn.Name = elem[ei]; cn.Action = action; cn.BackColor = Color.White; // name with the key it to find it..
cn.ImageKey = devID; cn.BackColor = Color.White; // some stuff does not work properly...
if ( ActivationMode.IsDefault( defActivationModeName ) ) {
cn.NodeFont = FontAction;
}
else {
cn.NodeFont = FontActionActivated;
}
Array.Resize( ref cnl, cnl.Length + 1 ); cnl[cnl.Length - 1] = cn;
// derive content tree
@ -522,7 +540,7 @@ namespace SCJMapper_V2
}//for
tn = new ActionTreeNode( acm.name, cnl ); tn.Name = acm.name; tn.Action = acm.name; // name it to find it..
tn.ImageIndex = 0; tn.NodeFont = new Font( m_MasterTree.Font, FontStyle.Bold );
tn.ImageIndex = 0; tn.NodeFont = FontActionmap; // new Font( m_MasterTree.Font, FontStyle.Bold );
m_MasterTree.BackColor = Color.White; // fix for defect TreeView (cut off bold text)
m_MasterTree.Nodes.Add( tn ); // add to control
if ( topNode == null ) topNode = tn; // once to keep the start of list
@ -535,7 +553,7 @@ namespace SCJMapper_V2
}
// fix for defect TreeView (cut off bold text at last element -despite the BackColor fix) add another and delete it
tn = new ActionTreeNode( "DUMMY" ); tn.Name = "DUMMY";
tn.ImageIndex = 0; tn.NodeFont = new Font( m_MasterTree.Font, FontStyle.Bold );
tn.ImageIndex = 0; tn.NodeFont = FontActionmap; // new Font( m_MasterTree.Font, FontStyle.Bold );
m_MasterTree.BackColor = m_MasterTree.BackColor; // fix for defect TreeView (cut off bold text)
m_MasterTree.Nodes.Add( tn ); // add to control
m_MasterTree.Nodes.RemoveByKey( "DUMMY" );
@ -555,7 +573,7 @@ namespace SCJMapper_V2
/// <returns>A ActivationModes list - first element is the default, second the selected Mode</returns>
public ActivationModes ActivationModeSelectedItem( )
{
ActivationModes am = new ActivationModes( ActivationMode.Default ); am.Add( ActivationMode.Default );// dummy answer Default is Default and selected is Default
ActivationModes am = new ActivationModes( ActivationMode.Default, ActivationMode.Default );// policy: get the default first, then the attached one - dummy answer
if ( Ctrl.SelectedNode == null ) return am; // ERROR exit
if ( ( Ctrl.SelectedNode.Level == 0 ) || ( Ctrl.SelectedNode.Level > 2 ) ) return am;
@ -564,18 +582,20 @@ namespace SCJMapper_V2
// has a parent - must be level 1 or 2
if ( Ctrl.SelectedNode.Level == 1 ) {
// this is the main node with Action Cmd
ActionCls ac = FindActionObject( Ctrl.SelectedNode.Parent.Name, Ctrl.SelectedNode.Name ); if ( ac == null ) return am; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( Ctrl.SelectedNode.Text ) ); if ( acc == null ) return am; // ERROR exit
am = new ActivationModes( ac.defActivationMode ); am.Add( acc.ActivationMode );
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 1
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); if ( ac == null ) return am; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( atn.Text ) ); if ( acc == null ) return am; // ERROR exit
am = new ActivationModes( ac.defActivationMode, acc.ActivationMode ); // policy: get the default first, then the attached one
return am;
}
else if ( Ctrl.SelectedNode.Level == 2 ) {
// this is a child of an action with further commands
ActionTreeNode atn = ( m_ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode
ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 1
// the related action
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); if ( ac == null ) return am; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( m_ctrl.SelectedNode.Index ); if ( acc == null ) return am; // ERROR exit
am = new ActivationModes( ac.defActivationMode ); am.Add( acc.ActivationMode );
ActionCls ac = FindActionObject( patn.Parent.Name, patn.Name ); if ( ac == null ) return am; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( atn.Index ); if ( acc == null ) return am; // ERROR exit
am = new ActivationModes( ac.defActivationMode, acc.ActivationMode );// policy: get the default first, then the attached one
return am;
}
@ -595,8 +615,9 @@ namespace SCJMapper_V2
// has a parent - must be level 1 or 2
if ( Ctrl.SelectedNode.Level == 1 ) {
// this is the main node with Action Cmd
ActionCls ac = FindActionObject( Ctrl.SelectedNode.Parent.Name, Ctrl.SelectedNode.Name ); if ( ac == null ) return; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( Ctrl.SelectedNode.Text ) ); if ( acc == null ) return; // ERROR exit
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 1
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); if ( ac == null ) return; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( atn.Text ) ); if ( acc == null ) return; // ERROR exit
// new am is either a named one or the Default from Profile (which is the default from the Action due to multiTaps..)
if ( ActivationMode.IsDefault( newActivationModeName ) ) {
acc.ActivationMode = new ActivationMode( ActivationMode.Default );
@ -604,15 +625,17 @@ namespace SCJMapper_V2
else {
acc.ActivationMode = ActivationModes.Instance.ActivationModeByName( newActivationModeName );
}
UpdateNodeFromAction( ( ActionTreeNode )Ctrl.SelectedNode, acc );
atn.UpdateAction( acc ); UpdateMasterNode( atn );
Dirty = true;
}
else if ( Ctrl.SelectedNode.Level == 2 ) {
// this is a child of an action with further commands
ActionTreeNode atn = ( m_ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode
ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode from a level 2
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 2
// the related action
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); if ( ac == null ) return; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( m_ctrl.SelectedNode.Index ); if ( acc == null ) return; // ERROR exit
ActionCls ac = FindActionObject( patn.Parent.Name, patn.Name ); if ( ac == null ) return; // ERROR exit
// find it in the sublist
ActionCommandCls acc = ac.FindActionInputObject( atn.Index ); if ( acc == null ) return; // ERROR exit
// new am is either a named one or the Default from Profile (which is the default from the Action due to multiTaps..)
if ( ActivationMode.IsDefault( newActivationModeName ) ) {
acc.ActivationMode = new ActivationMode( ActivationMode.Default );
@ -620,7 +643,7 @@ namespace SCJMapper_V2
else {
acc.ActivationMode = ActivationModes.Instance.ActivationModeByName( newActivationModeName );
}
UpdateInputNodeFromAction( ( ActionTreeInputNode )Ctrl.SelectedNode, acc );
atn.UpdateAction( acc ); UpdateMasterNode( atn );
Dirty = true;
}
}
@ -641,27 +664,29 @@ namespace SCJMapper_V2
// has a parent - must be level 1 or 2
if ( Ctrl.SelectedNode.Level == 1 ) {
// this is the main node with Action Cmd
ActionCls ac = FindActionObject( Ctrl.SelectedNode.Parent.Name, Ctrl.SelectedNode.Name );
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 1
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); // the related action in an actionmap
if ( ac == null ) return false; // ERROR exit
if ( checkKind && ( ac.actionDevice != inKind ) ) return false; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( Ctrl.SelectedNode.Text ) );
ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( atn.Text ) );
if ( acc == null ) return false; // ERROR exit
// have it - continue
ac.UpdateCommandFromInput( ActionCls.DevInput( input, inKind ), acc.NodeIndex + 1 );
UpdateNodeFromAction( ( ActionTreeNode )Ctrl.SelectedNode, acc );
atn.UpdateAction( acc ); UpdateMasterNode( atn );
Dirty = true;
}
else if ( Ctrl.SelectedNode.Level == 2 ) {
// this is a child of an action with further commands
ActionTreeNode atn = ( m_ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode
ActionCls ac = FindActionObject( atn.Parent.Name, atn.Name ); // the related action
ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode from a level 2
ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 2
ActionCls ac = FindActionObject( patn.Parent.Name, patn.Name ); // the related action in an actionmap
if ( ac == null ) return false; // ERROR exit
if ( checkKind && ( ac.actionDevice != inKind ) ) return false; // ERROR exit
ActionCommandCls acc = ac.FindActionInputObject( m_ctrl.SelectedNode.Index );
ActionCommandCls acc = ac.FindActionInputObject( atn.Index );
if ( acc == null ) return false; // ERROR exit
// have it - continue
ac.UpdateCommandFromInput( ActionCls.DevInput( input, inKind ), acc.NodeIndex + 1 );
UpdateInputNodeFromAction( ( ActionTreeInputNode )Ctrl.SelectedNode, acc );
atn.UpdateAction( acc ); UpdateMasterNode( atn );
Dirty = true;
}
return true;
@ -735,79 +760,6 @@ namespace SCJMapper_V2
}
/// <summary>
/// Apply an update from the action to the treenode
/// First apply to the GUI tree where the selection happend then copy it over to master tree
/// </summary>
/// <param name="input">The input command</param>
/// <param name="node">The TreeNode to update</param>
/// <param name="action">The action that carries the update</param>
/// <param name="inKind">The input device</param>
private void UpdateNodeFromAction( ActionTreeNode node, ActionCommandCls actionCmd )
{
//log.Debug( "UpdateNodeFromAction - Entry" );
if ( actionCmd == null ) return;
// applies only to ActionTreeNode
if ( node.Level == 1 ) {
// input is either "" or a valid mapping or a blended mapping
if ( String.IsNullOrEmpty( actionCmd.Input ) ) {
// new unmapped
node.Command = ""; node.BackColor = MyColors.UnassignedColor;
}
// blended mapped ones - can only get a Blend Background
else if ( actionCmd.Input == DeviceCls.BlendedInput ) {
node.Command = actionCmd.DevInput; node.BackColor = MyColors.BlendedColor;
}
else {
// mapped ( regular ones )
node.Command = actionCmd.DevInput;
// background is along the input
node.BackColor = ActionCls.DeviceColor( actionCmd.DevInput );
}
node.Modified = !actionCmd.DefaultActivationMode; // apply modifier visual
UpdateMasterNode( node );
}
}
/// <summary>
/// Apply an update from the action to the treenode
/// First apply to the GUI tree where the selection happend then copy it over to master tree
/// </summary>
/// <param name="input">The input command</param>
/// <param name="node">The TreeNode to update</param>
/// <param name="actionCmd">The actionCommand that carries the update</param>
private void UpdateInputNodeFromAction( ActionTreeInputNode node, ActionCommandCls actionCmd )
{
log.Debug( "UpdateInputNodeFromAction - Entry" );
if ( actionCmd == null ) return;
if ( node.Level != 2 ) return; // applies only to ActionTreeInputNode
// input is either "" or a valid mapping or a blended mapping
if ( String.IsNullOrEmpty( actionCmd.Input ) ) {
// new unmapped
node.Command = ""; node.BackColor = MyColors.UnassignedColor;
}
// blended mapped ones - can only get a Blend Background
else if ( actionCmd.Input == DeviceCls.BlendedInput ) {
node.Command = actionCmd.DevInput; node.BackColor = MyColors.BlendedColor;
}
else {
// mapped ( regular ones )
node.Command = actionCmd.DevInput;
// background is along the input
node.BackColor = ActionCls.DeviceColor(actionCmd.DevInput );
}
node.Modified = !actionCmd.DefaultActivationMode; // apply modifier visual
UpdateMasterNode( node );
}
/// <summary>
/// Defines what to show in the tree
/// </summary>
@ -847,7 +799,7 @@ namespace SCJMapper_V2
ac.UpdateCommandFromInput( acc.DevInput, acc.NodeIndex + 1 ); // this may apply (un)Blending if needed
// the first one goes into the node, further must be created if not existing
if ( first ) {
UpdateNodeFromAction( matn, acc );
matn.UpdateAction( acc ); UpdateMasterNode( matn );
matn.Nodes.Clear( ); // clear add childs - those don't persist from newly loaded actionmaps
first = false;
}
@ -856,7 +808,7 @@ namespace SCJMapper_V2
ActionTreeInputNode matin = new ActionTreeInputNode( "UNDEF" ); matin.ImageKey = "Add";
acc.NodeIndex = matin.Index; // assign visual reference
matn.Nodes.Add( matin ); // add to master tree
UpdateInputNodeFromAction( matin, acc );
matin.UpdateAction( acc ); UpdateMasterNode( matin );
}
}
catch {
@ -1034,6 +986,9 @@ namespace SCJMapper_V2
}
/// <summary>
/// Returns the Action name of the selected item
/// </summary>
public String SelectedAction
{
get

@ -150,6 +150,34 @@ namespace SCJMapper_V2
this.Modified = other.Modified;
}
/// <summary>
/// Apply an update from the action to the treenode
/// First apply to the GUI tree where the selection happend then copy it over to master tree
/// </summary>
/// <param name="action">The action that carries the update</param>
public void UpdateAction( ActionCommandCls actionCmd )
{
//log.Debug( "UpdateNodeFromAction - Entry" );
if ( actionCmd == null ) return;
// input is either "" or a valid mapping or a blended mapping
if ( String.IsNullOrEmpty( actionCmd.Input ) ) {
// new unmapped
this.Command = ""; this.BackColor = MyColors.UnassignedColor;
}
// blended mapped ones - can only get a Blend Background
else if ( actionCmd.Input == DeviceCls.BlendedInput ) {
this.Command = actionCmd.DevInput; this.BackColor = MyColors.BlendedColor;
}
else {
// mapped ( regular ones )
this.Command = actionCmd.DevInput;
// background is along the input
this.BackColor = ActionCls.DeviceColor( actionCmd.DevInput );
}
this.Modified = !actionCmd.DefaultActivationMode; // apply modifier visual
}
public new String Text

@ -13,7 +13,7 @@ namespace SCJMapper_V2
static public Color[] TabColor = { Color.LightGreen, Color.LightBlue, Color.Khaki, Color.LightSalmon,
Color.Beige, Color.Yellow, Color.Plum, Color.MintCream,
Color.LightCyan, Color.MistyRose, Color.Wheat, Color.Pink };
static public Color GamepadColorDefault = Color.Fuchsia; // will be changed on init (else we see pink..)
static public Color GamepadColorDefault = Color.Orchid; // will be changed on init (else we see pink..)
static public Color[] MapColor = ( System.Drawing.Color[] )TabColor.Clone( );
static public Color GamepadColor = GamepadColorDefault;

@ -1,10 +1,10 @@
SC Joystick Mapper V 2.21 - Build 55 BETA
(c) Cassini, StandardToaster - 06-March-2016
SC Joystick Mapper V 2.22 - Build 56 BETA
(c) Cassini, StandardToaster - 11-March-2016
Contains 9 files:
SCJMapper.exe The program (V2.21)
SCJMapper.exe.config Program config (V2.21) - MUST be in the same folder as the Exe file
SCJMapper.exe The program (V2.22)
SCJMapper.exe.config Program config (V2.22) - MUST be in the same folder as the Exe file
SharpDX.DirectInput.dll Managed DirectInput Assembly - MUST be in the same folder as the Exe file
SharpDX.dll Managed DirectX Assembly - MUST be in the same folder as the Exe file
OpenTK.dll Managed OpenGL Assembly - MUST be in the same folder as the Exe file
@ -29,6 +29,11 @@ Scanned for viruses before packing...
cassini@burri-web.org
Changelog:
V 2.22 - BETA Build 56
- fix - try again to fix Win10 scaling issues for some PCs (hidden assignment area)
- improvement - actions with a profile modifier attached will show underlined in the action tree
- improvement - less offensive gamepad color mark ...
- some internal stuff
V 2.21 - BETA Build 55
- fix #40 added Tab entry in Ctrl. context menu
- fix - try to fix Win10 scaling issues (hidden assignment area)

Loading…
Cancel
Save