Allgharb wrote:Hi again, sorry for the lat reply.
I agree that the values should be saved on the main "inc" file.
Here's what the user should choose:
Coin denomination (BTC, EHC, LTC, DASH, etc.) - I still don't know if there's the possibility of having a dropdown menu for this. It would be useful because the coin denomination has to be the same as in coinmarket cap's API.
Amount of Coin that the user has in the portfolio
Average price that the currency was bought
Was this what you were looking for?
Ok, not exactly a dropdown menu, but something similar. Take a look please to the following simple code. It is the code of a Settings skin. Please create a new folder (place it near Coin1_Skin, Coin2_Skin, Coin3_Skin, Coin4_Skin and Portfolios), name it Settings (or use the appropriate name for it), then save the following code into it, naming the file Settings.ini (or whatever you'd like). If you did all these, don't forget to do a Refresh all, to can see the newly created skin. Now you can load it.
As I said, this is the code of a settings skin. In this skin you can choose a coin (this action sets / writes into the CryptoSkin_Main.inc file, the Coin variable) and can enter the amount of coin (Amount variable) and the average price (AvPrice variable). Obviously you can rename these variables, I don't know if you already have a name for them. If you have, just be careful to replace the above names with those used by you.
Here is the code:
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=80,80,80,220
SkinWidth=240
SkinHeight=136
[Variables]
@include=#@#CryptoSkin_Main.inc
[StringStyle]
W=60
H=24
FontColor=220,220,220
FontEffectColor=0,0,0,150
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=CENTERCENTER
AntiAlias=1
[MeterCoin]
Meter=STRING
X=50
Y=16
W=100
H=24
FontColor=220,220,220
FontEffectColor=0,0,0,150
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=CENTERCENTER
AntiAlias=1
Text=Coin: #Coin#
DynamicVariables=1
;SolidColor=255,0,0
[MeterBTC]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=36r
Text=BTC
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,150"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable Coin "BTC"][!WriteKeyValue Variables Coin "BTC" "#@#CryptoSkin_Main.inc"][!UpdateMeter "MeterCoin"][!Redraw]
[MeterEHC]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=24r
Text=EHC
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,150"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable Coin "EHC"][!WriteKeyValue Variables Coin "EHC" "#@#CryptoSkin_Main.inc"][!UpdateMeter "MeterCoin"][!Redraw]
;SolidColor=0,255,0
[MeterLTC]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=24r
Text=LTC
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,150"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable Coin "LTC"][!WriteKeyValue Variables Coin "LTC" "#@#CryptoSkin_Main.inc"][!UpdateMeter "MeterCoin"][!Redraw]
;SolidColor=0,0,255
[MeterDASH]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=24r
Text=DASH
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,150"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "200,200,200,1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable Coin "DASH"][!WriteKeyValue Variables Coin "DASH" "#@#CryptoSkin_Main.inc"][!UpdateMeter "MeterCoin"][!Redraw]
;SolidColor=255,240,0
[MeterAmountCoinStr]
Meter=STRING
MeterStyle=StringStyle
X=180
Y=24
Text=Coin you have:
;SolidColor=255,0,0
[MeasureInputAmountOfCoin]
Measure=Plugin
Plugin=InputText
SolidColor=229,241,251
StringAlign=RIGHT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=Segoe UI
FontSize=9
X=130
Y=40
W=100
H=18
FocusDismiss=1
DefaultValue=#Amount#
Command1=[!SetVariable Amount "$UserInput$"][!UpdateMeasure "MeasureInputAmountOfCoin"][!UpdateMeter "MeterAmountOfCoin"][!Redraw]
Command2=[!WriteKeyValue Variables Amount "[MeasureInputAmountOfCoin]" "#@#CryptoSkin_Main.inc"]
UpdateDivider=86400
DynamicVariables=1
[MeterAmountOfCoin]
Meter=STRING
X=230
Y=40
W=100
H=18
FontColor=220,220,220
FontEffectColor=0,0,0,150
SolidColor=200,200,200,150
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text=#Amount#
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureInputAmountOfCoin" "ExecuteBatch 1-2"]
[MeterAveragePriceStr]
Meter=STRING
MeterStyle=StringStyle
X=180
Y=84
Text=Average price:
;SolidColor=255,0,0
[MeasureInputAveragePrice]
Measure=Plugin
Plugin=InputText
SolidColor=229,241,251
StringAlign=RIGHT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=Segoe UI
FontSize=9
X=130
Y=100
W=100
H=18
FocusDismiss=1
DefaultValue=#AvPrice#
Command1=[!SetVariable AvPrice "$UserInput$"][!UpdateMeasure "MeasureInputAveragePrice"][!UpdateMeter "MeterAveragePrice"][!Redraw]
Command2=[!WriteKeyValue Variables AvPrice "[MeasureInputAveragePrice]" "#@#CryptoSkin_Main.inc"]
UpdateDivider=86400
DynamicVariables=1
[MeterAveragePrice]
Meter=STRING
X=230
Y=100
W=100
H=18
FontColor=220,220,220
FontEffectColor=0,0,0,150
SolidColor=200,200,200,150
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text=#AvPrice#
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureInputAveragePrice" "ExecuteBatch 1-2"]
For now the skin created based on this code has a completely different design that your skins. If you find it useful, we can redesign it, to look similarly as your skins, but first please take a look and let me know if works as you've expected.