新增更好买,支持购买东西吃

This commit is contained in:
ZouJin 2023-06-08 18:46:53 +10:00
parent 1c9c65f680
commit e18417618e
98 changed files with 664 additions and 343 deletions

View File

@ -14,7 +14,7 @@ namespace VPet_Simulator.Core
/// <returns></returns>
public static Brush ResourcesBrush(BrushType name)
{
return (Brush)Application.Current.Resources.MergedDictionaries[0][name.ToString()];
return (Brush)Application.Current.Resources.MergedDictionaries[0].MergedDictionaries[0][name.ToString()];
}
public enum BrushType
{

View File

@ -174,7 +174,10 @@ namespace VPet_Simulator.Core
else
StrengthChange(StoreStrengthFood);
}
/// <summary>
/// 吃食物
/// </summary>
/// <param name="food">食物类</param>
public void EatFood(IFood food)
{
Exp += food.Exp;

View File

@ -71,7 +71,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LinePutScript.1.8.1\lib\net462\LinePutScript.dll</HintPath>
<HintPath>..\packages\LinePutScript.1.8.2\lib\net462\LinePutScript.dll</HintPath>
</Reference>
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll</HintPath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LinePutScript" version="1.8.1" targetFramework="net462" />
<package id="LinePutScript" version="1.8.2" targetFramework="net462" />
<package id="Panuon.WPF" version="1.0.1" targetFramework="net462" />
<package id="Panuon.WPF.UI" version="1.1.11.11" targetFramework="net462" />
</packages>

View File

@ -1,33 +1,118 @@
using LinePutScript.Converter;
using Panuon.WPF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using VPet_Simulator.Core;
using static LinePutScript.Converter.LPSConvert;
namespace VPet_Simulator.Windows.Interface
{
public class Food : IFood
public class Food : NotifyPropertyChangedBase, IFood
{
[Line]
/// <summary>
/// 食物类型
/// </summary>
public enum FoodType
{
/// <summary>
/// 食物 (默认)
/// </summary>
Food,
/// <summary>
/// 收藏 (自定义)
/// </summary>
Star,
/// <summary>
/// 正餐
/// </summary>
Meal,
/// <summary>
/// 零食
/// </summary>
Snack,
/// <summary>
/// 饮料
/// </summary>
Drink,
/// <summary>
/// 功能性
/// </summary>
Functional,
/// <summary>
/// 药品
/// </summary>
Drug,
}
/// <summary>
/// 食物类型
/// </summary>
[Line(type: ConvertType.ToEnum, ignoreCase: true)]
public FoodType Type { get; set; } = FoodType.Food;
/// <summary>
/// 食物名字
/// </summary>
[Line(name: "name")]
public string Name { get; set; }
[Line(ignoreCase: true)]
public int Exp { get; set; }
[Line]
[Line(ignoreCase: true)]
public double Strength { get; set; }
[Line]
[Line(ignoreCase: true)]
public double StrengthFood { get; set; }
[Line]
[Line(ignoreCase: true)]
public double StrengthDrink { get; set; }
[Line]
[Line(ignoreCase: true)]
public double Feeling { get; set; }
[Line]
[Line(ignoreCase: true)]
public double Health { get; set; }
[Line]
[Line(ignoreCase: true)]
public double Likability { get; set; }
/// <summary>
/// 食物价格
/// </summary>
[Line]
[Line(ignoreCase: true)]
public double Price { get; set; }
/// <summary>
/// 描述
/// </summary>
[Line(ignoreCase: true)]
public string Desc { get; set; }
/// <summary>
/// 描述(ToBetterBuy)
/// </summary>
public string Description
{
get
{
StringBuilder sb = new StringBuilder(Desc);
return sb.ToString();
}
}
/// <summary>
/// 显示的图片
/// </summary>
public ImageSource ImageSource { get; set; }
/// <summary>
/// 是否已收藏
/// </summary>
public bool Star { get; set; }
/// <summary>
/// 物品图片
/// </summary>
[Line(ignoreCase: true)]
public string Image;
/// <summary>
/// 加载物品图片
/// </summary>
public void LoadImageSource(IMainWindow imw)
{
ImageSource = imw.ImageSources.FindImage(Image ?? Name, "food");
Star = imw.Set["betterbuy"]["star"].GetInfos().Contains(Name);
}
}
}

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Windows.Media;
using VPet_Simulator.Core;
namespace VPet_Simulator.Windows.Interface
@ -47,7 +48,11 @@ namespace VPet_Simulator.Windows.Interface
/// <summary>
/// 所有食物
/// </summary>
List<Food> Items { get; }
List<Food> Foods { get; }
/// <summary>
/// 图片资源
/// </summary>
ImageResources ImageSources { get; }
/// <summary>
/// 设置游戏缩放倍率
/// </summary>

View File

@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
using LinePutScript;
using LinePutScript.Dictionary;
namespace VPet_Simulator.Windows.Interface
{
/// <summary>
/// 资源集
/// </summary>
public class Resources : LPS_D
{
public Resources() { }
/// <summary>
/// 添加资源,后来覆盖之前
/// </summary>
/// <param name="line">资源行</param>
/// <param name="modpath">功能位置</param>
public void AddSource(ILine line, string modpath)
{
ISub source = line.Find("source");
if (source == null)
return;
//else if (!source.Info.Contains(":\\"))
source.Info = modpath + '\\' + source.Info;
line.Name = line.Name.ToLower();
AddorReplaceLine(line);
}
/// <summary>
/// 添加资源,后来覆盖之前
/// </summary>
/// <param name="line">资源行</param>
public void AddSource(ILine line)
{
ISub source = line.Find("source");
if (source == null)
return;
//else if (!source.Info.Contains(":\\"))
line.Name = line.Name.ToLower();
AddorReplaceLine(line);
}
/// <summary>
/// 添加多个资源,后来覆盖之前
/// </summary>
/// <param name="lps">资源表</param>
public void AddSources(ILPS lps)
{
foreach (ILine line in lps)
{
line.Name = line.Name.ToLower();
AddSource(line);
}
}
/// <summary>
/// 添加多个资源,后来覆盖之前
/// </summary>
/// <param name="lps">资源表</param>
/// <param name="modpath">功能位置</param>
public void AddSources(ILPS lps, string modpath = "")
{
foreach (ILine line in lps)
{
AddSource(line, modpath);
}
}
/// <summary>
/// 添加资源,后来覆盖之前的
/// </summary>
/// <param name="name">资源名字</param>
/// <param name="path">资源位置</param>
public void AddSource(string name, string path)
{
AddorReplaceLine(new Line(name.ToLower(), "", "", new Sub("source", path)));
}
/// <summary>
/// 查找资源
/// </summary>
/// <param name="name">资源名称</param>
/// <param name="nofind">如果未找到,退回这个值</param>
/// <returns>返回资源位置,如果未找到,则退回nofind</returns>
public string FindSource(string name, string nofind = null)
{
ILine line = FindLine(name.ToLower());
if (line == null)
return nofind;
return line.Find("source").Info;
}
/// <summary>
/// 查找资源
/// </summary>
/// <param name="name">资源名称</param>
/// <param name="nofind">如果未找到,退回这个值</param>
/// <returns>返回资源位置,如果未找到,则退回nofind</returns>
public Uri FindSourceUri(string name, string nofind = null)
{
ILine line = FindLine(name.ToLower());
if (line == null)
if (nofind != null)
return new Uri(nofind);
else
return null;
return new Uri(line.Find("source").Info);
}
}
/// <summary>
/// 图片资源集合
/// </summary>
public class ImageResources : Resources
{
public ImageResources()
{
}
/// <summary>
/// 添加图片集,后来覆盖之前
/// </summary>
/// <param name="lps">图片集</param>
/// <param name="modpath">文件夹位置</param>
public void AddImages(LpsDocument lps, string modpath = "") => AddSources(lps, modpath);
/// <summary>
/// 添加单个图片,后来覆盖之前
/// </summary>
/// <param name="line">图片行</param>
/// <param name="modpath">文件夹位置</param>
public void AddImage(ILine line, string modpath = "") => AddSource(line, modpath);
/// <summary>
/// 查找图片资源
/// </summary>
/// <param name="imagename">图片名称</param>
/// <returns>图片资源,如果未找到则退回错误提示图片</returns>
public BitmapImage FindImage(string imagename) => new BitmapImage(FindImageUri(imagename));
public Uri FindImageUri(string imagename)
{
#if DEBUGs
var v = FindSourceUri(imagename, "pack://application:,,,/Res/Image/system/error.png");
if (v.AbsoluteUri == "pack://application:,,,/Res/Image/system/error.png")
throw new Exception($"image nofound {imagename}");
return v;
#else
return FindSourceUri(imagename, "pack://application:,,,/Res/Image/system/error.png");
#endif
}
/// <summary>
/// 查找图片资源 如果找不到则使用上级
/// </summary>
/// <param name="imagename">图片名称</param>
/// <returns>图片资源,如果未找到则退回错误提示图片</returns>
/// <param name="superior">上级图片 如果没有专属的图片,则提供上级的图片</param>
public BitmapImage FindImage(string imagename, string superior)
{
string source = FindSource(imagename);
if (source == null)
{
return new BitmapImage(FindImageUri(superior));
}
return new BitmapImage(new Uri(source));
}
/// <summary>
/// 图片设置 (eg:定位锚点等)
/// </summary>
public LpsDocument ImageSetting = new LpsDocument();
}
}

View File

@ -89,7 +89,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LinePutScript.1.8.1\lib\net462\LinePutScript.dll</HintPath>
<HintPath>..\packages\LinePutScript.1.8.2\lib\net462\LinePutScript.dll</HintPath>
</Reference>
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll</HintPath>
@ -116,6 +116,7 @@
<Compile Include="MainPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting.cs" />
<Compile Include="Source.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LinePutScript" version="1.8.1" targetFramework="net462" />
<package id="LinePutScript" version="1.8.2" targetFramework="net462" />
<package id="Panuon.WPF" version="1.0.1" targetFramework="net462" />
<package id="Panuon.WPF.UI" version="1.1.11.11" targetFramework="net462" />
</packages>

View File

@ -7,6 +7,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
<ResourceDictionary>
<FontFamily x:Key="MainFont">
/VPet-Simulator.Windows;component/Res/Font/#OPPOSans R
@ -22,7 +23,6 @@
IconFontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
IconFontSize="16" />
</ResourceDictionary>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@ -1,4 +1,5 @@
using LinePutScript;
using LinePutScript.Converter;
using System;
using System.Collections.Generic;
using System.IO;
@ -35,6 +36,29 @@ namespace VPet_Simulator.Windows
public string Content = "";
public bool SuccessLoad = true;
public static string INTtoVER(int ver) => $"{ver / 100}.{ver % 100:00}";
public static void LoadImage(MainWindow mw, DirectoryInfo di)
{
//加载其他放在文件夹的图片
foreach (FileInfo fi in di.EnumerateFiles("*.png"))
{
mw.ImageSources.AddSource(fi.Name.ToLower().Substring(0, fi.Name.Length - 4), fi.FullName);
}
//加载其他放在文件夹中文件夹的图片
foreach (DirectoryInfo fordi in di.EnumerateDirectories())
{
LoadImage(mw, fordi);
}
//加载标志好的图片和图片设置
foreach (FileInfo fi in di.EnumerateFiles("*.lps"))
{
var tmp = new LpsDocument(File.ReadAllText(fi.FullName));
if (fi.Name.ToLower().StartsWith("set_"))
foreach (var line in tmp)
mw.ImageSources.ImageSetting.AddorReplaceLine(line);
else
mw.ImageSources.AddImages(tmp, di.FullName);
}
}
public CoreMOD(DirectoryInfo directory, MainWindow mw)
{
Path = directory;
@ -83,6 +107,23 @@ namespace VPet_Simulator.Windows
}
}
break;
case "food":
Content += "食物\n";
foreach (FileInfo fi in di.EnumerateFiles("*.lps"))
{
var tmp = new LpsDocument(File.ReadAllText(fi.FullName));
foreach (ILine li in tmp)
{
string tmps = li.Find("name").info;
mw.Foods.RemoveAll(x => x.Name == tmps);
mw.Foods.Add(LPSConvert.DeserializeObject<Food>(li));
}
}
break;
case "image":
Content += "图片包\n";
LoadImage(mw, di);
break;
case "plugin":
Content += "代码插件\n";
SuccessLoad = false;
@ -133,7 +174,7 @@ namespace VPet_Simulator.Windows
modlps.FindorAddLine("authorid").InfoToInt64 = AuthorID;
modlps.FindorAddLine("itemid").info = ItemID.ToString();
File.WriteAllText(Path.FullName + @"\info.lps", modlps.ToString());
}
}
}
public static class ExtensionSetting
{

View File

@ -22,12 +22,14 @@ namespace VPet_Simulator.Windows
public Main Main { get; set; }
public UIElement TalkBox;
public winGameSetting winSetting { get; set; }
public winBetterBuy winBetterBuy { get; set; }
public ChatGPTClient CGPTClient;
public ImageResources ImageSources { get; set; } = new ImageResources();
/// <summary>
/// 所有三方插件
/// </summary>
public List<MainPlugin> Plugins { get; } = new List<MainPlugin>();
public List<Food> Items { get; } = new List<Food>();
public List<Food> Foods { get; } = new List<Food>();
/// <summary>
/// 版本号
/// </summary>

View File

@ -218,6 +218,7 @@ namespace VPet_Simulator.Windows
LoadingText.Content = "正在加载CGPT";
winSetting = new winGameSetting(this);
winBetterBuy = new winBetterBuy(this);
Main = new Main(Core) { };
if (!Set["CGPT"][(gbol)"enable"] && IsSteamUser)
{
@ -240,6 +241,8 @@ namespace VPet_Simulator.Windows
{
new winReport(this, "由于插件引起的游戏启动错误\n" + e.ToString()).Show();
}
Foods.ForEach(item => item.LoadImageSource(this));
Main.DefaultClickAction = () =>
{
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
@ -277,15 +280,24 @@ namespace VPet_Simulator.Windows
Main.ToolBar.Visibility = Visibility.Collapsed;
IRunImage eat = (IRunImage)Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
var b = Main.FindDisplayBorder(eat);
eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/tony.bmp")), Main.DisplayToNomal);
eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/汉堡.png")), Main.DisplayToNomal);
}
);
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "给不二一测试用的窗口", () =>
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "吃饭", () =>
{
winBetterBuy.Show(Food.FoodType.Meal);
}
);
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喝水", () =>
{
new winBetterBuy(this).Show();
winBetterBuy.Show(Food.FoodType.Drink);
}
);
);
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "药品", () =>
{
winBetterBuy.Show(Food.FoodType.Drug);
}
);
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
if (Set.MessageBarOutside)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -76,10 +76,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="ChatGPT.API.Framework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ChatGPT.API.Framework.1.0.2\lib\net462\ChatGPT.API.Framework.dll</HintPath>
<HintPath>..\packages\ChatGPT.API.Framework.1.0.4\lib\net462\ChatGPT.API.Framework.dll</HintPath>
</Reference>
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LinePutScript.1.8.1\lib\net48\LinePutScript.dll</HintPath>
<HintPath>..\packages\LinePutScript.1.8.2\lib\net48\LinePutScript.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -252,6 +252,7 @@
</Resource>
<Resource Include="Res\TopLogo2019.PNG" />
<Resource Include="Res\tony.bmp" />
<Resource Include="Res\汉堡.png" />
<Content Include="steam_api.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@ -1,89 +1,46 @@
<pu:WindowX x:Class="VPet_Simulator.Windows.winBetterBuy"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:local="clr-namespace:VPet_Simulator.Windows"
mc:Ignorable="d"
Title="winBetterBuy"
Height="450"
Width="800"
FontSize="14"
WindowStartupLocation="CenterScreen"
Background="#E0F6FF"
pu:WindowXCaption.Height="45"
pu:WindowXCaption.Background="{DynamicResource DARKPrimary}"
pu:WindowXCaption.Foreground="#FFFFFF"
pu:WindowXCaption.Buttons="Close"
pu:WindowXCaption.ShadowColor="{DynamicResource ShadowColor}">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Windows"
mc:Ignorable="d" Title="更好买" Height="450" Width="800" FontSize="14" WindowStartupLocation="CenterScreen"
Background="#E0F6FF" pu:WindowXCaption.Height="45" pu:WindowXCaption.Background="{DynamicResource DARKPrimary}"
pu:WindowXCaption.Foreground="#FFFFFF" pu:WindowXCaption.Buttons="Close" Topmost="True"
pu:WindowXCaption.ShadowColor="{DynamicResource ShadowColor}" Closing="WindowX_Closing">
<pu:WindowXCaption.CloseButtonStyle>
<Style TargetType="Button"
BasedOn="{StaticResource {x:Static pu:WindowXCaption.CloseButtonStyleKey}}">
<Setter Property="Width"
Value="28" />
<Setter Property="Height"
Value="28" />
<Setter Property="Margin"
Value="0,0,7,0" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="pu:ButtonHelper.CornerRadius"
Value="14" />
<Setter Property="pu:ButtonHelper.HoverBackground"
Value="White" />
<Setter Property="pu:ButtonHelper.ClickBackground"
Value="{x:Null}" />
<Setter Property="pu:ButtonHelper.HoverForeground"
Value="{DynamicResource DARKPrimary}" />
<Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.CloseButtonStyleKey}}">
<Setter Property="Width" Value="28" />
<Setter Property="Height" Value="28" />
<Setter Property="Margin" Value="0,0,7,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="pu:ButtonHelper.CornerRadius" Value="14" />
<Setter Property="pu:ButtonHelper.HoverBackground" Value="White" />
<Setter Property="pu:ButtonHelper.ClickBackground" Value="{x:Null}" />
<Setter Property="pu:ButtonHelper.HoverForeground" Value="{DynamicResource DARKPrimary}" />
</Style>
</pu:WindowXCaption.CloseButtonStyle>
<pu:WindowXCaption.HeaderTemplate>
<DataTemplate>
<Grid Margin="10,0">
<StackPanel Orientation="Horizontal">
<Button Style="{DynamicResource TextButtonStyle}"
Foreground="{DynamicResource DARKPrimaryText}"
Content="更好买"
VerticalAlignment="Center"
FontSize="20"
Click="BtnTitle_Click"/>
<Grid Grid.Column="1"
Margin="15,0,0,0"
Width="200">
<Button Style="{DynamicResource TextButtonStyle}" Foreground="{DynamicResource DARKPrimaryText}"
Content="更好买" VerticalAlignment="Center" FontSize="20" Click="BtnTitle_Click" />
<Grid Grid.Column="1" Margin="15,0,0,0" Width="200">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="TbTitleSearch"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
Padding="7,0"
pu:TextBoxHelper.Watermark="搜索商品"
FontSize="14"
Background="#33FFFFFF"
Height="30"
BorderThickness="0"
pu:TextBoxHelper.CornerRadius="5"
Loaded="TbTitleSearch_Loaded"
Foreground="{DynamicResource DARKPrimaryText}" />
<Button Grid.Column="1"
Margin="0,0,3,0"
VerticalAlignment="Center"
Height="28"
Width="28"
<TextBox x:Name="TbTitleSearch" Grid.ColumnSpan="2" VerticalAlignment="Center" Padding="7,0"
pu:TextBoxHelper.Watermark="搜索商品" FontSize="14" Background="#33FFFFFF" Height="30"
BorderThickness="0" pu:TextBoxHelper.CornerRadius="5" Loaded="TbTitleSearch_Loaded"
Foreground="{DynamicResource DARKPrimaryText}" />
<Button Grid.Column="1" Margin="0,0,3,0" VerticalAlignment="Center" Height="28" Width="28"
IsDefault="{Binding IsKeyboardFocusWithin, ElementName=TbTitleSearch}"
BorderThickness="0"
pu:ButtonHelper.CornerRadius="0,5,5,0"
Background="Transparent"
FontFamily="pack://application:,,,/Res/#remixicon"
Content="&#xF0D1;"
Padding="0"
Foreground="{DynamicResource DARKPrimaryText}"
FontSize="16"
Cursor="Hand"
BorderThickness="0" pu:ButtonHelper.CornerRadius="0,5,5,0" Background="Transparent"
FontFamily="pack://application:,,,/Res/#remixicon" Content="&#xF0D1;" Padding="0"
Foreground="{DynamicResource DARKPrimaryText}" FontSize="16" Cursor="Hand"
Click="BtnSearch_Click" />
</Grid>
@ -97,27 +54,18 @@
<DataTemplate x:Key="CommodityDataTemplate">
<Grid>
<pu:CarouselPanel Grid.Column="1"
Animation="Fade,Flow"
AnimationDuration="0:0:0.3"
CurrentIndex="{Binding IsChecked, Converter={StaticResource BoolToIntConverter}, ElementName=TbtnDetail}">
<Border Background="{DynamicResource SecondaryTrans4}"
CornerRadius="5">
<pu:CarouselPanel Grid.Column="1" Animation="Fade,Flow" AnimationDuration="0:0:0.3"
CurrentIndex="{Binding IsChecked, Converter={StaticResource BoolToIntConverter}, ElementName=TbtnDetail}">
<Border Background="{DynamicResource SecondaryTrans4}" CornerRadius="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border Margin="25,0,0,0"
Width="{Binding ActualHeight, ElementName=BdrImage}" />
<TextBlock Grid.ColumnSpan="2"
Margin="10,7,0,0"
FontWeight="Bold"
TextTrimming="CharacterEllipsis"
FontSize="18"
Text="{Binding Name}" />
<Grid Grid.Column="1"
Margin="0,40,0,10">
<Border Margin="25,0,0,0" Width="{Binding ActualHeight, ElementName=BdrImage}" />
<TextBlock Grid.ColumnSpan="2" Margin="10,7,0,0" FontWeight="Bold"
TextTrimming="CharacterEllipsis" FontSize="18" Text="{Binding Name}" />
<Grid Grid.Column="1" Margin="0,40,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@ -125,71 +73,44 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="1"
Orientation="Horizontal">
<TextBlock x:Name="TxtPrice"
VerticalAlignment="Bottom"
TextDecorations="Strikethrough"
Text="{Binding Price, StringFormat='¥ 0.0'}"
FontWeight="Bold"
FontSize="10"
Foreground="{DynamicResource PrimaryText}" />
<TextBlock x:Name="TxtDiscountPrice"
Margin="5,0,0,0"
FontWeight="Bold"
FontSize="18"
Foreground="{DynamicResource DARKPrimary}">
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock x:Name="TxtPrice" VerticalAlignment="Bottom"
Text="{Binding Price, StringFormat='¥ 0.0'}" FontWeight="Bold" FontSize="18"
Foreground="{DynamicResource DARKPrimary}" />
<!--<TextBlock x:Name="TxtDiscountPrice" Margin="5,0,0,0" FontWeight="Bold"
FontSize="18" Foreground="{DynamicResource DARKPrimary}">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource DiscountPriceConverter}">
<Binding Path="Price" />
<Binding Path="Discount" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</TextBlock>-->
</StackPanel>
<Border Grid.Row="3"
Margin="0,5,0,0"
HorizontalAlignment="Left"
Background="{DynamicResource SecondaryTrans}"
CornerRadius="2">
<!--<Border Grid.Row="3" Margin="0,5,0,0" HorizontalAlignment="Left"
Background="{DynamicResource SecondaryTrans}" CornerRadius="2">
<StackPanel Orientation="Horizontal">
<RepeatButton VerticalAlignment="Center"
Content="-"
Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnDecrease_Click" />
<TextBox Grid.Column="1"
Cursor="IBeam"
Background="#CDFFFFFF"
BorderThickness="0"
HorizontalContentAlignment="Center"
Text="{Binding Quantity}"
MinWidth="30" />
<RepeatButton Grid.Column="2"
VerticalAlignment="Center"
Content="+"
Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnIncrease_Click" />
<RepeatButton VerticalAlignment="Center" Content="-" Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnDecrease_Click" />
<TextBox Grid.Column="1" Cursor="IBeam" Background="#CDFFFFFF"
BorderThickness="0" HorizontalContentAlignment="Center"
Text="{Binding Quantity}" MinWidth="30" />
<RepeatButton Grid.Column="2" VerticalAlignment="Center" Content="+"
Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnIncrease_Click" />
</StackPanel>
</Border>
<Button Grid.Row="4"
Margin="0,7,0,0"
Padding="7,5"
Cursor="Hand"
HorizontalAlignment="Left"
pu:ButtonHelper.Icon="&#xef60;"
Style="{DynamicResource ThemedButtonStyle}"
Content="购买"
Click="BtnBuy_Click" />
</Border>-->
<Button Grid.Row="4" Margin="0,7,0,0" Padding="7,5" Cursor="Hand"
HorizontalAlignment="Left" pu:ButtonHelper.Icon="&#xEF61;"
Style="{DynamicResource ThemedButtonStyle}" Content="购买" Click="BtnBuy_Click" />
</Grid>
</Grid>
</Border>
<Border Background="{DynamicResource DARKPrimary}"
CornerRadius="5">
<Border Background="{DynamicResource DARKPrimary}" CornerRadius="5">
<Grid>
<Grid Grid.Column="1"
Margin="10,10,10,0">
<Grid Grid.Column="1" Margin="10,10,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@ -197,22 +118,13 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
FontSize="16"
Foreground="{DynamicResource DARKPrimaryText}"
Text="{Binding Name}" />
<ScrollViewer Grid.Row="1"
Grid.RowSpan="4"
Margin="0,7,0,0"
pu:ScrollBarHelper.ThumbBackground="#44FFFFFF"
pu:ScrollBarHelper.HoverThumbBackground="#88FFFFFF">
<TextBlock TextWrapping="Wrap"
Background="Transparent"
FontSize="12"
Padding="0"
Foreground="{DynamicResource DARKPrimaryText}"
Text="阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴" />
<TextBlock VerticalAlignment="Center" TextTrimming="CharacterEllipsis" FontSize="16"
Foreground="{DynamicResource DARKPrimaryText}" Text="{Binding Name}" />
<ScrollViewer Grid.Row="1" Grid.RowSpan="4" Margin="0,7,0,0"
pu:ScrollBarHelper.ThumbBackground="#44FFFFFF"
pu:ScrollBarHelper.HoverThumbBackground="#88FFFFFF">
<TextBlock TextWrapping="Wrap" Background="Transparent" FontSize="12" Padding="0"
Foreground="{DynamicResource DARKPrimaryText}" Text="{Binding Description}" />
</ScrollViewer>
</Grid>
</Grid>
@ -223,49 +135,35 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border x:Name="BdrImage"
Margin="10,35,0,10"
CornerRadius="5"
<Border x:Name="BdrImage" Margin="10,35,0,10" CornerRadius="5"
Visibility="{Binding IsChecked,Converter={StaticResource {x:Static pu:ConverterKeys.TrueToCollapseConverter}}, ElementName=TbtnDetail}">
<Image Source="{Binding ImageShot}"
Stretch="UniformToFill"/>
<Image Source="{Binding ImageSource}" Stretch="UniformToFill" />
</Border>
<ToggleButton x:Name="TbtnDetail"
Grid.ColumnSpan="2"
Margin="0,5,8,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Width="30"
Height="30"
Padding="0"
FontSize="22"
Foreground="{DynamicResource PrimaryText}"
Background="Transparent"
ToolTip="物品详情"
pu:ToggleButtonHelper.CornerRadius="5"
pu:ToggleButtonHelper.CheckedForeground="{DynamicResource DARKPrimaryText}"
pu:IconHelper.Margin="0"
FontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
Content="&#xeb47;" />
<ToggleButton x:Name="TbtnStar" Grid.ColumnSpan="2" Margin="0,5,32,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="30" Height="30" Padding="0" FontSize="22"
Foreground="#FFB300" Background="Transparent" ToolTip="收藏食物"
pu:ToggleButtonHelper.CornerRadius="5" pu:ToggleButtonHelper.CheckedContent="&#xF186;"
pu:IconHelper.Margin="0" FontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
Content="&#xF18B;" IsChecked="{Binding Star}" />
<ToggleButton x:Name="TbtnDetail" Grid.ColumnSpan="2" Margin="0,5,8,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="30" Height="30" Padding="0" FontSize="22"
Foreground="{DynamicResource PrimaryText}" Background="Transparent" ToolTip="物品详情"
pu:ToggleButtonHelper.CornerRadius="5"
pu:ToggleButtonHelper.CheckedForeground="{DynamicResource DARKPrimaryText}"
pu:IconHelper.Margin="0" FontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
Content="&#xEF78;" />
</Grid>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Discount}"
Value="100">
<Setter TargetName="TxtPrice"
Property="Foreground"
Value="{DynamicResource DARKPrimary}" />
<Setter TargetName="TxtPrice"
Property="FontSize"
Value="18" />
<Setter TargetName="TxtPrice"
Property="TextDecorations"
Value="None" />
<Setter TargetName="TxtDiscountPrice"
Property="Visibility"
Value="Collapsed" />
<!--<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Discount}" Value="100">
<Setter TargetName="TxtPrice" Property="Foreground" Value="{DynamicResource DARKPrimary}" />
<Setter TargetName="TxtPrice" Property="FontSize" Value="18" />
<Setter TargetName="TxtPrice" Property="TextDecorations" Value="None" />
-->
<!--<Setter TargetName="TxtDiscountPrice" Property="Visibility" Value="Collapsed" />-->
<!--
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate.Triggers>-->
</DataTemplate>
</Window.Resources>
<Grid>
@ -277,76 +175,60 @@
<Grid Margin="12, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="3*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<TextBlock Text="商品分类"
FontSize="18"
Foreground="{DynamicResource DARKPrimary}" />
<ListBox x:Name="LsbCategory"
Grid.Row="1"
Margin="-12,10,-12,0"
Background="Transparent"
BorderThickness="0"
SelectedIndex="0"
pu:ListBoxHelper.ItemsPadding="15,8"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}">
<ListBoxItem Content="食物" />
<ListBoxItem Content="饮料" />
<ListBoxItem Content="药品" />
<TextBlock Text="商品分类" FontSize="18" Margin="10" Foreground="{DynamicResource DARKPrimary}" />
<ListBox x:Name="LsbCategory" Grid.Row="1" Margin="-12,10,-12,0" Background="Transparent"
BorderThickness="0" SelectedIndex="0" pu:ListBoxHelper.ItemsPadding="15,8"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectionChanged="LsbSortRule_SelectionChanged">
<ListBoxItem Content="全部" />
<ListBoxItem Content="收藏" />
<ListBoxItem Content="正餐" />
<ListBoxItem Content="零食" />
<ListBoxItem Content="饮料" />
<ListBoxItem Content="功能性" />
<ListBoxItem Content="药品" />
</ListBox>
<TextBlock Grid.Row="2"
Text="排序方式"
FontSize="18"
Foreground="{DynamicResource DARKPrimary}" />
<Border Grid.Row="3"
Margin="0,10,0,0"
MinHeight="100"
CornerRadius="5">
<TextBlock Grid.Row="2" Text="排序方式" Margin="10" FontSize="18" Foreground="{DynamicResource DARKPrimary}" />
<Border Grid.Row="3" Margin="0,10,0,0" MinHeight="100" CornerRadius="5">
<Grid VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ListBox x:Name="LsbSortRule" Background="Transparent"
BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5"
pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0">
<ListBox x:Name="LsbSortRule" Background="Transparent" BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5" pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0" SelectionChanged="LsbSortRule_SelectionChanged">
<ListBoxItem Content="按名字" />
<ListBoxItem Content="按价格" />
<ListBoxItem Content="按饱腹度" />
<ListBoxItem Content="按口渴度" />
<ListBoxItem Content="按体力" />
<ListBoxItem Content="按心情" />
<ListBoxItem Content="按健康" />
</ListBox>
<Rectangle Grid.Column="1"
Margin="10,0,10,0"
Width="1"
Fill="{DynamicResource DARKPrimaryTrans4}" />
<ListBox x:Name="LsbSortAsc"
Grid.Column="2"
Background="Transparent"
BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5"
pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0">
<Rectangle Grid.Column="1" Margin="10,0,10,0" Width="1" Fill="{DynamicResource DARKPrimaryTrans4}" />
<ListBox x:Name="LsbSortAsc" Grid.Column="2" Background="Transparent" BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5" pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0" SelectionChanged="LsbSortRule_SelectionChanged">
<ListBoxItem Content="升序" />
<ListBoxItem Content="降序" />
</ListBox>
</Grid>
</Border>
</Grid>
<Grid Margin="10"
Grid.Column="1">
<Grid Margin="10" Grid.Column="1">
<ScrollViewer>
<ItemsControl x:Name="IcCommodity"
VerticalAlignment="Top">
<ItemsControl x:Name="IcCommodity" VerticalAlignment="Top">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<local:AutoUniformGrid ItemsMinWidth="250" />
@ -354,10 +236,8 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Height="140"
Margin="0,0,10,10"
Content="{Binding}"
ContentTemplate="{StaticResource CommodityDataTemplate}" />
<ContentControl Height="140" Margin="0,0,10,10" Content="{Binding}"
ContentTemplate="{StaticResource CommodityDataTemplate}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

