-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
408 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/Northstar.Client/mod/resource/northstar_client_localisation_*.txt text diff working-tree-encoding=UTF-16LE-BOM | ||
/Northstar.Client/mod/resource/northstar_client_localisation_*.txt text diff working-tree-encoding=UTF-16LE-BOM | ||
|
||
# Highlight `.gnut` like `.nut` files | ||
*.gnut linguist-language=Squirrel |
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
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
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
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
117 changes: 117 additions & 0 deletions
117
Northstar.Client/mod/scripts/vscripts/ui/menu_ns_moddownload.nut
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,117 @@ | ||
global function DownloadMod | ||
global function DisplayModDownloadErrorDialog | ||
|
||
global enum eModInstallStatus | ||
{ | ||
DOWNLOADING, | ||
CHECKSUMING, | ||
EXTRACTING, | ||
DONE, | ||
FAILED, | ||
FAILED_READING_ARCHIVE, | ||
FAILED_WRITING_TO_DISK, | ||
MOD_FETCHING_FAILED, | ||
MOD_CORRUPTED, | ||
NO_DISK_SPACE_AVAILABLE, | ||
NOT_FOUND | ||
} | ||
|
||
const int MB = 1024*1000; | ||
|
||
bool function DownloadMod( RequiredModInfo mod ) | ||
{ | ||
// Downloading mod UI | ||
DialogData dialogData | ||
dialogData.header = Localize( "#DOWNLOADING_MOD_TITLE" ) | ||
dialogData.message = Localize( "#DOWNLOADING_MOD_TEXT", mod.name, mod.version ) | ||
dialogData.showSpinner = true; | ||
|
||
// Prevent user from closing dialog | ||
dialogData.forceChoice = true; | ||
OpenDialog( dialogData ) | ||
|
||
// Save reference to UI elements, to update their content | ||
var menu = GetMenu( "Dialog" ) | ||
var header = Hud_GetChild( menu, "DialogHeader" ) | ||
var body = GetSingleElementByClassname( menu, "DialogMessageClass" ) | ||
|
||
// Start actual mod downloading | ||
NSDownloadMod( mod.name, mod.version ) | ||
|
||
ModInstallState state = NSGetModInstallState() | ||
while ( state.status < eModInstallStatus.DONE ) | ||
{ | ||
state = NSGetModInstallState() | ||
UpdateModDownloadDialog( mod, state, menu, header, body ) | ||
WaitFrame() | ||
} | ||
|
||
printt( "Mod status:", state.status ) | ||
|
||
// Close loading dialog | ||
CloseActiveMenu() | ||
|
||
return state.status == eModInstallStatus.DONE | ||
} | ||
|
||
void function UpdateModDownloadDialog( RequiredModInfo mod, ModInstallState state, var menu, var header, var body ) | ||
{ | ||
switch ( state.status ) | ||
{ | ||
case eModInstallStatus.DOWNLOADING: | ||
Hud_SetText( header, Localize( "#DOWNLOADING_MOD_TITLE_W_PROGRESS", string( state.ratio ) ) ) | ||
Hud_SetText( body, Localize( "#DOWNLOADING_MOD_TEXT_W_PROGRESS", mod.name, mod.version, floor( state.progress / MB ), floor( state.total / MB ) ) ) | ||
break | ||
case eModInstallStatus.CHECKSUMING: | ||
Hud_SetText( header, Localize( "#CHECKSUMING_TITLE" ) ) | ||
Hud_SetText( body, Localize( "#CHECKSUMING_TEXT", mod.name, mod.version ) ) | ||
break | ||
case eModInstallStatus.EXTRACTING: | ||
Hud_SetText( header, Localize( "#EXTRACTING_MOD_TITLE", string( state.ratio ) ) ) | ||
Hud_SetText( body, Localize( "#EXTRACTING_MOD_TEXT", mod.name, mod.version, floor( state.progress / MB ), floor( state.total / MB ) ) ) | ||
break | ||
default: | ||
break | ||
} | ||
} | ||
|
||
void function DisplayModDownloadErrorDialog( string modName ) | ||
{ | ||
ModInstallState state = NSGetModInstallState() | ||
|
||
DialogData dialogData | ||
dialogData.header = Localize( "#FAILED_DOWNLOADING", modName ) | ||
dialogData.image = $"ui/menu/common/dialog_error" | ||
|
||
switch ( state.status ) | ||
{ | ||
case eModInstallStatus.FAILED_READING_ARCHIVE: | ||
dialogData.message = Localize( "#FAILED_READING_ARCHIVE" ) | ||
break | ||
case eModInstallStatus.FAILED_WRITING_TO_DISK: | ||
dialogData.message = Localize( "#FAILED_WRITING_TO_DISK" ) | ||
break | ||
case eModInstallStatus.MOD_FETCHING_FAILED: | ||
dialogData.message = Localize( "#MOD_FETCHING_FAILED" ) | ||
break | ||
case eModInstallStatus.MOD_CORRUPTED: | ||
dialogData.message = Localize( "#MOD_CORRUPTED" ) | ||
break | ||
case eModInstallStatus.NO_DISK_SPACE_AVAILABLE: | ||
dialogData.message = Localize( "#NO_DISK_SPACE_AVAILABLE" ) | ||
break | ||
case eModInstallStatus.NOT_FOUND: | ||
dialogData.message = Localize( "#NOT_FOUND" ) | ||
break | ||
case eModInstallStatus.FAILED: | ||
default: | ||
dialogData.message = Localize( "#MOD_FETCHING_FAILED_GENERAL" ) | ||
break | ||
} | ||
|
||
AddDialogButton( dialogData, "#DISMISS" ) | ||
AddDialogFooter( dialogData, "#A_BUTTON_SELECT" ) | ||
AddDialogFooter( dialogData, "#B_BUTTON_DISMISS_RUI" ) | ||
|
||
OpenDialog( dialogData ) | ||
} |
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
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
18 changes: 18 additions & 0 deletions
18
Northstar.Custom/mod/materials/models/northstartree/lightsflicker.vmt
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,18 @@ | ||
"UnlitTexture" | ||
{ | ||
$basetexture "models/northstartree/lightsflicker" | ||
$color "[1.5 1.5 1.5]" | ||
|
||
Proxies | ||
{ | ||
|
||
TextureScroll | ||
{ | ||
texturescrollvar $basetexturetransform | ||
texturescrollrate 0.33 | ||
texturescrollangle 45 | ||
} | ||
|
||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,21 @@ | ||
global function EventModelsInit | ||
|
||
void function EventModelsInit() | ||
{ | ||
if( !GetConVarBool( "ns_show_event_models" ) ) | ||
return | ||
|
||
table timeParts = GetUnixTimeParts() | ||
int month = expect int( timeParts[ "month" ] ) | ||
int day = expect int( timeParts[ "day" ] ) | ||
|
||
// 18th December to 6th January | ||
if( ( ( month == 12 ) && ( day >= 18 ) ) || ( ( month == 1 ) && ( day <= 6 ) ) ) | ||
{ | ||
PrecacheModel( $"models/northstartee/winter_holiday_tree.mdl" ) | ||
PrecacheModel( $"models/northstartree/winter_holiday_floor.mdl" ) | ||
|
||
CreatePropDynamic( $"models/northstartree/winter_holiday_tree.mdl", < -60, 740, 30 >, < 0, 0, 0 >, SOLID_VPHYSICS, 1000 ) | ||
CreatePropDynamic( $"models/northstartree/winter_holiday_floor.mdl", < -60, 740, 30 >, < 0, 0, 0 >, SOLID_VPHYSICS, 1000 ) | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Northstar.Custom/mod/scripts/vscripts/ui/ns_custom_mod_settings.gnut
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,8 @@ | ||
global function NSCustomModSettings | ||
|
||
void function NSCustomModSettings() | ||
{ | ||
ModSettings_AddModTitle( "Northstar Custom" , 2 ) | ||
ModSettings_AddModCategory( "Event Models" ) | ||
ModSettings_AddEnumSetting( "ns_show_event_models", "Show Event Models", [ "#SETTING_OFF", "#SETTING_ON" ], 2 ) | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"Postload": { | ||
"mp_weapon_shotgun_doublebarrel.rpak": "common.rpak" | ||
"mp_weapon_shotgun_doublebarrel.rpak": "common.rpak", | ||
"leaves.rpak": "common.rpak", | ||
"tree_stump.rpak": "common.rpak", | ||
"bt.rpak": "common.rpak", | ||
"giftwrap.rpak": "common.rpak", | ||
"snow.rpak": "common.rpak" | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.