Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - liquid8d

Pages: 1 [2] 3 4 ... 30
16
Themes / Re: I present... AMBuilder: Layout Designer!
« on: December 02, 2017, 08:52:21 AM »
It's probably still gonna be a bit before I get this going any further - adding some additional modules is definitely a next step. It should be easy enough to get added though - at least initially with no live preview, since I'd have to "emulate" how it works in AM in the designer.

We've opened up some discussion, so I'm hoping this leads to some exciting new modules that can be used in the designer - including ArcadeBliss' fantastic work in that one.

17
Announcements / Re: Version 2.3 Released
« on: November 20, 2017, 08:46:05 AM »
Thank you!  ;D

18
Scripting / Re: Getting Magic Tokens to work with fe.do_nut
« on: November 17, 2017, 10:55:05 PM »
I used this before without any issue:

Code: [Select]
//replace specified magic tokens in path
    function get_magic_token_path(path) {
        local tokens = {
            "Name": fe.game_info(Info.Name),
            "Emulator": fe.game_info(Info.Emulator),
            "Year": fe.game_info(Info.Year),
            "Manufacturer": fe.game_info(Info.Manufacturer),
            "Category": fe.game_info(Info.Category),
            "System": fe.game_info(Info.System),
            "DisplayName": fe.list.name
        }
        foreach( key, val in tokens)
            path = replace(path, "[" + key + "]", val);
           
        //replace slashes with backslashes
        path = replace(path, "\\", "/");
        //ensure trailing slash
        local trailing = path.slice(path.len() - 1, path.len());
        if ( trailing != "/") path += "/";
        return path;
    }

    //replace all instances of 'find' in 'str' with 'repl'
    function replace(str, find, repl) {
        local start = str.find(find);
        if ( start != null ) {
            local end = start + find.len();
            local before = str.slice(0, start);
            local after = str.slice(end, str.len());
            str = before + repl + after;
            str = replace(str, find, repl);
        }
        return str;
    }

But your problem may be that you are trying to load the .nut before AM has that info.

Try doing this before you load .nut:
Code: [Select]
local filename = fe.list.name + ".nut";
print( filename + "\n" );

You might have to use a transition callback and catch the Transition.StartLayout or Transition.ToNewList or whatever you need, where that information will be available.

That may put a kink in your plans, depending on what you are trying to do in the .nut

19
Scripting / Re: KeyboardSearch module
« on: November 16, 2017, 08:26:16 AM »
I'll see if I can look at your script and this issue tonight. I think the issue with selecting a certain button is more difficult because which buttons are on a row is configurable. It does make sense, though. I'll see what I can do with it.

20
Scripting / Re: animation pulse not working?
« on: November 13, 2017, 02:02:01 PM »
glad to hear it! Let me know if you have any feedback or suggestions.

21
Scripting / Re: animation pulse not working?
« on: November 12, 2017, 12:49:39 PM »
hey popoklo,

I am not sure what happened with pulse, but i'm seeing the same thing you are. I'll try to take a look at why it seems broken.

In the meantime, I have been working on rewriting the animation module and have a wip up here:
https://github.com/liquid8d/attract-extra/tree/master/modules/animate2

It has some changes in the way things operate, but you might be interested in taking a look. For example in the new engine for pulse, you could do:

Code: [Select]
PropertyAnimation(OBJECTS.wheel).key("alpha").from(255).to(0).loops(-1).yoyo().speed(0.5).play();

If you do decide to use it for your layouts, please understand it is still a wip, and you may need to include it or instruct the user how to get it as it is not included like the original animate module is.

22
Scripting / Re: KeyboardSearch module
« on: November 09, 2017, 04:03:22 PM »
kent,

Right now, you are only checking if the surface is visible when your layout starts, and that's it. The layout doesn't reload or anything when the search is hidden or shown. Perhaps you can check in tick?

Code: [Select]
local search_surface = ....
KeyboardSearch(...)...

local searchVisible = 0;
function on_tick(ttime) {
   ...
   if ( search_surface.alpha != searchVisible ) {
      //search has been toggled
      searchVisible = search_surface.alpha;
      if ( search_surface.alpha == 0 ) {
         //search was hidden
      } else {
         //search was shown
      }
   }
}