View File

@ -14,6 +14,10 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using VPet_Simulator.Core;
using VPet_Simulator.Windows.Interface;
using static VPet_Simulator.Core.GraphCore;
using static VPet_Simulator.Core.IGraph;
namespace VPet_Simulator.Windows
{
@ -23,45 +27,124 @@ namespace VPet_Simulator.Windows
public partial class winBetterBuy : WindowX
{
private TextBox _searchTextBox;
MainWindow mw;
private bool AllowChange = false;
public winBetterBuy(MainWindow mw)
{
InitializeComponent();
IcCommodity.ItemsSource = new List<BetterBuyItem>()
this.mw = mw;
LsbSortRule.SelectedIndex = mw.Set["betterbuy"].GetInt("lastorder");
LsbSortAsc.SelectedIndex = mw.Set["betterbuy"].GetBool("lastasc") ? 0 : 1;
AllowChange = true;
}
public void Show(Food.FoodType type)
{
LsbCategory.SelectedIndex = (int)type;
//OrderItemSource(type, LsbSortRule.SelectedIndex, LsbSortAsc.SelectedIndex);
Show();
}
public void OrderItemSource(Food.FoodType type, int sortrule, bool sortasc)
{
Task.Run(() =>
{
new BetterBuyItem()
IList<Food> foods;
switch (type)
{
Name = "商品A",
Description = "一件商品",
ImageShot = new BitmapImage(new Uri("/VPet-Simulator.Windows;component/Res/tony.bmp", UriKind.RelativeOrAbsolute)),
},
new BetterBuyItem()
case Food.FoodType.Food:
foods = mw.Foods;
break;
case Food.FoodType.Star:
//List<Food> lf = new List<Food>();
//foreach (var sub in mw.Set["betterbuy"].FindAll("star"))
//{
// var str = sub.Info;
// var food = mw.Foods.FirstOrDefault(x => x.Name == str);
// if (food != null)
// lf.Add(food);
//}
//foods = lf;
foods = mw.Foods.FindAll(x => x.Star);
break;
default:
foods = mw.Foods.FindAll(x => x.Type == type);
break;
}
IOrderedEnumerable<Food> ordered;
switch (sortrule)
{
Name = "商品B",
Description = "一件商品",
ImageShot = new BitmapImage(new Uri("/VPet-Simulator.Windows;component/Res/tony.bmp", UriKind.RelativeOrAbsolute)),
},
};
case 0:
if (sortasc)
ordered = foods.OrderBy(x => x.Name);
else
ordered = foods.OrderByDescending(x => x.Name);
break;
case 1:
if (sortasc)
ordered = foods.OrderBy(x => x.Price);
else
ordered = foods.OrderByDescending(x => x.Price);
break;
case 2:
if (sortasc)
ordered = foods.OrderBy(x => x.StrengthFood);
else
ordered = foods.OrderByDescending(x => x.StrengthFood);
break;
case 3:
if (sortasc)
ordered = foods.OrderBy(x => x.StrengthDrink);
else
ordered = foods.OrderByDescending(x => x.StrengthDrink);
break;
case 4:
if (sortasc)
ordered = foods.OrderBy(x => x.Strength);
else
ordered = foods.OrderByDescending(x => x.Strength);
break;
case 5:
if (sortasc)
ordered = foods.OrderBy(x => x.Feeling);
else
ordered = foods.OrderByDescending(x => x.Feeling);
break;
default:
if (sortasc)
ordered = foods.OrderBy(x => x.Health);
else
ordered = foods.OrderByDescending(x => x.Health);
break;
}
Dispatcher.Invoke(() =>
{
IcCommodity.ItemsSource = ordered;
});
});
}
private void RbtnIncrease_Click(object sender, RoutedEventArgs e)
{
var repeatButton = sender as RepeatButton;
var item = repeatButton.DataContext as BetterBuyItem;
item.Quantity = Math.Max(1, item.Quantity + 1);
}
//private void RbtnIncrease_Click(object sender, RoutedEventArgs e)
//{
// var repeatButton = sender as RepeatButton;
// var item = repeatButton.DataContext as BetterBuyItem;
// item.Quantity = Math.Max(1, item.Quantity + 1);
//}
private void RbtnDecrease_Click(object sender, RoutedEventArgs e)
{
var repeatButton = sender as RepeatButton;
var item = repeatButton.DataContext as BetterBuyItem;
item.Quantity = Math.Max(1, item.Quantity - 1);
}
//private void RbtnDecrease_Click(object sender, RoutedEventArgs e)
//{
// var repeatButton = sender as RepeatButton;
// var item = repeatButton.DataContext as BetterBuyItem;
// item.Quantity = Math.Max(1, item.Quantity - 1);
//}
private void BtnBuy_Click(object sender, RoutedEventArgs e)
{
this.Hide();
var Button = sender as Button;
var item = Button.DataContext as Food;
IRunImage eat = (IRunImage)mw.Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
var b = mw.Main.FindDisplayBorder(eat);
eat.Run(b, item.ImageSource, mw.Main.DisplayToNomal);
}
private void BtnSearch_Click(object sender, RoutedEventArgs e)
@ -88,47 +171,22 @@ namespace VPet_Simulator.Windows
{
_searchTextBox = sender as TextBox;
}
}
public class BetterBuyItem
: NotifyPropertyChangedBase
{
/// <summary>
/// 物品图像
/// </summary>
public ImageSource ImageShot { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 显示名称
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// 物品描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 物品分类
/// </summary>
public string[] Categories { get; set; }
/// <summary>
/// 物品价格
/// </summary>
public double Price { get; set; }
/// <summary>
/// 商品实际价格
/// </summary>
public double RealPrice { get; set; }
/// <summary>
/// 选择的物品个数
/// </summary>
public int Quantity { get => _quantity; set => Set(ref _quantity, value); }
private int _quantity;
/// <summary>
/// 商品折扣 (100%)
/// </summary>
public int Discount { get; set; }
private void LsbSortRule_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!AllowChange)
return;
int order = LsbSortRule.SelectedIndex;
bool asc = LsbSortAsc.SelectedIndex == 0;
mw.Set["betterbuy"].SetInt("lastorder", order);
mw.Set["betterbuy"].SetBool("lastasc", asc);
OrderItemSource((Food.FoodType)LsbCategory.SelectedIndex, order, asc);
}
private void WindowX_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
Hide();
}
}
}

