Browse Source

调整部分图标

master
秦汉 3 weeks ago
parent
commit
cf345a9823
  1. 14
      Build_God_Api/Build_God_Api/Controllers/CharacterController.cs
  2. 18
      Build_God_Api/Build_God_Api/Services/BattleService.cs
  3. 3
      Build_God_Game/src/api/character.ts
  4. 2
      Build_God_Game/src/assets/images/bag.svg
  5. 2
      Build_God_Game/src/assets/images/character.svg
  6. 2
      Build_God_Game/src/assets/images/meditation.svg
  7. 2
      Build_God_Game/src/assets/images/mission.svg
  8. 12
      Build_God_Game/src/assets/images/monster.svg
  9. 2
      Build_God_Game/src/assets/images/shop.svg
  10. 19
      Build_God_Game/src/stores/character.ts
  11. 4
      Build_God_Game/src/views/GameView.vue
  12. 2
      Build_God_Game/src/views/ShopView.vue

14
Build_God_Api/Build_God_Api/Controllers/CharacterController.cs

@ -46,6 +46,20 @@ namespace Build_God_Api.Controllers
return await characterService.GetCharacterById(characterId);
}
/// <summary>
/// 获取角色详情(包含境界和灵根信息)
/// </summary>
[HttpGet("{characterId}/detail")]
[Authorize]
public async Task<ActionResult<CharacterDto>> GetCharacterDetail(int characterId)
{
var characters = await characterService.GetCharacterListWithDetails(currentUserService.UserId);
var character = characters.FirstOrDefault(c => c.Id == characterId);
if (character == null)
return NotFound("角色不存在");
return character;
}
[HttpPost("register")]
[Authorize]
public async Task<ActionResult<bool>> RegisterCharacter([FromBody] CharacterRegisterDto dto)

18
Build_God_Api/Build_God_Api/Services/BattleService.cs

@ -241,6 +241,24 @@ namespace Build_God_Api.Services
}
}
}
// 检查任务是否全部完成
var allProgresses = await _db.Queryable<CharacterMissionProgress>()
.Where(cp => cp.CharacterId == characterId && cp.MissionId == dailyMission.MissionId)
.ToListAsync();
var missionConfigProgresses = await _db.Queryable<MissionProgress>()
.Where(p => p.MissionId == dailyMission.MissionId)
.ToListAsync();
bool allCompleted = missionConfigProgresses.All(p =>
allProgresses.Any(cp => cp.MissionProgressId == p.Id && cp.IsCompleted));
if (allCompleted)
{
dailyMission.Status = DailyMissionStatus.Completed;
await _db.Updateable(dailyMission).ExecuteCommandAsync();
}
}
}
}

3
Build_God_Game/src/api/character.ts

