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

Improved user messages (guide controller) #593

Closed
kianzarrin opened this issue Dec 15, 2019 · 8 comments · Fixed by #653
Closed

Improved user messages (guide controller) #593

kianzarrin opened this issue Dec 15, 2019 · 8 comments · Fixed by #653
Assignees
Labels
adjustments required An issue require some adjustments in code enhancement Improve existing feature UI User interface updates Usability Make mod easier to use
Milestone

Comments

@kianzarrin
Copy link
Collaborator

kianzarrin commented Dec 15, 2019

In some circumistances when the user makes a small mistake and we want to explain why TM does not make any changes to traffic rules I think its better to show a message like this:
Screenshot (193)

Rather than an ugly annoying panel like this:
Screenshot (194)

This mostly resolves #594

@kianzarrin kianzarrin added feature A new distinct feature triage Awaiting issue categorisation labels Dec 15, 2019
@kianzarrin
Copy link
Collaborator Author

Does anyone know what is the name of that top panel ?

@originalfoo
Copy link
Member

originalfoo commented Dec 15, 2019

Mod Tools might be able to give some insight in to the panel name. It has a feature that lets you click on any interface element to see details about it. https://steamcommunity.com/sharedfiles/filedetails/?id=450877484

UPDATE 3.2.0 (7/26/2019)
Added: Selection Tool (Ctrl+M or UI button) - allows to select anything and show in SceneExplorer

@originalfoo originalfoo added adjustments required An issue require some adjustments in code enhancement Improve existing feature UI User interface updates Usability Make mod easier to use and removed feature A new distinct feature triage Awaiting issue categorisation labels Dec 15, 2019
@originalfoo originalfoo added this to the 11.0 milestone Dec 15, 2019
@kianzarrin
Copy link
Collaborator Author

@aubergine10 Added: Selection Tool (Ctrl+M or UI button) - allows to select anything and show in SceneExplorer

Mod tools selection tool only works on segments as far as I can tell. I tried it your way activated mod tools selection tool and clicked on the warning panel. But nothing happened in the scene explorer.

There is also a button in scene explorer to show active tool. but the warning panel is not a tool so that's a dead end too.

@krzychu124
Copy link
Member

try Ctrl+R

@kianzarrin
Copy link
Collaborator Author

I followed the decompiled code and stumbled upon this:

// RoadBaseAI
using ColossalFramework;
public override void UpgradeFailed()
{
	GuideController properties = Singleton<GuideManager>.instance.m_properties;
	if ((object)properties != null)
	{
		Singleton<NetManager>.instance.m_upgradeExistingRoad.Activate(properties.m_upgradeExistingRoad);
	}
}

@krzychu124
Copy link
Member

Yup, GuideManager spawns popups, so you should search there how to add new popup/set text. You can use ModTools UI debugger view (Ctrl+R - pretty slow but does its job) to find out which panel is used

@originalfoo originalfoo modified the milestones: 11.0, 11.1 Jan 24, 2020
@kianzarrin kianzarrin changed the title Improved user messages Improved user messages (guide controller) Feb 4, 2020
@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Feb 4, 2020

Progress report:

  • Guide controller should be activated from ToolBase.SimulationStep() override otherwise it might not work.
  • I made my own guide wrapper and made it work with built in messages (see code snippet)
    public class GuideWrapper {
        private GenericGuide m_guide;
        public GuideInfo m_info;

        public GuideWrapper() {
            m_guide = new GenericGuide();
            m_info = new GuideInfo {
                m_delayType = GuideInfo.Delay.OccurrenceCount,
                m_displayDelay = 1,
                m_repeatDelay = 1, //3
                m_overrideOptions = true,
                m_icon = "ToolbarIconRoads",
                m_tag = "Generic",
                m_name = "RoadUpgradeNonroad",
            };
        }

        public void Activate() =>m_guide?.Activate(m_info ?? throw new Exception("m_info is null"));
        public void Deactivate() => m_guide?.Deactivate();

        public static GuideWrapper example = new GuideWrapper();
    }

EDIT: i managed to insert my own messages and icon.
Screenshot (391)

@kianzarrin
Copy link
Collaborator Author

I need someone to help me to create new crowdin file for guide messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adjustments required An issue require some adjustments in code enhancement Improve existing feature UI User interface updates Usability Make mod easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants