From a84fdc38cb93ff629c95bc5f9b751877059cdd26 Mon Sep 17 00:00:00 2001 From: wanlop run Date: Sat, 19 Apr 2025 23:35:56 +0700 Subject: [PATCH] menu_new_layout_gen_v3 add parameter from xml --- .../xml/multi/v3/menu_new_layout_gen_v3.py | 67 +- .../v3/page_catalog_group_frozen_fruit.lxml | 46 +- .../xml/page_topping_frozen_fruit_select.lxml | 1938 +---------------- menu/new-layout.tsv | 30 +- ui/lang.tsv | 2 +- xml/page_board.xml | 2 +- xml/page_catalog_group_other.xml | 1506 ++++++------- xml/page_catalog_group_other_other.xml | 1506 ++++++------- xml/page_catalog_group_pro_boost_energy.xml | 502 ++--- xml/page_catalog_group_recommend.xml | 767 ++++++- xml/page_catalog_group_tea.xml | 4 +- 11 files changed, 2605 insertions(+), 3765 deletions(-) diff --git a/inter/tha/xml/multi/v3/menu_new_layout_gen_v3.py b/inter/tha/xml/multi/v3/menu_new_layout_gen_v3.py index 052487ec..c7fdc7f0 100644 --- a/inter/tha/xml/multi/v3/menu_new_layout_gen_v3.py +++ b/inter/tha/xml/multi/v3/menu_new_layout_gen_v3.py @@ -81,27 +81,41 @@ out_xml('\t\t\t\n') out_xml('\t\t\n') - out_xml('\t\t ' + pd_stage1 + ' \n') - out_xml('\t\t ' + pd_stage2 + ' \n') + if "show-blend-only" in xml_parameter: + print("Hot price ignore ") + else: + out_xml('\t\t ' + pd_stage1 + ' \n') + + if "show-blend-only" in xml_parameter: + print("Cold price ignore ") + else: + out_xml('\t\t ' + pd_stage2 + ' \n') + out_xml('\t\t ' + pd_stage3 + ' \n') + + if "show-blend-only" in xml_parameter: + print("Hot price ignore ") + else: + out_xml('\t\t eval( \n') - out_xml('\t\t eval( \n') - - out_xml( '\t\tIf $' + pd_code_1 + '.Price = -1 Then\r\n') - out_xml( '\t\t\tVar return = "Free"\r\n') - out_xml( '\t\tElse\r\n') - out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_1 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n') - out_xml( '\t\tEndIf\r\n') - out_xml('\t\t) \n') + out_xml( '\t\tIf $' + pd_code_1 + '.Price = -1 Then\r\n') + out_xml( '\t\t\tVar return = "Free"\r\n') + out_xml( '\t\tElse\r\n') + out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_1 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n') + out_xml( '\t\tEndIf\r\n') + out_xml('\t\t) \n') - out_xml('\t\t eval( \n') - out_xml( '\t\tIf $' + pd_code_2 + '.Price = -1 Then\r\n') - out_xml( '\t\t\tVar return = "Free"\r\n') - out_xml( '\t\tElse\r\n') - out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_2 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n') - out_xml( '\t\tEndIf\r\n') - out_xml('\t\t) \n') + if "show-blend-only" in xml_parameter: + print("Cold price ignore ") + else: + out_xml('\t\t eval( \n') + out_xml( '\t\tIf $' + pd_code_2 + '.Price = -1 Then\r\n') + out_xml( '\t\t\tVar return = "Free"\r\n') + out_xml( '\t\tElse\r\n') + out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_2 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n') + out_xml( '\t\tEndIf\r\n') + out_xml('\t\t) \n') out_xml('\t\t eval( \n') @@ -133,8 +147,11 @@ out_xml('\t\t\n') out_xml('\t\t\t ;dummy_layout.inc ; menu_new_list 11 + ; ==================> Len = 16 + ; - 12-05-02-0148 - + + 33 + 22 + 225 + 296 + Flag( 12-05-02-0148.Button,$Sum1205020148) + + + 16 + 164 + 24 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showthaiText + "เป๊ปซี่ทรอปิคอล" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showthaiText + "เป๊ปซี่ เครื่องดื่มเต่าทรงพลัง มะพร้าว/n(มีคาเฟอีน)" + + + 16 + 164 + 22 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showengText + "Pepsi Tropical" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showengText + "Pepsi Medicine Drink Coconut Soda" + + + 16 + 264 + Var( DirImage2 + "option_deactive.png" ) + + + 16 + 264 + "Invisible" + Var( DirImage2 + "hot.png" ) + Var( DirImage2 + "hot_db.png" ) + + + 50 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + "Invisible" + StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + Var( DirImage2 + "cold.png" ) + Var( DirImage2 + "cold_db.png" ) + $12-05-02-0148.Button + + + 115 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-05-02-0148.Button + StringFmt( $12-05-02-0148.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 146 + 264 + Var( DirImage2 + "blend.png" ) + Var( DirImage2 + "blend_db.png" ) + "Invisible" + + + 180 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitRegularTTF + 0x6F5F51 + 0xEAE6E1 + "Invisible" + StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + + eval( + If ICE_PROCESS_STATUS = 2 Then + + Var ice_tab_process_show = "Invisible" + + Else + Var ice_tab_process_show = "Invisible" + EndIf + Var return = ice_tab_process_show + ) + + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" + + + 49 + 117 + + eval( + If $Sum1205020148 = "Disable" Then + STRCONTAIN "ERR" $##-##-##-####.TAG tag1_is_disable + STRCONTAIN "ERR" $12-05-02-0148.TAG tag2_is_disable + STRCONTAIN "ERR" $##-##-##-####.TAG tag3_is_disable + Var return = "Invisible" + If tag1_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag2_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag3_is_disable = "true" Then + Var return = "Enable" + EndIf + Else + Var return = "Invisible" + EndIf + ) + + "ROOT/taobin_project/image//img_menu_err2.png" + + + 84 + 266 + 10 + OpunMediumTTF + 0xDE794E + ice_tab_process_show + ice_show_open + + + 48 + 116 + 32 + 128 + 64 + MITRegularTTF + 0x5A5A5A + "disable-show" + $Sum1205020148 + text_unavailable + center-vertical-horizontal + + + ; - - - ; ==================> Len = 16 ; - 12-05-02-0034 12-05-03-0034 @@ -2544,257 +2795,6 @@ text_unavailable center-vertical-horizontal - - ; - - - - ; ==================> Len = 16 - ; - 12-05-02-0148 - - - 33 - 22 - 225 - 296 - Flag( 12-05-02-0148.Button,$Sum1205020148) - - - 16 - 164 - 24 - 220 - "multi2" - KanitMediumTTF - 0x322B26 - showthaiText - "เป๊ปซี่ทรอปิคอล" - - - 16 - 220 - 14 - 220 - KanitMediumTTF - 0x6F5F51 - showthaiText - "เป๊ปซี่ เครื่องดื่มเต่าทรงพลัง มะพร้าว/n(มีคาเฟอีน)" - - - 16 - 164 - 22 - 220 - "multi2" - KanitMediumTTF - 0x322B26 - showengText - "Pepsi Tropical" - - - 16 - 220 - 14 - 220 - KanitMediumTTF - 0x6F5F51 - showengText - "Pepsi Medicine Drink Coconut Soda" - - - 16 - 264 - Var( DirImage2 + "option_deactive.png" ) - - - 16 - 264 - "Invisible" - Var( DirImage2 + "hot.png" ) - Var( DirImage2 + "hot_db.png" ) - - - 50 - TextPriceMenuY - TextPriceMenuSize - 220 - KanitMediumTTF - 0x6F5F51 - 0xEAE6E1 - "Invisible" - StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test - - - 81 - 264 - Var( DirImage2 + "cold.png" ) - Var( DirImage2 + "cold_db.png" ) - $12-05-02-0148.Button - - - 115 - TextPriceMenuY - TextPriceMenuSize - 220 - KanitMediumTTF - 0x6F5F51 - 0xEAE6E1 - $12-05-02-0148.Button - StringFmt( $12-05-02-0148.Price , DisplayFormat, PreScaleConvertShow) ; test - - - 146 - 264 - Var( DirImage2 + "blend.png" ) - Var( DirImage2 + "blend_db.png" ) - "Invisible" - - - 180 - TextPriceMenuY - TextPriceMenuSize - 220 - KanitRegularTTF - 0x6F5F51 - 0xEAE6E1 - "Invisible" - StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test - - - 81 - 264 - - eval( - If ICE_PROCESS_STATUS = 2 Then - - Var ice_tab_process_show = "Invisible" - - Else - Var ice_tab_process_show = "Invisible" - EndIf - Var return = ice_tab_process_show - ) - - "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" - "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" - - - 49 - 117 - - eval( - If $Sum1205020148 = "Disable" Then - STRCONTAIN "ERR" $##-##-##-####.TAG tag1_is_disable - STRCONTAIN "ERR" $12-05-02-0148.TAG tag2_is_disable - STRCONTAIN "ERR" $##-##-##-####.TAG tag3_is_disable - Var return = "Invisible" - If tag1_is_disable = "true" Then - Var return = "Enable" - EndIf - If tag2_is_disable = "true" Then - Var return = "Enable" - EndIf - If tag3_is_disable = "true" Then - Var return = "Enable" - EndIf - Else - Var return = "Invisible" - EndIf - ) - - "ROOT/taobin_project/image//img_menu_err2.png" - - - 84 - 266 - 10 - OpunMediumTTF - 0xDE794E - ice_tab_process_show - ice_show_open - - - 48 - 116 - 32 - 128 - 64 - MITRegularTTF - 0x5A5A5A - "disable-show" - $Sum1205020148 - text_unavailable - center-vertical-horizontal - ; - - - diff --git a/xml/page_catalog_group_recommend.xml b/xml/page_catalog_group_recommend.xml index e7a92ecb..c48e8e75 100644 --- a/xml/page_catalog_group_recommend.xml +++ b/xml/page_catalog_group_recommend.xml @@ -61,7 +61,7 @@ ;banner_shifting ;dummy_layout.inc -; menu_new_list 58 +; menu_new_list 61 ; ==================> Len = 16 ; - 12-02-02-0099 - @@ -2837,7 +2837,7 @@ Caramel Oreo" 22 225 296 - Flag( 12-03-03-0009.Button,Disable=Invisible,$Sum1203030009) + Flag( 12-03-03-0009.Button,DateTimeEnd="2025/05/01T00:00:00",Disable=Invisible,$Sum1203030009) + + 16 + 164 + 24 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showthaiText + "เป๊ปซี่ (เพิ่มปริมาณ)" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showthaiText + "เป๊ปซี่ โซดา และน้ำแข็ง" + + + 16 + 164 + 22 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showengText + "Pepsi Extra" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showengText + "Pepsi, Soda And Ice" + + + 16 + 264 + Var( DirImage2 + "option_deactive.png" ) + + + 16 + 264 + "Invisible" + Var( DirImage2 + "hot.png" ) + Var( DirImage2 + "hot_db.png" ) + + + 50 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + "Invisible" + StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + Var( DirImage2 + "cold.png" ) + Var( DirImage2 + "cold_db.png" ) + $12-05-02-0133.Button + + + 115 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-05-02-0133.Button + StringFmt( $12-05-02-0133.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 146 + 264 + Var( DirImage2 + "blend.png" ) + Var( DirImage2 + "blend_db.png" ) + "Invisible" + + + 180 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitRegularTTF + 0x6F5F51 + 0xEAE6E1 + "Invisible" + StringFmt( $-.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + + eval( + If ICE_PROCESS_STATUS = 2 Then + + Var ice_tab_process_show = "Invisible" + + Else + Var ice_tab_process_show = "Invisible" + EndIf + Var return = ice_tab_process_show + ) + + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" + + + 49 + 117 + + eval( + If $Sum1205020133 = "Disable" Then + STRCONTAIN "ERR" $##-##-##-####.TAG tag1_is_disable + STRCONTAIN "ERR" $12-05-02-0133.TAG tag2_is_disable + STRCONTAIN "ERR" $##-##-##-####.TAG tag3_is_disable + Var return = "Invisible" + If tag1_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag2_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag3_is_disable = "true" Then + Var return = "Enable" + EndIf + Else + Var return = "Invisible" + EndIf + ) + + "ROOT/taobin_project/image//img_menu_err2.png" + + + 84 + 266 + 10 + OpunMediumTTF + 0xDE794E + ice_tab_process_show + ice_show_open + + + 48 + 116 + 32 + 128 + 64 + MITRegularTTF + 0x5A5A5A + "disable-show" + $Sum1205020133 + text_unavailable + center-vertical-horizontal + ; - - - ; ==================> Len = 16 @@ -3600,7 +3851,7 @@ Volcano" 22 225 296 - Flag( 12-02-01-0026.Button,12-02-02-0026.Button,12-02-03-0026.Button,Disable=Invisible,$Sum120201002612020200261202030026) + Flag( 12-02-01-0026.Button,12-02-02-0026.Button,12-02-03-0026.Button,DateTimeEnd="2025/05/01T00:00:00",Disable=Invisible,$Sum120201002612020200261202030026) + + 16 + 164 + 24 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showthaiText + "ชานมไทย " + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showthaiText + "ชาไทย และ นม" + + + 16 + 164 + 22 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showengText + "Thai Milk Tea" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showengText + "Thai tea, Sugar, milk" + + + 16 + 264 + Var( DirImage2 + "option_deactive.png" ) + + + 16 + 264 + $12-02-01-0039.Button + Var( DirImage2 + "hot.png" ) + Var( DirImage2 + "hot_db.png" ) + + + 50 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-01-0039.Button + StringFmt( $12-02-01-0039.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + Var( DirImage2 + "cold.png" ) + Var( DirImage2 + "cold_db.png" ) + $12-02-02-0039.Button + + + 115 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-02-0039.Button + StringFmt( $12-02-02-0039.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 146 + 264 + Var( DirImage2 + "blend.png" ) + Var( DirImage2 + "blend_db.png" ) + $12-02-03-0039.Button + + + 180 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitRegularTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-03-0039.Button + StringFmt( $12-02-03-0039.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + + eval( + If ICE_PROCESS_STATUS = 2 Then + + If $Sum120201003912020200391202030039 = "Disable" Then + Var ice_tab_process_show = "Disable" + Else + Var ice_tab_process_show = "Enable" + EndIf + + Else + Var ice_tab_process_show = "Invisible" + EndIf + Var return = ice_tab_process_show + ) + + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" + + + 49 + 117 + + eval( + If $Sum120201003912020200391202030039 = "Disable" Then + STRCONTAIN "ERR" $12-02-01-0039.TAG tag1_is_disable + STRCONTAIN "ERR" $12-02-02-0039.TAG tag2_is_disable + STRCONTAIN "ERR" $12-02-03-0039.TAG tag3_is_disable + Var return = "Invisible" + If tag1_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag2_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag3_is_disable = "true" Then + Var return = "Enable" + EndIf + Else + Var return = "Invisible" + EndIf + ) + + "ROOT/taobin_project/image//img_menu_err2.png" + + + 84 + 266 + 10 + OpunMediumTTF + 0xDE794E + ice_tab_process_show + ice_show_open + + + 48 + 116 + 32 + 128 + 64 + MITRegularTTF + 0x5A5A5A + "disable-show" + $Sum120201003912020200391202030039 + text_unavailable + center-vertical-horizontal + + + ; - - - + ; ==================> Len = 21 + ; 12-02-01-0024 12-02-02-0024 12-02-03-0024 + + 33 + 22 + 225 + 296 + Flag( 12-02-01-0024.Button,12-02-02-0024.Button,12-02-03-0024.Button,DateTimeStart="2025/05/01T00:00:00",Disable=Invisible,$Sum120201002412020200241202030024) + + + 16 + 164 + 24 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showthaiText + "ชานมไทย " + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showthaiText + "ชาไทย และ นมอุ่น" + + + 16 + 164 + 22 + 220 + "multi2" + KanitMediumTTF + 0x322B26 + showengText + "Thai Milk Tea" + + + 16 + 220 + 14 + 220 + KanitMediumTTF + 0x6F5F51 + showengText + "Thai tea, Sugar, Warm milk" + + + 16 + 264 + Var( DirImage2 + "option_deactive.png" ) + + + 16 + 264 + $12-02-01-0024.Button + Var( DirImage2 + "hot.png" ) + Var( DirImage2 + "hot_db.png" ) + + + 50 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-01-0024.Button + StringFmt( $12-02-01-0024.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + Var( DirImage2 + "cold.png" ) + Var( DirImage2 + "cold_db.png" ) + $12-02-02-0024.Button + + + 115 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitMediumTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-02-0024.Button + StringFmt( $12-02-02-0024.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 146 + 264 + Var( DirImage2 + "blend.png" ) + Var( DirImage2 + "blend_db.png" ) + $12-02-03-0024.Button + + + 180 + TextPriceMenuY + TextPriceMenuSize + 220 + KanitRegularTTF + 0x6F5F51 + 0xEAE6E1 + $12-02-03-0024.Button + StringFmt( $12-02-03-0024.Price , DisplayFormat, PreScaleConvertShow) ; test + + + 81 + 264 + + eval( + If ICE_PROCESS_STATUS = 2 Then + + If $Sum120201002412020200241202030024 = "Disable" Then + Var ice_tab_process_show = "Disable" + Else + Var ice_tab_process_show = "Enable" + EndIf + + Else + Var ice_tab_process_show = "Invisible" + EndIf + Var return = ice_tab_process_show + ) + + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" + "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" + + + 49 + 117 + + eval( + If $Sum120201002412020200241202030024 = "Disable" Then + STRCONTAIN "ERR" $12-02-01-0024.TAG tag1_is_disable + STRCONTAIN "ERR" $12-02-02-0024.TAG tag2_is_disable + STRCONTAIN "ERR" $12-02-03-0024.TAG tag3_is_disable + Var return = "Invisible" + If tag1_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag2_is_disable = "true" Then + Var return = "Enable" + EndIf + If tag3_is_disable = "true" Then + Var return = "Enable" + EndIf + Else + Var return = "Invisible" + EndIf + ) + + "ROOT/taobin_project/image//img_menu_err2.png" + + + 84 + 266 + 10 + OpunMediumTTF + 0xDE794E + ice_tab_process_show + ice_show_open + + + 48 + 116 + 32 + 128 + 64 + MITRegularTTF + 0x5A5A5A + "disable-show" + $Sum120201002412020200241202030024 + text_unavailable + center-vertical-horizontal + ; - - - ; ==================> Len = 16 diff --git a/xml/page_catalog_group_tea.xml b/xml/page_catalog_group_tea.xml index 097ffb81..1f27f92b 100644 --- a/xml/page_catalog_group_tea.xml +++ b/xml/page_catalog_group_tea.xml @@ -2593,7 +2593,7 @@ Sugar And Ice" 22 225 296 - Flag( 12-02-01-0091.Button,12-02-02-0091.Button,12-02-03-0091.Button,DateTimeStart="2025/04/01T00:00:00",DateTimeEnd="2025/04/30T00:00:00",$Sum120201009112020200911202030091) + Flag( 12-02-01-0091.Button,12-02-02-0091.Button,12-02-03-0091.Button,DateTimeStart="2025/04/01T00:00:00",$Sum120201009112020200911202030091)