Coder Social home page Coder Social logo

spencerwooo / paimonmenubar Goto Github PK

View Code? Open in Web Editor NEW
163.0 3.0 12.0 18.03 MB

Track real-time Genshin Impact stats in your macOS menubar

Home Page: https://paimon.swo.moe

License: MIT License

Swift 100.00%
genshin-impact genshin genshinimpact paimon macos menubar menubar-app

paimonmenubar's Introduction

logo

PaimonMenuBar

Track real-time Genshin Impact stats in your macOS menubar

Use Swift macOS 11.0+ GitHub Release

What's this?

screenshot

Paimon helps you track your Genshin Impact daily resin, expeditions, and more — straight in your macOS menu bar.

Paimon can help you —

  • 🌙 Keep track of your daily resin.
  • 💰 Monitor your daily expeditions and real-time realm currency.
  • 🏁 Remind you about your daily commissions and weekly boss fights.
  • 🍯 And notify you when your parametric transformer is ready to use.

Basically, PaimonMenuBar lives in your macOS menu bar quietly, and offers you a nice way of monitoring your in-game real-time stats when you need to check them.

Note

PaimonMenuBar is made with SwiftUI, designed for and native to macOS.

Download

GitHub Release

Things to know

  1. Paimon uses the official Hoyoverse API found in either 米游社 (for CN players) or HoYoLAB (for Global players).
  2. Yes, Paimon needs your cookie. It is so that Paimon can request said API on your behalf, and fetch those in-game stats periodically. Rest assured that the cookie is only stored locally.
  3. Check FAQ if you have anymore questions.

Credits

Development notes.

TO-DO

  • Menu bar of varying height.
  • Configurable data refresh rate.
  • Start at login.
  • i18n support for at least Simplified Chinese and English.
  • Manual refresh button.
  • Code-sign and publish as .dmg.
  • Auto-updates and check for update.
  • Custom website and help for acquiring the cookie.
  • Help button beside the text field for entering the cookie.
  • Support for cn and global genshin accounts (米游社 and hoyolab).
  • Backward-compatibility for macOS 11.0.
  • Better first-time installation experience (guidance for initial setup).
  • [ ] Support for multiple accounts?

Releasing a new version

  • Create a build in Xcode, bump the build number, and notarize build.

  • Create a new release on GitHub with a new version tag and increment the build number.

  • Use create-dmg to create the .dmg file:

    create-dmg PaimonMenuBar.app
  • Update appcast.xml with the new version tag and build number:

    cd <PATH_TO_SPARKLE>/artifacts/sparkle/bin
    ./generate_appcast <PATH_TO_PROJECT>/PaimonMenuBar/Build/
  • Profit.

License

MIT

made with ❤️ by spencer woo

paimonmenubar's People

Contributors

breezewish avatar dreampiggy avatar spencerwooo avatar wu-qing-157 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

paimonmenubar's Issues

Fetch is always failed if server is untouched

Reproduce workflow:

  1. Clear all saved user defaults by using defaults delete spencerwoo.PaimonMenuBar
  2. Start App
  3. Enter UID
  4. Enter Cookie
  5. Click "Test config"

A "Failed to fetch" will be shown. If I do this further, then the config test will be succeeded:

  1. Click "天空岛" (which is the default selected)
  2. Click "Test config" again

Any plan to support macOS 11 ?

or even 10.15 ?

Swift concurrency support back-port to macOS 10.15/iOS 13.

And I can even install Xcode 13.3 on macOS 11, with some tweak :)

If you need help, maybe I can have a fork and PR in this weekend.

Can't get cookie from miyoushe

Mihoyo seems to have updated the website and it seems the cookie is different from the previous version.
Is there some other way to get the cookie and make the PaimonMenuBar work?
Thx a lot.

High CPU usage after preference is opened

Even when the preference dialog is closed, the CPU keeps high and causing high energy impact.

image

Profiled stacks:

