Fixes string interpolation

This commit is contained in:
Kamron Batman 2018-09-14 13:07:43 -07:00
parent 42d0b6271f
commit 7d3a0ca265
233 changed files with 758 additions and 690 deletions

View file

@ -62,7 +62,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ checkertrans {0} {1} {2} {3} }}", m_X, m_Y, m_Width, m_Height );
return $"{{ checkertrans {m_X} {m_Y} {m_Width} {m_Height} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "checkertrans" );

View file

@ -70,7 +70,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ resizepic {0} {1} {2} {3} {4} }}", m_X, m_Y, m_GumpID, m_Width, m_Height );
return $"{{ resizepic {m_X} {m_Y} {m_GumpID} {m_Width} {m_Height} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "resizepic" );

View file

@ -105,7 +105,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ button {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y, m_ID1, m_ID2, (int)m_Type, m_Param, m_ButtonID );
return $"{{ button {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "button" );

View file

@ -78,7 +78,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ checkbox {0} {1} {2} {3} {4} {5} }}", m_X, m_Y, m_ID1, m_ID2, m_InitialState ? 1 : 0, m_SwitchID );
return $"{{ checkbox {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "checkbox" );

View file

@ -40,7 +40,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ group {0} }}", m_Group );
return $"{{ group {m_Group} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "group" );

View file

@ -85,7 +85,8 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ htmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y, m_Width, m_Height, Parent.Intern( m_Text ), m_Background ? 1 : 0, m_Scrollbar ? 1 : 0 );
return
$"{{ htmlgump {m_X} {m_Y} {m_Width} {m_Height} {Parent.Intern(m_Text)} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "htmlgump" );

View file

@ -159,13 +159,16 @@ namespace Server.Gumps
switch ( m_Type )
{
case GumpHtmlLocalizedType.Plain:
return String.Format( "{{ xmfhtmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y, m_Width, m_Height, m_Number, m_Background ? 1 : 0, m_Scrollbar ? 1 : 0 );
return
$"{{ xmfhtmlgump {m_X} {m_Y} {m_Width} {m_Height} {m_Number} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} }}";
case GumpHtmlLocalizedType.Color:
return String.Format( "{{ xmfhtmlgumpcolor {0} {1} {2} {3} {4} {5} {6} {7} }}", m_X, m_Y, m_Width, m_Height, m_Number, m_Background ? 1 : 0, m_Scrollbar ? 1 : 0, m_Color );
return
$"{{ xmfhtmlgumpcolor {m_X} {m_Y} {m_Width} {m_Height} {m_Number} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} {m_Color} }}";
default: // GumpHtmlLocalizedType.Args
return String.Format( "{{ xmfhtmltok {0} {1} {2} {3} {4} {5} {6} {7} @{8}@ }}", m_X, m_Y, m_Width, m_Height, m_Background ? 1 : 0, m_Scrollbar ? 1 : 0, m_Color, m_Number, m_Args );
return
$"{{ xmfhtmltok {m_X} {m_Y} {m_Width} {m_Height} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} {m_Color} {m_Number} @{m_Args}@ }}";
}
}

View file

@ -68,9 +68,9 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
if ( m_Hue == 0 )
return String.Format( "{{ gumppic {0} {1} {2} }}", m_X, m_Y, m_GumpID );
return $"{{ gumppic {m_X} {m_Y} {m_GumpID} }}";
else
return String.Format( "{{ gumppic {0} {1} {2} hue={3} }}", m_X, m_Y, m_GumpID, m_Hue );
return $"{{ gumppic {m_X} {m_Y} {m_GumpID} hue={m_Hue} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "gumppic" );

View file

@ -148,9 +148,11 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
if ( m_LocalizedTooltip > 0 )
return String.Format( "{{ buttontileart {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} }}{{ tooltip {11} }}", m_X, m_Y, m_ID1, m_ID2, (int)m_Type, m_Param, m_ButtonID, m_ItemID, m_Hue, m_Width, m_Height, m_LocalizedTooltip );
return
$"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}{{ tooltip {m_LocalizedTooltip} }}";
else
return String.Format( "{{ buttontileart {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} }}", m_X, m_Y, m_ID1, m_ID2, (int)m_Type, m_Param, m_ButtonID, m_ItemID, m_Hue, m_Width, m_Height );
return
$"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "buttontileart" );

View file

@ -70,7 +70,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ gumppictiled {0} {1} {2} {3} {4} }}", m_X, m_Y, m_Width, m_Height, m_GumpID );
return $"{{ gumppictiled {m_X} {m_Y} {m_Width} {m_Height} {m_GumpID} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "gumppictiled" );

View file

@ -68,9 +68,9 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
if ( m_Hue == 0 )
return String.Format( "{{ tilepic {0} {1} {2} }}", m_X, m_Y, m_ItemID );
return $"{{ tilepic {m_X} {m_Y} {m_ItemID} }}";
else
return String.Format( "{{ tilepichue {0} {1} {2} {3} }}", m_X, m_Y, m_ItemID, m_Hue );
return $"{{ tilepichue {m_X} {m_Y} {m_ItemID} {m_Hue} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "tilepic" );

View file

@ -40,7 +40,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ itemproperty {0} }}", m_Serial );
return $"{{ itemproperty {m_Serial} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "itemproperty" );

View file

@ -63,7 +63,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ text {0} {1} {2} {3} }}", m_X, m_Y, m_Hue, Parent.Intern( m_Text ) );
return $"{{ text {m_X} {m_Y} {m_Hue} {Parent.Intern(m_Text)} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "text" );

View file

@ -78,7 +78,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ croppedtext {0} {1} {2} {3} {4} {5} }}", m_X, m_Y, m_Width, m_Height, m_Hue, Parent.Intern( m_Text ) );
return $"{{ croppedtext {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {Parent.Intern(m_Text)} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "croppedtext" );

View file

@ -40,7 +40,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ page {0} }}", m_Page );
return $"{{ page {m_Page} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "page" );

View file

@ -78,7 +78,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ radio {0} {1} {2} {3} {4} {5} }}", m_X, m_Y, m_ID1, m_ID2, m_InitialState ? 1 : 0, m_SwitchID );
return $"{{ radio {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "radio" );

View file

@ -86,7 +86,8 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ textentry {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y, m_Width, m_Height, m_Hue, m_EntryID, Parent.Intern( m_InitialText ) );
return
$"{{ textentry {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "textentry" );

View file

@ -82,7 +82,8 @@ namespace Server.Gumps {
}
public override string Compile( NetState ns ) {
return String.Format( "{{ textentrylimited {0} {1} {2} {3} {4} {5} {6} {7} }}", m_X, m_Y, m_Width, m_Height, m_Hue, m_EntryID, Parent.Intern( m_InitialText ), m_Size );
return
$"{{ textentrylimited {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} {m_Size} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "textentrylimited" );

View file

@ -40,7 +40,7 @@ namespace Server.Gumps
public override string Compile( NetState ns )
{
return String.Format( "{{ tooltip {0} }}", m_Number );
return $"{{ tooltip {m_Number} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "tooltip" );