qtscript: Add two new functions: showInterface() and hideInterface(). They currently
only serve to assist modifications of the reticule, but will eventually control hide/show of the larger user interface widgets. Also fix alpha values on two reticule images.master
parent
cd54d3880c
commit
c0abe4efe3
Binary file not shown.
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 967 B |
Binary file not shown.
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 907 B |
|
@ -16,6 +16,7 @@ function eventGameInit()
|
||||||
setReticuleButton(4, _("Design (F4)"), "image_design_up.png", "image_design_down.png");
|
setReticuleButton(4, _("Design (F4)"), "image_design_up.png", "image_design_down.png");
|
||||||
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
|
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
|
||||||
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
|
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
|
||||||
|
showInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventStartLevel()
|
function eventStartLevel()
|
||||||
|
|
|
@ -20,6 +20,7 @@ function eventGameInit()
|
||||||
setReticuleButton(4, _("Design (F4)"), "image_design_up.png", "image_design_down.png");
|
setReticuleButton(4, _("Design (F4)"), "image_design_up.png", "image_design_down.png");
|
||||||
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
|
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
|
||||||
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
|
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
|
||||||
|
showInterface();
|
||||||
|
|
||||||
if (tilesetType != "ARIZONA")
|
if (tilesetType != "ARIZONA")
|
||||||
{
|
{
|
||||||
|
|
|
@ -797,7 +797,7 @@ static void intDoScreenRefresh(void)
|
||||||
|
|
||||||
|
|
||||||
//hides the power bar from the display
|
//hides the power bar from the display
|
||||||
static void intHidePowerBar(void)
|
void intHidePowerBar()
|
||||||
{
|
{
|
||||||
//only hides the power bar if the player has requested no power bar
|
//only hides the power bar if the player has requested no power bar
|
||||||
if (!powerBarUp)
|
if (!powerBarUp)
|
||||||
|
|
|
@ -333,10 +333,9 @@ extern void flashReticuleButton(UDWORD buttonID);
|
||||||
extern void stopReticuleButtonFlash(UDWORD buttonID);
|
extern void stopReticuleButtonFlash(UDWORD buttonID);
|
||||||
|
|
||||||
//toggles the Power Bar display on and off
|
//toggles the Power Bar display on and off
|
||||||
extern void togglePowerBar(void);
|
void togglePowerBar();
|
||||||
|
void intShowPowerBar();
|
||||||
//displays the Power Bar
|
void intHidePowerBar();
|
||||||
extern void intShowPowerBar(void);
|
|
||||||
|
|
||||||
//hides the power bar from the display - regardless of what player requested!
|
//hides the power bar from the display - regardless of what player requested!
|
||||||
extern void forceHidePowerBar(void);
|
extern void forceHidePowerBar(void);
|
||||||
|
|
|
@ -1221,7 +1221,6 @@ bool stageThreeInitialise(void)
|
||||||
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_GAMEINIT);
|
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_GAMEINIT);
|
||||||
triggerEvent(TRIGGER_GAME_INIT);
|
triggerEvent(TRIGGER_GAME_INIT);
|
||||||
}
|
}
|
||||||
intAddReticule();
|
|
||||||
intAddPower();
|
intAddPower();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2718,7 +2718,8 @@ static QScriptValue js_enableTemplate(QScriptContext *context, QScriptEngine *en
|
||||||
//-- \subsection{setReticuleButton(id, filename, filenameHigh, tooltip, callback)} Add reticule button. id is which
|
//-- \subsection{setReticuleButton(id, filename, filenameHigh, tooltip, callback)} Add reticule button. id is which
|
||||||
//-- button to change, where zero is zero is the middle button, then going clockwise from the uppermost
|
//-- button to change, where zero is zero is the middle button, then going clockwise from the uppermost
|
||||||
//-- button. filename is button graphics and filenameHigh is for highlighting. The tooltip is the text you see when you
|
//-- button. filename is button graphics and filenameHigh is for highlighting. The tooltip is the text you see when you
|
||||||
//-- mouse over the button. Finally, the callback is which scripting function to call
|
//-- mouse over the button. Finally, the callback is which scripting function to call. Hide and show the user interface
|
||||||
|
//-- for such changes to take effect.
|
||||||
static QScriptValue js_setReticuleButton(QScriptContext *context, QScriptEngine *engine)
|
static QScriptValue js_setReticuleButton(QScriptContext *context, QScriptEngine *engine)
|
||||||
{
|
{
|
||||||
int button = context->argument(0).toInt32();
|
int button = context->argument(0).toInt32();
|
||||||
|
@ -2730,6 +2731,22 @@ static QScriptValue js_setReticuleButton(QScriptContext *context, QScriptEngine
|
||||||
return QScriptValue();
|
return QScriptValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-- \subsection{showInterface()} Show user interface.
|
||||||
|
static QScriptValue js_showInterface(QScriptContext *context, QScriptEngine *engine)
|
||||||
|
{
|
||||||
|
intAddReticule();
|
||||||
|
intShowPowerBar();
|
||||||
|
return QScriptValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-- \subsection{hideInterface(button type)} Hide user interface.
|
||||||
|
static QScriptValue js_hideInterface(QScriptContext *context, QScriptEngine *engine)
|
||||||
|
{
|
||||||
|
intRemoveReticule();
|
||||||
|
intHidePowerBar();
|
||||||
|
return QScriptValue();
|
||||||
|
}
|
||||||
|
|
||||||
//-- \subsection{removeReticuleButton(button type)} Remove reticule button. DO NOT USE FOR ANYTHING.
|
//-- \subsection{removeReticuleButton(button type)} Remove reticule button. DO NOT USE FOR ANYTHING.
|
||||||
static QScriptValue js_removeReticuleButton(QScriptContext *context, QScriptEngine *engine)
|
static QScriptValue js_removeReticuleButton(QScriptContext *context, QScriptEngine *engine)
|
||||||
{
|
{
|
||||||
|
@ -4487,6 +4504,8 @@ bool registerFunctions(QScriptEngine *engine, QString scriptName)
|
||||||
engine->globalObject().setProperty("enableTemplate", engine->newFunction(js_enableTemplate));
|
engine->globalObject().setProperty("enableTemplate", engine->newFunction(js_enableTemplate));
|
||||||
engine->globalObject().setProperty("setMiniMap", engine->newFunction(js_setMiniMap));
|
engine->globalObject().setProperty("setMiniMap", engine->newFunction(js_setMiniMap));
|
||||||
engine->globalObject().setProperty("setReticuleButton", engine->newFunction(js_setReticuleButton));
|
engine->globalObject().setProperty("setReticuleButton", engine->newFunction(js_setReticuleButton));
|
||||||
|
engine->globalObject().setProperty("showInterface", engine->newFunction(js_showInterface));
|
||||||
|
engine->globalObject().setProperty("hideInterface", engine->newFunction(js_hideInterface));
|
||||||
engine->globalObject().setProperty("addReticuleButton", engine->newFunction(js_removeReticuleButton)); // deprecated!!
|
engine->globalObject().setProperty("addReticuleButton", engine->newFunction(js_removeReticuleButton)); // deprecated!!
|
||||||
engine->globalObject().setProperty("removeReticuleButton", engine->newFunction(js_removeReticuleButton));
|
engine->globalObject().setProperty("removeReticuleButton", engine->newFunction(js_removeReticuleButton));
|
||||||
engine->globalObject().setProperty("enableStructure", engine->newFunction(js_enableStructure));
|
engine->globalObject().setProperty("enableStructure", engine->newFunction(js_enableStructure));
|
||||||
|
|
Loading…
Reference in New Issue