mirror of https://github.com/cosmo-ray/yirl.git
text-screen: add txt-file option
Signed-off-by: Matthias Gatto <matthias.gatto@protonmail.com>
This commit is contained in:
parent
f5dc760652
commit
927031c7b3
|
@ -34,6 +34,7 @@ typedef struct {
|
|||
static int tsInit(YWidgetState *opac, Entity *entity, void *args)
|
||||
{
|
||||
YTextScreenState *o_txt = (void *)opac;
|
||||
const char *txt_file = yeGetStringAt(entity, "txt-file");
|
||||
(void)args;
|
||||
|
||||
yeCreateInt(0, entity, "text-threshold");
|
||||
|
@ -41,6 +42,11 @@ static int tsInit(YWidgetState *opac, Entity *entity, void *args)
|
|||
if (yeGet(entity, "text-speed")) {
|
||||
o_txt->timerTxtSpeed = YTimerCreate();
|
||||
}
|
||||
if (txt_file) {
|
||||
yeAutoFree Entity *f = ygFileToEnt(YRAW_FILE, txt_file, NULL);
|
||||
|
||||
yeReplaceBack(entity, f, "text");
|
||||
}
|
||||
ywidGenericCall(opac, t, init);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1342,6 +1342,7 @@ again:
|
|||
yeDestroy(toPush);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline Entity *yeReplaceBack(Entity *array, Entity *toPush,
|
||||
const char *name)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue