diff --git a/README.md b/README.md index 606244d..1b42dc8 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ | 指令 | 描述 | Tip | | --- | --- | --- | | @小真寻 开通农场 | 首次开通农场 | | +| 我的农场 | 你的农场 | | +| 农场详述 | 农场详细信息 | | | 我的农场币 | 查询农场币 | | | 种子商店 [筛选关键字] [页数] or [页数] | 查看种子商店 | 当第一个参数为非整数时,会默认进入筛选状态。页数不填默认为1 | | 购买种子 [种子名称] [数量] | 购买种子 | 数量不填默认为1 | @@ -62,7 +64,7 @@ | 播种 [种子名称] [数量] | 播种种子 | 数量不填默认将最大可能播种 | | 收获 | 收获成熟作物 | | | 铲除 | 铲除荒废作物 | | -| 我的作物 | | | +| 我的作物 | 你的作物 | | | 出售作物 [作物名称] [数量] | 从仓库里向系统售卖作物 | 不填写作物名将售卖仓库种全部作物 填作物名不填数量将指定作物全部出售 | | @美波理 偷菜 | 偷别人的菜 | 每人每天只能偷5次 | | 购买农场币 | 将真寻金币兑换成农场币 | 兑换比例默认为1:2 手续费默认20% | @@ -90,7 +92,7 @@ - [x] 完善我的农场图片,例如左上角显示用户数据 - [ ] 完善升级数据、作物数据、作物图片 -- [ ] 签到功能 +- [x] 签到功能 - [ ] 添加渔场功能 - [ ] 增加活动、交易行功能 - [ ] 增加交易行总行功能 diff --git a/farm/farm.py b/farm/farm.py index 306c28d..fac1c10 100644 --- a/farm/farm.py +++ b/farm/farm.py @@ -184,6 +184,7 @@ class CFarmManager: "作物名称", "成熟时间", "土地状态", + "被偷数量", "剩余产出", ] @@ -193,65 +194,65 @@ class CFarmManager: for i in range(1, soilNumber + 1): soilInfo = await g_pDBService.userSoil.getUserSoil(uid, i) - if not soilInfo: - continue - - if soilInfo["soilLevel"] == 1: - iconPath = g_sResourcePath / f"soil/TODO.png" - else: - iconPath = g_sResourcePath / f"soil/普通土地.png" - - if iconPath.exists(): - icon = (iconPath, 33, 33) - - plantName = soilInfo.get("plantName", "-") - - if plantName == "-": - matureTime = "-" - soilStatus = "-" - plantNumber = "-" - else: - matureTime = g_pToolManager.dateTime().fromtimestamp(int(soilInfo.get("matureTime", 0))).strftime("%Y-%m-%d %H:%M:%S.%f") - soilStatus = await g_pDBService.userSoil.getUserSoilStatus(uid, i) - - num = await g_pDBService.userSteal.getTotalStolenCount(uid, i) - planInfo = await g_pDBService.plant.getPlantByName(plantName) - - if not planInfo: - plantNumber = f"None / {num}" + if soilInfo: + if soilInfo["soilLevel"] == 1: + iconPath = g_sResourcePath / f"soil/TODO.png" else: - plantNumber = f"{planInfo['harvest']} / {num}" + iconPath = g_sResourcePath / f"soil/普通土地.png" - dataList.append( - [ - icon, - i, - plantName, - matureTime, - soilStatus, - plantNumber, - ]) + if iconPath.exists(): + icon = (iconPath, 33, 33) - if len(dataList) >= 15: + plantName = soilInfo.get("plantName", "-") + + if plantName == "-": + matureTime = "-" + soilStatus = "-" + totalNumber = "-" + plantNumber = "-" + else: + matureTime = g_pToolManager.dateTime().fromtimestamp(int(soilInfo.get("matureTime", 0))).strftime("%Y-%m-%d %H:%M:%S") + soilStatus = await g_pDBService.userSoil.getUserSoilStatus(uid, i) + + totalNumber = await g_pDBService.userSteal.getTotalStolenCount(uid, i) + planInfo = await g_pDBService.plant.getPlantByName(plantName) + + if not planInfo: + plantNumber = f"None" + else: + plantNumber = f"{planInfo['harvest']}" + + dataList.append( + [ + icon, + i, + plantName, + matureTime, + soilStatus, + totalNumber, + plantNumber, + ]) + + if len(dataList) >= 15: + result = await ImageTemplate.table_page( + "土地详细信息", + "", + columnName, + dataList, + ) + + info.append(result.copy()) + dataList.clear() + + if i >= soilNumber: result = await ImageTemplate.table_page( "土地详细信息", - "测试N\n测试2", + "", columnName, dataList, ) - info.append(result) - dataList.clear() - - if i >= 30: - result = await ImageTemplate.table_page( - "土地详细信息", - "测试N\n测试2", - columnName, - dataList, - ) - - info.append(result) + info.append(result.copy()) dataList.clear() return info diff --git a/resource/db/plant.db b/resource/db/plant.db index 46975e9..a861423 100644 Binary files a/resource/db/plant.db and b/resource/db/plant.db differ diff --git a/resource/plant/香粽龙舟/1.png b/resource/plant/香粽龙舟/1.png new file mode 100644 index 0000000..2feafb4 Binary files /dev/null and b/resource/plant/香粽龙舟/1.png differ diff --git a/resource/plant/香粽龙舟/2.png b/resource/plant/香粽龙舟/2.png new file mode 100644 index 0000000..64b9a2a Binary files /dev/null and b/resource/plant/香粽龙舟/2.png differ diff --git a/resource/plant/香粽龙舟/3.png b/resource/plant/香粽龙舟/3.png new file mode 100644 index 0000000..e090a79 Binary files /dev/null and b/resource/plant/香粽龙舟/3.png differ diff --git a/resource/plant/香粽龙舟/4.png b/resource/plant/香粽龙舟/4.png new file mode 100644 index 0000000..8619dec Binary files /dev/null and b/resource/plant/香粽龙舟/4.png differ diff --git a/resource/plant/香粽龙舟/5.png b/resource/plant/香粽龙舟/5.png new file mode 100644 index 0000000..f857a33 Binary files /dev/null and b/resource/plant/香粽龙舟/5.png differ diff --git a/resource/soil/普通土地-施肥.png b/resource/soil/普通土地-施肥.png new file mode 100644 index 0000000..55a173c Binary files /dev/null and b/resource/soil/普通土地-施肥.png differ diff --git a/resource/soil/缺水-普通土地.png b/resource/soil/普通土地-缺水.png similarity index 100% rename from resource/soil/缺水-普通土地.png rename to resource/soil/普通土地-缺水.png diff --git a/resource/soil/浇水.png b/resource/soil/浇水.png deleted file mode 100644 index d40b9f1..0000000 Binary files a/resource/soil/浇水.png and /dev/null differ diff --git a/resource/soil/浇水2.png b/resource/soil/浇水2.png deleted file mode 100644 index 6e69f28..0000000 Binary files a/resource/soil/浇水2.png and /dev/null differ diff --git a/resource/soil/紫色土地.png b/resource/soil/紫金土地-施肥.png similarity index 100% rename from resource/soil/紫色土地.png rename to resource/soil/紫金土地-施肥.png diff --git a/resource/soil/紫金土地-缺水.png b/resource/soil/紫金土地-缺水.png new file mode 100644 index 0000000..17f49d0 Binary files /dev/null and b/resource/soil/紫金土地-缺水.png differ diff --git a/resource/soil/紫金土地.png b/resource/soil/紫金土地.png new file mode 100644 index 0000000..3dd7aab Binary files /dev/null and b/resource/soil/紫金土地.png differ diff --git a/resource/soil/红土地-施肥.png b/resource/soil/红土地-施肥.png new file mode 100644 index 0000000..fac008b Binary files /dev/null and b/resource/soil/红土地-施肥.png differ diff --git a/resource/soil/红土缺水.png b/resource/soil/红土地-缺水.png similarity index 100% rename from resource/soil/红土缺水.png rename to resource/soil/红土地-缺水.png diff --git a/resource/soil/红土地.png b/resource/soil/红土地.png new file mode 100644 index 0000000..c589d03 Binary files /dev/null and b/resource/soil/红土地.png differ diff --git a/resource/soil/红色土地.png b/resource/soil/红色土地.png deleted file mode 100644 index 7344aed..0000000 Binary files a/resource/soil/红色土地.png and /dev/null differ diff --git a/resource/soil/蓝晶土地-施肥.png b/resource/soil/蓝晶土地-施肥.png new file mode 100644 index 0000000..32205fd Binary files /dev/null and b/resource/soil/蓝晶土地-施肥.png differ diff --git a/resource/soil/蓝晶土地-缺水.png b/resource/soil/蓝晶土地-缺水.png new file mode 100644 index 0000000..44287e2 Binary files /dev/null and b/resource/soil/蓝晶土地-缺水.png differ diff --git a/resource/soil/蓝晶土地.png b/resource/soil/蓝晶土地.png new file mode 100644 index 0000000..48d9fe4 Binary files /dev/null and b/resource/soil/蓝晶土地.png differ diff --git a/resource/soil/肥沃土地.png b/resource/soil/金土地-施肥.png similarity index 100% rename from resource/soil/肥沃土地.png rename to resource/soil/金土地-施肥.png diff --git a/resource/soil/黄土缺水.png b/resource/soil/金土地-缺水.png similarity index 100% rename from resource/soil/黄土缺水.png rename to resource/soil/金土地-缺水.png diff --git a/resource/soil/黄土 肥沃.png b/resource/soil/金土地.png similarity index 100% rename from resource/soil/黄土 肥沃.png rename to resource/soil/金土地.png diff --git a/resource/soil/黑土地-施肥.png b/resource/soil/黑土地-施肥.png new file mode 100644 index 0000000..691aff3 Binary files /dev/null and b/resource/soil/黑土地-施肥.png differ diff --git a/resource/soil/黑土地-缺水.png b/resource/soil/黑土地-缺水.png new file mode 100644 index 0000000..e3be4dd Binary files /dev/null and b/resource/soil/黑土地-缺水.png differ diff --git a/resource/soil/黑土.png b/resource/soil/黑土地.png similarity index 100% rename from resource/soil/黑土.png rename to resource/soil/黑土地.png