Refine launcher navigation and install list
This commit is contained in:
@@ -140,7 +140,7 @@ function renderDetailPanel(profile){
|
||||
|
||||
function renderEmptyDetailPanel(){
|
||||
installDetailTitle.textContent = '프로필을 선택하세요'
|
||||
installDetailSummary.textContent = '왼쪽 목록에서 모드팩, 맵, 서버팩을 고르면 자세한 설명과 설치 조건을 볼 수 있습니다.'
|
||||
installDetailSummary.textContent = '아래 목록에서 모드팩, 맵, 서버팩을 고르면 자세한 설명과 설치 조건을 볼 수 있습니다.'
|
||||
installDetailMeta.innerHTML = ''
|
||||
installDetailInfo.innerHTML = ''
|
||||
installDetailBody.textContent = '관리자가 등록한 프로필 상세 설명이 여기에 표시됩니다.'
|
||||
@@ -183,24 +183,27 @@ async function renderInstallView(){
|
||||
}
|
||||
|
||||
for(const profile of catalog.profiles){
|
||||
const card = document.createElement('article')
|
||||
card.className = 'launcherCard'
|
||||
const row = document.createElement('article')
|
||||
row.className = 'launcherListItem'
|
||||
if(profile.id === selectedProfileId){
|
||||
card.setAttribute('selected', 'true')
|
||||
row.setAttribute('selected', 'true')
|
||||
}
|
||||
|
||||
const header = document.createElement('div')
|
||||
header.className = 'launcherCardHeader'
|
||||
const main = document.createElement('div')
|
||||
main.className = 'launcherListItemMain'
|
||||
|
||||
const titleGroup = document.createElement('div')
|
||||
titleGroup.className = 'launcherCardTitleGroup'
|
||||
const titleRow = document.createElement('div')
|
||||
titleRow.className = 'launcherListTitleRow'
|
||||
|
||||
const textGroup = document.createElement('div')
|
||||
textGroup.className = 'launcherListTextGroup'
|
||||
|
||||
const title = document.createElement('h3')
|
||||
title.className = 'launcherCardTitle'
|
||||
title.className = 'launcherListTitle'
|
||||
title.textContent = profile.name
|
||||
|
||||
const meta = document.createElement('div')
|
||||
meta.className = 'launcherCardMeta'
|
||||
meta.className = 'launcherListMeta'
|
||||
meta.appendChild(createInstallBadge(describeProfileKind(profile.kind)))
|
||||
if(installedIds.has(profile.id)){
|
||||
meta.appendChild(createInstallBadge('설치됨'))
|
||||
@@ -209,21 +212,20 @@ async function renderInstallView(){
|
||||
meta.appendChild(createInstallBadge('호스팅 가능'))
|
||||
}
|
||||
|
||||
titleGroup.appendChild(title)
|
||||
titleGroup.appendChild(meta)
|
||||
header.appendChild(titleGroup)
|
||||
textGroup.appendChild(title)
|
||||
|
||||
const description = document.createElement('p')
|
||||
description.className = 'launcherCardDescription'
|
||||
description.className = 'launcherListDescription'
|
||||
description.textContent = profile.description || '설명이 없습니다.'
|
||||
|
||||
const actions = document.createElement('div')
|
||||
actions.className = 'launcherCardActions'
|
||||
actions.className = 'launcherListActions'
|
||||
|
||||
const detailButton = document.createElement('button')
|
||||
detailButton.className = 'launcherSecondaryButton'
|
||||
detailButton.textContent = '자세히 보기'
|
||||
detailButton.addEventListener('click', () => {
|
||||
detailButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation()
|
||||
selectProfile(profile.id)
|
||||
renderInstallView()
|
||||
})
|
||||
@@ -232,7 +234,8 @@ async function renderInstallView(){
|
||||
installButton.className = 'launcherPrimaryButton'
|
||||
installButton.textContent = installedIds.has(profile.id) ? '설치됨' : '라이브러리에 추가'
|
||||
installButton.disabled = installedIds.has(profile.id) || !profile.launchReady
|
||||
installButton.addEventListener('click', async () => {
|
||||
installButton.addEventListener('click', async (event) => {
|
||||
event.stopPropagation()
|
||||
try {
|
||||
const installedProfile = await CatalogManager.installProfile(profile.id)
|
||||
await ProfileAssetManager.prefetchProfileAssets(installedProfile)
|
||||
@@ -255,10 +258,17 @@ async function renderInstallView(){
|
||||
actions.appendChild(detailButton)
|
||||
actions.appendChild(installButton)
|
||||
|
||||
card.appendChild(header)
|
||||
card.appendChild(description)
|
||||
card.appendChild(actions)
|
||||
installCatalogList.appendChild(card)
|
||||
titleRow.appendChild(textGroup)
|
||||
titleRow.appendChild(meta)
|
||||
main.appendChild(titleRow)
|
||||
main.appendChild(description)
|
||||
row.appendChild(main)
|
||||
row.appendChild(actions)
|
||||
row.addEventListener('click', () => {
|
||||
selectProfile(profile.id)
|
||||
renderInstallView()
|
||||
})
|
||||
installCatalogList.appendChild(row)
|
||||
}
|
||||
|
||||
if(catalog.profiles.length === 0){
|
||||
@@ -289,6 +299,10 @@ document.getElementById('installOpenSettingsButton').addEventListener('click', a
|
||||
switchView(getCurrentView(), VIEWS.settings)
|
||||
})
|
||||
|
||||
document.getElementById('installBackButton').addEventListener('click', () => {
|
||||
switchView(getCurrentView(), VIEWS.landing)
|
||||
})
|
||||
|
||||
document.getElementById('installBackToLibraryButton').addEventListener('click', async () => {
|
||||
if(typeof refreshLibraryView === 'function'){
|
||||
await refreshLibraryView()
|
||||
|
||||
@@ -40,6 +40,7 @@ const launch_progress = document.getElementById('launch_progress')
|
||||
const launch_progress_label = document.getElementById('launch_progress_label')
|
||||
const launch_details_text = document.getElementById('launch_details_text')
|
||||
const server_selection_button = document.getElementById('server_selection_button')
|
||||
const accountPreviewName = document.getElementById('accountPreviewName')
|
||||
const avatarMenuButton = document.getElementById('avatarMenuButton')
|
||||
const avatarContainer = document.getElementById('avatarContainer')
|
||||
const accountMenu = document.getElementById('accountMenu')
|
||||
@@ -245,11 +246,12 @@ function updateSelectedAccount(authUser){
|
||||
username = authUser.displayName
|
||||
}
|
||||
if(authUser.uuid != null){
|
||||
avatarContainer.style.backgroundImage = `url('https://mc-heads.net/avatar/${authUser.uuid}/64')`
|
||||
avatarContainer.style.backgroundImage = `url('https://mc-heads.net/avatar/${authUser.uuid}/64'), url('assets/images/Icon.png')`
|
||||
}
|
||||
} else {
|
||||
avatarContainer.style.backgroundImage = `url('assets/images/Icon.png')`
|
||||
}
|
||||
accountPreviewName.textContent = username
|
||||
accountMenuName.textContent = username
|
||||
avatarMenuButton.disabled = authUser == null
|
||||
if(authUser == null){
|
||||
|
||||
@@ -394,6 +394,10 @@ document.getElementById('libraryOpenInstallButton').addEventListener('click', as
|
||||
switchView(getCurrentView(), VIEWS.install)
|
||||
})
|
||||
|
||||
document.getElementById('libraryBackButton').addEventListener('click', () => {
|
||||
switchView(getCurrentView(), VIEWS.landing)
|
||||
})
|
||||
|
||||
document.getElementById('libraryOpenSettingsButton').addEventListener('click', async () => {
|
||||
await prepareSettings()
|
||||
switchView(getCurrentView(), VIEWS.settings)
|
||||
|
||||
@@ -8,6 +8,7 @@ const {
|
||||
|
||||
const DropinModUtil = require('./assets/js/dropinmodutil')
|
||||
const { MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR } = require('./assets/js/ipcconstants')
|
||||
const settingsBackButton = document.getElementById('settingsBackButton')
|
||||
|
||||
const settingsState = {
|
||||
invalid: new Set()
|
||||
@@ -339,6 +340,11 @@ settingsNavDone.onclick = () => {
|
||||
switchView(getCurrentView(), VIEWS.library)
|
||||
}
|
||||
|
||||
settingsBackButton.onclick = () => {
|
||||
fullSettingsSave()
|
||||
switchView(getCurrentView(), VIEWS.landing)
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Management Tab
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user