Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI Notification for Invalid Mod Installs #597

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
81aace2
add invalid mod install notification
uniboi Feb 26, 2023
c70b8c4
add translation example
uniboi Feb 26, 2023
ce2e95f
requests from review
uniboi Feb 28, 2023
d05f1fe
display invalid mods on top of the modlist
uniboi Mar 2, 2023
1ddd4ef
Merge branch 'invalid-mod-installs' of github.com:uniboi/NorthstarMod…
uniboi Mar 2, 2023
8fcb543
use invalid mod names
uniboi Apr 3, 2023
0cbfa5f
update localization
uniboi Apr 3, 2023
2fda18c
include profile in expected path
uniboi Apr 3, 2023
746df7d
Merge branch 'main' of github.com:R2Northstar/NorthstarMods into inva…
uniboi May 7, 2023
dbb74b6
switch to new native mods api
uniboi May 7, 2023
f4bc407
add new functions to nativefuncs.json
uniboi May 7, 2023
4011dcb
store last selected panel for extra information
uniboi May 7, 2023
2b4fb8d
rename vars for more precision
uniboi May 7, 2023
ad3557a
use localized helptext for incorrect installs
uniboi May 7, 2023
093c0ee
mention mod.json in the expected & actual path
uniboi May 10, 2023
e90b091
Merge branch 'main' into invalid-mod-installs
uniboi May 14, 2023
8e73259
feat: add missing translations
Alystrasz May 22, 2023
f117ce0
Merge pull request #2 from Alystrasz/invalid-mods-i18n
uniboi May 22, 2023
65ff5be
italian translation
uniboi May 22, 2023
5404e37
Merge branch 'main' into invalid-mod-installs
uniboi May 28, 2023
3dc6607
Merge branch 'main' into invalid-mod-installs
uniboi May 30, 2023
4d4df93
russian & french translations
uniboi May 30, 2023
e94ae35
Merge branch 'main' into invalid-mod-installs
uniboi Jun 23, 2023
d2031a5
Merge branch 'main' into invalid-mod-installs
uniboi Jul 14, 2023
a649d20
Merge branch 'main' into invalid-mod-installs
uniboi Jul 16, 2023
fd3344b
Merge branch 'main' into invalid-mod-installs
uniboi Jul 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
{
"name":"NSGetModDescriptionByModName",
"helpText":"",
"returnTypeString":"string",
"returnTypeString":"string ornull",
"argTypes":"string modName"
},
{
"name":"NSGetModVersionByModName",
"helpText":"",
"returnTypeString":"string",
"returnTypeString":"string ornull",
"argTypes":"string modName"
},
{
"name":"NSGetModDownloadLinkByModName",
"helpText":"",
"returnTypeString":"string",
"returnTypeString":"string ornull",
"argTypes":"string modName"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,31 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a
"INVALID_MASTERSERVER_TOKEN" "Invalid or expired masterserver token"
"JSON_PARSE_ERROR" "Error parsing json response"
"UNSUPPORTED_VERSION" "The version you are using is no longer supported"

uniboi marked this conversation as resolved.
Show resolved Hide resolved
// Mod Settings
"MOD_SETTINGS" "Mod Settings"
"NORTHSTAR_BASE_SETTINGS" "Northstar Base Settings"
"ONLY_HOST_MATCH_SETTINGS" "Only Host can change Private Match settings"
"ONLY_HOST_CAN_START_MATCH" "Only Host can Start the Match"
"MATCH_COUNTDOWN_LENGTH" "Private Match Countdown Duration"
"LOG_UNKNOWN_CLIENTCOMMANDS" "Log Unknown Client Commands"
"DISALLOWED_TACTICALS" "Prohibited Tacticals"
"TACTICAL_REPLACEMENT" "Replacement Tactical"
"DISALLOWED_WEAPONS" "Prohibited Weapons"
"REPLACEMENT_WEAPON" "Replacement Weapon"
"SHOULD_RETURN_TO_LOBBY" "Return To Lobby After Match End"
"ARE_YOU_SURE" "Are you sure?"
"WILL_RESET_ALL_SETTINGS" "This will reset ALL settings that belong to this category.\n\nThis is not revertable."
"WILL_RESET_SETTING" "This will reset the %s1 setting to it's default value.\n\nThis is not revertable."
"MOD_SETTINGS_SERVER" "Server"
"MOD_SETTINGS_RESET" "Reset"
"MOD_SETTINGS_RESET_ALL" "Reset All"
"NO_RESULTS" "No results."
"NO_MODS" "No settings available! Install more mods at ^5588FF00northstar.thunderstore.io^0."

// Incorrect Mod Installation
"INCORRECT_MOD_INSTALL_TOAST" "Some of your mods are incorrectly installed. Click here for more info."
"INCORRECT_MODS_MODLIST_HEADER" "Incorrectly Installed Mods (%s1)"
"INCORRECT_MOD_INSTALL_DESCRIPTION" "This mod is incorrectly installed. Every mod has a file called \"mod.json\" in it's root directory, however for this mod it was not found.\nPossible reasons\n - Mods manually downloaded from thunderstore are wrapped in another folder. Navigate to this folder bla bla bla"
uniboi marked this conversation as resolved.
Show resolved Hide resolved
}
}
239 changes: 239 additions & 0 deletions Northstar.Client/mod/resource/ui/menus/panels/mainmenu.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
#base "../combo_buttons.res"
"resource/ui/menus/panels/mainmenu.res"
{
Screen
{
ControlName Label
wide %100
tall %100
labelText ""
visible 0
}

PinFrame
{
ControlName Label
ypos -41
wide 1328
tall 433
labelText ""
//bgcolor_override "210 170 0 255"
//paintbackground 1
//visible 1

pin_to_sibling Screen
pin_corner_to_sibling TOP
pin_to_sibling_corner CENTER
}

ButtonRowAnchor
{
ControlName Label
labelText ""

pin_to_sibling PinFrame
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner TOP_LEFT
}

MainMenuButton0
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 0
visible 0

navUp MainMenuButton6
navDown MainMenuButton1

pin_to_sibling ButtonRow2x0
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton1
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 1
visible 0

navUp MainMenuButton0
navDown MainMenuButton2

pin_to_sibling MainMenuButton0
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton2
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 2
visible 0

navUp MainMenuButton1
navDown MainMenuButton3

pin_to_sibling MainMenuButton1
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton3
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 3
visible 0

navUp MainMenuButton2
navDown MainMenuButton4

pin_to_sibling MainMenuButton2
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton4
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 4
visible 0

navUp MainMenuButton3
navDown MainMenuButton5

pin_to_sibling MainMenuButton3
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton5
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 5
visible 0

navUp MainMenuButton4
navDown MainMenuButton6

pin_to_sibling MainMenuButton4
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}
MainMenuButton6
{
ControlName RuiButton
InheritProperties RuiSmallButton
classname MainMenuButtonClass
scriptID 6
visible 0

navUp MainMenuButton5
navDown MainMenuButton0

pin_to_sibling MainMenuButton5
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ServiceStatus
{
ControlName RuiPanel
xpos -12
ypos -38
wide 744
tall 100
rui "ui/service_status.rpak"
visible 1

pin_to_sibling PinFrame
pin_corner_to_sibling BOTTOM_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

WhatsNew
{
ControlName RuiPanel
ypos 380
wide 740
tall 125
rui "ui/whats_new.rpak"
visible 1

pin_to_sibling PinFrame
pin_corner_to_sibling TOP_RIGHT
pin_to_sibling_corner TOP_RIGHT
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

SpotlightPanel
{
ControlName CNestedPanel
xpos -540
ypos -11
wide 1920
tall 1080
visible 0
controlSettingsFile "resource/ui/menus/panels/spotlight.res"

pin_to_sibling PinFrame
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner TOP_RIGHT
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

InstallProgress
{
ControlName RuiPanel
wide 500
tall 100
rui "ui/main_menu_install_progress.rpak"
visible 1

pin_to_sibling ServiceStatus
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner TOP_LEFT
}

ActiveProfile
{
ControlName RuiPanel
xpos -13
wide 600
tall 28
visible 0
rui "ui/mainmenu_active_profile.rpak"

pin_to_sibling PinFrame
pin_corner_to_sibling BOTTOM_LEFT
pin_to_sibling_corner BOTTOM_LEFT
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

NSInvalidModsHint
{
ControlName CNestedPanel

tall 150

ypos -100
controlSettingsFile "resource/ui/menus/panels/toast_popup.res"

pin_to_sibling Screen
pin_to_sibling_corner RIGHT
pin_corner_to_sibling LEFT // start out of sight
}
}
56 changes: 56 additions & 0 deletions Northstar.Client/mod/resource/ui/menus/panels/toast_popup.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
resource/ui/menus/panels/toast_popup.res
{
Frame
{
ControlName ImagePanel

tall 100
auto_wide_tocontents 1

image vgui/hud/white
drawcolor "0 0 0 180"
scaleImage 1
}

Image
{
ControlName RuiPanel

wide 50
tall 50

xpos -20
uniboi marked this conversation as resolved.
Show resolved Hide resolved
rui "ui/basic_image.rpak" // The rui of an ruipanel needs to end with .rpak. Don't ask.

pin_to_sibling Frame
pin_to_sibling_corner LEFT
pin_corner_to_sibling LEFT
}

Text
{
ControlName Label

tall 100
auto_wide_tocontents 1

xpos 20
labelText "#INCORRECT_MOD_INSTALL_TOAST"

pin_to_sibling Image
pin_to_sibling_corner RIGHT
pin_corner_to_sibling LEFT
}

Button
{
ControlName RuiButton

tall 100
labelText ""

pin_to_sibling Frame
pin_to_sibling_corner CENTER
pin_corner_to_sibling CENTER
}
}
Loading