Skip to content

Commit

Permalink
v0.4.0 for WoT client v1.14.1.3 and higher
Browse files Browse the repository at this point in the history
- g_guiViews cleanup when leaving lobby and battle
- updateComponent no longer skips ImageEx components
- version number increased to 0.4.0
- gambiter.guiflash_0.4.0.wotmod included
  • Loading branch information
fusi0n committed Nov 4, 2021
1 parent 79ffecd commit 8fbdd8b
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 25 deletions.
4 changes: 2 additions & 2 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
},
"game": {
"folder": "X:\\wot\\ct",
"version": "1.14.0.3"
"version": "1.14.1.3"
},
"info": {
"id": "guiflash",
"author": "gambiter",
"name": "GUIFlash",
"description": "Flash components for use in python mods.",
"version": "0.3.9"
"version": "0.4.0"
}
}
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def buildPython():
cleanup_list.add('as3/DataStore')

# python bytecode
for dirName, _, files in os.walk('python'):
for dirName, _, files in os.walk('res'):
for fileName in files:
if fileName.endswith('.pyc'):
cleanup_list.add(os.path.join(dirName, fileName))
Expand Down
Binary file removed build/gambiter.guiflash_0.3.9.wotmod
Binary file not shown.
Binary file added build/gambiter.guiflash_0.4.0.wotmod
Binary file not shown.
Binary file modified res/gui/flash/GUIFlash.swf
Binary file not shown.
2 changes: 1 addition & 1 deletion res/gui/flash/as3proj/obj/GUIFlashConfig.old
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'20.09.2021'</value>
<value>'04.11.2021'</value>
</define>
<define append="true">
<name>CONFIG::air</name>
Expand Down
2 changes: 1 addition & 1 deletion res/gui/flash/as3proj/obj/GUIFlashConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'20.09.2021'</value>
<value>'04.11.2021'</value>
</define>
<define append="true">
<name>CONFIG::air</name>
Expand Down
12 changes: 10 additions & 2 deletions res/gui/flash/as3proj/src/net/gambiter/components/LabelEx.as
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

public class LabelEx extends UIComponentEx
{
//public static const NAME_FONT:String = "$UniversCondC";
public static const NAME_FONT:String = "$Fieldfont";

private var textField:TextField;
Expand Down Expand Up @@ -50,7 +49,16 @@
textField.antiAliasType = AntiAliasType.ADVANCED;

textField.defaultTextFormat = new TextFormat(NAME_FONT, 12, 0xFFFFFF, false, false, false, "", "", "left", 0, 0, 0, 0);
Properties.setShadow(textField, {"distance": 4, "angle": 45, "color": 0x999999, "alpha": 1, "blurX": 4, "blurY": 4, "strength": 1, "quality": 1});
Properties.setShadow(textField, {
"distance": 4,
"angle": 45,
"color": 0x999999,
"alpha": 1,
"blurX": 4,
"blurY": 4,
"strength": 1,
"quality": 1
});
}

override protected function configUI():void
Expand Down
5 changes: 4 additions & 1 deletion res/gui/flash/as3proj/src/net/gambiter/core/UIComponentEx.as
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@
var last_y:Number = _y;
_x = Math.round(super.x - (parent.width - width) * Align.getFactor(_alignX));
_y = Math.round(super.y - (parent.height - height) * Align.getFactor(_alignY));
if ((_x != last_x) || (_y != last_y)) py_updateProps({"x": _x, "y": _y});
if ((_x != last_x) || (_y != last_y))
{
py_updateProps({"x": _x, "y": _y});
}
}

private function py_updateProps(props:Object):void
Expand Down
18 changes: 15 additions & 3 deletions res/gui/flash/as3proj/src/net/gambiter/utils/Properties.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import flash.filters.DropShadowFilter;
import flash.filters.GlowFilter;

import com.greensock.TweenLite;
//import com.greensock.TweenLite;

import net.gambiter.FlashUI;
import net.gambiter.core.UIComponentEx;
Expand Down Expand Up @@ -95,12 +95,24 @@
FlashUI.ui.py_log("Object with linkage \'" + obj.name + "\' doesn`t contain property " + "with name \'" + prop + "\'.");
}

if (obj is UIComponentEx && !(obj is ImageEx)) {
if (obj is UIComponentEx /* && !(obj is ImageEx)*/ ) {
(obj as UIComponentEx).refresh();
}
}

