Skip to content

Commit

Permalink
Add password field.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Oct 30, 2024
1 parent c0aeb1f commit de5fea2
Show file tree
Hide file tree
Showing 19 changed files with 1,845 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/media/i18n/cs/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
#define CTR_DICT_UTF8_SET "utf8:"
#define CTR_DICT_NEW_TYPE_SET "new:type:"
#define CTR_DICT_FX "efekt:možnosti:"
#define CTR_DICT_FREEZE_SET "zmrazit:"
#define CTR_DICT_MASK_SET "zmrazit:"
1 change: 1 addition & 0 deletions plugins/media/i18n/de/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "neu:typ:"
#define CTR_DICT_FX "effekt:optionen:"
#define CTR_DICT_FREEZE_SET "einfrieren:"
#define CTR_DICT_MASK_SET "maskieren:"
1 change: 1 addition & 0 deletions plugins/media/i18n/en/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "new:type:"
#define CTR_DICT_FX "effect:options:"
#define CTR_DICT_FREEZE_SET "freeze:"
#define CTR_DICT_MASK_SET "mask:"
1 change: 1 addition & 0 deletions plugins/media/i18n/es/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "nuevo:tipo:"
#define CTR_DICT_FX "efecto:opciones:"
#define CTR_DICT_FREEZE_SET "congelar:"
#define CTR_DICT_MASK_SET "enmascarar:"
1 change: 1 addition & 0 deletions plugins/media/i18n/fa/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "جدید:نوع:"
#define CTR_DICT_FX "اثر:گزینه‌ها:"
#define CTR_DICT_FREEZE_SET "یخ زدن:"
#define CTR_DICT_MASK_SET "پوشاندن:"
1 change: 1 addition & 0 deletions plugins/media/i18n/fr/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "new:type:"
#define CTR_DICT_FX "effet:options:"
#define CTR_DICT_FREEZE_SET "geler:"
#define CTR_DICT_MASK_SET "masquer:"
1 change: 1 addition & 0 deletions plugins/media/i18n/fy/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "nij:type:"
#define CTR_DICT_FX "effekt:opsjes:"
#define CTR_DICT_FREEZE_SET "befrieze:"
#define CTR_DICT_MASK_SET "maskearje:"
1 change: 1 addition & 0 deletions plugins/media/i18n/hi/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "new:type:"
#define CTR_DICT_FX "प्रभाव:"
#define CTR_DICT_FREEZE_SET "जमना:"
#define CTR_DICT_MASK_SET "छुपाना:"
2 changes: 1 addition & 1 deletion plugins/media/i18n/id/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "baru:tipe:"
#define CTR_DICT_FX "efek:opsi:"
#define CTR_DICT_FREEZE_SET "membekukan:"

#define CTR_DICT_MASK_SET "masker:"
1 change: 1 addition & 0 deletions plugins/media/i18n/it/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "nuovo:tipo:"
#define CTR_DICT_FX "effetto:opzioni:"
#define CTR_DICT_FREEZE_SET "congelare:"
#define CTR_DICT_MASK_SET "mascherare:"
2 changes: 1 addition & 1 deletion plugins/media/i18n/nl/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
#define CTR_DICT_NEW_TYPE_SET "nieuw:type:"
#define CTR_DICT_FX "effect:opties:"
#define CTR_DICT_FREEZE_SET "bevriezen:"

#define CTR_DICT_MASK_SET "maskeren:"

1 change: 1 addition & 0 deletions plugins/media/i18n/no/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "ny:type:"
#define CTR_DICT_FX "effekt:innstillinger:"
#define CTR_DICT_FREEZE_SET "fryse:"
#define CTR_DICT_MASK_SET "maskere:"
1 change: 1 addition & 0 deletions plugins/media/i18n/pl/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@
#define CTR_DICT_NEW_TYPE_SET "nowy:typ:"
#define CTR_DICT_FX "efekt:ustawienia:"
#define CTR_DICT_FREEZE_SET "zamrozić:"
#define CTR_DICT_MASK_SET "maskować:"

2 changes: 1 addition & 1 deletion plugins/media/i18n/pt_br/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "novo:tipo:"
#define CTR_DICT_FX "efeito:configurações:"
#define CTR_DICT_FREEZE_SET "congelar:"

#define CTR_DICT_MASK_SET "mascarar:"
2 changes: 1 addition & 1 deletion plugins/media/i18n/ru/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
#define CTR_DICT_NEW_TYPE_SET "новый:тип:"
#define CTR_DICT_FX "эффект:настройки:"
#define CTR_DICT_FREEZE_SET "заморозить:"

#define CTR_DICT_MASK_SET "маскировать:"
1 change: 1 addition & 0 deletions plugins/media/i18n/uz/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@
#define CTR_DICT_NEW_TYPE_SET "yangi:tur:"
#define CTR_DICT_FX "ta'sir:sozlamalar:"
#define CTR_DICT_FREEZE_SET "muzlatish:"
#define CTR_DICT_MASK_SET "maskalash:"

1 change: 1 addition & 0 deletions plugins/media/i18n/zh2/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@
#define CTR_DICT_NEW_TYPE_SET "新:类型:"
#define CTR_DICT_FX "效果:设置:"
#define CTR_DICT_FREEZE_SET "冻结:"
#define CTR_DICT_MASK_SET "掩码:"

27 changes: 27 additions & 0 deletions plugins/media/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


#include "../../citrine.h"
#include "passw.c"
#include "media.h"

#ifdef SDL
Expand Down Expand Up @@ -2202,6 +2203,7 @@ void ctr_img_destructor(ctr_resource* rs) {
SDL_FreeSurface(image->surface);
}
image->ref = NULL;
image->font = NULL;
}

/**
Expand Down Expand Up @@ -2411,6 +2413,30 @@ ctr_object* ctr_img_freeze(ctr_object* myself, ctr_argument* argumentList) {
return myself;
}


/**
* @def
* [ Image ] mask: [ Number ]
*
* @example
* image mask: 10.
*
* @result
* @info-image-mask
*/
ctr_object* ctr_img_mask_set(ctr_object* myself, ctr_argument* argumentList) {
MediaIMG* image = ctr_internal_get_image_from_object(myself);
if (!image) return myself;
image->font = TTF_OpenFontRW(
SDL_RWFromConstMem(
CTR_MEDIA_PASSW_FONT,
CTR_MEDIA_PASSW_FONT_LEN),
0,
ctr_tonum(argumentList->object)
);
return myself;
}

/**
* @def
* [ Image ] x: [ Number ] y: [ Number ]
Expand Down Expand Up @@ -4381,6 +4407,7 @@ void begin(){
ctr_internal_create_func(imageObject, ctr_build_string_from_cstring( CTR_DICT_MOVE_TO_XY_SET ), &ctr_img_mov_set );
ctr_internal_create_func(imageObject, ctr_build_string_from_cstring( CTR_DICT_VISIBLE_SET ), &ctr_img_visible_set );
ctr_internal_create_func(imageObject, ctr_build_string_from_cstring( CTR_DICT_FREEZE_SET ), &ctr_img_freeze );
ctr_internal_create_func(imageObject, ctr_build_string_from_cstring( CTR_DICT_MASK_SET ), &ctr_img_mask_set );
fontObject = ctr_font_new(CtrStdObject, NULL);
fontObject->link = CtrStdObject;
ctr_internal_create_func(fontObject, ctr_build_string_from_cstring( CTR_DICT_NEW ), &ctr_font_new );
Expand Down
Loading

0 comments on commit de5fea2

Please sign in to comment.