4376	PaimonMenuBar (56544)	
4248	Main Thread  0xc8429	
4248	start	
4248	main	
4248	static PaimonMenuBarApp.$main()	
4248	static App.main()	
4248	runApp<A>(_:)	
4248	specialized runApp(_:)	
4248	NSApplicationMain	
4248	-[NSApplication run]	
4248	-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]	
4248	_DPSNextEvent	
4248	_BlockUntilNextEventMatchingListInModeWithFilter	
4248	ReceiveNextEventCommon	
4248	RunCurrentEventLoopInMode	
4248	CFRunLoopRunSpecific	
4248	__CFRunLoopRun	
4012	__CFRunLoopDoObservers	
3989	__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__	
3113	___NSRunLoopObserverCreateWithHandler_block_invoke	
3112	__62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke	
2884	CA::Transaction::commit()	
2383	CA::Transaction::run_commit_handlers(CATransactionPhase)	
2375	NSDisplayCycleFlush	
2342	NSDisplayCycleObserverInvoke	
2020	__NSWindowGetDisplayCycleObserverForLayout_block_invoke	
2007	-[NSWindow(NSConstraintBasedLayout) layoutIfNeeded]	
2000	-[NSWindow(NSConstraintBasedLayout) _layoutViewTree]	
1997	-[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:]	
1681	-[NSView _layoutSubtreeWithOldSize:]	
1666	-[NSView _layoutSubtreeWithOldSize:]	
1651	_NSViewLayout	
1624	@objc NSHostingView.layout()	
1623	NSHostingView.layout()	
1610	+[NSAnimationContext runAnimationGroup:]	
1598	thunk for @escaping @callee_guaranteed (@guaranteed NSAnimationContext) -> ()	
1593	partial apply for thunk for @callee_guaranteed (@guaranteed NSAnimationContext) -> ()	
1593	closure #1 in NSHostingView.layout()	
1586	ViewRendererHost.render(interval:updateDisplayList:)	
1578	closure #1 in ViewRendererHost.render(interval:updateDisplayList:)	
814	NSHostingView.renderDisplayList(_:asynchronously:time:nextTime:version:maxVersion:)	
811	closure #1 in NSHostingView.renderDisplayList(_:asynchronously:time:nextTime:version:maxVersion:)	
809	DisplayList.ViewRenderer.render(rootView:from:time:nextTime:version:maxVersion:contentsScale:)	
805	DisplayList.ViewUpdater.render(rootView:from:time:version:maxVersion:contentsScale:)	
784	closure #1 in DisplayList.ViewUpdater.render(rootView:from:time:version:maxVersion:contentsScale:)	
758	DisplayList.ViewUpdater.update(container:from:parentState:)	
753	DisplayList.ViewUpdater.updateInheritedView(container:from:parentState:)	
741	DisplayList.ViewUpdater.update(container:from:parentState:)	
734	DisplayList.ViewUpdater.updateInheritedView(container:from:parentState:)	
725	DisplayList.ViewUpdater.updateItemView(container:from:localState:)	
488	DisplayList.ViewUpdater.update(container:from:parentState:)	
482	DisplayList.ViewUpdater.updateInheritedView(container:from:parentState:)	
476	DisplayList.ViewUpdater.update(container:from:parentState:)	
469	DisplayList.ViewUpdater.updateInheritedView(container:from:parentState:)	
430	DisplayList.ViewUpdater.update(container:from:parentState:)	
429	DisplayList.ViewUpdater.updateInheritedView(container:from:parentState:)	
426	DisplayList.ViewUpdater.updateItemView(container:from:localState:)	
415	DisplayList.ViewUpdater.ViewCache.update(item:state:tag:in:makeView:updateView:)	
407	static DisplayList.ViewUpdater.Platform.updateItemView(_:item:state:)	
407	static DisplayList.ViewUpdater.Platform.updateState(_:item:size:state:)	
398	static DisplayList.ViewUpdater.Platform.updateGeometry(_:item:size:state:clipRectChanged:)	
303	-[NSView setFrameTransform:]	
140	_NSViewHierarchyDidChangeBackingProperties	
123	@objc PlatformViewHost._intrinsicContentSizeInvalidated(forChildView:)	
120	PlatformViewHost.enqueueLayoutInvalidation()	
116	onNextMainRunLoop(do:)	
70	-[NSRunLoop(NSRunLoop) performInModes:block:]	
67	CFRunLoopPerformBlock	
45	@objc __SwiftNativeNSArrayWithContiguousStorage.getObjects(_:range:)	
43	__SwiftDeferredNSArray.withUnsafeBufferOfObjects<A>(_:)	
33	_ContiguousArrayStorage._getNonVerbatimBridgingBuffer()	
27	bridgeAnythingNonVerbatimToObjectiveC(swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, bool)	
13	findBridgeWitness(swift::TargetMetadata<swift::InProcess> const*)	
12	swift_conformsToProtocol	
10	swift_conformsToProtocolMaybeInstantiateSuperclasses(swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptor<swift::InProcess> const*, bool)	
4	std::__1::pair<(anonymous namespace)::ConformanceCacheEntry*, unsigned int> swift::ConcurrentReadableHashMap<(anonymous namespace)::ConformanceCacheEntry, swift::StaticMutex>::find<(anonymous namespace)::ConformanceCacheKey>((anonymous namespace)::ConformanceCacheKey const&, swift::ConcurrentReadableHashMap<(anonymous namespace)::ConformanceCacheEntry, swift::StaticMutex>::IndexStorage, unsigned long, (anonymous namespace)::ConformanceCacheEntry*)	
2	__swift::__runtime::llvm::hash_code __swift::__runtime::llvm::hashing::detail::hash_combine_recursive_helper::combine<swift::TargetProtocolDescriptor<swift::InProcess> const*>(unsigned long, char*, char*, swift::TargetProtocolDescriptor<swift::InProcess> const* const&)	
2	__swift::__runtime::llvm::hash_code __swift::__runtime::llvm::hashing::detail::hash_combine_recursive_helper::combine<swift::TargetProtocolDescriptor<swift::InProcess> const*>(unsigned long, char*, char*, swift::TargetProtocolDescriptor<swift::InProcess> const* const&)	
2	char* __swift::__runtime::llvm::hashing::detail::hash_combine_recursive_helper::combine_data<swift::TargetProtocolDescriptor<swift::InProcess> const*>(unsigned long&, char*, char*, swift::TargetProtocolDescriptor<swift::InProcess> const*)	