View File

@ -0,0 +1,63 @@
food:|type#Drink:|name#ab钙奶:|price#5.0:|desc#健康美味,经济实惠:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#5:|Health#1:|Feeling#1:|
food:|type#Drink:|name#果汁:|price#7.0:|desc#那个那个那个那个果汁分你一半:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#4:|Health#3:|Feeling#3:|
food:|type#Drink:|name#可乐:|price#6.5:|desc#蓝色那个在日用品区谢谢:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#2:|Health#-1:|Feeling#20:|
food:|type#Drink:|name#凉茶:|price#12.0:|desc#怕上火,喝广东咖啡!:|Exp#50:|Strength#50:|StrengthDrink#50:|StrengthFood#1:|Health#5:|Feeling#5:|
food:|type#Drink:|name#维他奶:|price#5.5:|desc#:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#5:|Health#1:|Feeling#1:|
food:|type#Drink:|name#雷碧:|price#5.5:|desc#透心扬,心飞凉:|Exp#6:|Strength#6:|StrengthDrink#6:|StrengthFood#3:|Health#-1:|Feeling#15:|
food:|type#Drink:|name#盐汽水:|price#6.0:|desc#我一口盐汽水!:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#3:|Health#-0.5:|Feeling#15:|
food:|type#Drink:|name#椰汁:|price#8.0:|desc#白白胖胖曲线圆润要喝不加香油的椰O牌椰汁:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#4:|Health#2:|Feeling#10:|
food:|type#Functional:|name#咖啡饮料:|price#9.0:|desc#不小心倒在键盘上效果更好哦!:|Exp#80:|Strength#80:|StrengthDrink#80:|StrengthFood#3:|Health#-1:|Feeling#:|
food:|type#Functional:|name#大鹏特饮:|price#11.5:|desc#困了累了,大鹏特饮:|Exp#120:|Strength#120:|StrengthDrink#120:|StrengthFood#3:|Health#-1:|Feeling#10:|
food:|type#Functional:|name#黄牛:|price#13.0:|desc#放心,喝他的饮料不是他出钱你出命:|Exp#160:|Strength#160:|StrengthDrink#160:|StrengthFood#3:|Health#-1:|Feeling#10:|
food:|type#Functional:|name#能量饮料:|price#14.0:|desc#:|Exp#280:|Strength#280:|StrengthDrink#280:|StrengthFood#3:|Health#-5:|Feeling#8:|
food:|type#Functional:|name#土力架:|price#11.5:|desc#横扫自己,做回饥饿:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#80:|Health#0:|Feeling#:|
food:|type#Functional:|name#压缩饼干:|price#12.5:|desc#饼干.rar:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#100:|Feeling#:|
food:|type#Snack:|name#爆米花:|price#5.5:|desc#电影必备,吃不完也要买:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#30:|Health#-1:|Feeling#10:|
food:|type#Snack:|name#冰激凌:|price#6.0:|desc#中国人免费领:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#24:|Health#-0.5:|Feeling#20:|
food:|type#Snack:|name#瓜子:|price#5.5:|desc#嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱嘎吱:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#26:|Feeling#15:|
food:|type#Snack:|name#核桃仁:|price#8.5:|desc#这次不用自己带锤子了:|Exp#80:|Strength#80:|StrengthDrink#80:|StrengthFood#5:|Health#5:|Feeling#:|
food:|type#Snack:|name#火腿肠:|price#6.0:|desc#:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#38:|Health#-0.5:|Feeling#:|
food:|type#Snack:|name#花生米:|price#3.0:|desc#但凡有一粒花生米。。。:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#20:|Health#-0.5:|Feeling#:|
food:|type#Snack:|name#戒指糖:|price#1.5:|desc#这不比那个不能吃的破石头有用多了:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#10:|Health#-0.5:|Feeling#:|
food:|type#Snack:|name#老冰棍:|price#3.0:|desc#厂家正在考虑与辐射4联动中:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#5:|Health#-0.5:|Feeling#2:|
food:|type#Snack:|name#绿色心情:|price#2.5:|desc#几年前还是一块钱的呜呜呜:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#5:|Health#-0.5:|Feeling#5:|
food:|type#Snack:|name#奶片:|price#2.5:|desc#希望你们永远不会知道这个药。。。:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#8:|Feeling#7:|
food:|type#Snack:|name#奶糖:|price#4.5:|desc#小白兔牌:|Exp#30:|Strength#30:|StrengthDrink#30:|StrengthFood#15:|Feeling#15:|
food:|type#Snack:|name#牛板筋:|price#2.5:|desc#只要来一根,大家都是好兄弟:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#8:|Health#-1:|Feeling#10:|
food:|type#Snack:|name#牛扎糖:|price#3.0:|desc#好甜,像你一样:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#8:|Feeling#15:|
food:|type#Snack:|name#泡泡糖:|price#3.5:|desc#就吹吧你:|Exp#30:|Strength#30:|StrengthDrink#30:|StrengthFood#5:|Feeling#17:|
food:|type#Snack:|name#巧克力:|price#7.0:|desc#纵享丝滑:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#38:|Feeling#15:|
food:|type#Snack:|name#软糖:|price#2.5:|desc#come on baby~:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#12:|Feeling#5:|
food:|type#Snack:|name#薯片:|price#5.5:|desc#开趴必备:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#28:|Feeling#5:|
food:|type#Snack:|name#娃仔小馒头:|price#3.5:|desc#这是我们的宝贝~~:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#12:|Feeling#10:|
food:|type#Snack:|name#小布丁:|price#3.0:|desc#没关系,小小的也很好吃:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#10:|Feeling#5:|
food:|type#Snack:|name#雪饼:|price#4.0:|desc#小时候的一口吃不下:|Exp#20:|Strength#20:|StrengthDrink#20:|StrengthFood#15:|Feeling#10:|
food:|type#Snack:|name#散射雪糕:|price#4.5:|desc#三倍的快乐:|Exp#10:|Strength#10:|StrengthDrink#10:|StrengthFood#20:|Feeling#10:|
food:|type#Snack:|name#猪肉脯:|price#9.5:|desc#你感觉在吃牛皮。。:|Exp#30:|Strength#30:|StrengthFood#48:|Feeling#15:|
food:|type#Meal:|name#臭豆腐:|price#14.5:|desc#闻起来臭,吃起来也臭,就是越吃越香。:|Exp#100:|Strength#100:|StrengthFood#55:|Feeling#5:|
food:|type#Meal:|name#东坡肘子:|price#30.5:|desc#小知识:东坡肘子其实并非苏东坡之功,而是其妻子王弗的妙作:|Exp#300:|Strength#300:|StrengthFood#85:|Health#1:|Feeling#30:|
food:|type#Meal:|name#番茄意面:|price#28.0:|desc#只要不是巧克力酱什么都好说。。:|Exp#200:|Strength#200:|StrengthFood#110:|Health#1:|Feeling#20:|
food:|type#Meal:|name#红烧狮子头:|price#32.0:|desc#芋头西米露:|Exp#300:|Strength#300:|StrengthFood#90:|Health#1:|Feeling#30:|
food:|type#Meal:|name#红烧牛肉:|price#37.5:|desc#不是4块钱的请放心:|Exp#300:|Strength#300:|StrengthFood#130:|Health#1:|Feeling#30:|
food:|type#Meal:|name#华夫饼:|price#22.0:|desc#蜜饼!小刻最爱!:|Exp#140:|Strength#140:|StrengthFood#80:|Feeling#30:|
food:|type#Meal:|name#鸡翅:|price#16.5:|desc#红烧翅膀~我喜欢吃~:|Exp#60:|Strength#60:|StrengthFood#75:|Feeling#20:|
food:|type#Meal:|name#煎西冷牛排:|price#52.0:|desc#开瓶可乐吧,上流:|Exp#450:|Strength#450:|StrengthFood#150:|Health#5:|Feeling#40:|
food:|type#Meal:|name#辣子鸡:|price#35.5:|desc#当红辣子鸡哟:|Exp#300:|Strength#300:|StrengthFood#120:|Feeling#40:|
food:|type#Meal:|name#罗宋汤:|price#28.5:|desc#咲夜!“给我吃!”:|Exp#200:|Strength#200:|StrengthFood#110:|Feeling#30:|
food:|type#Meal:|name#麻婆豆腐:|price#26.0:|desc#麻婆豆腐之所以叫麻婆豆腐是因为麻婆喜欢吃:|Exp#150:|Strength#150:|StrengthFood#110:|Feeling#30:|
food:|type#Meal:|name#梅菜扣肉:|price#29.5:|desc#不会咬人的谢谢:|Exp#250:|Strength#250:|StrengthFood#100:|Feeling#25:|
food:|type#Meal:|name#面包:|price#14.5:|desc#你还记得你吃过多少块面包吗:|Strength#:|StrengthFood#100:|
food:|type#Meal:|name#南瓜吐司:|price#20.5:|desc#加了南瓜!是的!我加了南瓜!:|Exp#100:|Strength#100:|StrengthFood#100:|Feeling#15:|
food:|type#Meal:|name#酿豆腐:|price#21.0:|desc#你中有我,我中有你:|Exp#150:|Strength#150:|StrengthFood#80:|Feeling#15:|
food:|type#Meal:|name#披萨:|price#31.5:|desc#不要放菠萝!!!:|Exp#300:|Strength#300:|StrengthFood#100:|Feeling#20:|
food:|type#Meal:|name#三明治:|price#18.5:|desc#两面包夹芝士:|Exp#100:|Strength#100:|StrengthFood#85:|Feeling#15:|
food:|type#Meal:|name#沙拉:|price#38.5:|desc#沙拉沙拉啦啦啦:|Exp#300:|Strength#300:|StrengthFood#80:|Health#10:|Feeling#5:|
food:|type#Meal:|name#烧鹅:|price#33.0:|desc#官方特意调整成鹅的,这让我文案不好做啊,我就要在这里写上烧鸡两个大字!:|Exp#300:|Strength#300:|StrengthFood#100:|Feeling#30:|
food:|type#Meal:|name#酸菜鱼:|price#34.5:|desc#人人皆是酸菜鱼:|Exp#300:|Strength#300:|StrengthFood#110:|Feeling#35:|
food:|type#Meal:|name#西冷牛排:|price#52.5:|desc#开瓶拉菲吧,上流:|Exp#500:|Strength#500:|StrengthFood#140:|Health#5:|Feeling#40:|
food:|type#Meal:|name#香煎牛仔骨:|price#68.0:|desc#开瓶红酒吧,上流:|Exp#600:|Strength#600:|StrengthFood#160:|Health#10:|Feeling#50:|
food:|type#Meal:|name#盐焗鸡:|price#31.0:|desc#谁说的腌鸡!站出来!:|Exp#300:|Strength#300:|StrengthFood#90:|Feeling#30:|
food:|type#Meal:|name#芝士焗虾:|price#25.5:|desc#焗虾闭嘴:|Exp#250:|Strength#250:|StrengthFood#70:|Feeling#30:|
food:|type#Meal:|name#纸包鸡:|price#24.0:|desc#纸包鸡包纸包鸡包鸡包纸:|Exp#200:|Strength#200:|StrengthFood#75:|Feeling#30:|
food:|type#Meal:|name#炸鸡腿:|price#12.5:|desc#:|Exp#100:|Strength#100:|StrengthFood#40:|Feeling#20:|
food:|type#Meal:|name#汉堡:|price#15.5:|desc#还想要汉O王这价格不是华O士已经对你很好了。:|Exp#100:|Strength#100:|StrengthFood#60:|Feeling#20:|

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ChatGPT.API.Framework" version="1.0.2" targetFramework="net48" />
<package id="ChatGPT.API.Framework" version="1.0.4" targetFramework="net48" />
<package id="Facepunch.Steamworks" version="2.3.3" targetFramework="net48" />
<package id="Facepunch.Steamworks.win32" version="2.3.3" targetFramework="net48" />
<package id="LinePutScript" version="1.8.1" targetFramework="net48" />
<package id="LinePutScript" version="1.8.2" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="Panuon.WPF" version="1.0.1" targetFramework="net48" />
<package id="Panuon.WPF.UI" version="1.1.11.11" targetFramework="net48" />