Author Topic: [HELP] Scroll UP - Scroll Down manual History.dat Info  (Read 3297 times)

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
[HELP] Scroll UP - Scroll Down manual History.dat Info
« on: December 07, 2019, 05:03:55 PM »
Hello everyone, I need some help so I can scroll the history.dat text up and down when it is displayed in the menu using the arrow keys, would anyone have any idea how to do it, below I leave the code I'm using to the text appears.

Code:
Code: [Select]
class UserConfig {
</ label="Preview Buttom", help="Input that triggers a search", options="custom1,custom2,custom3,custom4,custom5,custom6", order=5 /> preview="custom2";
}

local my_config = fe.get_config();

# Resolução #
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;


fe.load_module("fade");
fe.load_module( "animate" );


::OBJECTS <- {

bg_black = fe.add_image ("images/popup/black.png",0,0,flw, flh),
game_flyer = fe.add_artwork("wheel",flx*0.360, fly*0.400, flw*0.280, flh*0.190),
game_desc = fe.add_text("[!get_hisinfo]",flx*0.245, fly*0.300, flw*0.500, flh*0.720),
game_desc1 = fe.add_text("[Overview]",flx*0.245, fly*0.300, flw*0.500, flh*0.720),

}

OBJECTS.bg_black.alpha = 240;

OBJECTS.game_desc.word_wrap = true;
OBJECTS.game_desc.font = "Geforce Light";
OBJECTS.game_desc.align = Align.Centre;
OBJECTS.game_desc.word_wrap = true;
OBJECTS.game_desc.charsize = 35;

OBJECTS.game_desc1.word_wrap = true;
OBJECTS.game_desc1.font = "Geforce Light";
OBJECTS.game_desc1.align = Align.Centre;
OBJECTS.game_desc1.word_wrap = true;
OBJECTS.game_desc1.charsize = 35;

OBJECTS.bg_black.visible=false;
OBJECTS.game_flyer.visible=false;
OBJECTS.game_desc.visible=false;
OBJECTS.game_desc1.visible=false;

class displayPreview{

_trigger="Custom1";

constructor()
{
fe.add_signal_handler( this, "on_signal" )
_trigger=fe.get_config()["preview"].tolower();
}

function on_signal( signal )
{
if ( signal == _trigger )
{
local previewClick = fe.add_sound("images/popup/start.mp3")
previewClick.playing=true
display_preview();
return true;
}
return false;
}
}

displayPreview();

function display_preview()
{

if (OBJECTS.bg_black.visible == false) {

OBJECTS.bg_black.visible=true;
OBJECTS.game_flyer.visible=true;
OBJECTS.game_desc.visible=true;
OBJECTS.game_desc1.visible=true;

local shrink_bg_black = {
    property = "scale", start = 0.1 end = 1.0, time = 500 tween = Tween.Quad,
 }

local move_game_flyer_y = {
    property = "y", start = fly*2 end = fly*0.00, time = 450
 } 

local move_game_desc_y = {
    property = "y", start = fly*2 end = fly*0.190, time = 600
 }

local move_game_desc1_y = {
    property = "y", start = fly*2 end = fly*0.190, time = 600
 } 

animation.add( PropertyAnimation( OBJECTS.bg_black, shrink_bg_black ) );
animation.add( PropertyAnimation( OBJECTS.game_flyer, move_game_flyer_y ) );
animation.add( PropertyAnimation( OBJECTS.game_desc, move_game_desc_y ) );
animation.add( PropertyAnimation( OBJECTS.game_desc1, move_game_desc1_y ) );

}

else if (OBJECTS.bg_black.visible == true) {

OBJECTS.bg_black.visible=false;
OBJECTS.game_flyer.visible=false;
OBJECTS.game_desc.visible=false;
OBJECTS.game_desc1.visible=false;
 }
}

Thanks!!!

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #1 on: December 08, 2019, 08:28:46 AM »
 is this kind of what you mean,,,

this is arcadbiss script,  can be modified to be what it is your looking for im asuming...

https://youtu.be/Ewjy7uWrK0o    :o

note this is done , with true or false,  so you onley get the animation one way,

« Last Edit: December 08, 2019, 08:31:55 AM by jedione »
help a friend....

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #2 on: December 08, 2019, 05:48:36 PM »
is this kind of what you mean,,,

