diff --git a/html/mainPage/index.html b/html/mainPage/index.html
index 7c34948..6596ca3 100644
--- a/html/mainPage/index.html
+++ b/html/mainPage/index.html
@@ -85,13 +85,6 @@
Filtering
-
-
diff --git a/html/mainPage/js/defaults.json b/html/mainPage/js/defaults.json
index 6d66500..85f494c 100644
--- a/html/mainPage/js/defaults.json
+++ b/html/mainPage/js/defaults.json
@@ -12,5 +12,17 @@
"clientbound": ["keep_alive", "update_time", "rel_entity_move", "entity_teleport", "map_chunk", "update_light", "update_view_position", "entity_metadata", "entity_update_attributes", "unload_chunk", "entity_velocity", "entity_move_look", "entity_head_rotation"]
},
"useExtendedPresets": true
- }
-}
\ No newline at end of file
+ },
+ "extended_presets": [
+ {
+ "Player_movement": {
+ "serverbound":[
+ "query_block_nbt","set_difficulty","client_command","settings","tab_complete","transaction","enchant_item","window_click","close_window","custom_payload","edit_book","query_entity_nbt","use_entity","generate_structure","keep_alive","lock_difficulty","pick_item","craft_recipe_request","block_dig","entity_action","steer_vehicle","displayed_recipe","recipe_book","name_item","resource_pack_receive","advancement_tab","select_trade","set_beacon_effect","held_item_slot","update_command_block","update_command_block_minecart","set_creative_slot","update_jigsaw_block","update_structure_block","update_sign","arm_animation","spectate","block_place","use_item"
+ ],
+ "clientbound": [
+ "spawn_entity","spawn_entity_experience_orb","spawn_entity_living","spawn_entity_painting","named_entity_spawn","animation","statistics","acknowledge_player_digging","block_break_animation","tile_entity_data","block_action","block_change","boss_bar","difficulty","tab_complete","declare_commands","transaction","close_window","window_items","craft_progress_bar","set_slot","set_cooldown","custom_payload","named_sound_effect","kick_disconnect","entity_status","explosion","unload_chunk","game_state_change","open_horse_window","keep_alive","map_chunk","world_event","world_particles","update_light","login","map","trade_list","rel_entity_move","entity_move_look","entity_look","entity","open_book","open_window","open_sign_entity","craft_recipe_response","abilities","combat_event","unlock_recipes","entity_destroy","remove_entity_effect","resource_pack_send","entity_head_rotation","multi_block_change","select_advancement_tab","world_border","camera","held_item_slot","update_view_position","update_view_distance","scoreboard_display_objective","entity_metadata","attach_entity","entity_velocity","entity_equipment","experience","update_health","scoreboard_objective","set_passengers","teams","scoreboard_score","update_time","title","entity_sound_effect","sound_effect","stop_sound","playerlist_header","nbt_query_response","collect","entity_teleport","advancements","entity_update_attributes","declare_recipes","tags","entity_effect"
+ ]
+ }
+ }
+ ]
+}
diff --git a/html/mainPage/js/main.js b/html/mainPage/js/main.js
index cb1b07c..e17a4d7 100644
--- a/html/mainPage/js/main.js
+++ b/html/mainPage/js/main.js
@@ -169,6 +169,22 @@ function findDefault(setting) {
}
}
}
+// TODO: saving and loading custom presets
+function findPreset(elem) {
+ const name = elem.innerText.match(/Preset: ([\w|\s]+)/i)[1].replace(/\s/g, '_')
+ defaultsJson.extended_presets.forEach((value) => {
+ if (value.hasOwnProperty(name)) {
+ sharedVars.hiddenPackets = value[name]
+ }
+ })
+}
+defaultsJson.extended_presets.forEach((value) => {
+ const e = document.createElement('button')
+ e.setAttribute('onclick', 'findPreset(this); updateFilteringTab()')
+ e.setAttribute('style', 'margin-left: 8px;');
+ e.innerText = `Preset: ${Object.keys(value)[0].replace(/_/g, ' ')}`;
+ document.getElementById('extendedPresets').appendChild(e)
+})
if (!findDefault('useExtendedPresets')) {
document.getElementById('extendedPresets').style.display = 'none'
@@ -232,7 +248,7 @@ function updateFilteringStorage () {
function updateFilteringTab () {
for (const item of filteringPackets.children) {
const name = item.children[0].children[2].textContent
- console.log(name);
+ //console.log(name);
const checkbox = item.children[0].firstElementChild
checkbox.readOnly = false
diff --git a/package-lock.json b/package-lock.json
index 10e6331..2ca019c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,9 +5,10 @@
"requires": true,
"packages": {
"": {
+ "name": "pakkit",
"version": "1.0.0",
"hasInstallScript": true,
- "license": "ISC",
+ "license": "MIT",
"dependencies": {
"axios": "^0.21.1",
"clusterize.js": "^0.18.1",