Comments (24)
In theory, it should automatically switch to English
And loading an empty language will not result in an error
I will add an automatic switch to English in the next update if the current language is empty
from vpet.
Stack trace. But I don't think it's really helpful now
System.FormatException
HResult=0x80131537
Message=Входная строка имела неверный формат. <-- Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.String.System.IConvertible.ToDouble(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at LinePutScript.Converter.LPSConvert.GetStringObject(String value, Type type, ConvertType convtype, LineAttribute att)
at LinePutScript.Converter.LPSConvert.GetSubObject(ISub sub, Type type, ConvertType convtype, LineAttribute att)
at LinePutScript.Converter.LPSConvert.DeserializeObject[T](ISub value)
at VPet_Simulator.Windows.CoreMOD..ctor(DirectoryInfo directory, MainWindow mw) in E:\Git\VPet\VPet-Simulator.Windows\Function\CoreMOD.cs:line 137
at VPet_Simulator.Windows.MainWindow.<GameLoad>d__107.MoveNext() in E:\Git\VPet\VPet-Simulator.Windows\MainWindow.xaml.cs:line 208```
from vpet.
I think that's the real reason for the error report. I'll study how to solve it. Thank you for your feedback. It really helped a lot
from vpet.
Different one, but still the same exception. I will now send details
from vpet.
It's works!
from vpet.
Thanks for you help!
from vpet.
Thank you again for your help, I will update fix to steam soon
I will close when the update is complete
from vpet.
I update a new version, can you open now?
from vpet.
I managed to compile latest VPet-Simulator.Windows and that's what I got.
Localization is automaticlly switching to EN without latest changes (sorry). Fortunatly, I discovered why app crashes exactly on Core mod loading. There's an exception on food initializing.
case "food":
Tag.Add("food");
foreach (FileInfo fi in di.EnumerateFiles("*.lps"))
{
var tmp = new LpsDocument(File.ReadAllText(fi.FullName));
foreach (ILine li in tmp)
{
string tmps = li.Find("name").info;
mw.Foods.RemoveAll(x => x.Name == tmps);
mw.Foods.Add(LPSConvert.DeserializeObject<Food>(li));
}
}
break;
System.FormatException: Input string was not in a correct format.
on mw.Foods.Add(LPSConvert.DeserializeObject<Food>(li));
If I compile whole thing with american formats in Win settings, everything is fine. I don't really know much about dotnet, so no ideas.
from vpet.
That's so stupid, but it's real. This converter or smth else in the code can't accept a comma as a decimal separator. If I change it to point in Win Control Panel without completely switching to American standards, it will work. LMAO
Looks like somewhere in the converter code, there is no lookup for system formats, but hardcoded point.
from vpet.
I'm sorry, I wrote this LinePutScript
I may find a solution and try to lock the language to en US
Convert.ChangeType(Sub.TextDeReplace(value), type, new CultureInfo("en-US"));
but I am not sure is that work, I will compile a beta version. Can you help me test it
from vpet.
ok, no problem
from vpet.
LinePutScript.zip
rereplace it with LinePutScript.dll
is game working?
from vpet.
Nope. Neither the steam version nor the compiled one
from vpet.
Can you use visual studio Reference this DLL and run again?
I want to see is same error or different
from vpet.
VPet-Simulator.Core/Graph/FoodAnimation.cs:151
if (strs.Length > 4)
{
Rotate = double.Parse(strs[4]);//Rotate
if (strs.Length > 5)
Opacity = double.Parse(strs[5]);//Opacity
}
Same System.FormatException: Input string was not in a correct format.
on double.Parse(strs[5])
Stack trace
System.FormatException
HResult=0x80131537
Message=Входная строка имела неверный формат.
Source=mscorlib
StackTrace:
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Double.Parse(String s)
at VPet_Simulator.Core.FoodAnimation.Animation..ctor(FoodAnimation parent, ISub sub) in E:\Git\VPet\VPet-Simulator.Core\Graph\FoodAnimation.cs:line 149
at VPet_Simulator.Core.FoodAnimation..ctor(GraphCore graphCore, GraphInfo graphinfo, String front_Lay, String back_Lay, ILine animations, Boolean isLoop) in E:\Git\VPet\VPet-Simulator.Core\Graph\FoodAnimation.cs:line 45
at VPet_Simulator.Core.FoodAnimation.LoadGraph(GraphCore graph, FileSystemInfo path, ILine info) in E:\Git\VPet\VPet-Simulator.Core\Graph\FoodAnimation.cs:line 53
at VPet_Simulator.Core.PetLoader.LoadGraph(GraphCore graph, DirectoryInfo di, String startuppath) in E:\Git\VPet\VPet-Simulator.Core\Handle\PetLoader.cs:line 94
at VPet_Simulator.Core.PetLoader.LoadGraph(GraphCore graph, DirectoryInfo di, String startuppath) in E:\Git\VPet\VPet-Simulator.Core\Handle\PetLoader.cs:line 117
at VPet_Simulator.Core.PetLoader.Graph(Int32 Resolution) in E:\Git\VPet\VPet-Simulator.Core\Handle\PetLoader.cs:line 25
at VPet_Simulator.Windows.MainWindow.<>c__DisplayClass107_0.<GameLoad>b__7() in E:\Git\VPet\VPet-Simulator.Windows\MainWindow.xaml.cs:line 327
at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
from vpet.
Can you add
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
at https://github.com/LorisYounger/VPet/blob/main/VPet-Simulator.Windows/MainWindow.xaml.cs#L43
public MainWindow()
{
LocalizeCore.StoreTranslation = true;
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
...
and try again?
from vpet.
Nothing has changed
from vpet.
How about
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
at https://github.com/LorisYounger/VPet/blob/main/VPet-Simulator.Windows/MainWindow.xaml.cs#L43
public MainWindow()
{
LocalizeCore.StoreTranslation = true;
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
from vpet.
System.InvalidOperationException on new line
It's says that it's read-only value
from vpet.
CultureInfo.CurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name);
CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator = ".";
This should be effective
from vpet.
No effect. Still the same error as here but on line 149
from vpet.
LocalizeCore.StoreTranslation = true;
CultureInfo.CurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name);
CultureInfo.CurrentCulture.NumberFormat = new CultureInfo("en-US").NumberFormat;
from vpet.
Should I close this issue or it's just a temporary solution?
from vpet.
Related Issues (20)
- Page number does not reset when changing categories in betterbuy [BUG] HOT 1
- 捏脸结算问题 HOT 3
- Changing the language does not take full effect until game restart [SUGGESTION] HOT 1
- 动画问题#2
- 有没有将项目集成到自己的WPF程序中的demo呢
- 给多开存档添加设置备份的功能 HOT 5
- 判断设置是否损坏而读取设置备份 HOT 1
- German translation HOT 3
- Window size for translation needs (Please!) HOT 2
- Missing level (muti adjust) of current working/ learning/playing and schedules HOT 3
- Starting a favorite is always using "Start Working" string HOT 1
- Schedule resting can be abused (bug) HOT 1
- Schedule is in wrong status after game restart (bug) HOT 1
- Schedule can be edited while in progress (bug)
- 桌宠统计面板的移动距离不停增加
- 桌宠“被提起”状态结束的动画可以反复播放 HOT 1
- Detailed statistics showing too much decimal places
- Clicking on body does not trigger speaking (like in tutorial description) HOT 3
- Stamina needs balancing HOT 6
- 小建议 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vpet.