public static function setAnimateProperty(obj:DisplayObject, props:Object, params:Object):void
{
if (!obj || !props) return;

var tweens:Object = new Object();

var from:Boolean = params.hasOwnProperty('from') && params.from;
var start:Boolean = params.hasOwnProperty('start') && params.start;
var delay:Number = ! !params.hasOwnProperty('delay') ? Number(params.delay) : Number(0);
setProperty(obj, props);
}

/* public static function setAnimatePropertyOld(obj:DisplayObject, props:Object, params:Object):void
{
if (!obj || !props) return;
Expand Down Expand Up @@ -130,7 +142,7 @@
if (from) TweenLite.from(obj, duration, tweens);
else TweenLite.to(obj, duration, tweens);
}

*/
private static function isEmptyObject(obj:Object):Boolean
{
var isEmpty:Boolean = true;
Expand Down
2 changes: 1 addition & 1 deletion res/scripts/client/gui/mods/gambiter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

g_guiFlash = GUIFlash()

print 'GUIFlash v0.3.9 by GambitER initialised. (maintained by CHAMPi)'
print 'GUIFlash v0.4.0 by GambitER initialised. (maintained by CHAMPi)'
24 changes: 11 additions & 13 deletions res/scripts/client/gui/mods/gambiter/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,10 @@ def isComponent(self, alias):
def isActiveComponent(self, alias):
if alias not in self.components:
return False
if hasattr(BigWorld.player(), 'arena'):
return self.components[alias]['battle']
return self.components[alias]['lobby']
return self.components[alias]['battle'] if hasattr(BigWorld.player(), 'arena') else self.components[alias]['lobby']

def getComponent(self, alias=None):
if alias is None:
return self.components
return self.components.get(alias)
return self.components if alias is None else self.components.get(alias)

def getKeys(self):
return sorted(filter(self.isActiveComponent, self.components.keys()))
Expand All @@ -103,14 +99,12 @@ def getCustomizedType(self, compType):
def isTypeValid(self, compType):
return compType in ALL_COMPONENT_TYPES

# ..
def readConfig(self, path):
LOG_DEBUG("Read config from file '%s'." % path)
with open(path, "r") as f:
data = json.load(f)
return data

# ..
def saveConfig(self, path, data):
LOG_DEBUG("Save config in file '%s'." % path)
with codecs.open(path, 'w', 'utf-8') as f:
Expand Down Expand Up @@ -332,10 +326,14 @@ def goToBattle(self):
ServicesLocator.appLoader.getApp().loadView(SFViewLoadParams(CONSTANTS.VIEW_ALIAS))

def leaveLobby(self):
pass
if g_guiViews.ui is not None:
g_guiViews.ui.destroy()
return

def leaveBattle(self):
pass
if g_guiViews.ui is not None:
g_guiViews.ui.destroy()
return

def resizeStage(self):
g_guiViews.resize()
Expand Down Expand Up @@ -368,8 +366,8 @@ class Settings(object):
def _start(self):
# since WoT 1.10.1
# noinspection PyArgumentList
g_entitiesFactories.addSettings(ViewSettings(
CONSTANTS.VIEW_ALIAS, Flash_UI, CONSTANTS.FILE_NAME, WindowLayer.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))
g_entitiesFactories.addSettings(ViewSettings(CONSTANTS.VIEW_ALIAS, Flash_UI, CONSTANTS.FILE_NAME, WindowLayer.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))
return

def _destroy(self):
g_entitiesFactories.removeSettings(CONSTANTS.VIEW_ALIAS)
Expand Down Expand Up @@ -430,6 +428,7 @@ def _dispose(self):
g_guiViews.ui = None
g_guiHooks._dispose()
super(Flash_UI, self)._dispose()
return

def py_log(self, *args):
LOG_NOTE(*args)
Expand Down Expand Up @@ -464,7 +463,6 @@ def createComponent(self, alias, compType, props=None, battle=True, lobby=False)
LOG_ERROR("Component '%s' already exists!" % alias)

def updateComponent(self, alias, props, params=None):
# TODO: image components are currently not updated by updateComponent calls.
if g_guiCache.isComponent(alias):
g_guiCache.update(alias, props)
if g_guiCache.isActiveComponent(alias):
Expand Down

0 comments on commit 8fbdd8b

Please sign in to comment.