public async Task <IActionResult> Edit(int id, [Bind("id,Product_Id,Product_Name,Brand,Retailer_Id,Type,Price")] Makeup makeup)
        {
            if (id != makeup.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(makeup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MakeupExists(makeup.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(makeup));
        }
    IEnumerator LoadMakeupBundle(Makeup makeupitem)
    {
        rtt.UnBindItem((int)SlotForItems.Makeup, (int)SlotForItems.Makeup_bundle);
        yield return(rtt.LoadItem(makeupitem.item, (int)SlotForItems.Makeup_bundle));

        rtt.BindItem((int)SlotForItems.Makeup, (int)SlotForItems.Makeup_bundle);
    }
        public async Task <IActionResult> Create([Bind("id,Product_Id,Product_Name,Brand,Retailer_Id,Type,Price")] Makeup makeup)
        {
            if (ModelState.IsValid)
            {
                _context.Add(makeup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(makeup));
        }
Exemple #4
0
 public string makeupDetected(Makeup makeup)
 {
     if (makeup.eyeMakeup && makeup.lipMakeup)
     {
         return(" She has made makeup in her eyes and lips.");
     }
     else if (makeup.eyeMakeup && makeup.lipMakeup == false)
     {
         return(" She has made makeup in her eyes.");
     }
     else if (makeup.eyeMakeup && makeup.lipMakeup == false)
     {
         return(" She has made makeup in her lips.");
     }
     else
     {
         return(" She has not made makeup she looks so natyral.");
     }
 }
Exemple #5
0
    GameObject AddMakeupOptions(Makeup makeupitem)
    {
        GameObject option = Instantiate(BeautyFilter_UIExample);

        option.transform.SetParent(BeautyOptionContentTrans, false);
        option.transform.localScale    = Vector3.one;
        option.transform.localPosition = Vector3.zero;
        option.name = makeupitem.name;
        option.GetComponentInChildren <Text>().text    = makeupitem.name;
        option.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(ItemType.Makeup, makeupitem.iconid);

        if (MakeupGOs.ContainsKey(makeupitem))
        {
            MakeupGOs.Remove(makeupitem);
        }
        MakeupGOs.Add(makeupitem, option);
        option.GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
        {
            if (go != currentSelected)
            {
                currentSelected = go;
                foreach (var bgo in MakeupGOs)
                {
                    bgo.Value.transform.Find("Image_bg").gameObject.SetActive(false);
                }
                go.transform.Find("Image_bg").gameObject.SetActive(true);
            }
            currentSelectedMakeupName = makeupitem.name;
            currentMakeupfilterV      = makeupitem.filter_intensity / makeupitem.intensity;

            if (makeupitem.intensity <= 0)
            {
                rtt.SetItemParamd((int)SlotForItems.Makeup, "is_makeup_on", 0);
            }
            else
            {
                rtt.SetItemParamd((int)SlotForItems.Makeup, "is_makeup_on", 1);
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity", makeupitem.intensity);

                rtt.SetItemParamdv((int)SlotForItems.Makeup, "makeup_lip_color", makeupitem.Lipstick_color);
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity_lip", makeupitem.Lipstick_intensity);
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_lip_mask", 1.0);

                CreateTexForItem(uisprites.GetTexture(MakeupType.Blush, makeupitem.Blush_id), "tex_blusher");
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity_blusher", makeupitem.Blush_intensity);

                CreateTexForItem(uisprites.GetTexture(MakeupType.Eyebrow, makeupitem.Eyebrow_id), "tex_brow");
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity_eyeBrow", makeupitem.Eyebrow_intensity);

                CreateTexForItem(uisprites.GetTexture(MakeupType.Eyeshadow, makeupitem.Eyeshadow_id), "tex_eye");
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity_eye", makeupitem.Eyeshadow_intensity);

                rtt.SetItemParams(BeautySkinItemName, "filter_name", makeupitem.filter_name);
                rtt.SetItemParamd(BeautySkinItemName, "filter_level", makeupitem.filter_intensity);
            }

            if (string.Compare(BeautyConfig.makeupGroup_1[0].name, makeupitem.name, true) != 0)
            {
                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkin_Slider.minValue = 0;
                BeautySkin_Slider.maxValue = 1;
                BeautySkin_Slider.value    = (float)rtt.GetItemParamd(MakeupItemName, "makeup_intensity");
                BeautySkin_Slider.onValueChanged.AddListener(delegate
                {
                    rtt.SetItemParamd(MakeupItemName, "makeup_intensity", BeautySkin_Slider.value);
                    float v = BeautySkin_Slider.value * currentMakeupfilterV;
                    v       = v > 1 ? 1 : v;
                    v       = v < 0 ? 0 : v;
                    rtt.SetItemParamd(BeautySkinItemName, "filter_level", v);
                });
                BeautySkinContentPanels[1].SetActive(true);
            }
            else
            {
                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkinContentPanels[1].SetActive(false);
            }
        });
        return(option);
    }
    GameObject AddMakeupOptions(Makeup makeupitem)
    {
        GameObject option = Instantiate(BeautyFilter_UIExample);

        option.transform.SetParent(BeautyOptionContentTrans, false);
        option.transform.localScale    = Vector3.one;
        option.transform.localPosition = Vector3.zero;
        option.name = makeupitem.name;
        option.GetComponentInChildren <Text>().text    = makeupitem.name;
        option.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(ItemType.Makeup, makeupitem.item.iconid);

        if (MakeupGOs.ContainsKey(makeupitem))
        {
            MakeupGOs.Remove(makeupitem);
        }
        MakeupGOs.Add(makeupitem, option);
        option.GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
        {
            if (go != currentSelected)
            {
                currentSelected = go;
                foreach (var bgo in MakeupGOs)
                {
                    bgo.Value.transform.Find("Image_bg").gameObject.SetActive(false);
                }
                go.transform.Find("Image_bg").gameObject.SetActive(true);
            }

            currentSelectedMakeupName = makeupitem.name;

            if (makeupitem.intensity <= 0)
            {
                rtt.SetItemParamd((int)SlotForItems.Makeup, "is_makeup_on", 0);
            }
            else
            {
                rtt.SetItemParamd((int)SlotForItems.Makeup, "is_makeup_on", 1);
                rtt.SetItemParamd((int)SlotForItems.Makeup, "makeup_intensity", makeupitem.intensity);
            }

            if (string.Compare(BeautyConfig.makeupGroup_1[0].name, makeupitem.name, true) != 0)
            {
                StartCoroutine(LoadMakeupBundle(makeupitem));

                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkin_Slider.minValue = 0;
                BeautySkin_Slider.maxValue = 1;
                BeautySkin_Slider.value    = (float)rtt.GetItemParamd(MakeupItemName, "makeup_intensity");
                BeautySkin_Slider.onValueChanged.AddListener(delegate
                {
                    rtt.SetItemParamd(MakeupItemName, "makeup_intensity", BeautySkin_Slider.value);
                });
                BeautySkinContentPanels[1].SetActive(true);
            }
            else
            {
                UnLoadMakeupBundle();

                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkinContentPanels[1].SetActive(false);
            }
        });
        return(option);
    }
 public static double Average(this Makeup makeup)
 {
     return((makeup.EyeMakeup || makeup.LipMakeup) ? 1 : 0);
 }