The colored icon seems to be discordant

image

image

The colored icon seems to be not well-fitted with other MacOS apps :)

Do you consider using a pure-colored icon (which renders as a white icon or a black icon), just like other Apps?

"Today" can be confusing

time

(Today -> Yesterday)

Yesterday? Today? Tomorrow? Not a big deal actually. To fix this glitch, I suggest refreshing the panel from the local cache when proper:

  • time change
  • time zone change, including adjusting for daylight saving time

Cookie issue

i have been trying forever to fix this, but whenever i input my cookie, it always just shows
image
my server is asia, and the browser i used to get my cookie is Brave.
regards.

Flip the meaning of daily commission?

Currently the number displayed in daily commission means "Finished number", while the other items means "TODO number". This brings confusions.

For example, in the picture below, they are all displayed as "0 / N" items.. While actually daily commission is not finished:

image

Additionally, the "✓" of parametric transformer is confusing as well. It's unclear of:

  • Parametric transformer has been cool-down?
  • Parametric transformer has been used?

About honkai: star rail

Great plugin! I was wondering if the author has any plans to develop a corresponding plugin for the 'Honkai: star rail’? They seem very similar in form. Thanks!

导入Cookie的格式?

我直接复制粘贴的 Netscape HTTP Cookie File 格式的 txt 文件,提示我不对,请问一下导入的 Cookie 是需要什么格式的?

Data fetching not working / 数据无法更新

it works fine before, but now it just stop refresh and even if the cookie is correct, it still sats that it is wrong, maybe something changes in the mihoyo's website i.e miyoushe and hoyo lab.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.