add image file / drinkok.xml add button

This commit is contained in:
kong 2022-04-17 21:48:43 +07:00
parent 64e9f2b4ab
commit ca374272bd
76 changed files with 1060 additions and 599 deletions

View file

@ -81,7 +81,8 @@
Var showname = NameDrink
Var showdesc = DrinkDescription
Var text_show_thai = "Invisible"
Var text_show_eng = "Enable"
Else
@ -91,6 +92,8 @@
Var showname = NameDrinkTH
Var showdesc = DrinkDescriptionTH
Var text_show_thai = "Enable"
Var text_show_eng = "Invisible"
EndIf
@ -206,6 +209,28 @@
DEBUGVAR PriceD1
DEBUGVAR PriceD2
DEBUGVAR PriceD3
If hot_button_state = "Disable2" Then
Var text_price_d1 = ""
Else
Var text_price_d1 = "(฿" + PriceD1
Var text_price_d1 = text_price_d1 + ")"
EndIf
If cold_button_state = "Disable2" Then
Var text_price_d2 = ""
Else
Var text_price_d2 = "(฿" + PriceD2
Var text_price_d2 = text_price_d2 + ")"
EndIf
If blend_button_state = "Disable2" Then
Var text_price_d3 = ""
Else
Var text_price_d3 = "(฿" + PriceD3
Var text_price_d3 = text_price_d3 + ")"
EndIf
DEBUGVAR PD_CODE1
DEBUGVAR PD_CODE2
DEBUGVAR PD_CODE3
@ -213,6 +238,17 @@
DEBUGVAR PD_STAGE_2
DEBUGVAR PD_STAGE_3
Var img_cold = "/bt_cold_no.png"
Var img_cold_sel = "/bt_cold_selected_no.png"
Var img_cold_dis = "/bt_cold_disable_no.png"
Var img_cold_dis2 = "/bt_cold_disable2_no.png"
Var img_smth = "/bt_smoothie_no.png"
Var img_smth_sel = "/bt_smoothie_selected_no.png"
Var img_smth_dis = "/bt_smoothie_disable_no.png"
Var img_smth_dis2 = "/bt_smoothie_disable2_no.png"
@ -220,6 +256,8 @@
<Timeout> 1000 </Timeout>
<EventTimeout>
DEBUGVAR Timeout
Var Timeout = Timeout + 1
If Timeout > 40 Then
@ -276,18 +314,26 @@
If show_eng = "true" Then
Var DirImage = "ROOT/taobin_project/image/topping2_en/"
Var DirImage = "ROOT/taobin_project/image/topping2_en"
Var show_btp = "ROOT/taobin_project/image/bn_thai_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_thai_lang.png"
Var showname = NameDrink
Var showdesc = DrinkDescription
Var text_show_thai = "Invisible"
Var text_show_eng = "Enable"
Else
Var DirImage = "ROOT/taobin_project/image/topping2/"
Var DirImage = "ROOT/taobin_project/image/topping2"
Var show_btp = "ROOT/taobin_project/image/bn_eng_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_eng_lang.png"
Var showname = NameDrinkTH
Var showdesc = DrinkDescriptionTH
Var text_show_thai = "Enable"
Var text_show_eng = "Invisible"
EndIf
Var backGroundAddExtra = DirImage + "/bg_add_shot_coffee_only.png"
@ -955,16 +1001,18 @@
</EventClick>
</Button>
<Button>
<X> 614 </X>
<Y> 72 </Y>
<State> cold_button_state </Stage>
<Mode> "No" </Mode>
<Filename> Var( DirImage + "/bt_cold.png" ) </Filename>
<FilenamePress> Var( DirImage + "/bt_cold_selected.png" ) </FilenamePress>
<FilenameDisable> Var( DirImage + "/bt_cold_disable.png" ) </FilenameDisable>
<FilenameDisable2> Var( DirImage + "/bt_cold_disable2.png" ) </FilenameDisable2>
<FilenameForce> Var( DirImage + "/bt_cold_selected.png" ) </FilenameForce>
<Filename> Var( DirImage + img_cold ) </Filename>
<FilenamePress> Var( DirImage + img_cold_sel ) </FilenamePress>
<FilenameDisable> Var( DirImage + img_cold_dis ) </FilenameDisable>
<FilenameDisable2> Var( DirImage + img_cold_dis2 ) </FilenameDisable2>
<FilenameForce> Var( DirImage + img_cold_sel ) </FilenameForce>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
@ -1006,11 +1054,11 @@
<Y> 72 </Y>
<State> blend_button_state </Stage>
<Mode> "No" </Mode>
<Filename> Var( DirImage + "/bt_smoothie.png" ) </Filename>
<FilenamePress> Var( DirImage + "/bt_smoothie_selected.png" ) </FilenamePress>
<FilenameDisable> Var( DirImage + "/bt_smoothie_disable.png" ) </FilenameDisable>
<FilenameDisable2> Var( DirImage + "/bt_smoothie_disable2.png" ) </FilenameDisable2>
<FilenameForce> Var( DirImage + "/bt_smoothie_selected.png" ) </FilenameForce>
<Filename> Var( DirImage + img_smth ) </Filename>
<FilenamePress> Var( DirImage + img_smth_sel ) </FilenamePress>
<FilenameDisable> Var( DirImage + img_smth_dis ) </FilenameDisable>
<FilenameDisable2> Var( DirImage + img_smth_dis2 ) </FilenameDisable2>
<FilenameForce> Var( DirImage + img_smth_sel ) </FilenameForce>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
@ -1046,6 +1094,41 @@
</Button>
<Text>
<X> 552 </X>
<Y> 85 </Y>
<Font> KanitRegularTTF </Font>
<Size> 23 </Size>
<Color> text_hot_color </Color>
<Value> text_price_d1 </Value>
</Text>
<Text>
<X> 710 </X>
<Y> 85 </Y>
<Font> KanitRegularTTF </Font>
<Size> 23 </Size>
<Color> text_cold_color </Color>
<Value> text_price_d2 </Value>
</Text>
<Text>
<X> 852 </X>
<Y> 85 </Y>
<Font> KanitRegularTTF </Font>
<Size> 23 </Size>
<State> text_show_thai</State>
<Color> text_blender_color </Color>
<Value> text_price_d3 </Value>
</Text>
<Text>
<X> 872 </X>
<Y> 85 </Y>
<Font> KanitRegularTTF </Font>
<State> text_show_eng</State>
<Size> 23 </Size>
<Color> text_blender_color </Color>
<Value> text_price_d3 </Value>
</Text>
</Block>
@ -2032,6 +2115,73 @@
<Function2>
Var img_cold_no_flag = 0
Var img_smth_no_flag = 0
If hot_button_state = "Disable2" Then
If blend_button_state = "Disable2" Then
Var img_cold_no_flag = 1
Else
Var img_cold_no_flag = 1
Var img_smth_no_flag = 2
EndIf
EndIf
If PriceD1 = PriceD2 Then
Var img_cold_no_flag = 1
EndIf
If hot_button_state = "Disable2" Then
If cold_button_state = "Disable2" Then
Var img_smth_no_flag = 1
EndIf
EndIf
If img_cold_no_flag = 1 Then
SAVELOG "Cold Image change."
Var img_cold = "/bt_cold_no.png"
Var img_cold_sel = "/bt_cold_selected_no.png"
Var img_cold_dis = "/bt_cold_disable_no.png"
Var img_cold_dis2 = "/bt_cold_disable2_no.png"
Else
Var img_cold = "/bt_cold.png"
Var img_cold_sel = "/bt_cold_selected.png"
Var img_cold_dis = "/bt_cold_disable.png"
Var img_cold_dis2 = "/bt_cold_disable2.png"
EndIf
If img_smth_no_flag = 1 Then
SAVELOG "Smoothies change img. 1"
Var img_smth = "/bt_smoothie_no.png"
Var img_smth_sel = "/bt_smoothie_selected_no.png"
Var img_smth_dis = "/bt_smoothie_disable_no.png"
Var img_smth_dis2 = "/bt_smoothie_disable2_no.png"
Else
If img_smth_no_flag = 2 Then
SAVELOG "Smoothies change img. 2"
Var img_smth = "/bt_smoothie_sub2.png"
Var img_smth_sel = "/bt_smoothie_selected_sub2.png"
Var img_smth_dis = "/bt_smoothie_disable_sub2.png"
Var img_smth_dis2 = "/bt_smoothie_disable2_sub2.png"
Else
Var img_smth = "/bt_smoothie.png"
Var img_smth_sel = "/bt_smoothie_selected.png"
Var img_smth_dis = "/bt_smoothie_disable.png"
Var img_smth_dis2 = "/bt_smoothie_disable2.png"
EndIf
EndIf
Var img_cold = "/bt_cold_no.png"
Var img_cold_sel = "/bt_cold_selected_no.png"
Var img_cold_dis = "/bt_cold_disable_no.png"
Var img_cold_dis2 = "/bt_cold_disable2_no.png"
Var img_smth = "/bt_smoothie_no.png"
Var img_smth_sel = "/bt_smoothie_selected_no.png"
Var img_smth_dis = "/bt_smoothie_disable_no.png"
Var img_smth_dis2 = "/bt_smoothie_disable2_no.png"
DEBUGVAR menu_name_thai_cold
SAVELOG "FUNCTION2"
@ -2054,6 +2204,10 @@
Var showname = menu_name_thai_hot
Var showdesc = menu_desc_thai_hot
EndIf
Var text_hot_color = "0xFFFFFF"
Var text_cold_color = "0x84776F"
Var text_blender_color = "0x84776F"
EndIf
If cold_button_state = "PressForever" Then
@ -2072,6 +2226,11 @@
Var showname = menu_name_thai_cold
Var showdesc = menu_desc_thai_cold
EndIf
Var text_hot_color = "0x84776F"
Var text_cold_color = "0xFFFFFF"
Var text_blender_color = "0x84776F"
EndIf
If blend_button_state = "PressForever" Then
@ -2088,6 +2247,11 @@
Var showname = menu_name_thai_blender
Var showdesc = menu_desc_thai_blender
EndIf
Var text_hot_color = "0x84776F"
Var text_cold_color = "0x84776F"
Var text_blender_color = "0xFFFFFF"
EndIf
@ -2146,6 +2310,7 @@
Var Timeout = 0
RefreshAll
</Function2>