forked from E-riCA0/StawdewValley
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputButton.cs
More file actions
67 lines (62 loc) · 1.87 KB
/
InputButton.cs
File metadata and controls
67 lines (62 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Decompiled with JetBrains decompiler
// Type: StardewValley.InputButton
// Assembly: Stardew Valley, Version=1.2.6400.27469, Culture=neutral, PublicKeyToken=null
// MVID: 77B7094A-F6F0-4ACC-91F4-E335E2733EDB
// Assembly location: D:\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe
using Microsoft.Xna.Framework.Input;
namespace StardewValley
{
public struct InputButton
{
public Keys key;
public bool mouseLeft;
public bool mouseRight;
public InputButton(Keys key)
{
this.key = key;
this.mouseLeft = false;
this.mouseRight = false;
}
public InputButton(bool mouseLeft)
{
this.key = Keys.None;
this.mouseLeft = mouseLeft;
this.mouseRight = !mouseLeft;
}
public override string ToString()
{
if (this.mouseLeft)
return Game1.content.LoadString("Strings\\StringsFromCSFiles:Left-Click");
if (this.mouseRight)
return Game1.content.LoadString("Strings\\StringsFromCSFiles:Right-Click");
switch (this.key)
{
case Keys.D0:
return "0";
case Keys.D1:
return "1";
case Keys.D2:
return "2";
case Keys.D3:
return "3";
case Keys.D4:
return "4";
case Keys.D5:
return "5";
case Keys.D6:
return "6";
case Keys.D7:
return "7";
case Keys.D8:
return "8";
case Keys.D9:
return "9";
default:
string str = this.key.ToString().Replace("Oem", "");
if (Game1.content.LoadString("Strings\\StringsFromCSFiles:" + this.key.ToString().Replace("Oem", "")) != "Strings\\StringsFromCSFiles:" + this.key.ToString().Replace("Oem", ""))
str = Game1.content.LoadString("Strings\\StringsFromCSFiles:" + this.key.ToString().Replace("Oem", ""));
return str;
}
}
}
}