@ -49,6 +49,9 @@ export const characterApi = {
getCharacterList: (): Promise<CharacterDto[]> => {
return http.get('/character/list')
},
getCharacterDetail: (characterId: number): Promise<CharacterDto> => {
return http.get(`/character/${characterId}/detail`)
},
createCharacter: (data: CreateCharacterRequest): Promise<boolean> => {
return http.post('/character/register', data)
},

2
Build_God_Game/src/assets/images/bag.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

2
Build_God_Game/src/assets/images/character.svg

@ -1 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1774669454892" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24840" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M728.64 577.67a25.92 25.92 0 0 0-12.89-15.52c-2.93-3.53-5.78-7-8.45-10.2 93.14-102.54 90.44-275.69 7.75-388-97.19-132-274.55-133.19-366.92-3.75C290.45 222 257 308.7 269.75 388.8c9.24 58.07 32.18 127.4 75.58 172.94-36.54 77.4-94.83 143.81-137.62 217.8-19.06 33-51.87 83.41-35.8 123.93 35.5 89.57 250 47.27 315.51 41.71 88.27-7.5 174.73-17.66 262.06-32.56 34.43-5.87 76.15-8.32 94.25-42.15 47.89-89.47-51.15-215.58-115.09-292.8z m-233.87 208c-3.66 36.19-9.83 72.49-6.76 108.68q-23.45 1.86-46.76 3.58c-52.48 4-106.86 6.74-159.44 3.77-67.53-3.82-54.18-45.64-31.14-97.1 29.85-66.66 78-132.93 103.56-203.15 5 26 5.13 59.14 11.11 87.33-17 38.38-49.11 71.73-78.21 101.64-18.12 18.62-45.61 43-44.2 71.45 0.29 5.82 9 5.89 9.1 0 0.57-35.41 40.73-63.07 61.88-87.89 10.14-11.91 19.88-24.46 29.37-36.91a260.72 260.72 0 0 0 17.57-25.43c4.54-7.7 3.52-12.42 4-16.24-0.2 1.72 1.3 2.66 2.82 2.74 5.49 19.77 14.78 36.17 32.34 44.29 34.58 16 71.11-2.51 98.27-31.64a713.34 713.34 0 0 1-3.51 74.92z m-133-207.07c0.12-0.41 0.29-0.81 0.41-1.22a153.07 153.07 0 0 0 27 17.6c31.26 15.8 67.92 26.82 105.41 31.31-2.14 43.17-60.29 117.05-99.72 71.7-10.08-11.59-10.78-41.08-13.59-55.38-4.28-21.73-6.44-45.77-19.47-63.97z m44.09-34.2a140.9 140.9 0 0 1-14.46-9.81c14.18-25 26.69-50.69 35.31-78.65 1.4-4.54-5.69-6.48-7.11-2-8.41 26.89-20.67 51.32-34.55 75.13A168.46 168.46 0 0 1 357 497.86c30.66-38.35 57.58-79.88 79-124 2.34-4.82-4.81-9.07-7.24-4.23-21.51 42.91-48.64 81.14-78.11 118.47a243.13 243.13 0 0 1-16.01-31.1c10.81-13.52 16-30.2 23.8-46.53 13.87-29.17 31.45-56.32 49.51-83 2.72-4-3.76-7.74-6.49-3.79-15.55 22.55-30.71 45.38-43.59 69.59-9.28 17.44-15.56 37.81-27 54.11a384.72 384.72 0 0 1-16.59-55.2 192.62 192.62 0 0 1-3-19.31c11.24-30.45 42.29-52.7 62.45-77 24-28.94 45.51-59.87 70.32-88.19 2.8-3.2-1.84-7.91-4.7-4.7-31.88 35.83-58.39 76.24-92 110.53-13.52 13.8-27.67 27-37.23 42.84-1.89-52.87 15.94-107.75 47.16-153.71a17.38 17.38 0 0 0 9.72-7.14c75.56-113 234.55-107.43 310 1.55 78.64 113.56 68.79 296.2-66.77 362.29-61.04 29.78-146.88 19.01-204.33-14.9zM670 590.32c-10 24.39-13.7 51.89-31.77 72.84-23.34 27.06-57.87 41.9-80.06 6.91-7.85-12.37-12.34-27.34-16.14-41.73 33.74-1.21 66.61-8.31 95.23-22.78a246.11 246.11 0 0 0 30.37-18.34c0.72 0.96 1.63 2.11 2.37 3.1z m119.3 259.33c-9.41 12.2-126.28 23.89-150 27.78-27.72 4.56-55.88 7.92-84.12 10.83a29.23 29.23 0 0 0-12.18-21.9c-4.33-40.72 4.93-91.17 3.86-136.12a76.1 76.1 0 0 0 47.55 18.26c65.54 2 90.5-58.08 112.95-110.84C760.19 704.89 828 799.45 789.3 849.65z" fill="#49e356" p-id="24841"></path><path d="M383.91 739.39c-28.26 36.32-64.15 68.21-82.17 111.4-1.2 2.88 1.75 5.34 4.24 5.57l6.24 0.57c4.73 0.43 5.9-7.73 1.13-8.37l-0.79-0.11c18.75-39.74 50.08-70.37 76.45-105.12 2.22-2.91-2.83-6.86-5.1-3.94zM363.25 860.68l-8.83 27.86c-1.64 5.18 6.32 7.27 8.08 2.23l9.67-27.63c1.96-5.6-7.11-8.14-8.92-2.46z" fill="#49e356" p-id="24842"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1777209614455" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="46137" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 949.3504a437.3504 437.3504 0 1 1 0-874.7008 437.3504 437.3504 0 0 1 0 874.7008z m0-64a373.3504 373.3504 0 1 0 0-746.7008 373.3504 373.3504 0 0 0 0 746.7008z" fill="#ffffff" p-id="46138" data-spm-anchor-id="a313x.search_index.0.i20.4ba43a8195VCxk" class="selected"></path><path d="M512 716.8a183.5008 183.5008 0 0 0 181.0432-153.6H330.9568A183.5008 183.5008 0 0 0 512 716.8z m233.728-204.8a234.6496 234.6496 0 1 1-467.456 0h467.456z" fill="#ffffff" p-id="46139" data-spm-anchor-id="a313x.search_index.0.i22.4ba43a8195VCxk" class="selected"></path><path d="M375.4496 409.6a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4zM648.5504 409.6a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4z" fill="#ffffff" p-id="46140" data-spm-anchor-id="a313x.search_index.0.i21.4ba43a8195VCxk" class="selected"></path></svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

2
Build_God_Game/src/assets/images/meditation.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

2
Build_God_Game/src/assets/images/mission.svg

@ -1 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1777104274111" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21236" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M468.114286 621.714286c7.314286 21.942857 21.942857 36.571429 43.885714 36.571428s36.571429-14.628571 43.885714-36.571428L585.142857 219.428571c0-43.885714-36.571429-73.142857-73.142857-73.142857-43.885714 0-73.142857 36.571429-73.142857 80.457143l29.257143 394.971429zM512 731.428571c-43.885714 0-73.142857 29.257143-73.142857 73.142858s29.257143 73.142857 73.142857 73.142857 73.142857-29.257143 73.142857-73.142857-29.257143-73.142857-73.142857-73.142858z" p-id="21237" data-spm-anchor-id="a313x.search_index.0.i3.2c923a81AKleVA" class="selected" fill="#d81e06"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1777209717001" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="49805" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M468.114286 621.714286c7.314286 21.942857 21.942857 36.571429 43.885714 36.571428s36.571429-14.628571 43.885714-36.571428L585.142857 219.428571c0-43.885714-36.571429-73.142857-73.142857-73.142857-43.885714 0-73.142857 36.571429-73.142857 80.457143l29.257143 394.971429zM512 731.428571c-43.885714 0-73.142857 29.257143-73.142857 73.142858s29.257143 73.142857 73.142857 73.142857 73.142857-29.257143 73.142857-73.142857-29.257143-73.142857-73.142857-73.142858z" p-id="49806" data-spm-anchor-id="a313x.search_index.0.i24.4ba43a8195VCxk" class="selected" fill="#ffffff"></path></svg>

Before

Width:  |  Height:  |  Size: 912 B

After

Width:  |  Height:  |  Size: 913 B

12
Build_God_Game/src/assets/images/monster.svg

@ -1,11 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
<circle cx="32" cy="32" r="28" fill="#7c3aed" opacity="0.2"/>
<circle cx="32" cy="32" r="24" fill="#7c3aed" opacity="0.3"/>
<path d="M20 24c-4-4-8-2-8 4s4 8 8 8" stroke="#22c55e" stroke-width="3" stroke-linecap="round"/>
<circle cx="24" cy="26" r="3" fill="#22c55e"/>
<path d="M44 24c4-4 8-2 8 4s-4 8-8 8" stroke="#22c55e" stroke-width="3" stroke-linecap="round"/>
<circle cx="40" cy="26" r="3" fill="#22c55e"/>
<path d="M16 36c-4 4-2 8 4 8s8-4 8-8" stroke="#ef4444" stroke-width="3" stroke-linecap="round"/>
<path d="M48 36c4 4 2 8-4 8s-8-4-8-8" stroke="#ef4444" stroke-width="3" stroke-linecap="round"/>
<ellipse cx="32" cy="44" rx="12" ry="6" fill="#7c3aed"/>
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1777209142133" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="27995" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M329.142857 671.869388c-83.591837 0-151.510204-67.918367-151.510204-151.510204s67.918367-151.510204 151.510204-151.510204 151.510204 67.918367 151.510204 151.510204-67.918367 151.510204-151.510204 151.510204z m0-261.22449c-60.604082 0-109.714286 49.110204-109.714286 109.714286s49.110204 109.714286 109.714286 109.714285 109.714286-49.110204 109.714286-109.714285-49.110204-109.714286-109.714286-109.714286zM694.857143 671.869388c-83.591837 0-151.510204-67.918367-151.510204-151.510204s67.918367-151.510204 151.510204-151.510204 151.510204 67.918367 151.510204 151.510204-67.918367 151.510204-151.510204 151.510204z m0-261.22449c-60.604082 0-109.714286 49.110204-109.714286 109.714286s49.110204 109.714286 109.714286 109.714285 109.714286-49.110204 109.714286-109.714285-49.110204-109.714286-109.714286-109.714286z" fill="#ffffff" p-id="27996" data-spm-anchor-id="a313x.search_index.0.i4.4ba43a8195VCxk" class="selected"></path><path d="M644.179592 913.240816c-26.644898 0-50.155102-12.016327-66.351021-30.30204-16.195918 18.808163-39.706122 30.302041-66.35102 30.30204s-50.155102-12.016327-66.35102-30.30204c-16.195918 18.808163-39.706122 30.302041-66.351021 30.30204-48.065306 0-87.24898-39.183673-87.248979-87.248979v-36.571429c-133.746939-38.138776-198.530612-123.820408-198.530613-261.22449 0-230.4 187.559184-417.959184 417.959184-417.959183s417.959184 187.559184 417.959184 417.959183c0 137.404082-64.783673 223.085714-198.530613 261.22449v36.571429c1.044898 48.587755-38.138776 87.24898-86.204081 87.248979z m-86.726531-86.72653h41.795919c0 25.077551 20.37551 45.453061 45.453061 45.453061 25.077551 0 45.453061-20.37551 45.453061-45.453061V757.55102l15.673469-4.179591c124.865306-30.82449 182.857143-102.4 182.857143-225.175511 0-207.412245-168.75102-376.163265-376.163265-376.163265s-376.163265 168.75102-376.163265 376.163265c0 122.77551 57.991837 193.828571 182.857143 225.175511l15.673469 4.179591v68.963266c0 25.077551 20.37551 45.453061 45.453061 45.453061 25.077551 0 45.453061-20.37551 45.453061-45.453061h41.795919c0 25.077551 20.37551 45.453061 45.453061 45.453061s44.408163-20.897959 44.408163-45.453061z" fill="#ffffff" p-id="27997" data-spm-anchor-id="a313x.search_index.0.i3.4ba43a8195VCxk" class="selected"></path></svg>

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 2.5 KiB

2
Build_God_Game/src/assets/images/shop.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

19
Build_God_Game/src/stores/character.ts

@ -91,6 +91,24 @@ export const useCharacterStore = defineStore('character', () => {
}
}
const refreshCurrentCharacter = async (): Promise<boolean> => {
if (!currentCharacter.value) return false
isLoading.value = true
try {
const updatedChar = await characterApi.getCharacterDetail(currentCharacter.value.id)
if (updatedChar) {
currentCharacter.value = updatedChar
localStorage.setItem('current_character', JSON.stringify(updatedChar))
}
return true
} catch (error) {
console.error('Failed to refresh character:', error)
return false
} finally {
isLoading.value = false
}
}
const clearCurrentCharacter = () => {
currentCharacter.value = null
localStorage.removeItem('current_character')
@ -166,6 +184,7 @@ export const useCharacterStore = defineStore('character', () => {
deleteCharacter,
selectCharacter,
initCurrentCharacter,
refreshCurrentCharacter,
clearCurrentCharacter,
startTraining,
stopTraining,

4
Build_God_Game/src/views/GameView.vue

@ -9,7 +9,7 @@ import GlareHover from '@/components/GlareHover/GlareHover.vue'
import ChatBox from '@/components/ChatBox.vue'
import ShinyText from '@/components/ShinyText/ShinyText.vue'
import StarBorder from '@/components/StarBorder/StarBorder.vue'
import trainingIcon from '@/assets/images/training.svg'
import meditationIcon from '@/assets/images/meditation.svg'
import missionIcon from '@/assets/images/mission.svg'
import scrapIcon from '@/assets/images/scrap.svg'
import characterIco from '@/assets/images/character.svg'
@ -44,7 +44,7 @@ const showBreakthroughMessage = ref(false)
const menuItems = computed(() => [
{ label: '任务', icon: missionIcon, useImage: true },
{ label: '角色', icon: characterIco, useImage: true },
{ label: isTraining.value ? '打坐中' : '打坐', icon: trainingIcon, useImage: true, isTraining: isTraining.value },
{ label: isTraining.value ? '打坐中' : '打坐', icon: meditationIcon, useImage: true, isTraining: isTraining.value },
{ label: '背包', icon: bagIcon, useImage: true },
{ label: '捡垃圾', icon: scrapIcon, useImage: true },
{ label: '商店', icon: shopIcon, useImage: true },

2
Build_God_Game/src/views/ShopView.vue

@ -108,7 +108,7 @@ const goBack = () => {
}
onMounted(async () => {
await characterStore.fetchCharacters()
await characterStore.refreshCurrentCharacter()
await fetchShop()
})
</script>

Loading…
Cancel
Save