this is arcadbiss script,  can be modified to be what it is your looking for im asuming...

https://youtu.be/Ewjy7uWrK0o    :o

note this is done , with true or false,  so you onley get the animation one way,


In fact the script already has what I really wanted and when I call the script and pop up the information I can scroll the information up and down with the keyboard keys.

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #3 on: December 08, 2019, 06:24:55 PM »
humm,  probley take a  (sig) wsitch  w/ animation

would love to see that..   could be done....
help a friend....

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #4 on: December 08, 2019, 10:39:03 PM »
humm,  probley take a  (sig) wsitch  w/ animation

would love to see that..   could be done....

I found this code that ArcadeBliss published but couldn't make the text slide up and down with it :'(

Code: [Select]
local history =fe.add_text("", 442,188,810,290)
history.charsize = 18;
history.align = Align.Left;
history.word_wrap = true;
history.msg = "XXXXXXXXXXX PUT YOUR TEXT HERE XXXXXXXXXX";


function historynav( tick_time )
{

if (fe.get_input_state("XXXXXXXXXX   PUT YOUR UP KEY HERE XXXXXXXXXXXXXX")==true)
{
                history.first_line_hint--;
}
if (fe.get_input_state("XXXXXXXXXX   PUT YOUR DOWN KEY HERE XXXXXXXXXXXXXX")==true)
{
history.first_line_hint++;
}
}
fe.add_ticks_callback("historynav");


arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #5 on: December 09, 2019, 07:41:21 PM »
Does anyone still have any idea how to make this work? :'( :'( :'( :'( :'( :'(

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #6 on: December 10, 2019, 09:44:39 AM »
Does anyone still have any idea how to make this work? :'( :'( :'( :'( :'( :'(

Im sorry, i can not help you. I have never been interested in these things. When i start Attract-Mode, what i want is to start playing, not read the games wikipedia.  :-[

But i know this layout that does something similar, in case it can help you: http://forum.attractmode.org/index.php?topic=1558.0  8)
Nacer a los 15 años Una novela de iOtero

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [HELP] Scroll UP - Scroll Down manual History.dat Info
« Reply #7 on: December 11, 2019, 08:17:12 AM »
Does anyone still have any idea how to make this work? :'( :'( :'( :'( :'( :'(

Im sorry, i can not help you. I have never been interested in these things. When i start Attract-Mode, what i want is to start playing, not read the games wikipedia.  :-[

But i know this layout that does something similar, in case it can help you: http://forum.attractmode.org/index.php?topic=1558.0  8)

Thanks for the indication, from what I saw and a high-level scroll, I don't like this kind of scroll very much, I would like a manual scroll with the up and down arrow, also when you enable the history.dat plugin and call it with One key you are able to scroll the test up and down with the arrows. The download link is no longer available.


I tried using this function for the code that calls history.dat to display but was unsuccessful.


Code: [Select]
function on_scroll_up()
{
m_text.first_line_hint--;
}

function on_scroll_down()
{
m_text.first_line_hint++;
}


Code: [Select]
class UserConfig {

</ label="● History Dat", help="History.dat location. Be sure to enable and config History.dat from the plugins menu.", order=9 /> dat_path="..\\AttractMode\\history.dat";

}

################## Include the utilities to read the history.dat file##################

dofile(fe.script_dir + "scripts/file_util.nut");

################## History ##################

function get_hisinfo()
{
local sys = split( fe.game_info( Info.System ), ";" );
local rom = fe.game_info( Info.Name );
local text = "";
local currom = "";

local alt = fe.game_info( Info.AltRomname );
local cloneof = fe.game_info( Info.CloneOf );
local lookup = get_history_offset( sys, rom, alt, cloneof );

if ( lookup >= 0 )
{

text = get_history_entry( lookup, my_config );
  local index = text.find("- TECHNICAL -");
if (index >= 0)
{
local tempa = text.slice(0, index);
text = strip(tempa);
}


} else {
if ( lookup == -2 )
text = "Index file not found.  Try generating an index from the history.dat plug-in configuration menu.";
else
text = "";

return text;
}


local history = fe.add_text("", flx*0.0, fly*0.690, flw*0.560, flh*0.240);
history.charsize = 16;
history.align = Align.Centre;
history.word_wrap = true;
history.msg = "[!get_hisinfo]";
history.font = "Geforce Light";
local old_tick = 0;