So are you wanting to change the skin? If so, then you can probably accomplish that by modifying the layouts.
The reason why the text is dark is because your using the built in TimerWindowCreate. When you add the lotv campaign dependency you need to switch to using libVCUI_gf_TimerWindowCreate. Just take a look at the trigger GUI timers. You will notice that there are two create timer windows to pick from. Use the one that references LOTV.
Hey prodigy, I looked into what you said. Mind posting where you might find this function's definition? I opened up the code browse via the command line, no luck. Thanks!
Hey prodigy, I looked into what you said. Mind posting where you might find this function's definition? I opened up the code browse via the command line, no luck. Thanks!
Mentioned function is located in Void Campaign UI / VCUI library.
tried using the function you linked. The Text is still very dark. It looks terrible, any way to make the text look more visible like the old sc2 timers?
You just need to change the style of your text to something more visible or make custom UI. Timers are just text labels with some variables behind them.
The solution to this was posted a while ago. One needs to order the timer dialog to play its appropriate intro animation and the text will become crystal clear.
Ik how to make custom UI. That's something i was gonna try but i figured i was doing something wrong. I was hoping to make the standard one work though bc i assume it's more optimal than periodically updating a custom dialog
For the timer dialog to function correctly it must be sent the appropriate animation. That is how it is used by Blizzard and why it works in Coop mode. This is a fairly commonly asked question where the specific required animation string. Specifically HighlightStop.
int TimerWindowCreateFixed (timer lp_timer, text lp_title, bool lp_visible, bool lp_elapsed) { string auto2D681054_val; playergroup group = PlayerGroupAll(); int window;
We used to have skins like this:
Once you add the LOTV campaign dependency, the skin turns into this:
I tried using Galaxy native calls to darken the text. Nothing I tried worked.
Used TimerWindowSetColor. Any suggestions?
So are you wanting to change the skin? If so, then you can probably accomplish that by modifying the layouts.
The reason why the text is dark is because your using the built in TimerWindowCreate. When you add the lotv campaign dependency you need to switch to using libVCUI_gf_TimerWindowCreate. Just take a look at the trigger GUI timers. You will notice that there are two create timer windows to pick from. Use the one that references LOTV.
In reply to Prodigy454:
In reply to Prodigy454:
In reply to Prodigy454:
The Hookup Dialog Item action is the one you want.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
https://github.com/Talv/sc2-data-trigger/blob/c8ca574f086cf12f61820d88abfcf096145ff964/campaigns/voidstory.sc2campaign/base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy#L5279
Previously known as: SomeoneTookMyNameTT
In reply to Talv_:
You just need to change the style of your text to something more visible or make custom UI. Timers are just text labels with some variables behind them.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
The solution to this was posted a while ago. One needs to order the timer dialog to play its appropriate intro animation and the text will become crystal clear.
In reply to DrSuperEvil:
I think he says send a UI animation event once and it will be fine.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
For the timer dialog to function correctly it must be sent the appropriate animation. That is how it is used by Blizzard and why it works in Coop mode. This is a fairly commonly asked question where the specific required animation string. Specifically HighlightStop.
This thread shows the solution...
https://www.sc2mapster.com/forums/development/triggers/229728-timer-opacity#c3
Everything we've discussed resulted in the following function. It works but only once XD. There was something missing in the function
const string TIMER_DIALOG_PATH = "UIContainer\\ConsoleUIContainer\\TriggerWindowPanel\\TimerWindowTemplate";
const string TIMER_DIALOG_ANIMATION = "HighlightStop";
const int TIMER_DIALOG_CONTROL_TYPE = c_triggerControlTypePanel;
int TimerWindowCreateFixed (timer lp_timer, text lp_title, bool lp_visible, bool lp_elapsed) {
string auto2D681054_val;
playergroup group = PlayerGroupAll();
int window;
// Variable Declarations
string lv_image;
// Variable Initialization
// Implementation
window = TimerWindowCreate(lp_timer, lp_title, lp_visible, lp_elapsed);
TimerWindowShowBorder(window, true);
TimerWindowSetImageType(window, c_timerWindowImageBackground, c_triggerImageTypeNineSlice);
TimerWindowSetImageType(window, c_timerWindowImageProgressFill, c_triggerImageTypeNineSlice);
TimerWindowSetImageType(window, c_timerWindowImageBorder, c_triggerImageTypeNineSlice);
TimerWindowSetImageType(window, c_timerWindowImageProgressFrame, c_triggerImageTypeNineSlice);
TimerWindowSetStyle(window, c_timerWindowStyleVerticalTitleTime, false);
TimerWindowSetFixedHeight(window, 80);
libVCUI_gf_RepositionTimerWindow(window);
if ((libVCUI_gv_pU_TimerWindowHighlightFrame != c_invalidDialogControlId)) {
DialogControlDestroy(libVCUI_gv_pU_TimerWindowHighlightFrame);
}
else {
}
DialogControlHookupStandard(TIMER_DIALOG_CONTROL_TYPE, TIMER_DIALOG_PATH);
DialogControlSendAnimationEvent(window, group, TIMER_DIALOG_ANIMATION);
libVCUI_gv_pU_TimerWindowHighlightFrame = DialogControlLastCreated();
libVCUI_gv_pU_TimerWindowTimer = lp_timer;
libVCUI_gv_pU_TimerWindowInDanger = false;
TriggerEnable(libVCUI_gt_PU_TimerWindowThresholdCrossed, true);
TriggerEnable(libVCUI_gt_PU_TimerWindowLoadUpdate, true);
libVCUI_gf_FlashTimerWindow(8.0, false);
auto2D681054_val = PlayerRace(1);
if (auto2D681054_val == "Prot") {
TimerWindowSetProgressColor(window, Color(100.00, 100.00, 0.00), 1);
}
else if (auto2D681054_val == "Terr") {
TimerWindowSetProgressColor(window, Color(42.75, 68.24, 16.86), 1);
}
else if (auto2D681054_val == "Zerg") {
TimerWindowSetProgressColor(window, Color(100.00, 50.20, 0.00), 1);
}
else {
}
return window;
}
Update! Got sick of this INANE api and built my own. Works better than the original and with multiple instances. No weird hacks required.
const string TIMER_DIALOG_TABLE_PREFIX = "TIMER_DIALOG_TABLE_PREFIX_";
const string TIMER_DIALOG_PARAMETER_COUNT = "TIMER_DIALOG_PARAMETER_COUNT";
const string TIMER_DIALOG_PARAMETER_ELAPSED = "TIMER_DIALOG_PARAMETER_ELAPSED_";
const string TIMER_DIALOG_PARAMETER_DIALOG = "TIMER_DIALOG_PARAMETER_DIALOG_";
const string TIMER_DIALOG_PARAMETER_TIMER = "TIMER_DIALOG_PARAMETER_TIMER_";
const string TIMER_DIALOG_PARAMETER_TIMER_LABEL = "TIMER_DIALOG_PARAMETER_TIMER_LABEL_";
const string TIMER_DIALOG_PARAMETER_DIALOG_TITLE = "TIMER_DIALOG_PARAMETER_DIALOG_TITLE_";
const int TIMER_DIALOG_DEFAULT_COUNT = 0;
//Dialog Settings
const string DIALOG_TIMER_DEFAULT_TITLE = "";
const bool DIALOG_TIMER_INITIALLY_VISIBLE = true;
const bool DIALOG_TIMER_COLLAPSEABLE = true;
const bool DIALOG_TIMER_MODAL = true;
const int DIALOG_TIMER_COLLAPSE_POSITION = DIALOG_COLLAPSED_POSITION_TOP_RIGHT;
const int DIALOG_TIMER_WIDTH = 400;
const int DIALOG_TIMER_HEIGHT = 120;
const int DIALOG_TIMER_X_OFFS = 25;
const int DIALOG_TIMER_Y_OFFS = 50;
const int DIALOG_TIMER_ANCHOR = c_anchorTopRight;
//Label Time Remaining Label
const string LABEL_TIME_REMAINING_TITLE_BASE = "<1>";
const int LABEL_TIME_REMAINING_TITLE_PRECISION = 0;
const bool LABEL_TIME_REMAINING_INITIALLY_VISIBLE = true;
const int LABEL_TIME_REMAINING_ANCHOR = c_anchorBottomRight;
const int LABEL_TIME_REMAINING_WIDTH = 70;
const int LABEL_TIME_REMAINING_HEIGHT = 20;
const int LABEL_TIME_REMAINING_X_OFFS = 40;
const int LABEL_TIME_REMAINING_Y_OFFS = 35;
//Label Dialog Title
const string LABEL_TIMER_DIALOG_TITLE_BASE = "<1>...";
const int LABEL_TIMER_DIALOG_TITLE_PRECISION = 0;
const bool LABEL_TIMER_DIALOG_INITIALLY_VISIBLE = true;
const int LABEL_TIMER_DIALOG_ANCHOR = c_anchorTop;
const int LABEL_TIMER_DIALOG_WIDTH = 250;
const int LABEL_TIMER_DIALOG_HEIGHT = 20;
const int LABEL_TIMER_DIALOG_X_OFFS = 0;
const int LABEL_TIMER_DIALOG_Y_OFFS = 35;
//variable
const fixed TIMER_DIALOG_UPDATE_RATE = 0.5;
const int TIMER_DIALOG_UPDATE_TYPE = c_timeGame;
trigger timerDialogUpdate = TriggerCreate("TimerDialogUpdateActions");
int TimerDialogGetCount(){
return DataTableGetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_COUNT);
}
void TimerDialogSetCount(int count){
DataTableSetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_COUNT, count);
}
bool TimerDialogIsElapsed(int dialog){
return DataTableGetBool(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_ELAPSED + IntToString(dialog));
}
void TimerDialogSetElapsed(int dialog, bool elapsed){
DataTableSetBool(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_ELAPSED + IntToString(dialog), elapsed);
}
int TimerDialogGetLabel(int dialog){
return DataTableGetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_TIMER_LABEL + IntToString(dialog));
}
void TimerDialogSetLabel(int dialog, int label){
DataTableSetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_TIMER_LABEL + IntToString(dialog), label);
}
int TimerDialogGetTitleLabel(int dialog){
return DataTableGetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_DIALOG_TITLE + IntToString(dialog));
}
void TimerDialogSetTitleLabel(int dialog, int label){
DataTableSetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_DIALOG_TITLE + IntToString(dialog), label);
}
void TimerDialogSetTitle(int dialog, playergroup group, string title){
string titleStr = StringFormat1(LABEL_TIMER_DIALOG_TITLE_BASE, title);
text titleText = StringToText(titleStr);
int label = TimerDialogGetTitleLabel(dialog);
DialogControlSetPropertyAsText (label, c_triggerControlPropertyText, group, titleText);
}
timer TimerDialogGetTimer(int dialog){
return DataTableGetTimer(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_TIMER + IntToString(dialog));
}
void TimerDialogSetTimer(int dialog, timer time){
DataTableSetTimer(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_TIMER + IntToString(dialog), time);
}
int TimerDialogGet(int index){
return DataTableGetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_DIALOG + IntToString(index));
}
void TimerDialogSet(int dialog, int index){
DataTableSetInt(true, TIMER_DIALOG_TABLE_PREFIX + TIMER_DIALOG_PARAMETER_DIALOG + IntToString(index), dialog);
}
bool TimerDialogIsVisible(int dialog, int p){
return DialogIsVisible(dialog, p);
}
void TimerDialogSetVisible(int dialog, playergroup group, bool visible){
DialogSetVisible(dialog, group, visible);
}
void TimerDialogUpdate(int dialog, playergroup group){
int label = TimerDialogGetLabel(dialog);
timer time = TimerDialogGetTimer(dialog);
bool elapsed = TimerDialogIsElapsed(dialog);
fixed timerValue;
string titleStr;
text title;
if(elapsed){
timerValue = TimerGetElapsed(time);
}
else{
timerValue = TimerGetRemaining(time);
}
titleStr = StringFormat1(LABEL_TIME_REMAINING_TITLE_BASE, FixedToString(timerValue, LABEL_TIME_REMAINING_TITLE_PRECISION));
title = StringToText(titleStr);
DialogControlSetPropertyAsText (label, c_triggerControlPropertyText, group, title);
}
int TimerDialogCreate(timer time, string title, bool visible, bool elapsed){
playergroup group = PlayerGroupAll();
int index = TimerDialogGetCount();
int count = index + 1;
int dialog = DialogCreate(DIALOG_TIMER_WIDTH, DIALOG_TIMER_HEIGHT,
DIALOG_TIMER_ANCHOR, DIALOG_TIMER_X_OFFS, DIALOG_TIMER_Y_OFFS,
DIALOG_TIMER_MODAL);
int labelTimeRemaining;
int labelTitle;
//dialog
TimerDialogSetVisible(dialog, group, visible);
TimerDialogSetElapsed(dialog, elapsed);
TimerDialogSetTimer(dialog, time);
TimerDialogSet(dialog, index);
TimerDialogSetCount(count);
//label time remaining
labelTimeRemaining = DialogControlCreate(dialog, c_triggerControlTypeLabel);
DialogControlSetVisible(labelTimeRemaining, group, LABEL_TIME_REMAINING_INITIALLY_VISIBLE);
DialogControlSetPosition(labelTimeRemaining, group, LABEL_TIME_REMAINING_ANCHOR, LABEL_TIME_REMAINING_X_OFFS, LABEL_TIME_REMAINING_Y_OFFS);
DialogControlSetSize(labelTimeRemaining, group, LABEL_TIME_REMAINING_WIDTH, LABEL_TIME_REMAINING_HEIGHT);
//label title
labelTitle = DialogControlCreate(dialog, c_triggerControlTypeLabel);
DialogControlSetVisible(labelTitle, group, LABEL_TIMER_DIALOG_INITIALLY_VISIBLE);
DialogControlSetPosition(labelTitle, group, LABEL_TIMER_DIALOG_ANCHOR, LABEL_TIMER_DIALOG_X_OFFS, LABEL_TIMER_DIALOG_Y_OFFS);
DialogControlSetSize(labelTitle, group, LABEL_TIMER_DIALOG_WIDTH, LABEL_TIMER_DIALOG_HEIGHT);
//
TimerDialogSetLabel(dialog, labelTimeRemaining);
TimerDialogSetTitleLabel(dialog, labelTitle);
TimerDialogSetTitle(dialog, group, title);
return dialog;
}
void InitTimerDialog(){
TimerDialogSetCount(TIMER_DIALOG_DEFAULT_COUNT);
TriggerAddEventTimePeriodic(timerDialogUpdate, TIMER_DIALOG_UPDATE_RATE, TIMER_DIALOG_UPDATE_TYPE);
}
bool TimerDialogUpdateActions(bool a, bool b){
int count = TimerDialogGetCount();
playergroup group = PlayerGroupAll();
int dialog;
int i;
for(i = 0; i < count; i = i + 1){
dialog = TimerDialogGet(i);
TimerDialogUpdate(dialog, group);
}
return true;
}