Skip to content

Commit

Permalink
Really odd bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Athanatos committed Jul 22, 2020
1 parent 08c8f53 commit 7feb0da
Show file tree
Hide file tree
Showing 29 changed files with 50 additions and 15 deletions.
Binary file modified 3DRadSpace/.vs/3DRadSpace/v16/.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions 3DRadSpace/3DRadSpace/Content/obj/Windows/Content/.mgstats
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Source File,Dest File,Processor Type,Content Type,Source File Size,Dest File Siz
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Font.spritefont","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Font.xnb","FontDescriptionProcessor","SpriteFontContent",2068,21524,0.1389985
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Shaders/RedVertexSh.fx","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Shaders/RedVertexSh.xnb","EffectProcessor","CompiledEffectContent",948,1809,3.044576
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Shaders/SH_Skybox.fx","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Shaders/SH_Skybox.xnb","EffectProcessor","CompiledEffectContent",2325,2188,3.903923
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Skinmeshes/terrain0100.dds","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Skinmeshes/terrain0100.xnb","TextureProcessor","Texture2DContent",2796344,2796345,1.474005
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Skinmeshes/terrain0100.x","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Skinmeshes/terrain0100.xnb","ModelProcessor","ModelContent",594945,439265,3.263107
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Skinmeshes/terrain0100.dds","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Skinmeshes/terrain0100.xnb","TextureProcessor","Texture2DContent",2796344,2796345,0.4109988
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Skinmeshes/terrain0100.x","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Skinmeshes/terrain0100.xnb","ModelProcessor","ModelContent",594945,439265,1.353998
"C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Sounds/sound.ogg","C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Sounds/sound.xnb","SoundEffectProcessor","SoundEffectContent",6625,36201,0.6680005
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<SourceFile>C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/Skinmeshes/terrain0100.x</SourceFile>
<SourceTime>2011-09-09T11:04:28+03:00</SourceTime>
<DestFile>C:/Users/Athanatos/Documents/GitHub/3D_Rad_Space/3DRadSpace/3DRadSpace/Content/bin/Windows/Content/Skinmeshes/terrain0100.xnb</DestFile>
<DestTime>2020-07-20T19:38:45.2133693+03:00</DestTime>
<DestTime>2020-07-22T23:32:25.4400665+03:00</DestTime>
<Importer>XImporter</Importer>
<ImporterTime>2020-02-26T07:46:56+02:00</ImporterTime>
<Processor>ModelProcessor</Processor>
Expand Down
24 changes: 15 additions & 9 deletions 3DRadSpace/3DRadSpace/EventOnKeyW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public EventOnKeyW(EventOnKey eok)
}
}
DetermineInputType(eok.Key.State);
Debug.Print("loading ->" + eok.Key.State);
textBox2.Text = "" + eok.HoldingTime;
_eok = eok;
opcodes = eok.Behiavours;
Expand All @@ -46,17 +47,20 @@ public EventOnKeyW(EventOnKey eok)
private void button1_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
EventOnKey k = new EventOnKey(
Editor.ValidateTextInput(textBox1.Text),
checkBox1.Checked,
new KeyInput(
GetKeyFromListBox(listBox1.Items[listBox1.SelectedIndex]+""),
GetInputType()
),
Convert.ToUInt32(Editor.ValidateNumberTextInput(textBox2.Text))
);
EventOnKey k = new EventOnKey() {
Name =Editor.ValidateTextInput(textBox1.Text),
Enabled = checkBox1.Checked,
Key = new KeyInput()
{
Key = GetKeyFromListBox(listBox1.Items[listBox1.SelectedIndex] + ""),
State = GetInputType()
},
HoldingTime = Convert.ToUInt32(Editor.ValidateNumberTextInput(textBox2.Text))
};

