PDA

View Full Version : Update available (2.4.0)



Goblin-King
June 22nd, 2009, 12:47
Version 2.4.0

Implemented a new launcher. You may notice it now relies less on Windows specific components, presents a more uniform user experience across the launcher and the actual game mode, allows increased flexibility such as returning to the launcher if the client connection is lost, as well as allowing us to develop the functionality of the launcher more flexibly in the future.
Added the function genericcontrol.hasIcon, which can be used to check if an icon that was set was actually loaded into the control.
Added script support for scrolling lists, formatted text controls and image controls. The functions windowcontrol.getScrollState and windowcontrol.setScrollPosition can be used to perform the operations, and the windowcontrol.onScroll handler is available for detecting changes.
Parameter coordinates to windowcontrol.onDrag were useless if the position of the receiving control was adjusted during a drag. The parameters are now based on the position of the control at the time the drag was started.
Added the bitmapwidget.setSize function to the scripting interface. This allows the implementation of widgets whose dimensions are not dependent on the size of the bitmap image contained inside. The widget frame will be adjusted to this size, and the contained bitmap will be scaled down to fit if it is too large to fit the given bounds.
Added a "center" panel & control anchor point. This allows both horizontal and vertical anchors to be set at the center of a window or parent control.
Support for local mode extensions was added. When local mode is started with a locally installed ruleset, any compatible extensions also locally installed can be enabled. When browsing campaigns previously played, the extensions enabled by the host on the last session will be automatically loaded.
The token drop script handlers will now be properly called, for tokens not marked modifiable and when performed by a client. Make sure to disallow the operations in the handlers if necessary.
Fixed a crash bug involving extension exclusion groups.
The databasenode.createNode function should no longer create invalid nodes when called to create child nodes to nodes not owned, as a client. In such a case, the function acts like the function databasenode.getChild. This also applies to DB.createNode. Windows otherwise created, such as using windowlist.createWindow or Interface.openWindow will create a window with no data source under such circumstances.

Moon Wizard
June 22nd, 2009, 20:50
Do you have any examples of the getScrollState(), getScrollPosition() and onScroll() functions in action? Perhaps in the foundation ruleset?

I assume these can be used to create scroll bars or perform other window viewport adjustments.

Thanks,
JPG

Lithl
June 22nd, 2009, 21:20
I'm getting an error in local mode...
Using d20 or foundation, when opening a character sheet:
scripts/template_modifiernumber.lua:60: attempt to index upvalue 'modifierFieldNode' (a nil value)
chasheet_main:touchac:1: attempt to index field 'encumberance.armormaxdexbonus' (a nil value)

(foundation is also missing a button graphic for "return to launcher" in the radial menu)

Also, in the nWod ruleset, and my Exalted ruleset (which is based on nWoD), simply opening the character selection window in local mode gives:
scripts/identityselection_list.lua:50: attempt to index local 'labelnode' (a nil value)
Relevant code:

--[[46]] function requestResponse(result, identity)
--[[47]] if result and identity then
--[[48]] local colortable = {};
--[[49]] if CampaignRegistry and CampaignRegistry.colortables and CampaignRegistry.colortables[identity] then
--[[50]] colortable = CampaignRegistry.colortables[identity];
--[[51]] end
--[[52]]
--[[53]] User.setCurrentIdentityColors(colortable.color or "000000", colortable.blacktext or false);
--[[54]]
--[[55]] windowlist.window.close();
--[[56]] else
--[[57]] error.setVisible(true);
--[[58]] end
--[[59]] end

I'm not certain what the problem is in nWoD/Exalted, since I haven't touched that code at all, but there's also errors in foundation, so I'm not sure where to go from there.

Goblin-King
June 23rd, 2009, 08:19
Do you have any examples of the getScrollState(), getScrollPosition() and onScroll() functions in action? Perhaps in the foundation ruleset?
A small example from the launcher:



<template name="scrollbar">
<genericcontrol>
<anchored>
<left>
<anchor>right</anchor>
</left>
<top>
<anchor>top</anchor>
</top>
<size>
<width>10</width>
<height>10</height>
</size>
</anchored>
<frame>
<offset>5,4,5,4</offset>
<name>scrollbar</name>
</frame>
<invisible />
<script>
function update()
if targetcontrol then
local sx, px, vx, sy, py, vy = targetcontrol.getScrollState();
local tw, th = targetcontrol.getSize();

if vy &lt; sy then
local pos = py/sy * th;
local height = vy/sy * th;

setAnchor("left", target[1], "right", "absolute", 1);
setAnchoredWidth(10);

setAnchor("top", target[1], "top", "absolute", pos);
setAnchoredHeight(height);

setVisible(true);
else
setVisible(false);
end
end
end

function onInit()
targetcontrol = window[target[1]];

if targetcontrol then
targetcontrol.onScroll = update;
end
end

function onDrag(button, x, y, draginfo)
if targetcontrol then
if not dragging then
local sx, px, vx, sy, py, vy = targetcontrol.getScrollState();

dragstarty = y;
dragstartpos = py;
dragfactor = sy/vy;
end

dragging = true;
targetcontrol.setScrollPosition(0, dragstartpos + (y - dragstarty)*dragfactor);
end

return true;
end

function onDragEnd()
dragging = false;
end
</script>
</genericcontrol>
</template>

Oberoten
June 23rd, 2009, 10:45
Any chance of fixing the labelnode error as well? It is kind of a let-down when players can not access their characters.

- Obe

Foen
June 23rd, 2009, 12:50
Hi

Is there any way to unpack the launcher.pak file? It doesn't seem to be a standard ZIP archive and it would be good to look at other examples of new functionality.

Cheers

Stuart

Foen
June 23rd, 2009, 12:53
Added script support for ... formatted text controls and image controls.


Hurrah!

Does this mean formatted text controls now have getValue and setValue methods? How quickly will you publish the new API documentation?

Cheers

Stuart

Tenian
June 23rd, 2009, 12:56
I read that as scroll support/events for those, not getValue() setValue() although I'd LOVE value support!