-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ynohtna92/panorama
Panorama ready!
- Loading branch information
Showing
101 changed files
with
198 additions
and
15,424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<root> | ||
<styles> | ||
<include src="s2r://panorama/styles/dotastyles.vcss_c" /> | ||
<include src="file://{resources}/styles/custom_game/custom_timer.css" /> | ||
</styles> | ||
<scripts> | ||
<include src="file://{resources}/scripts/custom_game/custom_timer.js" /> | ||
</scripts> | ||
<Panel hittest="false" class="BaseHud"> | ||
<Panel hittest="false" class="Clip"> | ||
<Panel hittest="false" id="TimerBox" class="TimerBox"> | ||
<Label id="TimerMsg" text="Remaining"/> | ||
<Label id="TimerRemaining" text="00:00:00"/> | ||
</Panel> | ||
</Panel> | ||
</Panel> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<root> | ||
<Panel> | ||
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/custom_timer.xml" /> | ||
</Panel> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
var COLOUR_NORMAL = "#FFFFFF"; | ||
var COLOUR_WARNING = "#DF161F"; | ||
var TIMER_INTERVAL = 0.05; | ||
var FADE_INTERVAL = 0.025; | ||
|
||
var startTime = -1; | ||
var timerDuration = 0; | ||
var timerMode = 0; // Countdown = 0, Countup = 1 | ||
var timerMessage = "Remaining"; | ||
var timerEnd = false; // When true, hide on timer end | ||
var timerPosition = 0; | ||
var timerPaused = false; | ||
var timerSound = false; | ||
var timer = null; | ||
var timerWarning = -1; // Second to start warning at from end (-1 Disabled) | ||
var timerLast = 0; | ||
|
||
var timer = $( "#TimerBox" ); | ||
var hideMarginTop = -78; | ||
var initMarginTop = 22; | ||
var curtMarginTop = hideMarginTop; | ||
|
||
function UpdateTimer() { | ||
if (timerPaused) | ||
startTime += 0.05; | ||
|
||
var timerTextRemain = $( "#TimerRemaining" ); | ||
var time = Game.GetGameTime() - startTime; | ||
var remaining = Math.ceil(timerDuration - time); | ||
|
||
if (remaining <= timerWarning && timerWarning != -1) { | ||
if (remaining != timerLast && timerSound) { | ||
timerLast = remaining; | ||
$.Msg('Beep'); | ||
Game.EmitSound("BUTTON_CLICK_MINOR"); | ||
} | ||
timerTextRemain.style['color'] = COLOUR_WARNING; | ||
} | ||
else | ||
timerTextRemain.style['color'] = COLOUR_NORMAL; | ||
if (remaining >= 0) { | ||
if (timerMode == 0) | ||
timerTextRemain.text = FormatTime(remaining); | ||
else | ||
timerTextRemain.text = FormatTime(time); | ||
} | ||
if (time < timerDuration) | ||
$.Schedule(TIMER_INTERVAL, function(){UpdateTimer();}); | ||
else | ||
timer.RemoveClass("FadeIn"); | ||
} | ||
|
||
function FadeIn() { | ||
curtMarginTop += 10; | ||
timer.style["margin-top"] = curtMarginTop + "px"; | ||
$.Msg(curtMarginTop); | ||
if (curtMarginTop != initMarginTop) | ||
$.Schedule(FADE_INTERVAL, function(){FadeIn();}); | ||
} | ||
|
||
function DisplayTimer( table ) { | ||
timerMessage = table.msg || "Remaining"; | ||
timerDuration = table.duration; | ||
timerMode = table.mode; | ||
timerEnd = table.endfade; | ||
timerPosition = table.position; | ||
timerWarning = table.warning; | ||
timerPaused = table.paused; | ||
timerSound = table.sound; | ||
startTime = Game.GetGameTime(); | ||
var timerTextMsg = $( "#TimerMsg" ); | ||
timerTextMsg.text = $.Localize(timerMessage); | ||
UpdateTimer(); | ||
//curtMarginTop = hideMarginTop; | ||
//timer.style["margin-top"] = curtMarginTop + "px"; | ||
//FadeIn(); | ||
timer.AddClass("FadeIn"); | ||
} | ||
|
||
function PauseTimer( bool ) { | ||
timerPaused = bool.pause; | ||
} | ||
|
||
function FormatTime( seconds ) { | ||
var hours = Math.floor(seconds / 3600); | ||
var remainder = seconds % 3600; | ||
var minutes = Math.floor(remainder / 60); | ||
var seconds = Math.floor(remainder % 60); | ||
var s = ""; | ||
var m = ""; | ||
var h = ""; | ||
if (seconds < 10) | ||
s = "0"; | ||
if (minutes < 10) | ||
m = "0"; | ||
if (hours < 10) | ||
h = "0"; | ||
return h + hours + ":" + m + minutes + ":" + s + seconds; | ||
} | ||
|
||
(function () { | ||
GameEvents.Subscribe( "display_timer", DisplayTimer ); | ||
GameEvents.Subscribe( "pause_timer", PauseTimer ); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.BaseHud | ||
{ | ||
width: 100%; | ||
height: 100%; | ||
flow-children: down; | ||
} | ||
|
||
.Clip | ||
{ | ||
clip: rect(44px, 300px, 110px,0px); | ||
horizontal-align: right; | ||
width: 300px; | ||
height: 110px; | ||
} | ||
|
||
.TimerBox | ||
{ | ||
width: 261px; | ||
height: 80px; | ||
background-image: url("file://{resources}/images/custom_game/custom_timer_bg.png"); | ||
background-size: 100%; | ||
horizontal-align: right; | ||
margin-top: -78px; | ||
margin-right: 15px; | ||
z-index: -10; | ||
transition-property: transform; | ||
transition-duration: 0.25s; | ||
transition-timing-function: linear; | ||
} | ||
|
||
.TimerBox Label | ||
{ | ||
color: #FFFFFF; | ||
font-size: 21px; | ||
font-weight: bold; | ||
|
||
} | ||
|
||
#TimerMsg | ||
{ | ||
margin-top: 34px; | ||
margin-left: 20px; | ||
text-align: center; | ||
width: 130px; | ||
} | ||
|
||
#TimerRemaining | ||
{ | ||
margin-top: 34px; | ||
margin-left: 144px; | ||
text-align: center; | ||
width: 100px; | ||
} | ||
|
||
.FadeIn | ||
{ | ||
transform: translateY(100px); | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.