k.Behiavours = opcodes;
Debug.Print("saving -> "+k.Key.State + " " + GetInputType());
k.Key.State = GetInputType();
Result = k;
Close();
}
Expand Down Expand Up @@ -182,13 +186,15 @@ private void button2_Click(object sender, EventArgs e)
}
bool DetermineInputType(KeyInputType t)
{
Debug.Print(t + " " + radioButton1.Checked + " " + radioButton2.Checked + " " + radioButton3.Checked);
if (t == KeyInputType.Released) return radioButton1.Checked = true;
if (t == KeyInputType.Pressed) return radioButton2.Checked = true;
if (t == KeyInputType.Holding) return radioButton3.Checked = true;
throw new Exception("some horrible bug happened there. It's because of WinForms.");
}
KeyInputType GetInputType()
{
Debug.Print( radioButton1.Checked + " " + radioButton2.Checked + " " + radioButton3.Checked);
if (radioButton1.Checked == true) return KeyInputType.Released;
if (radioButton2.Checked == true) return KeyInputType.Pressed;
if (radioButton3.Checked == true) return KeyInputType.Holding;
Expand Down
Binary file modified 3DRadSpace/3DRadSpace/bin/Windows/x86/Debug/3DRadSpace.exe
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace/bin/Windows/x86/Debug/3DRadSpace.pdb
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace/bin/Windows/x86/Debug/3DRadSpaceDll.dll
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace/bin/Windows/x86/Debug/3DRadSpaceDll.pdb
Binary file not shown.
6 changes: 6 additions & 0 deletions 3DRadSpace/3DRadSpace/bin/Windows/x86/Debug/3DRadSpaceDll.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3DRSP_text
eok EventOnKey True 38 1 0
eok EventOnKey True 38 0 0
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace/obj/x86/Debug/3DRadSpace.exe
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace/obj/x86/Debug/3DRadSpace.pdb
Binary file not shown.
11 changes: 10 additions & 1 deletion 3DRadSpace/3DRadSpaceDll/EventOnKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using _3DRadSpaceDll.OpcodeEvent;
using System.Diagnostics;

namespace _3DRadSpaceDll
{
Expand Down Expand Up @@ -50,7 +51,15 @@ public KeyInput(Keys key = Keys.None, KeyInputType state = KeyInputType.Released
/// The key state.
/// </summary>
public KeyInputType State;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public override string ToString()
{
return "{" + Key + " " + State + "}";
}
}
/// <summary>
/// Triggers when the key is up/down/ hold for enough time.
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion 3DRadSpace/3DRadSpaceDll/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static List<GameObject> Open(string filename)
}
case "eok":
{
a = new EventOnKey()
EventOnKey eok = new EventOnKey()
{
Name = Obj[1],
Enabled = Convert.ToBoolean(Obj[2], Main.CultureInfo),
Expand All @@ -250,6 +250,8 @@ public static List<GameObject> Open(string filename)
HoldingTime = Convert.ToUInt32(Obj[5], Main.CultureInfo),
Behiavours = OpcodeEvent.OpCodeCall.CreateFromString(6, Obj, Obj.Length)
};
eok.Key.State = (KeyInputType)Convert.ToInt32(Obj[4], Main.CultureInfo);
a = eok;
break;
}
case "gamesettings":
Expand Down
Binary file modified 3DRadSpace/3DRadSpaceDll/bin/Debug/3DRadSpaceDll.dll
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpaceDll/bin/Debug/3DRadSpaceDll.pdb
Binary file not shown.
6 changes: 6 additions & 0 deletions 3DRadSpace/3DRadSpaceDll/bin/Debug/3DRadSpaceDll.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpaceDll/obj/Debug/3DRadSpaceDll.dll
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpaceDll/obj/Debug/3DRadSpaceDll.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace_Player/obj/x86/Debug/3DRadSpace_Player.exe
Binary file not shown.
Binary file modified 3DRadSpace/3DRadSpace_Player/obj/x86/Debug/3DRadSpace_Player.pdb
Binary file not shown.

0 comments on commit 7feb0da

Please sign in to comment.