Skip to content

Commit

Permalink
#40 pixel grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
L3P3 committed Jul 6, 2024
1 parent d9f1f8c commit 1bd5041
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 43 deletions.
1 change: 1 addition & 0 deletions locales/de.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ no: Nein
only_local: Nur lokale Welt
open: Öffnen
owner: Besitzer
pixel_grouping: Pixelgruppierung
player: Spieler
project_page: Projektseite
public: Öffentlich
Expand Down
1 change: 1 addition & 0 deletions locales/en.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ no: No
only_local: Just a local world
open: Enter
owner: Owner
pixel_grouping: Pixel grouping
player: Player
project_page: Project page
public: Public
Expand Down
1 change: 1 addition & 0 deletions locales/ru.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ no: Нет
only_local: Толко локалный мир
open: Открыт
owner: Владелец
pixel_grouping: Группировка пикселей
player: Игрок
project_page: Сайт проекта
public: Публичный
Expand Down
3 changes: 2 additions & 1 deletion locales/tr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ error_world_is_present_both_sides: Dünya hem cihazınızda hem de sunucuda mevc
error_world_not_downloaded: Dünya henüz indirilmedi!
error_world_not_uploaded: Dünya henüz yüklenmedi!
game_saved: Oyun kaydedildi.
gamemode_set_to: Oyun modu ayarlandı:
gamemode_set_to: Oyun modu ayarlandı
inventory_cleared: Envanter temizlendi.
inventory: Envanter
item_labels: Hava,Taş,Çimen,Toprak,Parke Taşı,Kalas,Katman Kayası,Kütük,Yapraklar,Tuğlalar,Yün,Kum,Çakıl,Cam,Kitaplık,Obsidyen,Lapis Lazuli,Taş Tuğlalar,Kumtaşı,Lapis Lazuli Bloğu,Demir Blok,Altın Blok,Elmas Blok,Zümrüt Blok,Kızıltaş Blok,Kuvars Blok
Expand All @@ -58,6 +58,7 @@ no: Hayır
only_local: Sadece yerel
open: Aç
owner: Sahip
pixel_grouping: Piksel gruplaması
player: Oyuncu
project_page: Proje sayfası
public: Genel
Expand Down
1 change: 1 addition & 0 deletions locales/uk.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ no: Ні
only_local: Тільки локальні світ.
open: Відчинити
owner: Власник
pixel_grouping: Групування пікселів
player: Грок
project_page: Сторінка проекту
public: Публічно
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minicraft",
"version": "0.9.10",
"version": "0.10.0",
"description": "voxel-based 3d game, written in javascript",
"homepage": "https://l3p3.de/minicraft",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/etc/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const locale_no = 'Nein';
export const locale_only_local = 'Nur lokale Welt';
export const locale_open = 'Öffnen';
export const locale_owner = 'Besitzer';
export const locale_pixel_grouping = 'Pixelgruppierung';
export const locale_player = 'Spieler';
export const locale_project_page = 'Projektseite';
export const locale_public = 'Öffentlich';
Expand Down
7 changes: 7 additions & 0 deletions src/etc/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const reducers = {
const config = {
flag_textures: true,
flag_touch: false, // not saved
pixel_grouping: 1,
mouse_sensitivity: 3,
resolution_scaling: 4,
view_angle: 120,
Expand All @@ -56,6 +57,11 @@ export const reducers = {
if (tmp != null) {
config.flag_textures = tmp;
}
if ((
tmp = config_loaded['pixel_grouping']
) != null) {
config.pixel_grouping = tmp;
}
if ((
tmp = config_loaded['mouse_sensitivity']
) != null) {
Expand Down Expand Up @@ -111,6 +117,7 @@ export const reducers = {
localStorage_setItem('minicraft.config', JSON_stringify({
'version': VERSION,
'flag_textures': config.flag_textures,
'pixel_grouping': config.pixel_grouping,
'mouse_sensitivity': config.mouse_sensitivity,
'resolution_scaling': config.resolution_scaling,
'view_angle': config.view_angle,
Expand Down
5 changes: 3 additions & 2 deletions src/externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ var localStorage = {
function addEventListener(
/** string */ eventName,
/** function(Event) */ handler,
/** {passive: boolean}= */ options
/** (boolean|{passive: boolean})= */ options
){}
function removeEventListener(
/** string */ eventName,
/** function(Event) */ handler
/** function(Event) */ handler,
/** boolean= */ options
){}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/game/c_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
locale_back_to_game,
locale_mouse_sensitivity,
locale_pixel_grouping,
locale_resolution,
locale_settings,
locale_surfaces_colored,
Expand Down Expand Up @@ -96,6 +97,16 @@ export default function Settings({
)),
}),
]),
node_dom(`label[innerText=${locale_pixel_grouping}:]`, null, [
node_dom('input[type=range][min=1][max=6][step=1]', {
value: config.pixel_grouping,
onchange: hook_static(event => (
config_set({
pixel_grouping: Number(event.target.value),
})
)),
}),
]),
node_dom(`label[innerText=${locale_mouse_sensitivity}:]`, null, [
node_dom('input[type=range][min=1][max=15][step=1]', {
value: config.mouse_sensitivity,
Expand Down
4 changes: 0 additions & 4 deletions src/game/m_game.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,6 @@ export const game_message_send = (model, value) => {
game_save(model);
game_message_print(model, locale_game_saved, true);
break;
case 'smart':
player.name = 'LFF5644';
game_message_print(model, 'lff.smart: true', true);
break;
case 'spawn':
world.spawn_x = player.position_x;
world.spawn_y = player.position_y;
Expand Down
Loading

0 comments on commit 1bd5041

Please sign in to comment.