WTB scroll bar.

Fixious

Test Lead
MhEMi.png


60+ demos. Only 1/3 are available to click on.
 

Arch

Legions Developer
Go to live/client/gui/guis and open up loadDemo.gui. Scroll down until you find this.
Code:
new GuiDirectoryFileListCtrl(demosList)
            {
                // filePath = "legions/data/recordings";
                // fileFilter = "*.rec";
                AllowMultipleSelections = "0";
                fitParentWidth = "1";
                isContainer = "0";
                Profile = "ServerListTextListProfile";
                HorizSizing = "right";
                VertSizing = "bottom";
                position = "3 23";
                extent = "583 437";
                canSave = "0";
                Visible = "1";
                tooltipprofile = "GuiToolTipProfile";
                hovertime = "1000";
                canSaveDynamicFields = "0";
            };
Delete it and replace it with this.
Code:
new GuiScrollCtrl()
        {
            isContainer = "1";
            profile = "ServerListScrollProfile";
            horizSizing = "right";
            vertSizing = "bottom";
            extent = "583 437";
            position = "3 23";
            hScrollBar = "alwaysOff";
            vScrollBar = "dynamic";
       
            new GuiDirectoryFileListCtrl(demosList)
            {
                // filePath = "legions/data/recordings";
                // fileFilter = "*.rec";
                AllowMultipleSelections = "0";
                fitParentWidth = "1";
                fitParentHeight = "1";
                isContainer = "0";
                Profile = "ServerListTextListProfile";
                HorizSizing = "right";
                VertSizing = "bottom";
                position = "0 0";
                canSave = "0";
                Visible = "1";
                tooltipprofile = "GuiToolTipProfile";
                hovertime = "1000";
                canSaveDynamicFields = "0";
            };
        };
It does create a black/gray box but I don't feel like finding the transparent profile to put in there. Indenting on the forums is a bit weird so you may need to fix it in the script.
 

Arch

Legions Developer
I thought I would stick this in here. I don't want to make an entire new thread for it. I was just getting tired of having to manually input values into the demo controls to speed up, slow down, and pause it so I whipped this up quickly. Navigate to client/gui/scripts and open up demoControls.cs. Paste the following...
Code:
function LoadDemoKeyBindings()
{
    if($demoMode)
    {
        GlobalActionMap.bind(keyboard, "p", PausePlayDemo);
        GlobalActionMap.bind(keyboard, "pageup", SpeedUpDemo);
        GlobalActionMap.bind(keyboard, "pagedown", SlowDownDemo);
    }
}
 
function GameHud::onWake(%this)
{
    parent::onWake(%this);
 
    LoadDemoKeyBindings();
}
 
function PausePlayDemo(%val)
{
    if (!%val)
    return;
 
    if ($timeScale == 0)
        demoQuit.onClick();
    else
        demoPause.onClick();
}
 
function SpeedUpDemo(%val)
{
    if(!%val)
        return;
    else
    {
        demoSpeedText.setText(demoSpeedText.getText() + 1);
        demoSetSpeed.onClick();
    }
}
 
function SlowDownDemo(%val)
{
    if(!%val)
        return;
    else if(demoSpeedText.getText() >= 2)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
    }
    else
        return;
}

In here...
Code:
$demo_lastTimeScale = 1;
 
PASTE IT HERE...
 
function demoPlay::onClick(%this)
{
    $timeScale = $demo_lastTimeScale;
}
Press P to pause the demo, PageUp to speed up the demo, and PageDown to slow down the demo. You can change the keybindings within the chunk towards the top.
 

Arch

Legions Developer
Open up loadDemo.cs. It is in the same folder as the other one. Check if the function below matches yours. My guess is that I added $demoMode variable and forgot.
Code:
function loadDemoBtn::onClick(%this)
{
  %selection = demosList.getSelectedFile();
  echo (%selection);
  DemoRecording::playDemo($Pref::Demos::Directory @ %selection @ "");
  Canvas.popDialog(loadDemo);
  $demoMode = 1;
  //Legions::exportPrefs();
   
}
 

Fixious

Test Lead
$demoMode = 1; was indeed missing. After trying it again, P(pause) works, as does PageUP for speeding up the gameplay. However, PageDOWN does not slow down the base speed. It only slows it back down to normal if I speed it up. Is this working as intended?
 

Arch

