mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Plugin API: Renamed (Rm)ReadFormula to (Rm)ReadDouble. Changed (Rm)ReadInt to accept formulas.
This commit is contained in:
parent
1a5f77254b
commit
6a6770aeed
@ -77,22 +77,14 @@ namespace Rainmeter
|
|||||||
return new string(value);
|
return new string(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe double ReadFormula(string option, double defValue)
|
public unsafe double ReadDouble(string option, double defValue)
|
||||||
{
|
{
|
||||||
return RmReadFormula((void*)m_Rm, ToUnsafe(option), defValue);
|
return RmReadFormula((void*)m_Rm, ToUnsafe(option), defValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe int ReadInt(string option, int defValue)
|
public unsafe int ReadInt(string option, int defValue)
|
||||||
{
|
{
|
||||||
string value = ReadString(option, "");
|
return (int)RmReadFormula((void*)m_Rm, ToUnsafe(option), defValue);
|
||||||
try
|
|
||||||
{
|
|
||||||
return Convert.ToInt32(value);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return defValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe string GetMeasureName()
|
public unsafe string GetMeasureName()
|
||||||
|
@ -67,14 +67,12 @@ __inline LPCWSTR RmReadPath(void* rm, LPCWSTR option, LPCWSTR defValue)
|
|||||||
|
|
||||||
__inline int RmReadInt(void* rm, LPCWSTR option, int defValue)
|
__inline int RmReadInt(void* rm, LPCWSTR option, int defValue)
|
||||||
{
|
{
|
||||||
LPCWSTR value = RmReadString(rm, option, L"", TRUE);
|
return (int)RmReadFormula(rm, option, defValue);
|
||||||
return (*value) ? _wtoi(value) : defValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline double RmReadDouble(void* rm, LPCWSTR option, double defValue)
|
__inline double RmReadDouble(void* rm, LPCWSTR option, double defValue)
|
||||||
{
|
{
|
||||||
LPCWSTR value = RmReadString(rm, option, L"", TRUE);
|
return RmReadFormula(rm, option, defValue);
|
||||||
return (*value) ? wcstod(value, NULL) : defValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline LPCWSTR RmGetMeasureName(void* rm)
|
__inline LPCWSTR RmGetMeasureName(void* rm)
|
||||||
@ -106,4 +104,6 @@ enum LOGLEVEL
|
|||||||
};
|
};
|
||||||
#endif // LIBRARY_EXPORTS
|
#endif // LIBRARY_EXPORTS
|
||||||
|
|
||||||
|
#define RmReadFormula _ReadFormula
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user