Maybe I can add some kind of listener to notify you when the keyboard has been shown or hidden if that doesn't work for you.

23
Scripting / Re: KeyboardSearch module
« on: November 08, 2017, 03:25:23 PM »
No problem! There is a toggle() method in there which is called to show or hide the keyboard. All it does is switch the keyboard surface alpha to 0 or 255. You could hook into that, if ( surface.alpha == 0 ) //do your stuff.


24
Scripting / Re: KeyboardSearch module
« on: November 07, 2017, 08:22:49 PM »
hi kent, not sure what you mean? Are you saying you want to do that when the keyboard is closed?

25
Scripting / Re: Need your help with History.dat plugin
« on: November 05, 2017, 08:26:26 PM »
oh, right - just set it to custom1 and add multiple key inputs in settings -> controls - DUH  ;D

Does that work for you Arcadefan1?

26
Scripting / Re: Need your help with History.dat plugin
« on: November 05, 2017, 03:59:45 PM »
think the plan is to have multiple buttons, right? You'd have to do a bit more hacking, the submenu module that History.dat uses is designed for just 1 control button.. you could hack it into submenu maybe?

27
Scripting / Re: KeyboardSearch module
« on: November 05, 2017, 02:16:50 PM »
I added a DONE key, along with an option to retain the search when you reopen it. You can also now default to text only instead of images by just passing null to keys_image_folder() and set the keys charsize with .keys_charsize().

As for keyboard input, I realize why i didn't add it - I'm not sure if you can override (grab) individual keyboard keys, at least with a module. Have to look into it further.

You can grab the changes here:

https://github.com/liquid8d/attract-extra/tree/master/modules/objects/keyboard-search

As I was making the changes, I realized it was not very clearly explained and I struggled myself to setup the default stuff  ;D Some of the instructions were pulled directly from my blueprint layout and still had user_config[...] in there.

I'm going to update the instructions a bit. In the meantime, I added a sample layout:
https://github.com/liquid8d/attract-extra/tree/master/layouts/sample_keyboard_search

Probably the most confusing thing is text_pos() and keys_pos() - this is a 0-1 map of x, y, w, h on where the search text and key layout will be within the *search surface*. For example:

Code: [Select]
local search_surface = fe.add_surface(fe.layout.width / 2, fe.layout.height);
local keyboard = KeyboardSearch(search_surface)

Code: [Select]
keyboard.text_pos( 0, 0, 1, 0.1 )
Here the search text will occupy the full width of the search surface (or half the screen). It will occupy 10% (0.1) of the height of the search surface.

Code: [Select]
keyboard.text_pos( 0, 0.5, 1, 0.5 )
Here the keys (all of them) will occupy the bottom half of the search surface ( y = 0.5 and height = 0.5, or half of search surface height).

Hopefully that makes sense.

28
Scripting / Re: KeyboardSearch module
« on: November 05, 2017, 08:09:34 AM »
The list is in my layout.

AttractMode has a command to filter your results based on search text. The module just calls this command with the text you input, but your layout has to show the actual games - either through a list, or adding objects that have index_offset set to show a set of games.

Also, added keyboard typing to TODO :)

29
Scripting / Re: [ANNOUNCEMENT] Blending modes will come to Attract Mode
« on: November 04, 2017, 10:55:30 PM »
I'm dying for this one as well... :P

30
Scripting / Re: KeyboardSearch module
« on: November 04, 2017, 10:54:39 PM »
I do plan on adding a DONE or CONFIRM :)

SomeoneElse:

This is a module, meant for layout designers. However, if you are making your own layout - you are welcome to try it out.
First, make sure you are adding the search surface (the add_surface line) AFTER your background and other objects that you don't want ontop of the search.

Also, the default search key is "custom1" - if that is bound to something else, that might cause you problems. You can set it directly by adding .search_key("custom2") to the init line, or add the user config options as shown in the README to your layout.

Pages: 1 [2] 3 4 ... 30