Legions Developer
$demoMode = 1; was indeed missing. After trying it again, P(pause) works, as does PageUP for speeding up the gameplay. However, PageDOWN does not slow down the base speed. It only slows it back down to normal if I speed it up. Is this working as intended?
Yeah, that's what it is supposed to do. I didn't even think about making it turn the demo to slow-mo. It can definitely be done.
 

Dino

Member
How Do You Open The LoadDemo.gui? Notepad gives me this *dancing* *chocolate cookies*:

+ Ä GuiControl loadDemo isContainer 1 Profile GuiDefaultProfile HorizSizing right VertSizing bottom Position 0 0 Extent 1024 768 MinExtent 8 2 canSave Visible tooltipprofile GuiToolTipProfile hovertime 1000 canSaveDynamicFields GuiWindowCtrl resizeWidth 0 resizeHeight canMove canClose canMinimize canMaximize minSize 50 50 EdgeSnap text Demos closeCommand Canvas.popDialog(loadDemo); Margin 0 0 0 0 Padding AnchorTop AnchorBottom AnchorLeft AnchorRight TransGuiWindowProfile 40 51 752 518 GuiContainer TranslucentBackgroundProfile2 3 23 745 494 GuiDirectoryFileListCtrl demosList AllowMultipleSelections fitParentWidth ServerListTextListProfile 583 437 GuiBitmapButtonCtrl loadDemoBtn bitmap client/gui/images/menus/demos/transButton Load Demo groupNum -1 buttonType PushButton useMouseEvents GPTextButtonProfile 216 430 140 30 closeDemosWin Close 394 430 GuiGameListOptionsCtrl demosOptionsList Enabled MenuOptionsProfile center 0 465 748 0 DebugRender %guiContent ´  B RG QG Q ÿ® E!J.0 O8;E+J.0 O8;EIJ.0 O8;EZJ.0 O8;EjJ.0 O8;EuJ.0 O8;EˆJ.0 O8;E!J.0 O8;E!J.0 O8;E«J.0 O8;EÇJ.0 O8;E!J.0 O8;RG QE Q ÿ« EûJ.0 O8;EûJ.0 O8;E!J.0 O8;EûJ.0 O8;EûJ.0 O8;EûJ.0 O8;Eÿ; J.0 O8;E!J.0 O8;EÿO J.0 O8;Eÿb J.0 O8;Eÿ… J.0 O8;Eÿ… J.0 O8;E!J.0 O8;EûJ.0 O8;E!J.0 O8;EûJ.0 O8;E!J.0 O8;Eÿà J.0 O8;EIJ.0 O8;EZJ.0 O8;EÿÙ J.0 O8;Eÿß J.0 O8;EˆJ.0 O8;E!J.0 O8;E!J.0 O8;E«J.0 O8;EÇJ.0 O8;EûJ.0 O8; RG QE Q ÿ¨ Eÿ… J.0 O8;Eÿ… J.0 O8;E!J.0 O8;EûJ.0 O8;E!J.0 O8;EûJ.0 O8;E!J.0 O8;Eÿô J.0 O8;EIJ.0 O8;EZJ.0 O8;Eÿ J.0 O8;Eÿ J.0 O8;EˆJ.0 O8;E!J.0 O8;E!J.0 O8;E«J.0 O8;EÇJ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ô C O  / ^ Î # x ë : =  & U Å  o â 1 #   L ¼  f Ù (    C ³  ] Ð  
' | Ñ A  …     



And It Doesnt Come In Like Paragraphs Like In Arches Coding Uptop
 

Arch

Legions Developer
Locate the functions below and replace them with these. This will allow the demo to go slow-mo on keybinding. It can be a bit buggy at times. Ehhhhh
Code:
function SpeedUpDemo(%val)
{
    if(!%val)
        return;
       
    else if(demoSpeedText.getText() >= 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() + 1);
        demoSetSpeed.onClick();
        return;
    }
       
    if(demoSpeedText.getText() < 1 && (demoSpeedText.getText() >= 0))
    {
        demoSpeedText.setText(demoSpeedText.getText() + 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
function SlowDownDemo(%val)
{
    if(!%val)
        return;
   
    else if(demoSpeedText.getText() > 1)
    {
        demoSpeedText.setText(demoSpeedText.getText() - 1);
        demoSetSpeed.onClick();
        return;
    }
   
    if(demoSpeedText.getText() <= 1 && (demoSpeedText.getText() >= 0.05))
    {
        demoSpeedText.setText(demoSpeedText.getText() - 0.05);
        demoSetSpeed.onClick();
        return;
    }
}
 
Top