-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.0.5 fully implemented all 3 installation types, switched map sourc…
…es to .zip files, launches minecraft on exit - updated install page to be dynamic per installation type - added unique configuration pages for each install type - removed placeholder text - `.tar.gz` files may unfortunately incompatible with minecraft's internals - added function provider for `.zip` file extraction - removed tar-gz package, added unzip package
- Loading branch information
Showing
26 changed files
with
1,021 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Drehmal* | ||
map | ||
parts | ||
archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
import shutil | ||
import zipfile | ||
|
||
def get_size(start_path = '.'): | ||
total_size = 0 | ||
for dirpath, dirnames, filenames in os.walk(start_path): | ||
for f in filenames: | ||
fp = os.path.join(dirpath, f) | ||
total_size += os.path.getsize(fp) | ||
return total_size # size in bytes | ||
|
||
def split_directory(path, max_size, output_path): | ||
current_size = 0 | ||
current_dir = os.path.join(output_path, 'subdir_1') | ||
os.makedirs(current_dir, exist_ok=True) | ||
dir_counter = 1 | ||
|
||
for foldername, subfolders, filenames in os.walk(path): | ||
for filename in filenames: | ||
file_path = os.path.join(foldername, filename) | ||
file_size = os.path.getsize(file_path) | ||
if current_size + file_size > max_size: | ||
# Zip the current directory | ||
with zipfile.ZipFile(f'{current_dir}.zip', 'w', zipfile.ZIP_DEFLATED) as zipf: | ||
for folder, subfolders, files in os.walk(current_dir): | ||
for file in files: | ||
zipf.write(os.path.join(folder, file), | ||
os.path.relpath(os.path.join(folder, file), current_dir)) | ||
shutil.rmtree(current_dir) | ||
|
||
# Start a new directory | ||
dir_counter += 1 | ||
current_dir = os.path.join(output_path, f'subdir_{dir_counter}') | ||
os.makedirs(current_dir, exist_ok=True) | ||
current_size = 0 | ||
|
||
# Copy the file to the new directory | ||
rel_path = os.path.relpath(foldername, path) | ||
new_folder = os.path.join(current_dir, rel_path) | ||
os.makedirs(new_folder, exist_ok=True) | ||
shutil.copy(file_path, new_folder) | ||
current_size += file_size | ||
|
||
# Usage | ||
split_directory('./map', 500*1024*1024, './parts') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<template> | ||
<div class=""> | ||
<!-- Fabric download, install --> | ||
<progress-box | ||
:label="fabricProgress.label" | ||
:progress="fabricProgress.progress" | ||
:percent="fabricProgress.percent" | ||
:img="fabricProgress.img" | ||
:buttonClick="fabricClick" | ||
:buttonDisabled="fabricDisabled" | ||
/> | ||
<!-- Mods download --> | ||
<progress-box | ||
:label="modsProgress.label" | ||
:progress="modsProgress.progress" | ||
:percent="modsProgress.percent" | ||
:img="modsProgress.img" | ||
:buttonClick="modsClick" | ||
:buttonDisabled="modsDisabled" | ||
/> | ||
<!-- Resource Pack download --> | ||
<progress-box | ||
:label="resourcepackProgress.label" | ||
:progress="resourcepackProgress.progress" | ||
:percent="resourcepackProgress.percent" | ||
:img="resourcepackProgress.img" | ||
:buttonClick="resourcepackClick" | ||
:buttonDisabled="resourcepackDisabled" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { storeToRefs } from 'pinia'; | ||
import ProgressBox from 'src/components/ProgressBox.vue'; | ||
import { ProgressBox as ProgressBoxType, Shard } from 'src/components/models'; | ||
import { | ||
downloadMods, | ||
downloadResourcePack, | ||
installFabric, | ||
} from 'src/providers/InstallFabric'; | ||
import { useSourcesStore } from 'src/stores/SourcesStore'; | ||
import { useStateStore } from 'src/stores/StateStore'; | ||
import { ref } from 'vue'; | ||
const { map } = storeToRefs(useSourcesStore()); | ||
const { | ||
processingFabric, | ||
processingMods, | ||
processingResourcepack, | ||
disableBackNav, | ||
} = storeToRefs(useStateStore()); | ||
const versionFileName = map.value.versionName | ||
.toLowerCase() | ||
.split(' ') | ||
.join('-'); | ||
const shardsArr: Shard[] = []; | ||
const fabricDisabled = ref(false); | ||
const modsDisabled = ref(false); | ||
const resourcepackDisabled = ref(false); | ||
map.value.shards.forEach((shard, i) => | ||
shardsArr.push({ | ||
index: i, | ||
name: `${versionFileName}-${i}.zip`, | ||
label: 'Waiting. . .', | ||
downloaded: 0, | ||
totalSize: 0, | ||
progress: 0, | ||
percent: 0, | ||
url: shard, | ||
}) | ||
); | ||
const fabricProgress = ref<ProgressBoxType>({ | ||
label: 'Fabric - Waiting . . .', | ||
percent: 0, | ||
progress: 0, | ||
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB50lEQVRYhd2YTU7bYBCGn7GyoF0Eu17EpyARS1hEogeI1IXbs/QAvUpJFogcAESkwhIBvQRUMna9ABaQr4tgk9j5lSd1zLNybI8y7ze/shx3z+j4bfq9gaGCdPy29HsDxBhDvzcwIoLtfCjbr5WIwkeMMXT8tshx98wAWJawbVdLyN/okeFwlEg1AOfTx/Sh69bL8WpFgiBODz68fxgJSUhEbNVrecsN4il+xnXrBEGc3rOyL226CJjuo4WU4Ik2Apa8AyUC1KDY+PD3TiZ+9y4+r9VuFoULouU56fXVbbh2u1kUFvL9aBeAH18uaXlOetKzTtjfO0GApudwfRvSLRiJBPUW1fIcru+iuc9TFMtTTch4ZJoNOxeZb/unDI2h5Tn8/hPx89eB1l8Dkp8jWkycPLDTsNN7yVqhh9FPrWzNfN0/xbxG4uYu4vBcMxJvFBayqLibDTu9Hpp8JBbZL4tK+53WPscjM68mZtmvikqNLGo+L+o1kUelRua5mURm3VhT0rZyGKOUWpaUv3iqrSjZJXAZRISuUjtWmyPZAbgMGt0qQX1FKYu1rSj/m5yQp/i5DD9WYpqPE6kVBDGuW6+EmPEvKPAqJLx/AEbft7IvbDKJ3zBKrfKHQHEkSS0BzLjCCiEA/wAmNq0sQ6WYFQAAAA5lWElmTU0AKgAAAAgAAAAAAAAA0lOTAAAAAElFTkSuQmCC', | ||
}); | ||
const modsProgress = ref<ProgressBoxType>({ | ||
label: 'Mods - Waiting . . .', | ||
percent: 0, | ||
progress: 0, | ||
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB50lEQVRYhd2YTU7bYBCGn7GyoF0Eu17EpyARS1hEogeI1IXbs/QAvUpJFogcAESkwhIBvQRUMna9ABaQr4tgk9j5lSd1zLNybI8y7ze/shx3z+j4bfq9gaGCdPy29HsDxBhDvzcwIoLtfCjbr5WIwkeMMXT8tshx98wAWJawbVdLyN/okeFwlEg1AOfTx/Sh69bL8WpFgiBODz68fxgJSUhEbNVrecsN4il+xnXrBEGc3rOyL226CJjuo4WU4Ik2Apa8AyUC1KDY+PD3TiZ+9y4+r9VuFoULouU56fXVbbh2u1kUFvL9aBeAH18uaXlOetKzTtjfO0GApudwfRvSLRiJBPUW1fIcru+iuc9TFMtTTch4ZJoNOxeZb/unDI2h5Tn8/hPx89eB1l8Dkp8jWkycPLDTsNN7yVqhh9FPrWzNfN0/xbxG4uYu4vBcMxJvFBayqLibDTu9Hpp8JBbZL4tK+53WPscjM68mZtmvikqNLGo+L+o1kUelRua5mURm3VhT0rZyGKOUWpaUv3iqrSjZJXAZRISuUjtWmyPZAbgMGt0qQX1FKYu1rSj/m5yQp/i5DD9WYpqPE6kVBDGuW6+EmPEvKPAqJLx/AEbft7IvbDKJ3zBKrfKHQHEkSS0BzLjCCiEA/wAmNq0sQ6WYFQAAAA5lWElmTU0AKgAAAAgAAAAAAAAA0lOTAAAAAElFTkSuQmCC', | ||
}); | ||
const resourcepackProgress = ref<ProgressBoxType>({ | ||
label: 'Resource Pack - Waiting . . .', | ||
percent: 0, | ||
progress: 0, | ||
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB50lEQVRYhd2YTU7bYBCGn7GyoF0Eu17EpyARS1hEogeI1IXbs/QAvUpJFogcAESkwhIBvQRUMna9ABaQr4tgk9j5lSd1zLNybI8y7ze/shx3z+j4bfq9gaGCdPy29HsDxBhDvzcwIoLtfCjbr5WIwkeMMXT8tshx98wAWJawbVdLyN/okeFwlEg1AOfTx/Sh69bL8WpFgiBODz68fxgJSUhEbNVrecsN4il+xnXrBEGc3rOyL226CJjuo4WU4Ik2Apa8AyUC1KDY+PD3TiZ+9y4+r9VuFoULouU56fXVbbh2u1kUFvL9aBeAH18uaXlOetKzTtjfO0GApudwfRvSLRiJBPUW1fIcru+iuc9TFMtTTch4ZJoNOxeZb/unDI2h5Tn8/hPx89eB1l8Dkp8jWkycPLDTsNN7yVqhh9FPrWzNfN0/xbxG4uYu4vBcMxJvFBayqLibDTu9Hpp8JBbZL4tK+53WPscjM68mZtmvikqNLGo+L+o1kUelRua5mURm3VhT0rZyGKOUWpaUv3iqrSjZJXAZRISuUjtWmyPZAbgMGt0qQX1FKYu1rSj/m5yQp/i5DD9WYpqPE6kVBDGuW6+EmPEvKPAqJLx/AEbft7IvbDKJ3zBKrfKHQHEkSS0BzLjCCiEA/wAmNq0sQ6WYFQAAAA5lWElmTU0AKgAAAAgAAAAAAAAA0lOTAAAAAElFTkSuQmCC', | ||
}); | ||
const fabricClick = async () => { | ||
processingFabric.value = true; | ||
disableBackNav.value = true; | ||
fabricDisabled.value = true; | ||
fabricProgress.value.img = | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAByklEQVRYhd2YTVLCQBCFX6dYqIsIztyHI7DjGpYuRV2ouNTyGGRFbgD3yRDMAlhQtIs4KfKHhEwS4rcKSaboN6+7pys0ncwwGPbhOnNGCxkM++Q6cxAzw3XmTETo9i6bjqsQS38NZsZg2CeaTmYMAJZFuO62S8j3co3dLkykDgD0bq6ih0LYzURVEKWCaOP9xSoUotEiLuxOeuUZsQm2EMKGUkF0z0q+dO4igOwYLVADkZiGAIv+gRIC0AHKHR+jh6fY7/H7a6Xr8ihdEFLK6NrzvMrX5UGuM+NuL2y/QtgnF/vnx1csqLwd1k5IKeF53slObIJt1LWW/qq8I0mklFBKHXxeBcYc0eQ58zh6BjNHQt/GL6X+J+7IOn2OmCK580KI6B6z6fmUzTui0c4opYw6oTFeI7p484pWCBFdZznx1/pjMdJ+s9rn3f0tgNCZQ07krS9KZTWyj/maSFP5hKidqRqrhs2qHGZDqUXU/OBZOrV06iSHwGMgImPt2FiNnDJ6mOhWGmNC6irqPGppv3WQErIJtk3EUYisGGOppVQAIexWiNn/ggL8CvEXKwDh963kC+eMjhsIU6v5Q6A8pFOLAPC+whZBAPAD4SrOvdEMgKQAAAAOZVhJZk1NACoAAAAIAAAAAAAAANJTkwAAAABJRU5ErkJggg=='; | ||
installFabric(fabricProgress); | ||
return; | ||
}; | ||
const modsClick = async () => { | ||
processingMods.value = true; | ||
disableBackNav.value = true; | ||
modsDisabled.value = true; | ||
modsProgress.value.img = | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAByklEQVRYhd2YTVLCQBCFX6dYqIsIztyHI7DjGpYuRV2ouNTyGGRFbgD3yRDMAlhQtIs4KfKHhEwS4rcKSaboN6+7pys0ncwwGPbhOnNGCxkM++Q6cxAzw3XmTETo9i6bjqsQS38NZsZg2CeaTmYMAJZFuO62S8j3co3dLkykDgD0bq6ih0LYzURVEKWCaOP9xSoUotEiLuxOeuUZsQm2EMKGUkF0z0q+dO4igOwYLVADkZiGAIv+gRIC0AHKHR+jh6fY7/H7a6Xr8ihdEFLK6NrzvMrX5UGuM+NuL2y/QtgnF/vnx1csqLwd1k5IKeF53slObIJt1LWW/qq8I0mklFBKHXxeBcYc0eQ58zh6BjNHQt/GL6X+J+7IOn2OmCK580KI6B6z6fmUzTui0c4opYw6oTFeI7p484pWCBFdZznx1/pjMdJ+s9rn3f0tgNCZQ07krS9KZTWyj/maSFP5hKidqRqrhs2qHGZDqUXU/OBZOrV06iSHwGMgImPt2FiNnDJ6mOhWGmNC6irqPGppv3WQErIJtk3EUYisGGOppVQAIexWiNn/ggL8CvEXKwDh963kC+eMjhsIU6v5Q6A8pFOLAPC+whZBAPAD4SrOvdEMgKQAAAAOZVhJZk1NACoAAAAIAAAAAAAAANJTkwAAAABJRU5ErkJggg=='; | ||
downloadMods(modsProgress); | ||
return; | ||
}; | ||
const resourcepackClick = async () => { | ||
processingResourcepack.value = true; | ||
disableBackNav.value = true; | ||
resourcepackDisabled.value = true; | ||
resourcepackProgress.value.img = | ||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAAByklEQVRYhd2YTVLCQBCFX6dYqIsIztyHI7DjGpYuRV2ouNTyGGRFbgD3yRDMAlhQtIs4KfKHhEwS4rcKSaboN6+7pys0ncwwGPbhOnNGCxkM++Q6cxAzw3XmTETo9i6bjqsQS38NZsZg2CeaTmYMAJZFuO62S8j3co3dLkykDgD0bq6ih0LYzURVEKWCaOP9xSoUotEiLuxOeuUZsQm2EMKGUkF0z0q+dO4igOwYLVADkZiGAIv+gRIC0AHKHR+jh6fY7/H7a6Xr8ihdEFLK6NrzvMrX5UGuM+NuL2y/QtgnF/vnx1csqLwd1k5IKeF53slObIJt1LWW/qq8I0mklFBKHXxeBcYc0eQ58zh6BjNHQt/GL6X+J+7IOn2OmCK580KI6B6z6fmUzTui0c4opYw6oTFeI7p484pWCBFdZznx1/pjMdJ+s9rn3f0tgNCZQ07krS9KZTWyj/maSFP5hKidqRqrhs2qHGZDqUXU/OBZOrV06iSHwGMgImPt2FiNnDJ6mOhWGmNC6irqPGppv3WQErIJtk3EUYisGGOppVQAIexWiNn/ggL8CvEXKwDh963kC+eMjhsIU6v5Q6A8pFOLAPC+whZBAPAD4SrOvdEMgKQAAAAOZVhJZk1NACoAAAAIAAAAAAAAANJTkwAAAABJRU5ErkJggg=='; | ||
downloadResourcePack(resourcepackProgress); | ||
return; | ||
}; | ||
</script> | ||
|
||
<style scoped lang="sass"> | ||
.top-btn | ||
width: 100% | ||
// margin-bottom: 10px | ||
// height: | ||
.bottom-btns | ||
display: flex | ||
flex-direction: row | ||
justify-content: center | ||
align-items: center | ||
gap: 5px | ||
.bottom-btns > div | ||
width: 34% | ||
.center | ||
display: flex | ||
flex-direction: column | ||
justify-content: center | ||
align-items: center | ||
</style> |
Oops, something went wrong.